diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index 8ebcc839710..00000000000 --- a/.cargo/config +++ /dev/null @@ -1,4 +0,0 @@ -# TODO: we shouldn't check this in to git, need to figure out how to avoid doing -# that. -[target.wasm32-unknown-unknown] -runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --' diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000000..6440da0591e --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.'cfg(target_arch = "wasm32")'] +runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --' diff --git a/.github/FUNDING.yaml b/.github/FUNDING.yaml new file mode 100644 index 00000000000..23be5540cd8 --- /dev/null +++ b/.github/FUNDING.yaml @@ -0,0 +1 @@ +github: [daxpedda] diff --git a/.github/actions/setup-geckodriver/action.yml b/.github/actions/setup-geckodriver/action.yml index 57d5578a512..89dd42cad35 100644 --- a/.github/actions/setup-geckodriver/action.yml +++ b/.github/actions/setup-geckodriver/action.yml @@ -2,5 +2,5 @@ name: 'Setup Geckodriver' description: 'Setup Geckodriver' runs: - using: node12 + using: node20 main: 'main.js' diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000000..690cf6dfac4 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,20 @@ +version: 2 + +updates: + - package-ecosystem: cargo + directory: / + schedule: + interval: daily + ignore: + - dependency-name: 'wasmparser' + - dependency-name: 'wasmprinter' + - dependency-name: 'wast' + + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91718ba9d25..d887cc699b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,7 @@ on: tags-ignore: [dev] pull_request: branches: [main] + workflow_dispatch: defaults: run: shell: bash @@ -15,58 +16,206 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read # to fetch code (actions/checkout) + jobs: # Check Code style quickly by running `rustfmt` over all code rustfmt: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: rustup component add rustfmt - run: cargo fmt --all -- --check + # Check TOML style by using Taplo. + taplo: + name: Taplo + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: taiki-e/install-action@v2 + with: + tool: taplo-cli + - run: taplo fmt --check + # Run `cargo check` over everything check: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: cargo check --all + - run: cargo check --no-default-features + + # Run `cargo clippy` over everything + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: rustup target add wasm32-unknown-unknown + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-backend -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-cli -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-cli-support -- -D warnings + - run: cargo clippy --no-deps --all-features -p example-tests -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-externref-xform -- -D warnings + - run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -p wasm-bindgen-futures -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-macro -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-macro-support -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-multi-value-xform -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-shared -- -D warnings + - run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -p wasm-bindgen-test -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-test-macro -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-threads-xform -- -D warnings + - run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -p typescript-tests -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-wasm-conventions -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-wasm-interpreter -- -D warnings + - run: cargo clippy --no-deps --all-features -p wasm-bindgen-webidl -- -D warnings + - run: cargo clippy --no-deps --all-features -p webidl-tests -- -D warnings + - run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -p wasm-bindgen-benchmark -- -D warnings + + # Run `cargo clippy` over web-sys and js-sys crates + clippy_web_sys: + name: Clippy (web-sys) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: rustup target add wasm32-unknown-unknown + - run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -p js-sys --all-targets -- -D warnings + - run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -p web-sys --all-targets -- -D warnings + + # Run `cargo clippy` over crates that support `no_std` + clippy_no_std: + name: Clippy `no_std` + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: rustup target add wasm32-unknown-unknown + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen -- -D warnings + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p js-sys -- -D warnings + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p web-sys -- -D warnings + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen-futures -- -D warnings + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen-test -- -D warnings + + # Run `cargo clippy` over crates that support `no_std` with `target_feature = "atomics"` support. + clippy_no_std_atomics: + name: Clippy `no_std` with `atomics` + runs-on: ubuntu-latest + env: + RUSTFLAGS: -Ctarget-feature=+atomics,+bulk-memory + steps: + - uses: actions/checkout@v4 + - run: rustup default nightly-2024-07-06 + - run: rustup target add wasm32-unknown-unknown + - run: rustup component add clippy rust-src + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen -Zbuild-std=core,alloc -- -D warnings + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p js-sys -Zbuild-std=core,alloc -- -D warnings + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p web-sys -Zbuild-std=core,alloc -- -D warnings + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen-futures -Zbuild-std=core,alloc -- -D warnings + - run: cargo clippy --no-deps --no-default-features --target wasm32-unknown-unknown -p wasm-bindgen-test -Zbuild-std=core,alloc -- -D warnings + + # Run `cargo clippy` over the project + clippy_project: + name: Clippy (project) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: rustup target add wasm32-unknown-unknown + - run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown -- -D warnings + - run: cargo clippy --no-deps --all-features --target wasm32-unknown-unknown --tests -- -D warnings + - run: for i in examples/*/; do cd "$i"; cargo +stable clippy --no-deps --all-features --target wasm32-unknown-unknown -- -D warnings || exit 1; cd ../..; done test_wasm_bindgen: - name: "Run wasm-bindgen crate tests (unix)" + strategy: + matrix: + runs: + - name: "wasm-bindgen" + run: | + cargo test --target wasm32-unknown-unknown + cargo test --target wasm32-unknown-unknown -p wasm-bindgen-futures + - name: "wasm-bindgen (serde-serialize)" + run: cargo test --target wasm32-unknown-unknown --features serde-serialize + - name: "wasm-bindgen (enable-interning)" + run: cargo test --target wasm32-unknown-unknown --features enable-interning + name: "Run wasm-bindgen crate tests (${{ matrix.runs.name }})" runs-on: ubuntu-latest + env: + WASM_BINDGEN_SPLIT_LINKED_MODULES: 1 steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: rustup target add wasm32-unknown-unknown - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - node-version: '16' + node-version: '20' - uses: ./.github/actions/setup-geckodriver - - run: cargo test --target wasm32-unknown-unknown - - run: cargo test --target wasm32-unknown-unknown - - run: cargo test --target wasm32-unknown-unknown --features serde-serialize - - run: cargo test --target wasm32-unknown-unknown --features enable-interning - - run: cargo test --target wasm32-unknown-unknown -p no-std - - run: cargo test --target wasm32-unknown-unknown -p wasm-bindgen-futures - - run: cargo test --target wasm32-unknown-unknown --test wasm - env: - WASM_BINDGEN_WEAKREF: 1 + - run: ${{ matrix.runs.run }} + + test_wasm_bindgen_wasm: + name: "Run wasm-bindgen wasm test" + runs-on: ubuntu-latest + env: + WASM_BINDGEN_SPLIT_LINKED_MODULES: 1 + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: rustup target add wasm32-unknown-unknown + - uses: actions/setup-node@v4 + with: + node-version: '20' - run: cargo test --target wasm32-unknown-unknown --test wasm env: - WASM_BINDGEN_WEAKREF: 1 WASM_BINDGEN_NO_DEBUG: 1 - - run: cargo test --target wasm32-unknown-unknown --test wasm --features serde-serialize - env: - WASM_BINDGEN_WEAKREF: 1 + + test_wasm_bindgen_envs: + strategy: + matrix: + envs: + - name: "externref" + env: + WASM_BINDGEN_EXTERNREF: 1 + - name: "multi-value" + env: + WASM_BINDGEN_MULTI_VALUE: 1 + name: "Run wasm-bindgen crate tests with ${{ matrix.envs.name }} feature" + runs-on: ubuntu-latest + env: + WASM_BINDGEN_SPLIT_LINKED_MODULES: 1 + WASM_BINDGEN_EXTERNREF: ${{ matrix.envs.WASM_BINDGEN_EXTERNREF }} + WASM_BINDGEN_MULTI_VALUE: ${{ matrix.envs.WASM_BINDGEN_MULTI_VALUE }} + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: rustup target add wasm32-unknown-unknown + - uses: actions/setup-node@v4 + with: + node-version: '20' - run: cargo test --target wasm32-unknown-unknown - env: - WASM_BINDGEN_EXTERNREF: 1 - NODE_ARGS: --experimental-wasm-reftypes + test_threads: + name: "Run wasm-bindgen crate tests with multithreading" + runs-on: ubuntu-latest + env: + WASM_BINDGEN_SPLIT_LINKED_MODULES: 1 + steps: + - uses: actions/checkout@v4 + - run: rustup default nightly-2024-07-06 + - run: rustup target add wasm32-unknown-unknown + - run: rustup component add rust-src + - run: | + RUSTFLAGS='-C target-feature=+atomics,+bulk-memory,+mutable-globals' \ + cargo test --target wasm32-unknown-unknown -Z build-std=std,panic_abort # I don't know why this is failing so comment this out for now, but ideally # this would be figured out at some point and solved. @@ -74,12 +223,12 @@ jobs: # name: "Run wasm-bindgen crate tests (Windows)" # runs-on: windows-latest # steps: - # - uses: actions/checkout@v2 - # - run: rustup update stable && rustup default stable + # - uses: actions/checkout@v4 + # - run: rustup update --no-self-update stable && rustup default stable # - run: rustup target add wasm32-unknown-unknown - # - uses: actions/setup-node@v2 + # - uses: actions/setup-node@v4 # with: - # node-version: '16' + # node-version: '20' # - uses: ./.github/actions/setup-geckodriver # - run: cargo test --target wasm32-unknown-unknown # env: @@ -91,120 +240,99 @@ jobs: # WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: 1 # - run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features "Node Window Document" - test_wasm_bindgen_nightly: - name: "Run wasm-bindgen crate tests (nightly)" + # This checks that the output of the CLI is actually valid JavaScript and TypeScript + test_cli_reference_typescript: + name: Run CLI reference TypeScript check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup default nightly-2021-09-02 - - run: rustup target add wasm32-unknown-unknown - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: '16' - - run: cargo test --target wasm32-unknown-unknown --features nightly --test wasm + node-version: 'lts/*' + - run: npm i -g typescript + - run: npm i --save @types/node @types/deno + - name: Check TypeScript output + run: tsc --noEmit --skipLibCheck --lib esnext,dom $(echo crates/cli/tests/reference/*.d.ts) + - name: Check JavaScript output + run: tsc --noEmit --skipLibCheck --lib esnext,dom --module esnext --allowJs $(echo crates/cli/tests/reference/*.js) test_native: name: Run native tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: rustup target add wasm32-unknown-unknown - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - node-version: '16' + node-version: '20' - run: cargo test - run: cargo test -p wasm-bindgen-cli-support - run: cargo test -p wasm-bindgen-cli - run: cargo test -p wasm-bindgen-externref-xform + - run: cargo test -p wasm-bindgen-macro-support - run: cargo test -p wasm-bindgen-multi-value-xform - run: cargo test -p wasm-bindgen-wasm-interpreter - run: cargo test -p wasm-bindgen-futures - run: cargo test -p wasm-bindgen-shared - test_web_sys: - name: "Run web-sys crate tests" + test_with_geckodriver: + strategy: + matrix: + runs: + - name: "web-sys" + run: | + cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown + cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Node + cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Element + cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Window + - name: "web-sys (all features)" + run: cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features + - name: "web-sys (unstable, all features)" + run: cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features + env: + RUSTFLAGS: --cfg=web_sys_unstable_apis + - name: "js-sys" + run: cargo test -p js-sys --target wasm32-unknown-unknown + - name: "js-sys (unstable)" + run: cargo test -p js-sys --target wasm32-unknown-unknown + env: + RUSTFLAGS: --cfg=js_sys_unstable_apis + - name: "wasm-bindgen-webidl" + run: cargo test -p wasm-bindgen-webidl + - name: "webidl-tests" + run: cargo test -p webidl-tests --target wasm32-unknown-unknown + env: + WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: 1 + - name: "webidl-tests (unstable)" + run: cargo test -p webidl-tests --target wasm32-unknown-unknown + env: + RUSTFLAGS: --cfg=web_sys_unstable_apis + - name: "typescript-tests" + run: cd crates/typescript-tests && ./run.sh + name: "Run ${{ matrix.runs.name }} tests (with geckodriver)" + env: + RUSTFLAGS: ${{ matrix.runs.env.RUSTFLAGS }} + WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: ${{ matrix.runs.env.WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: rustup target add wasm32-unknown-unknown - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - node-version: '16' + node-version: '20' - uses: ./.github/actions/setup-geckodriver - - run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown - - run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Node - - run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Element - - run: cargo build --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --features Window - - run: cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features - - run: cargo test --manifest-path crates/web-sys/Cargo.toml --target wasm32-unknown-unknown --all-features - env: - RUSTFLAGS: --cfg=web_sys_unstable_apis - - check_web_sys: - name: "Verify that web-sys is compiled correctly" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable - - run: cd crates/web-sys && cargo run --release --package wasm-bindgen-webidl -- webidls src/features - - run: git diff --exit-code - - test_js_sys: - name: "Run js-sys crate tests" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable - - run: rustup target add wasm32-unknown-unknown - - uses: actions/setup-node@v2 - with: - node-version: '16' - - uses: ./.github/actions/setup-geckodriver - - run: cargo test -p js-sys --target wasm32-unknown-unknown - - run: cargo test -p js-sys --target wasm32-unknown-unknown - env: - RUSTFLAGS: --cfg=js_sys_unstable_apis - - test_webidl: - name: "Run wasm-bindgen-webidl crate tests" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable - - run: rustup target add wasm32-unknown-unknown - - uses: actions/setup-node@v2 - with: - node-version: '16' - - run: cargo test -p wasm-bindgen-webidl - - run: cargo test -p webidl-tests --target wasm32-unknown-unknown - env: - WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE: 1 - - run: cargo test -p webidl-tests --target wasm32-unknown-unknown - env: - RUSTFLAGS: --cfg=web_sys_unstable_apis - - test_typescript_output: - name: "Test TypeScript output of wasm-bindgen" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable - - run: rustup target add wasm32-unknown-unknown - - uses: actions/setup-node@v2 - with: - node-version: '16' - - run: cd crates/typescript-tests && ./run.sh + - run: ${{ matrix.runs.run }} test_deno: name: "Build and test the deno example" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: rustup target add wasm32-unknown-unknown - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: deno-version: v1.x - run: cd examples/deno && ./build.sh && deno run --allow-read test.ts @@ -213,67 +341,119 @@ jobs: name: Run UI compile-fail tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update 1.56.0 && rustup default 1.56.0 + - uses: actions/checkout@v4 + - run: rustup update --no-self-update 1.78.0 && rustup default 1.78.0 - run: cargo test -p wasm-bindgen-macro + - run: cargo test -p wasm-bindgen-test-macro + + build_webidl: + name: "Verify that web-sys is compiled correctly" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: cd crates/web-sys && cargo run --release --package wasm-bindgen-webidl -- webidls src/features ./Cargo.toml + - run: git diff --exit-code build_examples: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: rustup target add wasm32-unknown-unknown - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f - run: | cargo build -p wasm-bindgen-cli ln -snf `pwd`/target/debug/wasm-bindgen $(dirname `which cargo`)/wasm-bindgen - - run: mv _package.json package.json && npm install && rm package.json + # crete a workspace of all examples and install their dependencies at once + # sed is used to convert the literal "\n" to a newline character - run: | - for dir in `ls examples | grep -v README | grep -v asm.js | grep -v raytrace | grep -v without-a-bundler | grep -v wasm-in-web-worker | grep -v websockets | grep -v webxr | grep -v deno`; do - (cd examples/$dir && - ln -fs ../../node_modules . && - npm run build -- --output-path ../../exbuild/$dir) || exit 1; - done - - uses: actions/upload-artifact@v2 + [ -f pnpm-workspace.yaml ] || (echo 'packages:\n - "examples/*"' > pnpm-workspace.yaml && sed -i -e 's/\\n/\n/g' pnpm-workspace.yaml) + - run: | + [ -f package.json ] || (echo '{}' > package.json) + - run: corepack pnpm install -r + - run: | + function build() { + (cd examples/$1 && + (corepack pnpm run build -- --output-path ../../exbuild/$1 || + (./build.sh && mkdir -p ../../exbuild/$1 && cp -r ./* ../../exbuild/$1 && rm ../../exbuild/$1/**/.gitignore)) + ) || exit 1; + } + export -f build + ls examples | grep -v README | grep -v raytrace | grep -v deno | grep -v wasm-audio-worklet | parallel -j4 build + env: + RUSTFLAGS: --cfg=web_sys_unstable_apis + - uses: actions/upload-artifact@v4 with: name: examples1 path: exbuild - build_raytrace: + build_nightly: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup default nightly-2021-09-02 + - uses: actions/checkout@v4 + - run: rustup default nightly-2024-07-06 - run: rustup target add wasm32-unknown-unknown - run: rustup component add rust-src - run: | - sed -i 's/python/#python/' examples/raytrace-parallel/build.sh - (cd examples/raytrace-parallel && ./build.sh) - mkdir exbuild - cp examples/raytrace-parallel/*.{js,html,wasm} exbuild - - uses: actions/upload-artifact@v2 + for dir in raytrace-parallel wasm-audio-worklet; do + (cd examples/$dir && + ./build.sh && mkdir -p ../../exbuild/$dir && cp -r ./* ../../exbuild/$dir + ) || exit 1; + done + - uses: actions/upload-artifact@v4 with: name: examples2 path: exbuild + test_examples: + needs: + - build_examples + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: examples1 + path: exbuild + - run: rustup update --no-self-update stable && rustup default stable + - run: cargo test -p example-tests + env: + EXBUILD: ${{ github.workspace }}/exbuild + + test_nightly: + needs: + - build_nightly + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: examples2 + path: exbuild + - run: rustup update --no-self-update stable && rustup default stable + - run: cargo test -p example-tests --no-default-features --features nightly + env: + EXBUILD: ${{ github.workspace }}/exbuild + build_benchmarks: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: rustup target add wasm32-unknown-unknown - run: cargo build --manifest-path benchmarks/Cargo.toml --release --target wasm32-unknown-unknown - run: cargo run -p wasm-bindgen-cli -- target/wasm32-unknown-unknown/release/wasm_bindgen_benchmark.wasm --out-dir benchmarks/pkg --target web - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: benchmarks path: benchmarks - dist_linux: + dist_linux_x86_64_musl: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: rustup target add x86_64-unknown-linux-musl - run: sudo apt update -y && sudo apt install musl-tools -y - run: | @@ -281,33 +461,64 @@ jobs: strip -g target/x86_64-unknown-linux-musl/release/wasm-bindgen strip -g target/x86_64-unknown-linux-musl/release/wasm-bindgen-test-runner strip -g target/x86_64-unknown-linux-musl/release/wasm2es6js - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: - name: dist_linux + name: dist_linux_x86_64_musl path: "target/x86_64-unknown-linux-musl/release/wasm*" - dist_macos: + dist_linux_aarch64_gnu: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: rustup target add aarch64-unknown-linux-gnu + - run: sudo apt update -y && sudo apt install gcc-aarch64-linux-gnu -y + - run: | + cargo build --manifest-path crates/cli/Cargo.toml --target aarch64-unknown-linux-gnu --features vendored-openssl --release + env: + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + - uses: actions/upload-artifact@v4 + with: + name: dist_linux_aarch64_gnu + path: "target/aarch64-unknown-linux-gnu/release/wasm*" + + dist_macos_x86_64: runs-on: macos-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable - - run: cargo build --manifest-path crates/cli/Cargo.toml --release + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: rustup target add x86_64-apple-darwin + - run: cargo build --manifest-path crates/cli/Cargo.toml --target x86_64-apple-darwin --release env: MACOSX_DEPLOYMENT_TARGET: 10.7 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: - name: dist_macos + name: dist_macos_x86_64 + path: "target/x86_64-apple-darwin/release/wasm*" + + dist_macos_aarch64: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable + - run: | + cargo build --manifest-path crates/cli/Cargo.toml --release + env: + MACOSX_DEPLOYMENT_TARGET: 10.7 + - uses: actions/upload-artifact@v4 + with: + name: dist_macos_aarch64 path: "target/release/wasm*" dist_windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - run: rustup update stable && rustup default stable + - uses: actions/checkout@v4 + - run: rustup update --no-self-update stable && rustup default stable - run: cargo build --manifest-path crates/cli/Cargo.toml --release env: RUSTFLAGS: -Ctarget-feature=+crt-static - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: dist_windows path: "target/release/wasm*" @@ -315,12 +526,12 @@ jobs: doc_book: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: | - curl -L https://github.com/rust-lang-nursery/mdBook/releases/download/v0.3.0/mdbook-v0.3.0-x86_64-unknown-linux-gnu.tar.gz | tar xzf - + curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.28/mdbook-v0.4.28-x86_64-unknown-linux-gnu.tar.gz | tar xzf - echo $PWD >> $GITHUB_PATH - run: (cd guide && mdbook build) - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: doc_book path: guide/book/html @@ -328,38 +539,107 @@ jobs: doc_api: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: rustup update nightly && rustup default nightly - - run: cargo doc --no-deps --features 'nightly serde-serialize' + - uses: actions/checkout@v4 + - run: rustup update --no-self-update nightly && rustup default nightly + - run: cargo doc --no-deps --features 'serde-serialize' - run: cargo doc --no-deps --manifest-path crates/js-sys/Cargo.toml - run: cargo doc --no-deps --manifest-path crates/web-sys/Cargo.toml --all-features env: RUSTDOCFLAGS: --cfg=web_sys_unstable_apis - - run: cargo doc --no-deps --manifest-path crates/futures/Cargo.toml + - run: cargo doc --no-deps --manifest-path crates/futures/Cargo.toml --all-features + env: + RUSTDOCFLAGS: --cfg=docsrs - run: tar czvf docs.tar.gz target/doc - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: doc_api path: docs.tar.gz + msrv-resolver: + name: Check feature resolver version 1 compatibility + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: + - 1.57 + - stable + target: + - x86_64-unknown-linux-gnu + - wasm32-unknown-unknown + features: + - --no-default-features + - --no-default-features --features std + - --no-default-features --features msrv + - "" + defaults: + run: + working-directory: crates/msrv/resolver + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} && rustup target add ${{ matrix.target }} + - if: matrix.rust == '1.57' + run: | + cargo update -p bumpalo --precise 3.12.0 + cargo update -p log --precise 0.4.18 + - run: cargo build --target ${{ matrix.target }} ${{ matrix.features }} + + msrv-lib: + name: Check MSRV for libraries + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: + - x86_64-unknown-linux-gnu + - wasm32-unknown-unknown + features: + - --no-default-features + - --no-default-features --features std + - --no-default-features --features msrv + - "" + defaults: + run: + working-directory: crates/msrv/lib + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update 1.57 && rustup default 1.57 && rustup target add ${{ matrix.target }} + - run: cargo build --target ${{ matrix.target }} ${{ matrix.features }} + + msrv-cli: + name: Check MSRV for CLI tools + runs-on: ubuntu-latest + defaults: + run: + working-directory: crates/msrv/cli + steps: + - uses: actions/checkout@v4 + - run: rustup update --no-self-update 1.76 && rustup default 1.76 + - run: cargo build + deploy: + permissions: + contents: write # to push changes in repo (jamesives/github-pages-deploy-action) + + if: github.repository == 'rustwasm/wasm-bindgen' needs: - doc_api - doc_book - - dist_linux - - dist_macos + - dist_linux_x86_64_musl + - dist_linux_aarch64_gnu + - dist_macos_x86_64 + - dist_macos_aarch64 - dist_windows - build_examples - - build_raytrace + - build_nightly - build_benchmarks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - run: rustup update nightly && rustup default nightly - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: path: artifacts - run: find artifacts @@ -381,11 +661,14 @@ jobs: tmp/$name/ chmod +x tmp/$name/wasm* tar czvf gh-release/$name.tar.gz -C tmp $name + sha256sum gh-release/$name.tar.gz > gh-release/$name.tar.gz.sha256sum } - mk x86_64-unknown-linux-musl dist_linux - mk x86_64-apple-darwin dist_macos + mk x86_64-unknown-linux-musl dist_linux_x86_64_musl + mk aarch64-unknown-linux-gnu dist_linux_aarch64_gnu + mk x86_64-apple-darwin dist_macos_x86_64 + mk aarch64-apple-darwin dist_macos_aarch64 mk x86_64-pc-windows-msvc dist_windows - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: gh-release path: gh-release @@ -394,20 +677,28 @@ jobs: tar xf artifacts/doc_api/docs.tar.gz mv target/doc gh-pages/api mv artifacts/examples1 gh-pages/exbuild - mv artifacts/examples2 gh-pages/exbuild/raytrace-parallel + mv artifacts/examples2/* gh-pages/exbuild mv artifacts/benchmarks gh-pages/benchmarks tar czf gh-pages.tar.gz gh-pages - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: gh-pages path: gh-pages.tar.gz - - uses: JamesIves/github-pages-deploy-action@4.1.4 + - uses: JamesIves/github-pages-deploy-action@v4 with: branch: gh-pages folder: gh-pages single-commit: true if: github.event_name == 'push' && github.ref == 'refs/heads/main' - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - files: "gh-release/*.tar.gz" + files: "gh-release/*.tar.gz*" + - uses: dtolnay/rust-toolchain@stable + if: startsWith(github.ref, 'refs/tags/') + - run: rustc publish.rs + if: startsWith(github.ref, 'refs/tags/') + - run: ./publish publish + if: startsWith(github.ref, 'refs/tags/') + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_PUBLISH_TOKEN }} diff --git a/.gitignore b/.gitignore index 8cdf73b9e4f..cb63ac51317 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,11 @@ Cargo.lock node_modules package-lock.json npm-shrinkwrap.json +pnpm-lock.yaml yarn.lock /publish /publish.exe .vscode webdriver.json +benchmarks/pkg +/crates/msrv/*/target diff --git a/CHANGELOG.md b/CHANGELOG.md index 0316d3f176b..08dcd104a0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,983 @@ # `wasm-bindgen` Change Log -------------------------------------------------------------------------------- +## [0.2.100](https://github.com/rustwasm/wasm-bindgen/compare/0.2.99...0.2.100) + +Released 2025-01-12 + +### Added + +* Add attributes to overwrite return (``unchecked_return_type`) and parameter types (`unchecked_param_type`), descriptions (`return_description` and `param_description`) as well as parameter names (`js_name`) for exported functions and methods. See the guide for more details. + [#4394](https://github.com/rustwasm/wasm-bindgen/pull/4394) + +* Add a `copy_to_uninit()` method to all `TypedArray`s. It takes `&mut [MaybeUninit]` and returns `&mut [T]`. + [#4340](https://github.com/rustwasm/wasm-bindgen/pull/4340) + +* Add test coverage support for Node.js. + [#4348](https://github.com/rustwasm/wasm-bindgen/pull/4348) + +* Support importing memory and using `wasm_bindgen::module()` in Node.js. + [#4349](https://github.com/rustwasm/wasm-bindgen/pull/4349) + +* Add `--list`, `--ignored`, `--exact` and `--nocapture` to `wasm-bindgen-test-runner`, analogous to `cargo test`. + [#4356](https://github.com/rustwasm/wasm-bindgen/pull/4356) + +* Add bindings to `Date.to_locale_time_string_with_options`. + [#4384](https://github.com/rustwasm/wasm-bindgen/pull/4384) + +* `#[wasm_bindgen]` now correctly applies `#[cfg(...)]`s in `struct`s. + [#4351](https://github.com/rustwasm/wasm-bindgen/pull/4351) + + +### Changed + +* Optional parameters are now typed as `T | undefined | null` to reflect the actual JS behavior. + [#4188](https://github.com/rustwasm/wasm-bindgen/pull/4188) + +* Adding `getter`, `setter`, and `constructor` methods to enums now results in a compiler error. This was previously erroneously allowed and resulted in invalid JS code gen. + [#4278](https://github.com/rustwasm/wasm-bindgen/pull/4278) + +* Handle stuck and failed WebDriver processes when re-trying to start them. + [#4340](https://github.com/rustwasm/wasm-bindgen/pull/4340) + +* Align test output closer to native `cargo test`. + [#4358](https://github.com/rustwasm/wasm-bindgen/pull/4358) + +* Error if URL in `_REMOTE` can't be parsed instead of just ignoring it. + [#4362](https://github.com/rustwasm/wasm-bindgen/pull/4362) + +* Remove `WASM_BINDGEN_THREADS_MAX_MEMORY` and `WASM_BINDGEN_THREADS_STACK_SIZE`. The maximum memory size can be set via `-Clink-arg=--max-memory=`. The stack size of a thread can be set when initializing the thread via the `default` function. + [#4363](https://github.com/rustwasm/wasm-bindgen/pull/4363) + +* `console.*()` calls in tests are now always intercepted by default. To show them use `--nocapture`. When shown they are always printed in-place instead of after test results, analogous to `cargo test`. + [#4356](https://github.com/rustwasm/wasm-bindgen/pull/4356) + +### Fixed + +- Fixed using [JavaScript keyword](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords) as identifiers not being handled correctly. + [#4329](https://github.com/rustwasm/wasm-bindgen/pull/4329) + + - Using JS keywords as `struct` and `enum` names will now error at compile time, instead of causing invalid JS code gen. + - Using JS keywords that are not valid to call or access properties on will now error at compile time, instead of causing invalid JS code gen if used as: + 1. The first part of a `js_namespace` on imports. + 2. The name of an imported type or constant if the type or constant does not have a `js_namespace` or `module` attribute. + 3. The name of an imported function if the function is not a method and does not have a `js_namespace` or `module` attribute. + - Using JS keywords on imports in places other than the above will no longer cause the keywords to be escaped as `_{keyword}`. + +* Fixed passing large arrays into Rust failing because of internal memory allocations invalidating the memory buffer. + [#4353](https://github.com/rustwasm/wasm-bindgen/pull/4353) + +* Pass along an `ignore` attribute to `unsupported` tests. + [#4360](https://github.com/rustwasm/wasm-bindgen/pull/4360) + +* Use OS provided temporary directory for tests instead of Cargo's `target` directory. + [#4361](https://github.com/rustwasm/wasm-bindgen/pull/4361) + +* Error if URL in `_REMOTE` can't be parsed. + [#4362](https://github.com/rustwasm/wasm-bindgen/pull/4362) + +* Internal functions are now removed instead of invalidly imported if they are unused. + [#4366](https://github.com/rustwasm/wasm-bindgen/pull/4366) + +* Fixed `no_std` support for all APIs in `web-sys`. + [#4378](https://github.com/rustwasm/wasm-bindgen/pull/4378) + +* Prevent generating duplicate exports for closure conversions. + [#4380](https://github.com/rustwasm/wasm-bindgen/pull/4380) + +-------------------------------------------------------------------------------- + +## [0.2.99](https://github.com/rustwasm/wasm-bindgen/compare/0.2.98...0.2.99) + +Released 2024-12-07 + +### Fixed + +- Mark `wasm-bindgen` v0.2.98 only compatible with `wasm-bindgen-cli` of the same version. + [#4331](https://github.com/rustwasm/wasm-bindgen/pull/4331) + +-------------------------------------------------------------------------------- + +## [0.2.98](https://github.com/rustwasm/wasm-bindgen/compare/0.2.97...0.2.98) + +Released 2024-12-07 + +### Added + +* Add support for compiling with `atomics` for Node.js. + [#4318](https://github.com/rustwasm/wasm-bindgen/pull/4318) + +* Add `WASM_BINDGEN_TEST_DRIVER_TIMEOUT` environment variable to control the timeout to start and connect to the test driver. + [#4320](https://github.com/rustwasm/wasm-bindgen/pull/4320) + +* Add support for number slices of type `MaybeUninit`. + [#4316](https://github.com/rustwasm/wasm-bindgen/pull/4316) + +### Changed + +* Remove `once_cell/critical-section` requirement for `no_std` with atomics. + [#4322](https://github.com/rustwasm/wasm-bindgen/pull/4322) + +* `static FOO: Option` now returns `None` if undeclared in JS instead of throwing an error in JS. + [#4319](https://github.com/rustwasm/wasm-bindgen/pull/4319) + +### Fixed + +* Fix macro-hygiene for calls to `std::thread_local!`. + [#4315](https://github.com/rustwasm/wasm-bindgen/pull/4315) + +* Fix feature resolver version 1 compatibility. + [#4327](https://github.com/rustwasm/wasm-bindgen/pull/4327) + +-------------------------------------------------------------------------------- + +## [0.2.97](https://github.com/rustwasm/wasm-bindgen/compare/0.2.96...0.2.97) + +Released 2024-11-30 + +### Fixed + +* Fixed `js-sys` and `wasm-bindgen-futures` relying on internal paths of `wasm-bindgen` that are not crate feature additive. + [#4305](https://github.com/rustwasm/wasm-bindgen/pull/4305) + +-------------------------------------------------------------------------------- + +## [0.2.96](https://github.com/rustwasm/wasm-bindgen/compare/0.2.95...0.2.96) + +Released 2024-11-29 + +### Added + +* Added support for the [`HTMLOrSVGElement`](https://html.spec.whatwg.org/#htmlorsvgelement) `mixin`, which is used for all interfaces deriving from `Element`. + [#4143](https://github.com/rustwasm/wasm-bindgen/pull/4143) + +* Added bindings for [MathMLElement](https://www.w3.org/TR/MathML3). + [#4143](https://github.com/rustwasm/wasm-bindgen/pull/4143) + +* Added JSDoc type annotations to C-style enums. + [#4192](https://github.com/rustwasm/wasm-bindgen/pull/4192) + +* Added support for C-style enums with negative discriminants. + [#4204](https://github.com/rustwasm/wasm-bindgen/pull/4204) + +* Added bindings for `MediaStreamTrack.getCapabilities`. + [#4236](https://github.com/rustwasm/wasm-bindgen/pull/4236) + +* Added WASM ABI support for `u128` and `i128` + [#4222](https://github.com/rustwasm/wasm-bindgen/pull/4222) + +* Added support for the `wasm32v1-none` target. + [#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277) + +* Added support for `no_std` to `js-sys`, `web-sys`, `wasm-bindgen-futures` and `wasm-bindgen-test`. + [#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277) + +* Added support for `no_std` to `link_to!`, `static_string` (via `thread_local_v2`) and `throw`. + [#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277) + +* Added environment variables to configure tests: `WASM_BINDGEN_USE_BROWSER`, `WASM_BINDGEN_USE_DEDICATED_WORKER`, `WASM_BINDGEN_USE_SHARED_WORKER` `WASM_BINDGEN_USE_SERVICE_WORKER`, `WASM_BINDGEN_USE_DENO` and `WASM_BINDGEN_USE_NODE_EXPERIMENTAL`. The use of `wasm_bindgen_test_configure!` will overwrite any environment variable. + [#4295](https://github.com/rustwasm/wasm-bindgen/pull/4295) + +### Changed + +* String enums now generate private TypeScript types but only if used. + [#4174](https://github.com/rustwasm/wasm-bindgen/pull/4174) + +* Remove unnecessary JSDoc type annotations from generated `.d.ts` files + [#4187](https://github.com/rustwasm/wasm-bindgen/pull/4187) + +* Deprecate `autofocus`, `tabIndex`, `focus()` and `blur()` bindings in favor of bindings on the inherited `Element` class. + [#4143](https://github.com/rustwasm/wasm-bindgen/pull/4143) + +* Optimized ABI performance for `Option<{i32,u32,isize,usize,f32,*const T,*mut T}>`. + [#4183](https://github.com/rustwasm/wasm-bindgen/pull/4183) + +* Deprecate `--reference-types` in favor of automatic target feature detection. + [#4237](https://github.com/rustwasm/wasm-bindgen/pull/4237) + +* `wasm-bindgen-test-runner` now tries to restart the WebDriver on failure, instead of spending its timeout period trying to connect to a non-existing WebDriver. + [#4267](https://github.com/rustwasm/wasm-bindgen/pull/4267) + +* Deprecated `#[wasm_bindgen(thread_local)]` in favor of `#[wasm_bindgen(thread_local_v2)]`, which creates a `wasm_bindgen::JsThreadLocal`. It is similar to `std::thread::LocalKey` but supports `no_std`. + [#4277](https://github.com/rustwasm/wasm-bindgen/pull/4277) + +* Updated the WebGPU API to the current draft as of 2024-11-22. + [#4290](https://github.com/rustwasm/wasm-bindgen/pull/4290) + +* Improved error messages for `self` arguments in invalid positions. + [#4276](https://github.com/rustwasm/wasm-bindgen/pull/4276) + +### Fixed + +* Fixed methods with `self: &Self` consuming the object. + [#4178](https://github.com/rustwasm/wasm-bindgen/pull/4178) + +* Fixed unused string enums generating JS values. + [#4193](https://github.com/rustwasm/wasm-bindgen/pull/4193) + +* Fixed triggering lints in testing facilities. + [#4195](https://github.com/rustwasm/wasm-bindgen/pull/4195) + +* Fixed `#[should_panic]` not working with `#[wasm_bindgen_test(unsupported = ...)]`. + [#4196](https://github.com/rustwasm/wasm-bindgen/pull/4196) + +* Fixed potential `null` error when using `JsValue::as_debug_string()`. + [#4192](https://github.com/rustwasm/wasm-bindgen/pull/4192) + +* Fixed generated types when the getter and setter of a property have different types. + [#4202](https://github.com/rustwasm/wasm-bindgen/pull/4202) + +* Fixed generated types when a static getter/setter has the same name as an instance getter/setter. + [#4202](https://github.com/rustwasm/wasm-bindgen/pull/4202) + +* Fixed invalid TypeScript return types for multivalue signatures. + [#4210](https://github.com/rustwasm/wasm-bindgen/pull/4210) + +* Only emit `table.fill` instructions if the bulk-memory proposal is enabled. + [#4237](https://github.com/rustwasm/wasm-bindgen/pull/4237) + +* Fixed calls to `JsCast::instanceof()` not respecting JavaScript namespaces. + [#4241](https://github.com/rustwasm/wasm-bindgen/pull/4241) + +* Fixed imports for functions using `this` and late binding. + [#4225](https://github.com/rustwasm/wasm-bindgen/pull/4225) + +* Don't expose non-functioning implicit constructors to classes when none are provided. + [#4282](https://github.com/rustwasm/wasm-bindgen/pull/4282) + +-------------------------------------------------------------------------------- + +## [0.2.95](https://github.com/rustwasm/wasm-bindgen/compare/0.2.94...0.2.95) + +Released 2024-10-10 + +### Added + +* Added support for implicit discriminants in enums. + [#4152](https://github.com/rustwasm/wasm-bindgen/pull/4152) + +* Added support for `Self` in complex type expressions in methods. + [#4155](https://github.com/rustwasm/wasm-bindgen/pull/4155) + +### Changed + +* String enums are no longer generate TypeScript types. + [#4174](https://github.com/rustwasm/wasm-bindgen/pull/4174) + +### Fixed + +* Fixed generated setters from WebIDL interface attributes binding to wrong JS method names. + [#4170](https://github.com/rustwasm/wasm-bindgen/pull/4170) + +* Fix string enums showing up in JS documentation and TypeScript bindings without corresponding types. + [#4175](https://github.com/rustwasm/wasm-bindgen/pull/4175) + +-------------------------------------------------------------------------------- + +## [0.2.94](https://github.com/rustwasm/wasm-bindgen/compare/0.2.93...0.2.94) (YANKED) + +Released 2024-10-09 + +### Added + +* Added support for the WebAssembly `Tail Call` proposal. + [#4111](https://github.com/rustwasm/wasm-bindgen/pull/4111) + +* Add bindings for `RTCPeerConnection.setConfiguration(RTCConfiguration)` method. + [#4105](https://github.com/rustwasm/wasm-bindgen/pull/4105) + +* Add bindings to `RTCRtpTransceiverDirection.stopped`. + [#4102](https://github.com/rustwasm/wasm-bindgen/pull/4102) + +* Added experimental support for `Symbol.dispose` via `WASM_BINDGEN_EXPERIMENTAL_SYMBOL_DISPOSE`. + [#4118](https://github.com/rustwasm/wasm-bindgen/pull/4118) + +* Added bindings for the draft [WebRTC Encoded Transform](https://www.w3.org/TR/webrtc-encoded-transform) spec. + [#4125](https://github.com/rustwasm/wasm-bindgen/pull/4125) + +* Added `Debug` implementation to `JsError`. + [#4136](https://github.com/rustwasm/wasm-bindgen/pull/4136) + +* Added support for `js_name` and `skip_typescript` attributes for string enums. + [#4147](https://github.com/rustwasm/wasm-bindgen/pull/4147) + +* Added `unsupported` crate to `wasm_bindgen_test(unsupported = test)` as a way of running tests on non-Wasm targets as well. + [#4150](https://github.com/rustwasm/wasm-bindgen/pull/4150) + +* Added additional bindings for methods taking buffer view types (e.g. `&[u8]`) with corresponding JS types (e.g. `Uint8Array`). + [#4156](https://github.com/rustwasm/wasm-bindgen/pull/4156) + +* Added additional bindings for setters from WebIDL interface attributes with applicaple parameter types of just `JsValue`. + [#4156](https://github.com/rustwasm/wasm-bindgen/pull/4156) + +### Changed + +* Implicitly enable reference type and multivalue transformations if the module already makes use of the corresponding target features. + [#4133](https://github.com/rustwasm/wasm-bindgen/pull/4133) + +* Updated Gamepad API. + [#4134](https://github.com/rustwasm/wasm-bindgen/pull/4134) + +* Deprecated `Gamepad::display_id` and `GamepadHapticActuator::type_`. + [#4134](https://github.com/rustwasm/wasm-bindgen/pull/4134) + +* Removed `GamepadAxisMoveEvent`, `GamepadAxisMoveEventInit`, `GamepadButtonEvent`, `GamepadButtonEventInit` and `GamepadServiceTest`, which were seemingly never implemented by any JS environment. + [#4134](https://github.com/rustwasm/wasm-bindgen/pull/4134) + +* Changed `TextDecoder.decode()` `input` parameter type from `&mut [u8]` to `&[u8]`. + [#4141](https://github.com/rustwasm/wasm-bindgen/pull/4141) + +* Updated the WebGPU API to the current draft as of 2024-10-07. + [#4145](https://github.com/rustwasm/wasm-bindgen/pull/4145) + +* Deprecated generated setters from WebIDL interface attribute taking `JsValue` in favor of newer bindings with specific parameter types. + [#4156](https://github.com/rustwasm/wasm-bindgen/pull/4156) + +### Fixed + +* Fixed linked modules emitting snippet files when not using `--split-linked-modules`. + [#4066](https://github.com/rustwasm/wasm-bindgen/pull/4066) + +* Fixed incorrect deprecation warning when passing no parameter into `default()` (`init()`) or `initSync()`. + [#4074](https://github.com/rustwasm/wasm-bindgen/pull/4074) + +* Fixed many proc-macro generated `impl` blocks missing `#[automatically_derived]`, affecting test coverage. + [#4078](https://github.com/rustwasm/wasm-bindgen/pull/4078) + +* Fixed negative `BigInt` values being incorrectly formatted with two minus signs. + [#4082](https://github.com/rustwasm/wasm-bindgen/pull/4082) + [#4088](https://github.com/rustwasm/wasm-bindgen/pull/4088) + +* Fixed emitted `package.json` structure to correctly specify its dependencies + [#4091](https://github.com/rustwasm/wasm-bindgen/pull/4091) + +* Fixed returning `Option` now correctly has the `| undefined` type in TS bindings. + [#4137](https://github.com/rustwasm/wasm-bindgen/pull/4137) + +* Fixed enum variant name collisions with object prototype fields. + [#4137](https://github.com/rustwasm/wasm-bindgen/pull/4137) + +* Fixed multiline doc comment alignment and remove empty ones entirely. + [#4135](https://github.com/rustwasm/wasm-bindgen/pull/4135) + +* Fixed `experimental-nodejs-module` target when used with `#[wasm_bindgen(start)]`. + [#4093](https://github.com/rustwasm/wasm-bindgen/pull/4093) + +* Fixed error when importing very large JS files. + [#4146](https://github.com/rustwasm/wasm-bindgen/pull/4146) + +* Specify `"type": "module"` when deploying to nodejs-module + [#4092](https://github.com/rustwasm/wasm-bindgen/pull/4092) + +* Fixed string enums not generating TypeScript types. + [#4147](https://github.com/rustwasm/wasm-bindgen/pull/4147) + +* Bindings that take buffer view types (e.g. `&[u8]`) as parameters will now correctly return a `Result` when they might not support a backing `SharedArrayBuffer`. This only applies to new and unstable APIs, which won't cause a breaking in the API. + [#4156](https://github.com/rustwasm/wasm-bindgen/pull/4156) + +-------------------------------------------------------------------------------- + +## [0.2.93](https://github.com/rustwasm/wasm-bindgen/compare/0.2.92...0.2.93) + +Released 2024-08-13 + +### Added + +* Allow exporting functions named `default`. Throw error in wasm-bindgen-cli if --target web and + an exported symbol is named `default`. + [#3930](https://github.com/rustwasm/wasm-bindgen/pull/3930) + +* Added support for arbitrary expressions when using `#[wasm_bindgen(typescript_custom_section)]`. + [#3901](https://github.com/rustwasm/wasm-bindgen/pull/3901) + +* Implement `From>` for `JsValue`. + [#3877](https://github.com/rustwasm/wasm-bindgen/pull/3877) + +* Add method `copy_within` for TypedArray, add methods `find_last`,`find_last_index` for Array. + [#3888](https://github.com/rustwasm/wasm-bindgen/pull/3888) + +* Added support for returning `Vec`s from async functions. + [#3630](https://github.com/rustwasm/wasm-bindgen/pull/3630) + +* Added bindings for `InputDeviceInfo` and `MediaTrackCapabilities`. + [#3935](https://github.com/rustwasm/wasm-bindgen/pull/3935) + +* Add bindings for `RTCRtpReceiver.getCapabilities(DOMString)` method. + [#3941](https://github.com/rustwasm/wasm-bindgen/pull/3941) + +* Add bindings for `VisualViewport`. + [#3931](https://github.com/rustwasm/wasm-bindgen/pull/3931) + +* Add bindings for `queueMicrotask`. + [#3981](https://github.com/rustwasm/wasm-bindgen/pull/3981) + +* Add experimental bindings for User Agent Client Hints API + [#3989](https://github.com/rustwasm/wasm-bindgen/pull/3989) + +* Add bindings for `FocusOptions`. + [#3996](https://github.com/rustwasm/wasm-bindgen/pull/3996) + +* Add bindings for `RTCRtpReceiver.jitterBufferTarget`. + [#3968](https://github.com/rustwasm/wasm-bindgen/pull/3968) + +* Generate getters for all WebIDL dictionary types. + [#3993](https://github.com/rustwasm/wasm-bindgen/pull/3993) + +* Support for iterable in WebIDL. Gives `entries`, `keys`, `values` methods for regular and asynchronous, as well as `for_each` for regular, iterables. + [#3962](https://github.com/rustwasm/wasm-bindgen/pull/3962) + +* Add bindings for `HTMLTableCellElement.abbr` and `scope` properties. + [#3972](https://github.com/rustwasm/wasm-bindgen/pull/3972) + +* Add WebIDL definitions relating to `Popover API`. + [#3977](https://github.com/rustwasm/wasm-bindgen/pull/3977) + +* Added the `thread_stack_size` property to the object parameter of `default()` (`init()`) and `initSync()`, making it possible to set the stack size of spawned threads. `__wbindgen_thread_destroy()` now has a third optional parameter for the stack size, the default stack size is assumed when not passing it. When calling from the thread to be destroyed, by passing no parameters, the correct stack size is determined internally. + [#3995](https://github.com/rustwasm/wasm-bindgen/pull/3995) + +* Added bindings to the Device Memory API. + [#4011](https://github.com/rustwasm/wasm-bindgen/pull/4011) + +* Added support for WebIDL records. This added new methods to various APIs, notably `ClipboardItem()`, `GPUDeviceDescriptor.requiredLimits` and `Header()`. + [#4030](https://github.com/rustwasm/wasm-bindgen/pull/4030) + +* Added an official MSRV policy. Library MSRV changes will be accompanied by a minor version bump. CLI tool MSRV can change with any version bump. + [#4038](https://github.com/rustwasm/wasm-bindgen/pull/4038) + +* Added bindings to `NavigatorOptions.vibrate`. + [#4041](https://github.com/rustwasm/wasm-bindgen/pull/4041) + +* Added an experimental Node.JS ES module target, in comparison the current `node` target uses CommonJS, with `--target experimental-nodejs-module` or when testing with `wasm_bindgen_test_configure!(run_in_node_experimental)`. + [#4027](https://github.com/rustwasm/wasm-bindgen/pull/4027) + +* Added importing strings as `JsString` through `#[wasm_bindgen(thread_local, static_string)] static STRING: JsString = "a string literal";`. + [#4055](https://github.com/rustwasm/wasm-bindgen/pull/4055) + +* Added experimental test coverage support for `wasm-bindgen-test-runner`, see the guide for more information. + [#4060](https://github.com/rustwasm/wasm-bindgen/pull/4060) + +### Changed + +* Stabilize Web Share API. + [#3882](https://github.com/rustwasm/wasm-bindgen/pull/3882) + +* Generate JS bindings for WebIDL dictionary setters instead of using `Reflect`. This increases the size of the Web API bindings but should be more performant. Also, importing getters/setters from JS now supports specifying the JS attribute name as a string, e.g. `#[wasm_bindgen(method, setter = "x-cdm-codecs")]`. + [#3898](https://github.com/rustwasm/wasm-bindgen/pull/3898) + +* Greatly improve the performance of sending WebIDL 'string enums' across the JavaScript boundary by converting the enum variant string to/from an int. + [#3915](https://github.com/rustwasm/wasm-bindgen/pull/3915) + +* Use `table.fill` when appropriate. + [#3446](https://github.com/rustwasm/wasm-bindgen/pull/3446) + +* Annotated methods in WebCodecs that throw. + [#3970](https://github.com/rustwasm/wasm-bindgen/pull/3970) + +* Update and stabilize the Clipboard API. + [#3992](https://github.com/rustwasm/wasm-bindgen/pull/3992) + +* Deprecate builder-pattern type setters for WebIDL dictionary types and introduce non-mutable setters instead. + [#3993](https://github.com/rustwasm/wasm-bindgen/pull/3993) + +* Allow imported async functions to return any type that can be converted from a `JsValue`. + [#3919](https://github.com/rustwasm/wasm-bindgen/pull/3919) + +* Update Web Authentication API to level 3. + [#4000](https://github.com/rustwasm/wasm-bindgen/pull/4000) + +* Deprecate `AudioBufferSourceNode.onended` and `AudioBufferSourceNode.stop()`. + [#4020](https://github.com/rustwasm/wasm-bindgen/pull/4020) + +* Increase default stack size for spawned threads from 1 to 2 MB. + [#3995](https://github.com/rustwasm/wasm-bindgen/pull/3995) + +* Deprecated parameters to `default` (`init`) and `initSync` in favor of an object. + [#3995](https://github.com/rustwasm/wasm-bindgen/pull/3995) + +* Update `AbortSignal` and `AbortController` according to the WHATWG specification. + [#4026](https://github.com/rustwasm/wasm-bindgen/pull/4026) + +* Update the Indexed DB API. + [#4027](https://github.com/rustwasm/wasm-bindgen/pull/4027) + +* `UnwrapThrowExt for Result` now makes use of the required `Debug` bound to display the error as well. + [#4035](https://github.com/rustwasm/wasm-bindgen/pull/4035) + [#4049](https://github.com/rustwasm/wasm-bindgen/pull/4049) + +* MSRV of CLI tools bumped to v1.76. This does not affect libraries like `wasm-bindgen`, `js-sys` and `web-sys`! + [#4037](https://github.com/rustwasm/wasm-bindgen/pull/4037) + +* Filtered files in published crates, significantly reducing the package size and notably excluding any bash files. + [#4046](https://github.com/rustwasm/wasm-bindgen/pull/4046) + +* Deprecated `JsStatic` in favor of `#[wasm_bindgen(thread_local)]`, which creates a `std::thread::LocalKey`. The syntax is otherwise the same. + [#4057](https://github.com/rustwasm/wasm-bindgen/pull/4057) + +* Removed `impl Deref for JsStatic` when compiling with `cfg(target_feature = "atomics")`, which was unsound. + [#4057](https://github.com/rustwasm/wasm-bindgen/pull/4057) + +* Updated the WebGPU WebIDL to the current draft as of 2024-08-05. + [#4062](https://github.com/rustwasm/wasm-bindgen/pull/4062) + +* Use object URLs for linked modules without `--split-linked-modules`. + [#4067](https://github.com/rustwasm/wasm-bindgen/pull/4067) + +### Fixed + +* Copy port from headless test server when using `WASM_BINDGEN_TEST_ADDRESS`. + [#3873](https://github.com/rustwasm/wasm-bindgen/pull/3873) + +* Fix `catch` not being thread-safe. + [#3879](https://github.com/rustwasm/wasm-bindgen/pull/3879) + +* Fix MSRV compilation. + [#3927](https://github.com/rustwasm/wasm-bindgen/pull/3927) + +* Fix `clippy::empty_docs` lint. + [#3946](https://github.com/rustwasm/wasm-bindgen/pull/3946) + +* Fix missing target features in module when enabling reference types or multi-value transformation. + [#3967](https://github.com/rustwasm/wasm-bindgen/pull/3967) + +* Fixed Rust values getting GC'd while still borrowed. + [#3940](https://github.com/rustwasm/wasm-bindgen/pull/3940) + +* Fixed Rust values not getting GC'd if they were created via. a constructor. + [#3940](https://github.com/rustwasm/wasm-bindgen/pull/3940) + +* Fix triggering `clippy::mem_forget` lint in exported structs. + [#3985](https://github.com/rustwasm/wasm-bindgen/pull/3985) + +* Fix MDN links to static interface methods. + [#4010](https://github.com/rustwasm/wasm-bindgen/pull/4010) + +* Fixed Deno support. + [#3990](https://github.com/rustwasm/wasm-bindgen/pull/3990) + +* Fix `__wbindgen_thread_destroy()` ignoring parameters. + [#3995](https://github.com/rustwasm/wasm-bindgen/pull/3995) + +* Fix `no_std` support and therefor compiling with `default-features = false`. + [#4005](https://github.com/rustwasm/wasm-bindgen/pull/4005) + +* Fix byte order for big-endian platforms. + [#4015](https://github.com/rustwasm/wasm-bindgen/pull/4015) + +* Allow ex/importing structs, functions and parameters named with raw identifiers. + [#4025](https://github.com/rustwasm/wasm-bindgen/pull/4025) + +* Implement a more reliable way to detect the stack pointer. + [#4036](https://github.com/rustwasm/wasm-bindgen/pull/4036) + +* `#[track_caller]` is now always applied on `UnwrapThrowExt` methods when not targeting `wasm32-unknown-unknown`. + [#4042](https://github.com/rustwasm/wasm-bindgen/pull/4042) + +* Fixed linked modules emitting snippet files when not using `--split-linked-modules`. + [#4066](https://github.com/rustwasm/wasm-bindgen/pull/4066) + +-------------------------------------------------------------------------------- + +## [0.2.92](https://github.com/rustwasm/wasm-bindgen/compare/0.2.91...0.2.92) + +Released 2024-03-04 + +### Added + +* Add bindings for `RTCPeerConnectionIceErrorEvent`. + [#3835](https://github.com/rustwasm/wasm-bindgen/pull/3835) + +* Add bindings for `CanvasState.reset()`, affecting `CanvasRenderingContext2D` and `OffscreenCanvasRenderingContext2D`. + [#3844](https://github.com/rustwasm/wasm-bindgen/pull/3844) + +* Add `TryFrom` implementations for `Number`, that allow losslessly converting from 64- and 128-bits numbers. + [#3847](https://github.com/rustwasm/wasm-bindgen/pull/3847) + +* Add support for `Option<*const T>`, `Option<*mut T>` and `NonNull`. + [#3852](https://github.com/rustwasm/wasm-bindgen/pull/3852) + [#3857](https://github.com/rustwasm/wasm-bindgen/pull/3857) + +* Allow overriding the URL used for headless tests by setting `WASM_BINDGEN_TEST_ADDRESS`. + [#3861](https://github.com/rustwasm/wasm-bindgen/pull/3861) + +### Fixed + +* Make .wasm output deterministic when using `--reference-types`. + [#3851](https://github.com/rustwasm/wasm-bindgen/pull/3851) + +* Don't allow invalid Unicode scalar values in `char`. + [#3866](https://github.com/rustwasm/wasm-bindgen/pull/3866) + +-------------------------------------------------------------------------------- + +## [0.2.91](https://github.com/rustwasm/wasm-bindgen/compare/0.2.90...0.2.91) + +Released 2024-02-06 + +### Added + +* Added bindings for the `RTCRtpTransceiver.setCodecPreferences()` and unstable bindings for the `RTCRtpEncodingParameters.scalabilityMode`. + [#3828](https://github.com/rustwasm/wasm-bindgen/pull/3828) + +* Add unstable bindings for the FileSystemAccess API + [#3810](https://github.com/rustwasm/wasm-bindgen/pull/3810) + +* Added support for running tests in shared and service workers with `wasm_bindgen_test_configure!` `run_in_shared_worker` and `run_in_service_worker`. + [#3804](https://github.com/rustwasm/wasm-bindgen/pull/3804) + +* Accept the `--skip` flag with `wasm-bindgen-test-runner`. + [#3803](https://github.com/rustwasm/wasm-bindgen/pull/3803) + +* Introduce environment variable `WASM_BINDGEN_TEST_NO_ORIGIN_ISOLATION` to disable origin isolation for `wasm-bindgen-test-runner`. + [#3807](https://github.com/rustwasm/wasm-bindgen/pull/3807) + +* Add bindings for `USBDevice.forget()`. + [#3821](https://github.com/rustwasm/wasm-bindgen/pull/3821) + +### Changed + +* Stabilize `ClipboardEvent`. + [#3791](https://github.com/rustwasm/wasm-bindgen/pull/3791) + +* Use immutable buffers in `SubtleCrypto` methods. + [#3797](https://github.com/rustwasm/wasm-bindgen/pull/3797) + +* Deprecate `wasm_bindgen_test_configure!`s `run_in_worker` in favor of `run_in_dedicated_worker`. + [#3804](https://github.com/rustwasm/wasm-bindgen/pull/3804) + +* Updated the WebGPU WebIDL to the current draft as of 2024-01-30. Note that this retains the previous update's workaround for `GPUPipelineError`, and holds back an update to the `buffer` argument of the `GPUQueue.{writeBuffer,writeTexture}` methods. + [#3816](https://github.com/rustwasm/wasm-bindgen/pull/3816) + +* Deprecate `--weak-refs` and `WASM_BINDGEN_WEAKREF` in favor of automatic run-time detection. + [#3822](https://github.com/rustwasm/wasm-bindgen/pull/3822) + +### Fixed + +* Fixed UB when freeing strings received from JS if not using the default allocator. + [#3808](https://github.com/rustwasm/wasm-bindgen/pull/3808) + +* Fixed temporary folder detection by `wasm-bindgen-test-runner` on MacOS. + [#3817](https://github.com/rustwasm/wasm-bindgen/pull/3817) + +* Fixed using `#[wasm_bindgen(js_name = default)]` with `#[wasm_bindgen(module = ...)]`. + [#3823](https://github.com/rustwasm/wasm-bindgen/pull/3823) + +* Fixed nightly build of `wasm-bindgen-futures`. + [#3827](https://github.com/rustwasm/wasm-bindgen/pull/3827) + +-------------------------------------------------------------------------------- + +## [0.2.90](https://github.com/rustwasm/wasm-bindgen/compare/0.2.89...0.2.90) + +Released 2024-01-06 + +### Fixed + +* Fix JS shim default path detection for the no-modules target. + [#3748](https://github.com/rustwasm/wasm-bindgen/pull/3748) + +### Added + +* Add bindings for `HTMLFormElement.requestSubmit()`. + [#3747](https://github.com/rustwasm/wasm-bindgen/pull/3747) + +* Add bindings for `RTCRtpSender.getCapabilities(DOMString)` method, `RTCRtpCapabilities`, `RTCRtpCodecCapability` and `RTCRtpHeaderExtensionCapability`. + [#3737](https://github.com/rustwasm/wasm-bindgen/pull/3737) + +* Add bindings for `UserActivation`. + [#3719](https://github.com/rustwasm/wasm-bindgen/pull/3719) + +* Add unstable bindings for the Compression Streams API. + [#3752](https://github.com/rustwasm/wasm-bindgen/pull/3752) + +### Changed + +* Stabilize File System API. + [#3745](https://github.com/rustwasm/wasm-bindgen/pull/3745) + +* Stabilize `QueuingStrategy`. + [#3753](https://github.com/rustwasm/wasm-bindgen/pull/3753) + +### Fixed + +* Fixed a compiler error when using `#[wasm_bindgen]` inside `macro_rules!`. + [#3725](https://github.com/rustwasm/wasm-bindgen/pull/3725) + +### Removed + +* Removed Gecko-only `InstallTriggerData` and Gecko-internal `FlexLineGrowthState`, `GridDeclaration`, `GridTrackState`, + `RtcLifecycleEvent` and `WebrtcGlobalStatisticsReport` features. + [#3723](https://github.com/rustwasm/wasm-bindgen/pull/3723) + +-------------------------------------------------------------------------------- + +## [0.2.89](https://github.com/rustwasm/wasm-bindgen/compare/0.2.88...0.2.89) + +Released 2023-11-27. + +### Added + +* Add additional constructor to `DataView` for `SharedArrayBuffer`. + [#3695](https://github.com/rustwasm/wasm-bindgen/pull/3695) + +* Stabilize `wasm_bindgen::module()`. + [#3690](https://github.com/rustwasm/wasm-bindgen/pull/3690) + +### Fixed + +* The DWARF section is now correctly modified instead of leaving it in a broken state. + [#3483](https://github.com/rustwasm/wasm-bindgen/pull/3483) + +* Fixed an issue where `#[wasm_bindgen]` automatically derived the `TryFrom` trait for any struct, preventing custom `TryFrom` implementations. It has been updated to utilize a new `TryFromJsValue` trait instead. + [#3709](https://github.com/rustwasm/wasm-bindgen/pull/3709) + +* Update the TypeScript signature of `__wbindgen_thread_destroy` to indicate that it's parameters are optional. + [#3703](https://github.com/rustwasm/wasm-bindgen/pull/3703) + +### Removed + +* Removed Gecko-internal dictionary bindings `Csp`, `CspPolicies`, `CspReport` and `CspReportProperties`. + [#3721](https://github.com/rustwasm/wasm-bindgen/pull/3721) + +-------------------------------------------------------------------------------- + +## [0.2.88](https://github.com/rustwasm/wasm-bindgen/compare/0.2.87...0.2.88) (YANKED) + +Released 2023-11-01 + +### Added + +* Add bindings for `RTCRtpTransceiverInit.sendEncodings`. + [#3642](https://github.com/rustwasm/wasm-bindgen/pull/3642) + +* Add bindings for the Web Locks API to `web-sys`. + [#3604](https://github.com/rustwasm/wasm-bindgen/pull/3604) + +* Add bindings for `ViewTransition` to `web-sys`. + [#3598](https://github.com/rustwasm/wasm-bindgen/pull/3598) + +* Extend `AudioContext` with unstable features supporting audio sink configuration. + [#3433](https://github.com/rustwasm/wasm-bindgen/pull/3433) + +* Add bindings for `WebAssembly.Tag` and `WebAssembly.Exception`. + [#3484](https://github.com/rustwasm/wasm-bindgen/pull/3484) + +* Re-export `wasm-bindgen` from `js-sys`, `web-sys` and `wasm-bindgen-futures`. + [#3466](https://github.com/rustwasm/wasm-bindgen/pull/3466) + [#3601](https://github.com/rustwasm/wasm-bindgen/pull/3601) + +* Re-export `js-sys` from `web-sys` and `wasm-bindgen-futures`. + [#3466](https://github.com/rustwasm/wasm-bindgen/pull/3466) + [#3601](https://github.com/rustwasm/wasm-bindgen/pull/3601) + +* Add bindings for async variants of `Atomics.wait`. + [#3504](https://github.com/rustwasm/wasm-bindgen/pull/3504) + +* Add bindings for `WorkerGlobalScope.performance`. + [#3506](https://github.com/rustwasm/wasm-bindgen/pull/3506) + +* Add support for installing pre-built artifacts of `wasm-bindgen-cli` + via `cargo binstall wasm-bindgen-cli`. + [#3544](https://github.com/rustwasm/wasm-bindgen/pull/3544) + +* Add bindings for `RTCDataChannel.id`. + [#3547](https://github.com/rustwasm/wasm-bindgen/pull/3547) + +* Add bindings for `HTMLElement.inert`. + [#3557](https://github.com/rustwasm/wasm-bindgen/pull/3557) + +* Add unstable bindings for the Prioritized Task Scheduling API. + [#3566](https://github.com/rustwasm/wasm-bindgen/pull/3566) + +* Add bindings for `CssStyleSheet` constructor and `replace(_sync)` methods. + [#3573](https://github.com/rustwasm/wasm-bindgen/pull/3573) + +* Add bindings for `CanvasTransform.setTransform(DOMMatrix2DInit)`. + [#3580](https://github.com/rustwasm/wasm-bindgen/pull/3580) + +* Add a `crate` attribute to the `wasm_bindgen_test` proc-macro to specify a + non-default path to the `wasm-bindgen-test` crate. + [#3593](https://github.com/rustwasm/wasm-bindgen/pull/3593) + +* Add support for passing `Vec`s of exported Rust types and strings to/from JS. + [#3554](https://github.com/rustwasm/wasm-bindgen/pull/3554) + +* Implement `TryFrom` for exported Rust types and strings. + [#3554](https://github.com/rustwasm/wasm-bindgen/pull/3554) + +* Handle the `#[ignore = "reason"]` attribute with the `wasm_bindgen_test` + proc-macro and accept the `--include-ignored` flag with `wasm-bindgen-test-runner`. + [#3644](https://github.com/rustwasm/wasm-bindgen/pull/3644) + +* Added missing additions to the Notification API. + [#3667](https://github.com/rustwasm/wasm-bindgen/pull/3667) + +### Changed + +* Updated the WebGPU WebIDL. + The optional `message` argument of [`GPUPipelineError`](https://www.w3.org/TR/webgpu/#gpupipelineerror)'s constructor has been manually specified as a required argument, + because required arguments occurring after optional arguments are currently not supported by the generator. + [#3480](https://github.com/rustwasm/wasm-bindgen/pull/3480) + +* Replaced `curl` with `ureq`. By default we now use Rustls instead of OpenSSL. + [#3511](https://github.com/rustwasm/wasm-bindgen/pull/3511) + +* Changed mutability of the argument `buffer` in `write` functions to immutable for `FileSystemSyncAccessHandle` and `FileSystemWritableFileStream`. + It was also automatically changed for `IdbFileHandle`, which is deprecated. + [#3537](https://github.com/rustwasm/wasm-bindgen/pull/3537) + +* Changed behavior when compiling to `wasm32-wasi` to match `wasm32-emscripten` and + non-Wasm targets, generating a stub that panics when called rather than a wasm- + bindgen placeholder. + [#3233](https://github.com/rustwasm/wasm-bindgen/pull/3233) + +* Changed constructor implementation in generated JS bindings, it is now + possible to override methods from generated JS classes using inheritance. + When exported constructors return `Self`. + [#3562](https://github.com/rustwasm/wasm-bindgen/pull/3562) + +* Made `wasm-bindgen` forwards-compatible with the standard C ABI. + [#3595](https://github.com/rustwasm/wasm-bindgen/pull/3595) + +* Changed the design of the internal `WasmAbi` trait. Rather than marking a type + which can be passed directly as a parameter/result to/from JS, it now lets + types specify how they can be split into / recreated from multiple primitive + types which are then passed to/from JS. + `WasmPrimitive` now serves the old function of `WasmAbi`, minus allowing + `#[repr(C)]` types. + [#3595](https://github.com/rustwasm/wasm-bindgen/pull/3595) + +* Use `queueMicrotask` in `wasm-bindgen-futures` for scheduling tasks on the next tick. + If that is not available, use the previous `Promise.then` mechanism as a fallback. + This should avoid quirks, like exceptions thrown get now properly reported + as normal exceptions rather than as rejected promises. + [#3611](https://github.com/rustwasm/wasm-bindgen/pull/3611) + +* Improved TypeScript bindings to accurately reference Rust enum types in function signatures, + enhancing type safety and compatibility. + [#3647](https://github.com/rustwasm/wasm-bindgen/pull/3647) + +* Throw an error on enum name collisions, previously only one enum would be emitted. + [#3669](https://github.com/rustwasm/wasm-bindgen/pull/3669) + +### Fixed + +* Fixed `wasm_bindgen` macro to handle raw identifiers in field names. + [#3621](https://github.com/rustwasm/wasm-bindgen/pull/3621) + +* Fixed bindings and comments for `Atomics.wait`. + [#3509](https://github.com/rustwasm/wasm-bindgen/pull/3509) + +* Fixed `wasm_bindgen_test` macro to handle raw identifiers in test names. + [#3541](https://github.com/rustwasm/wasm-bindgen/pull/3541) + +* Fixed Cargo license field to follow the SPDX 2.1 license expression standard. + [#3529](https://github.com/rustwasm/wasm-bindgen/pull/3529) + +* Use fully qualified paths in the `wasm_bindgen_test` macro. + [#3549](https://github.com/rustwasm/wasm-bindgen/pull/3549) + +* Fixed bug allowing JS primitives to be returned from exported constructors. + [#3562](https://github.com/rustwasm/wasm-bindgen/pull/3562) + +* Fixed optional parameters in JSDoc. + [#3577](https://github.com/rustwasm/wasm-bindgen/pull/3577) + +* Use re-exported `js-sys` from `wasm-bindgen-futures` to account for + non-default path specified by the `crate` attribute in `wasm_bindgen_futures` + proc-macro. + [#3601](https://github.com/rustwasm/wasm-bindgen/pull/3601) + +* Fix bug with function arguments coming from `macro_rules!`. + [#3625](https://github.com/rustwasm/wasm-bindgen/pull/3625) + +* Fix some calls to `free()` missing alignment. + [#3639](https://github.com/rustwasm/wasm-bindgen/pull/3639) + +* Fix wrong ABI for raw pointers. + [#3655](https://github.com/rustwasm/wasm-bindgen/pull/3655) + +### Removed + +* Removed `ReadableStreamByobReader::read_with_u8_array()` because it doesn't work with Wasm. + [#3582](https://github.com/rustwasm/wasm-bindgen/pull/3582) + +* Removed `GetNotificationOptions`, `NotificationBehavior` and `Notification.get()` because + they don't exist anymore. + +-------------------------------------------------------------------------------- + +## [0.2.87](https://github.com/rustwasm/wasm-bindgen/compare/0.2.86...0.2.87) + +Released 2023-06-12. + +### Added + +* Implemented `IntoIterator` for `Array`. + [#3477](https://github.com/rustwasm/wasm-bindgen/pull/3477) + +### Changed + +* Deprecate `HtmlMenuItemElement` and parts of `HtmlMenuElement`. + [#3448](https://github.com/rustwasm/wasm-bindgen/pull/3448) + +* Stabilize `ResizeObserver`. + [#3459](https://github.com/rustwasm/wasm-bindgen/pull/3459) + +### Fixed + +* Take alignment into consideration during (de/re)allocation. + [#3463](https://github.com/rustwasm/wasm-bindgen/pull/3463) + +-------------------------------------------------------------------------------- + +## 0.2.86 + +Released 2023-05-16. + +[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.85...0.2.86) + +-------------------------------------------------------------------------------- + +## 0.2.85 + +Released 2023-05-09. + +[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.84...0.2.85) + +-------------------------------------------------------------------------------- + +## 0.2.84 + +Released 2023-02-01. + +[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.83...0.2.84) + +-------------------------------------------------------------------------------- + +## 0.2.83 + +Released 2022-09-12. + +[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.82...0.2.83) + +-------------------------------------------------------------------------------- + +## 0.2.82 + +Released 2022-07-25. + +[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.81...0.2.82) + +-------------------------------------------------------------------------------- + +## 0.2.81 + +Released 2022-06-14. + +[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.80...0.2.81) + +-------------------------------------------------------------------------------- + ## 0.2.80 Released 2022-04-04. @@ -317,7 +1294,7 @@ Released 2020-04-29. [#2099](https://github.com/rustwasm/wasm-bindgen/pull/2099) * The output of `wasm-bindgen` is now compatible with Webpack 5 and the updated - version of the wasm ESM integration specification. + version of the Wasm ESM integration specification. [#2110](https://github.com/rustwasm/wasm-bindgen/pull/2099) -------------------------------------------------------------------------------- @@ -411,7 +1388,7 @@ Released 2020-03-03. tightended up a bit. [#1987](https://github.com/rustwasm/wasm-bindgen/pull/1987) -* The `self` identifier is no longe used on the `no-modules` target, making it a +* The `self` identifier is no longer used on the `no-modules` target, making it a bit more flexible in more environments. [#1995](https://github.com/rustwasm/wasm-bindgen/pull/1995) @@ -500,7 +1477,7 @@ Released 2019-11-19. * Running `wasm-bindgen` over empty anyref modules now works again. [#1861](https://github.com/rustwasm/wasm-bindgen/pull/1861) -* Support for multi-value JS engines has been fixed as a wasm interface types +* Support for multi-value JS engines has been fixed as a Wasm interface types polyfill. [#1863](https://github.com/rustwasm/wasm-bindgen/pull/1863) @@ -654,7 +1631,7 @@ Released 2019-08-14. * Add binding for `Element.getElementsByClassName`. [#1665](https://github.com/rustwasm/wasm-bindgen/pull/1665) -* `PartialEq` and `Eq` are now implementd for all `web-sys` types. +* `PartialEq` and `Eq` are now implemented for all `web-sys` types. [#1673](https://github.com/rustwasm/wasm-bindgen/pull/1673) * The `wasm-bindgen-futures` crate now has support for futures when the @@ -723,8 +1700,8 @@ Released 2019-07-11. slices. [#1639](https://github.com/rustwasm/wasm-bindgen/pull/1639) -* When using the `bundler` target the import of the wasm file now uses the - `.wasm` extension to ensure a wasm file is loaded. +* When using the `bundler` target the import of the Wasm file now uses the + `.wasm` extension to ensure a Wasm file is loaded. [#1646](https://github.com/rustwasm/wasm-bindgen/pull/1646) * The old internal `Stack` trait has been removed since it is no longer used. @@ -785,7 +1762,7 @@ Released 2019-06-14. * Bindings for `Array#flat` and `Array#flatMap` have been added. [#1573](https://github.com/rustwasm/wasm-bindgen/pull/1573) -* All `#[wasm_bindgen]` types now `AsRef` to themslves. +* All `#[wasm_bindgen]` types now `AsRef` to themselves. [#1583](https://github.com/rustwasm/wasm-bindgen/pull/1583) * When using `--target web` the path passed to `init` is no longer required. @@ -852,7 +1829,7 @@ Released 2019-05-16. * A utility for counting the size of the `anyref` heap has been added. [#1521](https://github.com/rustwasm/wasm-bindgen/pull/1521) -* Passing ASCII-only strings to WASM should now be significantly faster. +* Passing ASCII-only strings to Wasm should now be significantly faster. [#1470](https://github.com/rustwasm/wasm-bindgen/pull/1470) * The `selectionStart` and `selectionEnd` APIs of text areas have been enabled. @@ -992,7 +1969,7 @@ Released 2019-04-10. [#1416](https://github.com/rustwasm/wasm-bindgen/pull/1416) * A `wasm_bindgen::function_table()` function has been added to expose the - `WebAssembly.Table` and get access to it in wasm code. + `WebAssembly.Table` and get access to it in Wasm code. [#1431](https://github.com/rustwasm/wasm-bindgen/pull/1431) ### Fixed @@ -1109,7 +2086,7 @@ Released 2019-03-04. landed and is enabled with `WASM_BINDGEN_ANYREF=1`. [#1002](https://github.com/rustwasm/wasm-bindgen/pull/1002) -* Support fot the new browser `TextEncode#encodeInto` API has been added. +* Support for the new browser `TextEncode#encodeInto` API has been added. [#1279](https://github.com/rustwasm/wasm-bindgen/pull/1279) * JS doc comments are now added to TypeScript bindings in addition to the JS @@ -1155,7 +2132,7 @@ Released 2019-02-15. [#1225](https://github.com/rustwasm/wasm-bindgen/pull/1225). * A `--remove-producers-section` flag has been added to the CLI tool to, well, - remove the `producers` section from the final wasm file. + remove the `producers` section from the final Wasm file. [#1256](https://github.com/rustwasm/wasm-bindgen/pull/1256). ### Fixed @@ -1193,7 +2170,7 @@ Released 2019-02-12. ### Changed * `wasm-bindgen` now internally uses the `walrus` crate to perform its - transformations of the wasm that rustc/LLVM emits. See + transformations of the Wasm that rustc/LLVM emits. See [#1237](https://github.com/rustwasm/wasm-bindgen/pull/1237). ### Fixed @@ -1345,17 +2322,17 @@ Released 2018-12-04. ### Added * Add a `#[wasm_bindgen(start)]` attribute to customize the `start` section of - the wasm module. + the Wasm module. [#1057](https://github.com/rustwasm/wasm-bindgen/pull/1057) -* Add support for producing the new "producers" section of wasm binaries +* Add support for producing the new "producers" section of Wasm binaries [#1041](https://github.com/rustwasm/wasm-bindgen/pull/1041) * Add support a `typescript_custom_section` attribute for producing custom typescript abstractions [#1048](https://github.com/rustwasm/wasm-bindgen/pull/1048) -* Generate `*.d.ts` files for wasm files in addition to the JS bindings +* Generate `*.d.ts` files for Wasm files in addition to the JS bindings [#1053](https://github.com/rustwasm/wasm-bindgen/pull/1053) * Add a feature to assert that all attributes in `#[wasm_bindgen]` are used to @@ -1632,7 +2609,7 @@ Released 2018-09-07 ### Fixed -* The "names" section of the wasm binary is now correctly preserved by +* The "names" section of the Wasm binary is now correctly preserved by wasm-bindgen. -------------------------------------------------------------------------------- diff --git a/Cargo.toml b/Cargo.toml index d6523f44f1f..cb97505b650 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,17 +1,19 @@ [package] -name = "wasm-bindgen" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -readme = "README.md" categories = ["wasm"] -repository = "https://github.com/rustwasm/wasm-bindgen" -homepage = "https://rustwasm.github.io/" -documentation = "https://docs.rs/wasm-bindgen" description = """ Easy support for interacting between JS and Rust. """ -edition = "2018" +documentation = "https://docs.rs/wasm-bindgen" +edition = "2021" +homepage = "https://rustwasm.github.io/" +include = ["/build.rs", "/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen" +readme = "README.md" +repository = "https://github.com/rustwasm/wasm-bindgen" +rust-version = "1.57" +version = "0.2.100" [package.metadata.docs.rs] features = ["serde-serialize"] @@ -20,42 +22,77 @@ features = ["serde-serialize"] test = false [features] -default = ["spans", "std"] -spans = ["wasm-bindgen-macro/spans"] -std = [] -serde-serialize = ["serde", "serde_json", "std"] -nightly = [] +default = ["std", "msrv"] enable-interning = ["std"] +serde-serialize = ["serde", "serde_json", "std"] +spans = [] +std = [] + +# Opt-in for Rust language features that require a higher MSRV. +# +# The current rustc version is detected at compile-time, so enabling this +# feature for older compilers will NOT result in a compilation error. Instead, +# any unsupported language feature will not be used. +msrv = ["rustversion"] # Whether or not the `#[wasm_bindgen]` macro is strict and generates an error on # all unused attributes strict-macro = ["wasm-bindgen-macro/strict-macro"] -# This is only for debugging wasm-bindgen! No stability guarantees, so enable +# INTERNAL ONLY: Enables gg-alloc as system allocator when using wasm-bindgen-test to check that large pointers +# are handled correctly +gg-alloc = ["wasm-bindgen-test/gg-alloc"] + +# INTERNAL ONLY: This is only for debugging wasm-bindgen! No stability guarantees, so enable # this at your own peril! xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"] [dependencies] -wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.80" } +cfg-if = "1.0.0" +once_cell = { version = "1.12", default-features = false } +rustversion = { version = "1.0", optional = true } serde = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true } -cfg-if = "1.0.0" +wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.100" } + +[dev-dependencies] +once_cell = "1" +wasm-bindgen-test = { path = 'crates/test' } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -js-sys = { path = 'crates/js-sys', version = '0.3.57' } -wasm-bindgen-test = { path = 'crates/test', version = '=0.3.30' } -wasm-bindgen-futures = { path = 'crates/futures', version = '=0.4.30' } +js-sys = { path = 'crates/js-sys' } +paste = "1" serde_derive = "1.0" -wasm-bindgen-test-crate-a = { path = 'tests/crates/a', version = '0.1' } -wasm-bindgen-test-crate-b = { path = 'tests/crates/b', version = '0.1' } +wasm-bindgen-futures = { path = 'crates/futures' } +wasm-bindgen-test-crate-a = { path = 'tests/crates/a' } +wasm-bindgen-test-crate-b = { path = 'tests/crates/b' } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] } + +[lints.clippy] +large_enum_variant = "allow" +new_without_default = "allow" +overly_complex_bool_expr = "allow" +too_many_arguments = "allow" +type_complexity = "allow" + +[workspace.lints.clippy] +large_enum_variant = "allow" +new_without_default = "allow" +overly_complex_bool_expr = "allow" +too_many_arguments = "allow" +type_complexity = "allow" [workspace] +exclude = ["crates/msrv/resolver", "crates/msrv/lib", "crates/msrv/cli"] members = [ "benchmarks", "crates/cli", "crates/js-sys", "crates/test", "crates/test/sample", + "crates/example-tests", "crates/typescript-tests", "crates/web-sys", "crates/webidl", @@ -68,6 +105,7 @@ members = [ "examples/deno", "examples/dom", "examples/duck-typed-interfaces", + "examples/explicit-resource-management", "examples/fetch", "examples/guide-supported-types-examples", "examples/hello_world", @@ -78,10 +116,10 @@ members = [ "examples/raytrace-parallel", "examples/request-animation-frame", "examples/todomvc", + "examples/wasm-audio-worklet", "examples/wasm-in-wasm", "examples/wasm-in-wasm-imports", "examples/wasm-in-web-worker", - "examples/wasm2js", "examples/weather_report", "examples/webaudio", "examples/webgl", @@ -90,11 +128,13 @@ members = [ "examples/webxr", "examples/without-a-bundler", "examples/without-a-bundler-no-modules", + "examples/synchronous-instantiation", "tests/no-std", ] +resolver = "2" [patch.crates-io] +js-sys = { path = 'crates/js-sys' } wasm-bindgen = { path = '.' } wasm-bindgen-futures = { path = 'crates/futures' } -js-sys = { path = 'crates/js-sys' } web-sys = { path = 'crates/web-sys' } diff --git a/README.md b/README.md index cf5dafcfd7e..d8e07bc0952 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,14 @@

- Build Status + Build Status Crates.io version Download docs.rs docs

- Guide + Guide (main branch) | API Docs | @@ -26,6 +26,24 @@ Built with 🦀🕸 by The Rust and WebAssembly Working Group +## Install `wasm-bindgen-cli` + +You can install it using `cargo install`: + +``` +cargo install wasm-bindgen-cli +``` + +Or, you can download it from the +[release page](https://github.com/rustwasm/wasm-bindgen/releases). + +If you have [`cargo-binstall`](https://crates.io/crates/cargo-binstall) installed, +then you can install the pre-built artifacts by running: + +``` +cargo binstall wasm-bindgen-cli +``` + ## Example Import JavaScript things into Rust and export Rust things to JavaScript. @@ -69,7 +87,7 @@ greet("World!"); * **Designed with the ["Web IDL bindings" proposal][webidl-bindings] in mind.** Eventually, there won't be any JavaScript shims between Rust-generated wasm - functions and native DOM methods. Because the wasm functions are statically + functions and native DOM methods. Because the Wasm functions are statically type checked, some of those native methods' dynamic type checks should become unnecessary, promising to unlock even-faster-than-JavaScript DOM access. @@ -90,6 +108,12 @@ You can find general documentation about using Rust and WebAssembly together - [web-sys](https://docs.rs/web-sys) - [wasm-bindgen-futures](https://docs.rs/wasm-bindgen-futures) +## MSRV Policy + +Libraries that are released on [crates.io](https://crates.io) have a MSRV of v1.57. Changes to the MSRV will be accompanied by a minor version bump. + +CLI tools and their corresponding support libraries have a MSRV of v1.76. Changes to the MSRV will be accompanied by a patch version bump. + ## License This project is licensed under either of @@ -110,4 +134,4 @@ Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. -[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html \ No newline at end of file +[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html diff --git a/_package.json b/_package.json deleted file mode 100644 index 95632f89360..00000000000 --- a/_package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "scripts": { - "build": "webpack", - "serve": "webpack serve" - }, - "devDependencies": { - "@wasm-tool/wasm-pack-plugin": "1.5.0", - "html-webpack-plugin": "^5.3.2", - "text-encoding": "^0.7.0", - "webpack": "^5.49.0", - "webpack-cli": "^4.7.2", - "webpack-dev-server": "^3.11.2" - } -} diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 7ffef776019..8c41d2d7998 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -1,11 +1,14 @@ [package] -name = "wasm-bindgen-benchmark" -version = "0.1.0" authors = ["The wasm-bindgen Developers"] +edition = "2021" +name = "wasm-bindgen-benchmark" +publish = false +version = "0.0.0" [dependencies] -wasm-bindgen = "0.2.43" -web-sys = { version = "0.3.20", features = ['Node'] } +js-sys = { path = '../crates/js-sys' } +wasm-bindgen = { path = '../' } +web-sys = { path = '../crates/web-sys', features = ['Node'] } [lib] crate-type = ['cdylib'] diff --git a/benchmarks/README.md b/benchmarks/README.md index 2309bcb8af2..ca1619cd3cd 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -11,17 +11,10 @@ performance suite for WebAssembly for Rust. ## Building and Running -First, copy the benchmarks to a temporary directory: - -``` -$ cp ./benchmarks /some/other/directory -``` - -Next, `cd` into that directory and execute: - ``` +$ cd benchmarks $ cargo build --release --target wasm32-unknown-unknown -$ wasm-bindgen --target web ./target/wasm32-unknown-unknown/release/crate.wasm +$ cargo run --package wasm-bindgen-cli -- --out-dir pkg --target web ../target/wasm32-unknown-unknown/release/wasm_bindgen_benchmark.wasm ``` Next, use your favorite static file server to host the current directory. For diff --git a/benchmarks/globals.js b/benchmarks/globals.js index 0412158e34a..13c8fe14b4a 100644 --- a/benchmarks/globals.js +++ b/benchmarks/globals.js @@ -1,5 +1,16 @@ export function jsthunk() {} export function add(a, b) { return a + b; } +export function use_baz(baz) { + if (baz !== Baz['variant-2']) { + throw new Error("Passed wrong variant"); + } + } export class Foo { bar() {} } + +export const Baz = { + 'variant-1': 'variant-1', + 'variant-2': 'variant-2', + 'variant-3': 'variant-3', +} diff --git a/benchmarks/index.html b/benchmarks/index.html index 42cd3dc515d..b20d27e5d45 100644 --- a/benchmarks/index.html +++ b/benchmarks/index.html @@ -22,7 +22,7 @@ - Source code + Source code

JS / wasm-bindgen comparison

@@ -56,7 +56,7 @@

JS / wasm-bindgen comparison

This benchmarks tests out how long it take JS to call a thunk in the given language. For example JS will call a JS thunk or - JS will call a wasm function that does nothing. + JS will call a Wasm function that does nothing.

@@ -131,7 +131,7 @@

JS / wasm-bindgen comparison

This benchmarks calculates the 40th fibonacci number. It in - theory should favor wasm since wasm is "better a compute", but + theory should favor Wasm since Wasm is "better a compute", but a good JIT will probably make the code roughly equivalent.

@@ -275,6 +275,20 @@

wasm-bindgen benchmarks

+ + + Call a custom JS function with a string enum value parameter + + (?) + +

+ Benchmarks the speed of passing string enums to javascript +

+ + + + + Pass to/from wasm-bindgen @@ -282,7 +296,7 @@

wasm-bindgen benchmarks

(?)

- This benchmarks the overhead of passing strings to wasm and + This benchmarks the overhead of passing strings to Wasm and also receiving them from wasm.

diff --git a/benchmarks/index.js b/benchmarks/index.js index ac603b63c76..a8cbae01e77 100644 --- a/benchmarks/index.js +++ b/benchmarks/index.js @@ -16,6 +16,7 @@ import wbindgen_init, { call_first_child_final_n_times as wbindgen_call_first_child_final_n_times, call_first_child_structural_n_times as wbindgen_call_first_child_structural_n_times, call_foo_bar_final_n_times as wbindgen_call_foo_bar_final_n_times, + call_use_baz_n_times as wbindgen_call_use_baz_n_times, call_foo_bar_structural_n_times as wbindgen_call_foo_bar_structural_n_times, str_roundtrip as wbindgen_str_roundtrip, } from './pkg/wasm_bindgen_benchmark.js'; @@ -80,6 +81,7 @@ function makeBenchmarks() { const foo = new globals.Foo(); benchmarks.wbindgen_call_foo_bar_final_n_times = () => wbindgen_call_foo_bar_final_n_times(10000, foo); benchmarks.wbindgen_call_foo_bar_structural_n_times = () => wbindgen_call_foo_bar_structural_n_times(10000, foo); + benchmarks.wbindgen_call_use_baz_n_times = () => wbindgen_call_use_baz_n_times(10000); const strings = { @@ -158,7 +160,7 @@ function executeBenchmark(name, bm) { }); } -// Load wasm files and when they're done (plus the DOM) then we initialize +// Load Wasm files and when they're done (plus the DOM) then we initialize // everything const wasms = []; wasms.push(wbindgen_init('./pkg/wasm_bindgen_benchmark_bg.wasm')); diff --git a/benchmarks/src/lib.rs b/benchmarks/src/lib.rs index f6c375db6ad..c5abf1c560c 100644 --- a/benchmarks/src/lib.rs +++ b/benchmarks/src/lib.rs @@ -2,7 +2,6 @@ extern crate wasm_bindgen; extern crate web_sys; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use web_sys::Node; #[wasm_bindgen(raw_module = "../globals.js")] @@ -12,6 +11,9 @@ extern "C" { #[wasm_bindgen(js_name = add)] fn js_add(a: i32, b: i32) -> i32; + #[wasm_bindgen(js_name = use_baz)] + fn js_use_baz(val: Baz); + pub type Foo; #[wasm_bindgen(method, final, js_name = bar)] fn bar_final(this: &Foo); @@ -24,6 +26,14 @@ extern "C" { fn doesnt_throw_catch() -> Result<(), JsValue>; } +#[wasm_bindgen] +#[derive(Copy, Clone)] +pub enum Baz { + Variant1 = "variant-1", + Variant2 = "variant-2", + Variant3 = "variant-3", +} + #[wasm_bindgen] pub fn call_js_thunk_n_times(n: usize) { for _ in 0..n { @@ -60,7 +70,7 @@ pub fn fibonacci(n: i32) -> i32 { unsafe { FIB_HIGH = (a >> 32) as i32; } - return a as i32; + a as i32 } #[wasm_bindgen] @@ -69,16 +79,23 @@ pub fn fibonacci_high() -> i32 { } #[wasm_bindgen] -pub fn call_foo_bar_final_n_times(n: usize, foo: &Foo) { +pub fn call_foo_bar_final_n_times(n: usize, js_foo: &Foo) { + for _ in 0..n { + js_foo.bar_final(); + } +} + +#[wasm_bindgen] +pub fn call_foo_bar_structural_n_times(n: usize, js_foo: &Foo) { for _ in 0..n { - foo.bar_final(); + js_foo.bar_structural(); } } #[wasm_bindgen] -pub fn call_foo_bar_structural_n_times(n: usize, foo: &Foo) { +pub fn call_use_baz_n_times(n: usize) { for _ in 0..n { - foo.bar_structural(); + js_use_baz(Baz::Variant2); } } diff --git a/crates/backend/Cargo.toml b/crates/backend/Cargo.toml index d4b10932f52..cc7566ffa1d 100644 --- a/crates/backend/Cargo.toml +++ b/crates/backend/Cargo.toml @@ -1,25 +1,28 @@ [package] -name = "wasm-bindgen-backend" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen-backend" description = """ Backend code generation of the wasm-bindgen tool """ -edition = "2018" +documentation = "https://docs.rs/wasm-bindgen-backend" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-backend" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend" +rust-version = "1.57" +version = "0.2.100" [features] -spans = [] extra-traits = ["syn/extra-traits"] [dependencies] bumpalo = "3.0.0" -lazy_static = "1.0.2" log = "0.4" proc-macro2 = "1.0" quote = '1.0' -syn = { version = '1.0', features = ['full'] } -wasm-bindgen-shared = { path = "../shared", version = "=0.2.80" } +syn = { version = '2.0', features = ['full'] } +wasm-bindgen-shared = { path = "../shared", version = "=0.2.100" } + +[lints] +workspace = true diff --git a/crates/backend/src/ast.rs b/crates/backend/src/ast.rs index 80af028f422..0fed5f18c54 100644 --- a/crates/backend/src/ast.rs +++ b/crates/backend/src/ast.rs @@ -1,30 +1,55 @@ //! A representation of the Abstract Syntax Tree of a Rust program, -//! with all the added metadata necessary to generate WASM bindings +//! with all the added metadata necessary to generate Wasm bindings //! for it. -use crate::Diagnostic; +use crate::{util::ShortHash, Diagnostic}; use proc_macro2::{Ident, Span}; use std::hash::{Hash, Hasher}; -use syn; +use syn::Path; use wasm_bindgen_shared as shared; /// An abstract syntax tree representing a rust program. Contains /// extra information for joining up this rust code with javascript. #[cfg_attr(feature = "extra-traits", derive(Debug))] -#[derive(Default, Clone)] +#[derive(Clone)] pub struct Program { /// rust -> js interfaces pub exports: Vec, /// js -> rust interfaces pub imports: Vec, + /// linked-to modules + pub linked_modules: Vec, /// rust enums pub enums: Vec, /// rust structs pub structs: Vec, /// custom typescript sections to be included in the definition file - pub typescript_custom_sections: Vec, + pub typescript_custom_sections: Vec, /// Inline JS snippets pub inline_js: Vec, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, + /// Path to js_sys + pub js_sys: Path, + /// Path to wasm_bindgen_futures + pub wasm_bindgen_futures: Path, +} + +impl Default for Program { + fn default() -> Self { + Self { + exports: Default::default(), + imports: Default::default(), + linked_modules: Default::default(), + enums: Default::default(), + structs: Default::default(), + typescript_custom_sections: Default::default(), + inline_js: Default::default(), + wasm_bindgen: syn::parse_quote! { wasm_bindgen }, + js_sys: syn::parse_quote! { js_sys }, + wasm_bindgen_futures: syn::parse_quote! { wasm_bindgen_futures }, + } + } } impl Program { @@ -37,8 +62,25 @@ impl Program { && self.typescript_custom_sections.is_empty() && self.inline_js.is_empty() } + + /// Name of the link function for a specific linked module + pub fn link_function_name(&self, idx: usize) -> String { + let hash = match &self.linked_modules[idx] { + ImportModule::Inline(idx, _) => ShortHash((1, &self.inline_js[*idx])).to_string(), + other => ShortHash((0, other)).to_string(), + }; + format!("__wbindgen_link_{}", hash) + } } +/// An abstract syntax tree representing a link to a module in Rust. +/// In contrast to Program, LinkToModule must expand to an expression. +/// linked_modules of the inner Program must contain exactly one element +/// whose link is produced by the expression. +#[cfg_attr(feature = "extra-traits", derive(Debug))] +#[derive(Clone)] +pub struct LinkToModule(pub Program); + /// A rust to js interface. Allows interaction with rust objects/functions /// from javascript. #[cfg_attr(feature = "extra-traits", derive(Debug))] @@ -58,14 +100,18 @@ pub struct Export { pub rust_class: Option, /// The name of the rust function/method on the rust side. pub rust_name: Ident, - /// Whether or not this function should be flagged as the wasm start + /// Whether or not this function should be flagged as the Wasm start /// function. pub start: bool, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, + /// Path to wasm_bindgen_futures + pub wasm_bindgen_futures: Path, } /// The 3 types variations of `self`. #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] -#[derive(Clone)] +#[derive(Copy, Clone)] pub enum MethodSelf { /// `self` ByValue, @@ -79,8 +125,8 @@ pub enum MethodSelf { #[cfg_attr(feature = "extra-traits", derive(Debug))] #[derive(Clone)] pub struct Import { - /// The type of module being imported from - pub module: ImportModule, + /// The type of module being imported from, if any + pub module: Option, /// The namespace to access the item through, if any pub js_namespace: Option>, /// The type of item being imported @@ -91,8 +137,6 @@ pub struct Import { #[cfg_attr(feature = "extra-traits", derive(Debug))] #[derive(Clone)] pub enum ImportModule { - /// No module / import from global scope - None, /// Import from the named module, with relative paths interpreted Named(String, Span), /// Import from the named module, without interpreting paths @@ -104,21 +148,9 @@ pub enum ImportModule { impl Hash for ImportModule { fn hash(&self, h: &mut H) { match self { - ImportModule::None => { - 0u8.hash(h); - } - ImportModule::Named(name, _) => { - 1u8.hash(h); - name.hash(h); - } - ImportModule::Inline(idx, _) => { - 2u8.hash(h); - idx.hash(h); - } - ImportModule::RawNamed(name, _) => { - 3u8.hash(h); - name.hash(h); - } + ImportModule::Named(name, _) => (1u8, name).hash(h), + ImportModule::Inline(idx, _) => (2u8, idx).hash(h), + ImportModule::RawNamed(name, _) => (3u8, name).hash(h), } } } @@ -131,10 +163,12 @@ pub enum ImportKind { Function(ImportFunction), /// Importing a static value Static(ImportStatic), + /// Importing a static string + String(ImportString), /// Importing a type/class Type(ImportType), /// Importing a JS enum - Enum(ImportEnum), + Enum(StringEnum), } /// A function being imported from JS @@ -163,7 +197,11 @@ pub struct ImportFunction { /// necessary conversions (EG adding a try/catch to change a thrown error into a Result) pub shim: Ident, /// The doc comment on this import, if one is provided - pub doc_comment: Option, + pub doc_comment: String, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, + /// Path to wasm_bindgen_futures + pub wasm_bindgen_futures: Path, } /// The type of a function being imported @@ -209,10 +247,10 @@ pub struct Operation { pub enum OperationKind { /// A standard method, nothing special Regular, - /// A method for getting the value of the provided Ident - Getter(Option), - /// A method for setting the value of the provided Ident - Setter(Option), + /// A method for getting the value of the provided Ident or String + Getter(Option), + /// A method for setting the value of the provided Ident or String + Setter(Option), /// A dynamically intercepted getter IndexingGetter, /// A dynamically intercepted setter @@ -235,6 +273,41 @@ pub struct ImportStatic { pub rust_name: Ident, /// The name of this static on the JS side pub js_name: String, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, + /// Version of `thread_local`, if any. + pub thread_local: Option, +} + +/// Which version of the `thread_local` attribute is enabled. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum ThreadLocal { + /// V1. + V1, + /// V2. + V2, +} + +/// The type of a static string being imported +#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] +#[derive(Clone)] +pub struct ImportString { + /// The visibility of this static string in Rust + pub vis: syn::Visibility, + /// The type specified by the user, which we only use to show an error if the wrong type is used. + pub ty: syn::Type, + /// The name of the shim function used to access this static + pub shim: Ident, + /// The name of this static on the Rust side + pub rust_name: Ident, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, + /// Path to js_sys + pub js_sys: Path, + /// The string to export. + pub string: String, + /// Version of `thread_local`. + pub thread_local: ThreadLocal, } /// The metadata for a type being imported @@ -263,22 +336,32 @@ pub struct ImportType { pub vendor_prefixes: Vec, /// If present, don't generate a `Deref` impl pub no_deref: bool, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, } -/// The metadata for an Enum being imported +/// The metadata for a String Enum #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] #[derive(Clone)] -pub struct ImportEnum { +pub struct StringEnum { /// The Rust enum's visibility pub vis: syn::Visibility, /// The Rust enum's identifiers pub name: Ident, + /// The name of this string enum in JS/TS code + pub js_name: String, /// The Rust identifiers for the variants pub variants: Vec, /// The JS string values of the variants pub variant_values: Vec, + /// The doc comments on this enum, if any + pub comments: Vec, /// Attributes to apply to the Rust enum pub rust_attrs: Vec, + /// Whether to generate a typescript definition for this enum + pub generate_typescript: bool, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, } /// Information about a function being imported or exported @@ -292,21 +375,53 @@ pub struct Function { /// Whether the function has a js_name attribute pub renamed_via_js_name: bool, /// The arguments to the function - pub arguments: Vec, - /// The return type of the function, if provided - pub ret: Option, + pub arguments: Vec, + /// The data of return type of the function + pub ret: Option, /// Any custom attributes being applied to the function pub rust_attrs: Vec, /// The visibility of this function in Rust pub rust_vis: syn::Visibility, + /// Whether this is an `unsafe` function + pub r#unsafe: bool, /// Whether this is an `async` function pub r#async: bool, /// Whether to generate a typescript definition for this function pub generate_typescript: bool, + /// Whether to generate jsdoc documentation for this function + pub generate_jsdoc: bool, + /// Whether this is a function with a variadict parameter + pub variadic: bool, +} + +/// Information about a function's return +#[cfg_attr(feature = "extra-traits", derive(Debug))] +#[derive(Clone)] +pub struct FunctionReturnData { + /// Specifies the type of the function's return + pub r#type: syn::Type, + /// Specifies the JS return type override + pub js_type: Option, + /// Specifies the return description + pub desc: Option, +} + +/// Information about a function's argument +#[cfg_attr(feature = "extra-traits", derive(Debug))] +#[derive(Clone)] +pub struct FunctionArgumentData { + /// Specifies the type of the function's argument + pub pat_type: syn::PatType, + /// Specifies the JS argument name override + pub js_name: Option, + /// Specifies the JS function argument type override + pub js_type: Option, + /// Specifies the argument description + pub desc: Option, } /// Information about a Struct being exported -#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] +#[cfg_attr(feature = "extra-traits", derive(Debug))] #[derive(Clone)] pub struct Struct { /// The name of the struct in Rust code @@ -321,10 +436,12 @@ pub struct Struct { pub is_inspectable: bool, /// Whether to generate a typescript definition for this struct pub generate_typescript: bool, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, } /// The field of a struct -#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] +#[cfg_attr(feature = "extra-traits", derive(Debug))] #[derive(Clone)] pub struct StructField { /// The name of the field in Rust code @@ -345,11 +462,19 @@ pub struct StructField { pub comments: Vec, /// Whether to generate a typescript definition for this field pub generate_typescript: bool, - /// Whether to use .clone() in the auto-generated getter for this field - pub getter_with_clone: bool, + /// Whether to generate jsdoc documentation for this field + pub generate_jsdoc: bool, + /// The span of the `#[wasm_bindgen(getter_with_clone)]` attribute applied + /// to this field, if any. + /// + /// If this is `Some`, the auto-generated getter for this field must clone + /// the field instead of copying it. + pub getter_with_clone: Option, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, } -/// Information about an Enum being exported +/// The metadata for an Enum #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] #[derive(Clone)] pub struct Enum { @@ -357,6 +482,9 @@ pub struct Enum { pub rust_name: Ident, /// The name of this enum in JS code pub js_name: String, + /// Whether the variant values and hole are signed, meaning that they + /// represent the bits of a `i32` value. + pub signed: bool, /// The variants provided by this enum pub variants: Vec, /// The doc comments on this enum, if any @@ -365,6 +493,8 @@ pub struct Enum { pub hole: u32, /// Whether to generate a typescript definition for this enum pub generate_typescript: bool, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, } /// The variant of an enum @@ -403,16 +533,26 @@ pub enum TypeLocation { ExportRet, } +/// An enum representing either a literal value (`Lit`) or an expression (`syn::Expr`). +#[cfg_attr(feature = "extra-traits", derive(Debug))] +#[derive(Clone)] +pub enum LitOrExpr { + /// Represents an expression that needs to be evaluated before it can be encoded + Expr(syn::Expr), + /// Represents a literal string that can be directly encoded. + Lit(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. pub(crate) fn rust_symbol(&self) -> Ident { let mut generated_name = String::from("__wasm_bindgen_generated"); if let Some(class) = &self.js_class { - generated_name.push_str("_"); + generated_name.push('_'); generated_name.push_str(class); } - generated_name.push_str("_"); + generated_name.push('_'); generated_name.push_str(&self.function.name.to_string()); Ident::new(&generated_name, Span::call_site()) } @@ -435,6 +575,7 @@ impl ImportKind { match *self { ImportKind::Function(_) => true, ImportKind::Static(_) => false, + ImportKind::String(_) => false, ImportKind::Type(_) => false, ImportKind::Enum(_) => false, } diff --git a/crates/backend/src/codegen.rs b/crates/backend/src/codegen.rs index ac179518036..01450ccb9df 100644 --- a/crates/backend/src/codegen.rs +++ b/crates/backend/src/codegen.rs @@ -1,13 +1,15 @@ use crate::ast; use crate::encode; -use crate::util::ShortHash; +use crate::encode::EncodeChunk; use crate::Diagnostic; -use proc_macro2::{Ident, Literal, Span, TokenStream}; +use proc_macro2::{Ident, Span, TokenStream}; +use quote::format_ident; +use quote::quote_spanned; use quote::{quote, ToTokens}; +use std::cell::RefCell; use std::collections::{HashMap, HashSet}; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::Mutex; -use syn; +use syn::parse_quote; +use syn::spanned::Spanned; use wasm_bindgen_shared as shared; /// A trait for converting AST structs into Tokens and adding them to a TokenStream, @@ -43,7 +45,11 @@ impl TryToTokens for ast::Program { } } for i in self.imports.iter() { - DescribeImport { kind: &i.kind }.to_tokens(tokens); + DescribeImport { + kind: &i.kind, + wasm_bindgen: &self.wasm_bindgen, + } + .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. @@ -79,17 +85,9 @@ impl TryToTokens for ast::Program { Diagnostic::from_vec(errors)?; // Generate a static which will eventually be what lives in a custom section - // of the wasm executable. For now it's just a plain old static, but we'll + // of the Wasm executable. For now it's just a plain old static, but we'll // eventually have it actually in its own section. - static CNT: AtomicUsize = AtomicUsize::new(0); - - let generated_static_name = format!( - "__WASM_BINDGEN_GENERATED_{}", - ShortHash(CNT.fetch_add(1, Ordering::SeqCst)), - ); - let generated_static_name = Ident::new(&generated_static_name, Span::call_site()); - // See comments in `crates/cli-support/src/lib.rs` about what this // `schema_version` is. let prefix_json = format!( @@ -97,17 +95,54 @@ impl TryToTokens for ast::Program { shared::SCHEMA_VERSION, shared::version() ); + + let wasm_bindgen = &self.wasm_bindgen; + let encoded = encode::encode(self)?; - let mut bytes = Vec::new(); - bytes.push((prefix_json.len() >> 0) as u8); - bytes.push((prefix_json.len() >> 8) as u8); - bytes.push((prefix_json.len() >> 16) as u8); - bytes.push((prefix_json.len() >> 24) as u8); - bytes.extend_from_slice(prefix_json.as_bytes()); - bytes.extend_from_slice(&encoded.custom_section); - let generated_static_length = bytes.len(); - let generated_static_value = syn::LitByteStr::new(&bytes, Span::call_site()); + let encoded_chunks: Vec<_> = encoded + .custom_section + .iter() + .map(|chunk| match chunk { + EncodeChunk::EncodedBuf(buf) => { + let buf = syn::LitByteStr::new(buf.as_slice(), Span::call_site()); + quote!(#buf) + } + EncodeChunk::StrExpr(expr) => { + // encode expr as str + quote!({ + use #wasm_bindgen::__rt::{encode_u32_to_fixed_len_bytes}; + const _STR_EXPR: &str = #expr; + const _STR_EXPR_BYTES: &[u8] = _STR_EXPR.as_bytes(); + const _STR_EXPR_BYTES_LEN: usize = _STR_EXPR_BYTES.len() + 5; + const _ENCODED_BYTES: [u8; _STR_EXPR_BYTES_LEN] = flat_byte_slices([ + &encode_u32_to_fixed_len_bytes(_STR_EXPR_BYTES.len() as u32), + _STR_EXPR_BYTES, + ]); + &_ENCODED_BYTES + }) + } + }) + .collect(); + + let chunk_len = encoded_chunks.len(); + + // concatenate all encoded chunks and write the length in front of the chunk; + let encode_bytes = quote!({ + const _CHUNK_SLICES: [&[u8]; #chunk_len] = [ + #(#encoded_chunks,)* + ]; + #[allow(long_running_const_eval)] + const _CHUNK_LEN: usize = flat_len(_CHUNK_SLICES); + #[allow(long_running_const_eval)] + const _CHUNKS: [u8; _CHUNK_LEN] = flat_byte_slices(_CHUNK_SLICES); + + const _LEN_BYTES: [u8; 4] = (_CHUNK_LEN as u32).to_le_bytes(); + const _ENCODED_BYTES_LEN: usize = _CHUNK_LEN + 4; + #[allow(long_running_const_eval)] + const _ENCODED_BYTES: [u8; _ENCODED_BYTES_LEN] = flat_byte_slices([&_LEN_BYTES, &_CHUNKS]); + &_ENCODED_BYTES + }); // We already consumed the contents of included files when generating // the custom section, but we want to make sure that updates to the @@ -122,17 +157,28 @@ impl TryToTokens for ast::Program { quote! { include_str!(#file) } }); + let len = prefix_json.len() as u32; + let prefix_json_bytes = [&len.to_le_bytes()[..], prefix_json.as_bytes()].concat(); + let prefix_json_bytes = syn::LitByteStr::new(&prefix_json_bytes, Span::call_site()); + (quote! { - #[cfg(target_arch = "wasm32")] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] #[automatically_derived] - #[link_section = "__wasm_bindgen_unstable"] - #[doc(hidden)] - pub static #generated_static_name: [u8; #generated_static_length] = { + const _: () = { + use #wasm_bindgen::__rt::{flat_len, flat_byte_slices}; + static _INCLUDED_FILES: &[&str] = &[#(#file_dependencies),*]; - *#generated_static_value - }; + const _ENCODED_BYTES: &[u8] = #encode_bytes; + const _PREFIX_JSON_BYTES: &[u8] = #prefix_json_bytes; + const _ENCODED_BYTES_LEN: usize = _ENCODED_BYTES.len(); + const _PREFIX_JSON_BYTES_LEN: usize = _PREFIX_JSON_BYTES.len(); + const _LEN: usize = _PREFIX_JSON_BYTES_LEN + _ENCODED_BYTES_LEN; + #[link_section = "__wasm_bindgen_unstable"] + #[allow(long_running_const_eval)] + static _GENERATED: [u8; _LEN] = flat_byte_slices([_PREFIX_JSON_BYTES, _ENCODED_BYTES]); + }; }) .to_tokens(tokens); @@ -140,27 +186,55 @@ impl TryToTokens for ast::Program { } } +impl TryToTokens for ast::LinkToModule { + fn try_to_tokens(&self, tokens: &mut TokenStream) -> Result<(), Diagnostic> { + let mut program = TokenStream::new(); + self.0.try_to_tokens(&mut program)?; + let link_function_name = self.0.link_function_name(0); + let name = Ident::new(&link_function_name, Span::call_site()); + let wasm_bindgen = &self.0.wasm_bindgen; + let abi_ret = quote! { #wasm_bindgen::convert::WasmRet<<#wasm_bindgen::__rt::alloc::string::String as #wasm_bindgen::convert::FromWasmAbi>::Abi> }; + let extern_fn = extern_fn(&name, &[], &[], &[], abi_ret); + (quote! { + { + #program + #extern_fn + + static __VAL: #wasm_bindgen::__rt::LazyLock<#wasm_bindgen::__rt::alloc::string::String> = + #wasm_bindgen::__rt::LazyLock::new(|| unsafe { + <#wasm_bindgen::__rt::alloc::string::String as #wasm_bindgen::convert::FromWasmAbi>::from_abi(#name().join()) + }); + + #wasm_bindgen::__rt::alloc::string::String::clone(&__VAL) + } + }) + .to_tokens(tokens); + Ok(()) + } +} + impl ToTokens for ast::Struct { fn to_tokens(&self, tokens: &mut TokenStream) { let name = &self.rust_name; let name_str = self.js_name.to_string(); let name_len = name_str.len() as u32; - let name_chars = name_str.chars().map(|c| c as u32); + let name_chars: Vec = name_str.chars().map(|c| c as u32).collect(); let new_fn = Ident::new(&shared::new_function(&name_str), Span::call_site()); let free_fn = Ident::new(&shared::free_function(&name_str), Span::call_site()); - let free_fn_const = Ident::new(&format!("{}__const", free_fn), free_fn.span()); + let unwrap_fn = Ident::new(&shared::unwrap_function(&name_str), Span::call_site()); + let wasm_bindgen = &self.wasm_bindgen; (quote! { #[automatically_derived] - impl wasm_bindgen::describe::WasmDescribe for #name { + impl #wasm_bindgen::__rt::marker::SupportsConstructor for #name {} + #[automatically_derived] + impl #wasm_bindgen::__rt::marker::SupportsInstanceProperty for #name {} + #[automatically_derived] + impl #wasm_bindgen::__rt::marker::SupportsStaticProperty for #name {} + + #[automatically_derived] + impl #wasm_bindgen::describe::WasmDescribe for #name { fn describe() { - use wasm_bindgen::__wbindgen_if_not_std; - __wbindgen_if_not_std! { - compile_error! { - "exporting a class to JS requires the `std` feature to \ - be enabled in the `wasm-bindgen` crate" - } - } - use wasm_bindgen::describe::*; + use #wasm_bindgen::describe::*; inform(RUST_STRUCT); inform(#name_len); #(inform(#name_chars);)* @@ -168,102 +242,223 @@ impl ToTokens for ast::Struct { } #[automatically_derived] - impl wasm_bindgen::convert::IntoWasmAbi for #name { + impl #wasm_bindgen::convert::IntoWasmAbi for #name { type Abi = u32; fn into_abi(self) -> u32 { - use wasm_bindgen::__rt::std::boxed::Box; - use wasm_bindgen::__rt::WasmRefCell; - Box::into_raw(Box::new(WasmRefCell::new(self))) as u32 + use #wasm_bindgen::__rt::alloc::rc::Rc; + use #wasm_bindgen::__rt::WasmRefCell; + Rc::into_raw(Rc::new(WasmRefCell::new(self))) as u32 } } #[automatically_derived] - impl wasm_bindgen::convert::FromWasmAbi for #name { + impl #wasm_bindgen::convert::FromWasmAbi for #name { type Abi = u32; unsafe fn from_abi(js: u32) -> Self { - use wasm_bindgen::__rt::std::boxed::Box; - use wasm_bindgen::__rt::{assert_not_null, WasmRefCell}; + use #wasm_bindgen::__rt::alloc::rc::Rc; + use #wasm_bindgen::__rt::core::result::Result::{Ok, Err}; + use #wasm_bindgen::__rt::{assert_not_null, WasmRefCell}; let ptr = js as *mut WasmRefCell<#name>; assert_not_null(ptr); - let js = Box::from_raw(ptr); - (*js).borrow_mut(); // make sure no one's borrowing - js.into_inner() + let rc = Rc::from_raw(ptr); + match Rc::try_unwrap(rc) { + Ok(cell) => cell.into_inner(), + Err(_) => #wasm_bindgen::throw_str( + "attempted to take ownership of Rust value while it was borrowed" + ), + } } } #[automatically_derived] - impl wasm_bindgen::__rt::core::convert::From<#name> for - wasm_bindgen::JsValue + impl #wasm_bindgen::__rt::core::convert::From<#name> for + #wasm_bindgen::JsValue { fn from(value: #name) -> Self { - let ptr = wasm_bindgen::convert::IntoWasmAbi::into_abi(value); + let ptr = #wasm_bindgen::convert::IntoWasmAbi::into_abi(value); #[link(wasm_import_module = "__wbindgen_placeholder__")] - #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] extern "C" { fn #new_fn(ptr: u32) -> u32; } - #[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))] + #[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))] unsafe fn #new_fn(_: u32) -> u32 { - panic!("cannot convert to JsValue outside of the wasm target") + panic!("cannot convert to JsValue outside of the Wasm target") } unsafe { - + <#wasm_bindgen::JsValue as #wasm_bindgen::convert::FromWasmAbi> ::from_abi(#new_fn(ptr)) } } } - #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] #[automatically_derived] - const #free_fn_const: () = { + const _: () = { + #wasm_bindgen::__wbindgen_coverage! { #[no_mangle] #[doc(hidden)] - pub unsafe extern "C" fn #free_fn(ptr: u32) { - drop(<#name as wasm_bindgen::convert::FromWasmAbi>::from_abi(ptr)); + // `allow_delayed` is whether it's ok to not actually free the `ptr` immediately + // if it's still borrowed. + pub unsafe extern "C" fn #free_fn(ptr: u32, allow_delayed: u32) { + use #wasm_bindgen::__rt::alloc::rc::Rc; + + if allow_delayed != 0 { + // Just drop the implicit `Rc` owned by JS, and then if the value is still + // referenced it'll be kept alive by its other `Rc`s. + let ptr = ptr as *mut #wasm_bindgen::__rt::WasmRefCell<#name>; + #wasm_bindgen::__rt::assert_not_null(ptr); + drop(Rc::from_raw(ptr)); + } else { + // Claim ownership of the value, which will panic if it's borrowed. + let _ = <#name as #wasm_bindgen::convert::FromWasmAbi>::from_abi(ptr); + } + } } }; #[automatically_derived] - impl wasm_bindgen::convert::RefFromWasmAbi for #name { + impl #wasm_bindgen::convert::RefFromWasmAbi for #name { type Abi = u32; - type Anchor = wasm_bindgen::__rt::Ref<'static, #name>; + type Anchor = #wasm_bindgen::__rt::RcRef<#name>; unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor { - let js = js as *mut wasm_bindgen::__rt::WasmRefCell<#name>; - wasm_bindgen::__rt::assert_not_null(js); - (*js).borrow() + use #wasm_bindgen::__rt::alloc::rc::Rc; + + let js = js as *mut #wasm_bindgen::__rt::WasmRefCell<#name>; + #wasm_bindgen::__rt::assert_not_null(js); + + Rc::increment_strong_count(js); + let rc = Rc::from_raw(js); + #wasm_bindgen::__rt::RcRef::new(rc) } } #[automatically_derived] - impl wasm_bindgen::convert::RefMutFromWasmAbi for #name { + impl #wasm_bindgen::convert::RefMutFromWasmAbi for #name { type Abi = u32; - type Anchor = wasm_bindgen::__rt::RefMut<'static, #name>; + type Anchor = #wasm_bindgen::__rt::RcRefMut<#name>; unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor { - let js = js as *mut wasm_bindgen::__rt::WasmRefCell<#name>; - wasm_bindgen::__rt::assert_not_null(js); - (*js).borrow_mut() + use #wasm_bindgen::__rt::alloc::rc::Rc; + + let js = js as *mut #wasm_bindgen::__rt::WasmRefCell<#name>; + #wasm_bindgen::__rt::assert_not_null(js); + + Rc::increment_strong_count(js); + let rc = Rc::from_raw(js); + #wasm_bindgen::__rt::RcRefMut::new(rc) + } + } + + #[automatically_derived] + impl #wasm_bindgen::convert::LongRefFromWasmAbi for #name { + type Abi = u32; + type Anchor = #wasm_bindgen::__rt::RcRef<#name>; + + unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor { + ::ref_from_abi(js) } } #[automatically_derived] - impl wasm_bindgen::convert::OptionIntoWasmAbi for #name { + impl #wasm_bindgen::convert::OptionIntoWasmAbi for #name { #[inline] fn none() -> Self::Abi { 0 } } #[automatically_derived] - impl wasm_bindgen::convert::OptionFromWasmAbi for #name { + impl #wasm_bindgen::convert::OptionFromWasmAbi for #name { #[inline] fn is_none(abi: &Self::Abi) -> bool { *abi == 0 } } + + #[automatically_derived] + impl #wasm_bindgen::convert::TryFromJsValue for #name { + type Error = #wasm_bindgen::JsValue; + + fn try_from_js_value(value: #wasm_bindgen::JsValue) + -> #wasm_bindgen::__rt::core::result::Result { + let idx = #wasm_bindgen::convert::IntoWasmAbi::into_abi(&value); + + #[link(wasm_import_module = "__wbindgen_placeholder__")] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] + extern "C" { + fn #unwrap_fn(ptr: u32) -> u32; + } + + #[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))] + unsafe fn #unwrap_fn(_: u32) -> u32 { + panic!("cannot convert from JsValue outside of the Wasm target") + } + + let ptr = unsafe { #unwrap_fn(idx) }; + if ptr == 0 { + #wasm_bindgen::__rt::core::result::Result::Err(value) + } else { + // Don't run `JsValue`'s destructor, `unwrap_fn` already did that for us. + #[allow(clippy::mem_forget)] + #wasm_bindgen::__rt::core::mem::forget(value); + unsafe { + #wasm_bindgen::__rt::core::result::Result::Ok( + ::from_abi(ptr) + ) + } + } + } + } + + #[automatically_derived] + impl #wasm_bindgen::describe::WasmDescribeVector for #name { + fn describe_vector() { + use #wasm_bindgen::describe::*; + inform(VECTOR); + inform(NAMED_EXTERNREF); + inform(#name_len); + #(inform(#name_chars);)* + } + } + + #[automatically_derived] + impl #wasm_bindgen::convert::VectorIntoWasmAbi for #name { + type Abi = < + #wasm_bindgen::__rt::alloc::boxed::Box<[#wasm_bindgen::JsValue]> + as #wasm_bindgen::convert::IntoWasmAbi + >::Abi; + + fn vector_into_abi( + vector: #wasm_bindgen::__rt::alloc::boxed::Box<[#name]> + ) -> Self::Abi { + #wasm_bindgen::convert::js_value_vector_into_abi(vector) + } + } + + #[automatically_derived] + impl #wasm_bindgen::convert::VectorFromWasmAbi for #name { + type Abi = < + #wasm_bindgen::__rt::alloc::boxed::Box<[#wasm_bindgen::JsValue]> + as #wasm_bindgen::convert::FromWasmAbi + >::Abi; + + unsafe fn vector_from_abi( + js: Self::Abi + ) -> #wasm_bindgen::__rt::alloc::boxed::Box<[#name]> { + #wasm_bindgen::convert::js_value_vector_from_abi(js) + } + } + + #[automatically_derived] + impl #wasm_bindgen::__rt::VectorIntoJsValue for #name { + fn vector_into_jsvalue(vector: #wasm_bindgen::__rt::alloc::boxed::Box<[#name]>) -> #wasm_bindgen::JsValue { + #wasm_bindgen::__rt::js_value_vector_into_jsvalue(vector) + } + } }) .to_tokens(tokens); @@ -281,50 +476,59 @@ impl ToTokens for ast::StructField { let getter = &self.getter; let setter = &self.setter; - let maybe_assert_copy = if self.getter_with_clone { + let maybe_assert_copy = if self.getter_with_clone.is_some() { quote! {} } else { quote! { assert_copy::<#ty>() } }; let maybe_assert_copy = respan(maybe_assert_copy, ty); - let maybe_clone = if self.getter_with_clone { - quote! { .clone() } - } else { - quote! {} - }; + // Split this out so that it isn't affected by `quote_spanned!`. + // + // If we don't do this, it might end up being unable to reference `js` + // properly because it doesn't have the same span. + // + // See https://github.com/rustwasm/wasm-bindgen/pull/3725. + let js_token = quote! { js }; + let mut val = quote_spanned!(self.rust_name.span()=> (*#js_token).borrow().#rust_name); + if let Some(span) = self.getter_with_clone { + val = quote_spanned!(span=> <#ty as Clone>::clone(&#val) ); + } - let getter_const = Ident::new(&format!("{}__const", getter), getter.span()); + let wasm_bindgen = &self.wasm_bindgen; (quote! { #[automatically_derived] - const #getter_const: () = { - #[cfg_attr(all(target_arch = "wasm32", not(target_os = "emscripten")), no_mangle)] + const _: () = { + #wasm_bindgen::__wbindgen_coverage! { + #[cfg_attr(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")), no_mangle)] #[doc(hidden)] pub unsafe extern "C" fn #getter(js: u32) - -> <#ty as wasm_bindgen::convert::IntoWasmAbi>::Abi + -> #wasm_bindgen::convert::WasmRet<<#ty as #wasm_bindgen::convert::IntoWasmAbi>::Abi> { - use wasm_bindgen::__rt::{WasmRefCell, assert_not_null}; - use wasm_bindgen::convert::IntoWasmAbi; + use #wasm_bindgen::__rt::{WasmRefCell, assert_not_null}; + use #wasm_bindgen::convert::IntoWasmAbi; fn assert_copy(){} #maybe_assert_copy; let js = js as *mut WasmRefCell<#struct_name>; assert_not_null(js); - let val = (*js).borrow().#rust_name#maybe_clone; - <#ty as IntoWasmAbi>::into_abi(val) + let val = #val; + <#ty as IntoWasmAbi>::into_abi(val).into() + } } }; }) .to_tokens(tokens); Descriptor { - ident: &getter, + ident: getter, inner: quote! { <#ty as WasmDescribe>::describe(); }, attrs: vec![], + wasm_bindgen: &self.wasm_bindgen, } .to_tokens(tokens); @@ -332,26 +536,30 @@ impl ToTokens for ast::StructField { return; } - let setter_const = Ident::new(&format!("{}__const", setter), setter.span()); + let abi = quote! { <#ty as #wasm_bindgen::convert::FromWasmAbi>::Abi }; + let (args, names) = splat(wasm_bindgen, &Ident::new("val", rust_name.span()), &abi); (quote! { - #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] #[automatically_derived] - const #setter_const: () = { + const _: () = { + #wasm_bindgen::__wbindgen_coverage! { #[no_mangle] #[doc(hidden)] pub unsafe extern "C" fn #setter( js: u32, - val: <#ty as wasm_bindgen::convert::FromWasmAbi>::Abi, + #(#args,)* ) { - use wasm_bindgen::__rt::{WasmRefCell, assert_not_null}; - use wasm_bindgen::convert::FromWasmAbi; + use #wasm_bindgen::__rt::{WasmRefCell, assert_not_null}; + use #wasm_bindgen::convert::FromWasmAbi; let js = js as *mut WasmRefCell<#struct_name>; assert_not_null(js); + let val = <#abi as #wasm_bindgen::convert::WasmAbi>::join(#(#names),*); let val = <#ty as FromWasmAbi>::from_abi(val); (*js).borrow_mut().#rust_name = val; } + } }; }) .to_tokens(tokens); @@ -375,12 +583,14 @@ impl TryToTokens for ast::Export { }; let name = &self.rust_name; + let wasm_bindgen = &self.wasm_bindgen; + let wasm_bindgen_futures = &self.wasm_bindgen_futures; let receiver = match self.method_self { Some(ast::MethodSelf::ByValue) => { let class = self.rust_class.as_ref().unwrap(); arg_conversions.push(quote! { let me = unsafe { - <#class as wasm_bindgen::convert::FromWasmAbi>::from_abi(me) + <#class as #wasm_bindgen::convert::FromWasmAbi>::from_abi(me) }; }); quote! { me.#name } @@ -389,7 +599,7 @@ impl TryToTokens for ast::Export { let class = self.rust_class.as_ref().unwrap(); arg_conversions.push(quote! { let mut me = unsafe { - <#class as wasm_bindgen::convert::RefMutFromWasmAbi> + <#class as #wasm_bindgen::convert::RefMutFromWasmAbi> ::ref_mut_from_abi(me) }; let me = &mut *me; @@ -398,12 +608,24 @@ impl TryToTokens for ast::Export { } Some(ast::MethodSelf::RefShared) => { let class = self.rust_class.as_ref().unwrap(); + let (trait_, func, borrow) = if self.function.r#async { + ( + quote!(LongRefFromWasmAbi), + quote!(long_ref_from_abi), + quote!( + <<#class as #wasm_bindgen::convert::LongRefFromWasmAbi> + ::Anchor as #wasm_bindgen::__rt::core::borrow::Borrow<#class>> + ::borrow(&me) + ), + ) + } else { + (quote!(RefFromWasmAbi), quote!(ref_from_abi), quote!(&*me)) + }; arg_conversions.push(quote! { let me = unsafe { - <#class as wasm_bindgen::convert::RefFromWasmAbi> - ::ref_from_abi(me) + <#class as #wasm_bindgen::convert::#trait_>::#func(me) }; - let me = &*me; + let me = #borrow; }); quote! { me.#name } } @@ -415,47 +637,79 @@ impl TryToTokens for ast::Export { let mut argtys = Vec::new(); for (i, arg) in self.function.arguments.iter().enumerate() { - argtys.push(&arg.ty); + argtys.push(&*arg.pat_type.ty); let i = i + offset; let ident = Ident::new(&format!("arg{}", i), Span::call_site()); - let ty = &arg.ty; - match &*arg.ty { + fn unwrap_nested_types(ty: &syn::Type) -> &syn::Type { + match &ty { + syn::Type::Group(syn::TypeGroup { ref elem, .. }) => unwrap_nested_types(elem), + syn::Type::Paren(syn::TypeParen { ref elem, .. }) => unwrap_nested_types(elem), + _ => ty, + } + } + let ty = unwrap_nested_types(&arg.pat_type.ty); + + match &ty { syn::Type::Reference(syn::TypeReference { mutability: Some(_), elem, .. }) => { - args.push(quote! { - #ident: <#elem as wasm_bindgen::convert::RefMutFromWasmAbi>::Abi - }); + let abi = quote! { <#elem as #wasm_bindgen::convert::RefMutFromWasmAbi>::Abi }; + let (prim_args, prim_names) = splat(wasm_bindgen, &ident, &abi); + args.extend(prim_args); arg_conversions.push(quote! { let mut #ident = unsafe { - <#elem as wasm_bindgen::convert::RefMutFromWasmAbi> - ::ref_mut_from_abi(#ident) + <#elem as #wasm_bindgen::convert::RefMutFromWasmAbi> + ::ref_mut_from_abi( + <#abi as #wasm_bindgen::convert::WasmAbi>::join(#(#prim_names),*) + ) }; let #ident = &mut *#ident; }); } syn::Type::Reference(syn::TypeReference { elem, .. }) => { - args.push(quote! { - #ident: <#elem as wasm_bindgen::convert::RefFromWasmAbi>::Abi - }); - arg_conversions.push(quote! { - let #ident = unsafe { - <#elem as wasm_bindgen::convert::RefFromWasmAbi> - ::ref_from_abi(#ident) - }; - let #ident = &*#ident; - }); + if self.function.r#async { + let abi = + quote! { <#elem as #wasm_bindgen::convert::LongRefFromWasmAbi>::Abi }; + let (prim_args, prim_names) = splat(wasm_bindgen, &ident, &abi); + args.extend(prim_args); + arg_conversions.push(quote! { + let #ident = unsafe { + <#elem as #wasm_bindgen::convert::LongRefFromWasmAbi> + ::long_ref_from_abi( + <#abi as #wasm_bindgen::convert::WasmAbi>::join(#(#prim_names),*) + ) + }; + let #ident = <<#elem as #wasm_bindgen::convert::LongRefFromWasmAbi> + ::Anchor as core::borrow::Borrow<#elem>> + ::borrow(&#ident); + }); + } else { + let abi = quote! { <#elem as #wasm_bindgen::convert::RefFromWasmAbi>::Abi }; + let (prim_args, prim_names) = splat(wasm_bindgen, &ident, &abi); + args.extend(prim_args); + arg_conversions.push(quote! { + let #ident = unsafe { + <#elem as #wasm_bindgen::convert::RefFromWasmAbi> + ::ref_from_abi( + <#abi as #wasm_bindgen::convert::WasmAbi>::join(#(#prim_names),*) + ) + }; + let #ident = &*#ident; + }); + } } _ => { - args.push(quote! { - #ident: <#ty as wasm_bindgen::convert::FromWasmAbi>::Abi - }); + let abi = quote! { <#ty as #wasm_bindgen::convert::FromWasmAbi>::Abi }; + let (prim_args, prim_names) = splat(wasm_bindgen, &ident, &abi); + args.extend(prim_args); arg_conversions.push(quote! { let #ident = unsafe { - <#ty as wasm_bindgen::convert::FromWasmAbi> - ::from_abi(#ident) + <#ty as #wasm_bindgen::convert::FromWasmAbi> + ::from_abi( + <#abi as #wasm_bindgen::convert::WasmAbi>::join(#(#prim_names),*) + ) }; }); } @@ -466,7 +720,12 @@ impl TryToTokens for ast::Export { elems: Default::default(), paren_token: Default::default(), }); - let syn_ret = self.function.ret.as_ref().unwrap_or(&syn_unit); + let syn_ret = self + .function + .ret + .as_ref() + .map(|ret| &ret.r#type) + .unwrap_or(&syn_unit); if let syn::Type::Reference(_) = syn_ret { bail_span!(syn_ret, "cannot return a borrowed ref with #[wasm_bindgen]",) } @@ -480,19 +739,15 @@ impl TryToTokens for ast::Export { quote! { () }, quote! { () }, quote! { - wasm_bindgen_futures::spawn_local(async move { - <#syn_ret as wasm_bindgen::__rt::Start>::start(#ret.await); - }) + <#syn_ret as #wasm_bindgen::__rt::Start>::start(#ret.await) }, ) } else { ( - quote! { wasm_bindgen::JsValue }, + quote! { #wasm_bindgen::JsValue }, quote! { #syn_ret }, quote! { - wasm_bindgen_futures::future_to_promise(async move { - <#syn_ret as wasm_bindgen::__rt::IntoJsResult>::into_js_result(#ret.await) - }).into() + <#syn_ret as #wasm_bindgen::__rt::IntoJsResult>::into_js_result(#ret.await) }, ) } @@ -500,14 +755,38 @@ impl TryToTokens for ast::Export { ( quote! { () }, quote! { () }, - quote! { <#syn_ret as wasm_bindgen::__rt::Start>::start(#ret) }, + quote! { <#syn_ret as #wasm_bindgen::__rt::Start>::start(#ret) }, ) } else { (quote! { #syn_ret }, quote! { #syn_ret }, quote! { #ret }) }; - let projection = quote! { <#ret_ty as wasm_bindgen::convert::ReturnWasmAbi> }; - let convert_ret = quote! { #projection::return_abi(#ret_expr) }; + let mut call = quote! { + { + #(#arg_conversions)* + let #ret = #receiver(#(#converted_arguments),*); + #ret_expr + } + }; + + if self.function.r#async { + if self.start { + call = quote! { + #wasm_bindgen_futures::spawn_local(async move { + #call + }) + } + } else { + call = quote! { + #wasm_bindgen_futures::future_to_promise(async move { + #call + }).into() + } + } + } + + let projection = quote! { <#ret_ty as #wasm_bindgen::convert::ReturnWasmAbi> }; + let convert_ret = quote! { #projection::return_abi(#ret).into() }; let describe_ret = quote! { <#ret_ty as WasmDescribe>::describe(); <#inner_ret_ty as WasmDescribe>::describe(); @@ -515,37 +794,79 @@ impl TryToTokens for ast::Export { let nargs = self.function.arguments.len() as u32; let attrs = &self.function.rust_attrs; - let start_check = if self.start { - quote! { const _ASSERT: fn() = || -> #projection::Abi { loop {} }; } - } else { - quote! {} + let mut checks = Vec::new(); + if self.start { + checks.push(quote! { const _ASSERT: fn() = || -> #projection::Abi { loop {} }; }); }; - let generated_name_const = - Ident::new(&format!("{}__const", generated_name), generated_name.span()); + if let Some(class) = self.rust_class.as_ref() { + // little helper function to make sure the check points to the + // location of the function causing the assert to fail + let mut add_check = |token_stream| { + checks.push(respan(token_stream, &self.rust_name)); + }; + + match &self.method_kind { + ast::MethodKind::Constructor => { + add_check(quote! { + let _: #wasm_bindgen::__rt::marker::CheckSupportsConstructor<#class>; + }); + } + ast::MethodKind::Operation(operation) => match operation.kind { + ast::OperationKind::Getter(_) | ast::OperationKind::Setter(_) => { + if operation.is_static { + add_check(quote! { + let _: #wasm_bindgen::__rt::marker::CheckSupportsStaticProperty<#class>; + }); + } else { + add_check(quote! { + let _: #wasm_bindgen::__rt::marker::CheckSupportsInstanceProperty<#class>; + }); + } + } + _ => {} + }, + } + } + (quote! { #[automatically_derived] - const #generated_name_const: () = { + const _: () = { + #wasm_bindgen::__wbindgen_coverage! { #(#attrs)* #[cfg_attr( - all(target_arch = "wasm32", not(target_os = "emscripten")), + all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")), export_name = #export_name, )] - pub extern "C" fn #generated_name(#(#args),*) -> #projection::Abi { - #start_check - // Scope all local variables to be destroyed after we call - // the function to ensure that `#convert_ret`, if it panics, - // doesn't leak anything. - let #ret = { - #(#arg_conversions)* - #receiver(#(#converted_arguments),*) + pub unsafe extern "C" fn #generated_name(#(#args),*) -> #wasm_bindgen::convert::WasmRet<#projection::Abi> { + const _: () = { + #(#checks)* }; + + let #ret = #call; #convert_ret } + } }; }) .to_tokens(into); + let describe_args: TokenStream = argtys + .iter() + .map(|ty| match ty { + syn::Type::Reference(reference) + if self.function.r#async && reference.mutability.is_none() => + { + let inner = &reference.elem; + quote! { + inform(LONGREF); + <#inner as WasmDescribe>::describe(); + } + } + _ => quote! { <#ty as WasmDescribe>::describe(); }, + }) + .collect(); + // In addition to generating the shim function above which is what // our generated JS will invoke, we *also* generate a "descriptor" // shim. This descriptor shim uses the `WasmDescribe` trait to @@ -569,10 +890,11 @@ impl TryToTokens for ast::Export { inform(FUNCTION); inform(0); inform(#nargs); - #(<#argtys as WasmDescribe>::describe();)* + #describe_args #describe_ret }, attrs: attrs.clone(), + wasm_bindgen: &self.wasm_bindgen, } .to_tokens(into); @@ -585,6 +907,7 @@ impl TryToTokens for ast::ImportKind { match *self { ast::ImportKind::Function(ref f) => f.try_to_tokens(tokens)?, ast::ImportKind::Static(ref s) => s.to_tokens(tokens), + ast::ImportKind::String(ref s) => s.to_tokens(tokens), ast::ImportKind::Type(ref t) => t.to_tokens(tokens), ast::ImportKind::Enum(ref e) => e.to_tokens(tokens), } @@ -602,16 +925,15 @@ impl ToTokens for ast::ImportType { None => "", Some(comment) => comment, }; - let const_name = format!("__wbg_generated_const_{}", rust_name); - let const_name = Ident::new(&const_name, Span::call_site()); let instanceof_shim = Ident::new(&self.instanceof_shim, Span::call_site()); + let wasm_bindgen = &self.wasm_bindgen; let internal_obj = match self.extends.first() { Some(target) => { quote! { #target } } None => { - quote! { wasm_bindgen::JsValue } + quote! { #wasm_bindgen::JsValue } } }; @@ -619,7 +941,7 @@ impl ToTokens for ast::ImportType { 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::*; + use #wasm_bindgen::describe::*; inform(NAMED_EXTERNREF); inform(#typescript_type_len); #(inform(#typescript_type_chars);)* @@ -642,30 +964,41 @@ impl ToTokens for ast::ImportType { let no_deref = self.no_deref; + let doc = if doc_comment.is_empty() { + quote! {} + } else { + quote! { + #[doc = #doc_comment] + } + }; + (quote! { #[automatically_derived] #(#attrs)* - #[doc = #doc_comment] + #doc #[repr(transparent)] #vis struct #rust_name { obj: #internal_obj } #[automatically_derived] - const #const_name: () = { - use wasm_bindgen::convert::{IntoWasmAbi, FromWasmAbi}; - use wasm_bindgen::convert::{OptionIntoWasmAbi, OptionFromWasmAbi}; - use wasm_bindgen::convert::RefFromWasmAbi; - use wasm_bindgen::describe::WasmDescribe; - use wasm_bindgen::{JsValue, JsCast, JsObject}; - use wasm_bindgen::__rt::core; + const _: () = { + use #wasm_bindgen::convert::TryFromJsValue; + use #wasm_bindgen::convert::{IntoWasmAbi, FromWasmAbi}; + use #wasm_bindgen::convert::{OptionIntoWasmAbi, OptionFromWasmAbi}; + use #wasm_bindgen::convert::{RefFromWasmAbi, LongRefFromWasmAbi}; + use #wasm_bindgen::describe::WasmDescribe; + use #wasm_bindgen::{JsValue, JsCast, JsObject}; + use #wasm_bindgen::__rt::core; + #[automatically_derived] impl WasmDescribe for #rust_name { fn describe() { #description } } + #[automatically_derived] impl IntoWasmAbi for #rust_name { type Abi = ::Abi; @@ -675,6 +1008,7 @@ impl ToTokens for ast::ImportType { } } + #[automatically_derived] impl OptionIntoWasmAbi for #rust_name { #[inline] fn none() -> Self::Abi { @@ -682,6 +1016,7 @@ impl ToTokens for ast::ImportType { } } + #[automatically_derived] impl<'a> OptionIntoWasmAbi for &'a #rust_name { #[inline] fn none() -> Self::Abi { @@ -689,6 +1024,7 @@ impl ToTokens for ast::ImportType { } } + #[automatically_derived] impl FromWasmAbi for #rust_name { type Abi = ::Abi; @@ -700,11 +1036,13 @@ impl ToTokens for ast::ImportType { } } + #[automatically_derived] impl OptionFromWasmAbi for #rust_name { #[inline] fn is_none(abi: &Self::Abi) -> bool { *abi == 0 } } + #[automatically_derived] impl<'a> IntoWasmAbi for &'a #rust_name { type Abi = <&'a JsValue as IntoWasmAbi>::Abi; @@ -714,6 +1052,7 @@ impl ToTokens for ast::ImportType { } } + #[automatically_derived] impl RefFromWasmAbi for #rust_name { type Abi = ::Abi; type Anchor = core::mem::ManuallyDrop<#rust_name>; @@ -727,7 +1066,20 @@ impl ToTokens for ast::ImportType { } } + #[automatically_derived] + impl LongRefFromWasmAbi for #rust_name { + type Abi = ::Abi; + type Anchor = #rust_name; + + #[inline] + unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor { + let tmp = ::long_ref_from_abi(js); + #rust_name { obj: tmp.into() } + } + } + // TODO: remove this on the next major version + #[automatically_derived] impl From for #rust_name { #[inline] fn from(obj: JsValue) -> #rust_name { @@ -735,17 +1087,20 @@ impl ToTokens for ast::ImportType { } } + #[automatically_derived] impl AsRef for #rust_name { #[inline] fn as_ref(&self) -> &JsValue { self.obj.as_ref() } } + #[automatically_derived] impl AsRef<#rust_name> for #rust_name { #[inline] fn as_ref(&self) -> &#rust_name { self } } + #[automatically_derived] impl From<#rust_name> for JsValue { #[inline] fn from(obj: #rust_name) -> JsValue { @@ -753,14 +1108,15 @@ impl ToTokens for ast::ImportType { } } + #[automatically_derived] impl JsCast for #rust_name { fn instanceof(val: &JsValue) -> bool { #[link(wasm_import_module = "__wbindgen_placeholder__")] - #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] extern "C" { fn #instanceof_shim(val: u32) -> u32; } - #[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))] + #[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))] unsafe fn #instanceof_shim(_: u32) -> u32 { panic!("cannot check instanceof on non-wasm targets"); } @@ -811,7 +1167,7 @@ impl ToTokens for ast::ImportType { impl From<#rust_name> for #superclass { #[inline] fn from(obj: #rust_name) -> #superclass { - use wasm_bindgen::JsCast; + use #wasm_bindgen::JsCast; #superclass::unchecked_from_js(obj.into()) } } @@ -820,7 +1176,7 @@ impl ToTokens for ast::ImportType { impl AsRef<#superclass> for #rust_name { #[inline] fn as_ref(&self) -> &#superclass { - use wasm_bindgen::JsCast; + use #wasm_bindgen::JsCast; #superclass::unchecked_from_js_ref(self.as_ref()) } } @@ -830,115 +1186,126 @@ impl ToTokens for ast::ImportType { } } -impl ToTokens for ast::ImportEnum { +impl ToTokens for ast::StringEnum { fn to_tokens(&self, tokens: &mut TokenStream) { let vis = &self.vis; - let name = &self.name; - let expect_string = format!("attempted to convert invalid {} into JSValue", name); + let enum_name = &self.name; + let name_str = &self.js_name; + let name_len = name_str.len() as u32; + let name_chars = name_str.chars().map(u32::from); let variants = &self.variants; - let variant_strings = &self.variant_values; + let variant_count = self.variant_values.len() as u32; + let variant_values = &self.variant_values; + let variant_indices = (0..variant_count).collect::>(); + let invalid = variant_count; + let hole = variant_count + 1; let attrs = &self.rust_attrs; - let mut current_idx: usize = 0; - let variant_indexes: Vec = variants - .iter() - .map(|_| { - let this_index = current_idx; - current_idx += 1; - Literal::usize_unsuffixed(this_index) - }) - .collect(); - - // Borrow variant_indexes because we need to use it multiple times inside the quote! macro - let variant_indexes_ref = &variant_indexes; + let invalid_to_str_msg = format!( + "Converting an invalid string enum ({}) back to a string is currently not supported", + enum_name + ); // A vector of EnumName::VariantName tokens for this enum let variant_paths: Vec = self .variants .iter() - .map(|v| quote!(#name::#v).into_token_stream()) + .map(|v| quote!(#enum_name::#v).into_token_stream()) .collect(); // Borrow variant_paths because we need to use it multiple times inside the quote! macro let variant_paths_ref = &variant_paths; + let wasm_bindgen = &self.wasm_bindgen; + (quote! { #(#attrs)* - #vis enum #name { - #(#variants = #variant_indexes_ref,)* + #[non_exhaustive] + #[repr(u32)] + #vis enum #enum_name { + #(#variants = #variant_indices,)* #[automatically_derived] #[doc(hidden)] - __Nonexhaustive, + __Invalid } #[automatically_derived] - impl #name { - fn from_str(s: &str) -> Option<#name> { + impl #enum_name { + fn from_str(s: &str) -> Option<#enum_name> { match s { - #(#variant_strings => Some(#variant_paths_ref),)* + #(#variant_values => Some(#variant_paths_ref),)* _ => None, } } fn to_str(&self) -> &'static str { match self { - #(#variant_paths_ref => #variant_strings,)* - #name::__Nonexhaustive => panic!(#expect_string), + #(#variant_paths_ref => #variant_values,)* + #enum_name::__Invalid => panic!(#invalid_to_str_msg), } } - #vis fn from_js_value(obj: &wasm_bindgen::JsValue) -> Option<#name> { + #vis fn from_js_value(obj: &#wasm_bindgen::JsValue) -> Option<#enum_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 - #[automatically_derived] - impl wasm_bindgen::describe::WasmDescribe for #name { - fn describe() { - ::describe() - } - } - #[automatically_derived] - impl wasm_bindgen::convert::IntoWasmAbi for #name { - type Abi = ::Abi; + impl #wasm_bindgen::convert::IntoWasmAbi for #enum_name { + type Abi = u32; #[inline] - fn into_abi(self) -> Self::Abi { - ::into_abi(self.into()) + fn into_abi(self) -> u32 { + self as u32 } } #[automatically_derived] - impl wasm_bindgen::convert::FromWasmAbi for #name { - type Abi = ::Abi; + impl #wasm_bindgen::convert::FromWasmAbi for #enum_name { + type Abi = u32; - unsafe fn from_abi(js: Self::Abi) -> Self { - let s = ::from_abi(js); - #name::from_js_value(&s).unwrap_or(#name::__Nonexhaustive) + unsafe fn from_abi(val: u32) -> Self { + match val { + #(#variant_indices => #variant_paths_ref,)* + #invalid => #enum_name::__Invalid, + _ => unreachable!("The JS binding should only ever produce a valid value or the specific 'invalid' value"), + } } } #[automatically_derived] - impl wasm_bindgen::convert::OptionIntoWasmAbi for #name { + impl #wasm_bindgen::convert::OptionFromWasmAbi for #enum_name { #[inline] - fn none() -> Self::Abi { <::js_sys::Object as wasm_bindgen::convert::OptionIntoWasmAbi>::none() } + fn is_none(val: &u32) -> bool { *val == #hole } } #[automatically_derived] - impl wasm_bindgen::convert::OptionFromWasmAbi for #name { + impl #wasm_bindgen::convert::OptionIntoWasmAbi for #enum_name { #[inline] - fn is_none(abi: &Self::Abi) -> bool { <::js_sys::Object as wasm_bindgen::convert::OptionFromWasmAbi>::is_none(abi) } + fn none() -> Self::Abi { #hole } + } + + #[automatically_derived] + impl #wasm_bindgen::describe::WasmDescribe for #enum_name { + fn describe() { + use #wasm_bindgen::describe::*; + inform(STRING_ENUM); + inform(#name_len); + #(inform(#name_chars);)* + inform(#variant_count); + } } #[automatically_derived] - impl From<#name> for wasm_bindgen::JsValue { - fn from(obj: #name) -> wasm_bindgen::JsValue { - wasm_bindgen::JsValue::from(obj.to_str()) + impl #wasm_bindgen::__rt::core::convert::From<#enum_name> for + #wasm_bindgen::JsValue + { + fn from(val: #enum_name) -> Self { + #wasm_bindgen::JsValue::from_str(val.to_str()) } } - }).to_tokens(tokens); + }) + .to_tokens(tokens); } } @@ -961,7 +1328,7 @@ impl TryToTokens for ast::ImportFunction { ast::ImportFunctionKind::Normal => {} } let vis = &self.function.rust_vis; - let ret = match &self.function.ret { + let ret = match self.function.ret.as_ref().map(|ret| &ret.r#type) { Some(ty) => quote! { -> #ty }, None => quote!(), }; @@ -971,10 +1338,12 @@ impl TryToTokens for ast::ImportFunction { let mut arg_conversions = Vec::new(); let mut arguments = Vec::new(); let ret_ident = Ident::new("_ret", Span::call_site()); + let wasm_bindgen = &self.wasm_bindgen; + let wasm_bindgen_futures = &self.wasm_bindgen_futures; for (i, arg) in self.function.arguments.iter().enumerate() { - let ty = &arg.ty; - let name = match &*arg.pat { + let ty = &arg.pat_type.ty; + let name = match &*arg.pat_type.pat { syn::Pat::Ident(syn::PatIdent { by_ref: None, ident, @@ -983,15 +1352,16 @@ impl TryToTokens for ast::ImportFunction { }) => ident.clone(), syn::Pat::Wild(_) => syn::Ident::new(&format!("__genarg_{}", i), Span::call_site()), _ => bail_span!( - arg.pat, + arg.pat_type.pat, "unsupported pattern in #[wasm_bindgen] imported function", ), }; - abi_argument_names.push(name.clone()); - abi_arguments.push(quote! { - #name: <#ty as wasm_bindgen::convert::IntoWasmAbi>::Abi - }); + let abi = quote! { <#ty as #wasm_bindgen::convert::IntoWasmAbi>::Abi }; + let (prim_args, prim_names) = splat(wasm_bindgen, &name, &abi); + abi_arguments.extend(prim_args); + abi_argument_names.extend(prim_names.iter().cloned()); + let var = if i == 0 && is_method { quote! { self } } else { @@ -999,8 +1369,9 @@ impl TryToTokens for ast::ImportFunction { quote! { #name } }; arg_conversions.push(quote! { - let #name = <#ty as wasm_bindgen::convert::IntoWasmAbi> + let #name = <#ty as #wasm_bindgen::convert::IntoWasmAbi> ::into_abi(#var); + let (#(#prim_names),*) = <#abi as #wasm_bindgen::convert::WasmAbi>::split(#name); }); } let abi_ret; @@ -1014,37 +1385,39 @@ impl TryToTokens for ast::ImportFunction { } Some(ref ty) => { if self.function.r#async { - abi_ret = - quote! { ::Abi }; + abi_ret = quote! { + #wasm_bindgen::convert::WasmRet<<#wasm_bindgen_futures::js_sys::Promise as #wasm_bindgen::convert::FromWasmAbi>::Abi> + }; let future = quote! { - wasm_bindgen_futures::JsFuture::from( - - ::from_abi(#ret_ident) + #wasm_bindgen_futures::JsFuture::from( + <#wasm_bindgen_futures::js_sys::Promise as #wasm_bindgen::convert::FromWasmAbi> + ::from_abi(#ret_ident.join()) ).await }; convert_ret = if self.catch { - quote! { Ok(#future?) } + quote! { Ok(#wasm_bindgen::JsCast::unchecked_from_js(#future?)) } } else { - quote! { #future.expect("unexpected exception") } + quote! { #wasm_bindgen::JsCast::unchecked_from_js(#future.expect("unexpected exception")) } }; } else { abi_ret = quote! { - <#ty as wasm_bindgen::convert::FromWasmAbi>::Abi + #wasm_bindgen::convert::WasmRet<<#ty as #wasm_bindgen::convert::FromWasmAbi>::Abi> }; convert_ret = quote! { - <#ty as wasm_bindgen::convert::FromWasmAbi> - ::from_abi(#ret_ident) + <#ty as #wasm_bindgen::convert::FromWasmAbi> + ::from_abi(#ret_ident.join()) }; } } None => { if self.function.r#async { - abi_ret = - quote! { ::Abi }; + abi_ret = quote! { + #wasm_bindgen::convert::WasmRet<<#wasm_bindgen_futures::js_sys::Promise as #wasm_bindgen::convert::FromWasmAbi>::Abi> + }; let future = quote! { - wasm_bindgen_futures::JsFuture::from( - - ::from_abi(#ret_ident) + #wasm_bindgen_futures::JsFuture::from( + <#wasm_bindgen_futures::js_sys::Promise as #wasm_bindgen::convert::FromWasmAbi> + ::from_abi(#ret_ident.join()) ).await }; convert_ret = if self.catch { @@ -1063,7 +1436,7 @@ impl TryToTokens for ast::ImportFunction { if self.catch && !self.function.r#async { convert_ret = quote! { Ok(#convert_ret) }; exceptional_ret = quote! { - wasm_bindgen::__rt::take_last_exception()?; + #wasm_bindgen::__rt::take_last_exception()?; }; } @@ -1071,12 +1444,14 @@ impl TryToTokens for ast::ImportFunction { let import_name = &self.shim; let attrs = &self.function.rust_attrs; let arguments = &arguments; - let abi_arguments = &abi_arguments; - let abi_argument_names = &abi_argument_names; + let abi_arguments = &abi_arguments[..]; + let abi_argument_names = &abi_argument_names[..]; - let doc_comment = match &self.doc_comment { - None => "", - Some(doc_string) => doc_string, + let doc = if self.doc_comment.is_empty() { + quote! {} + } else { + let doc_comment = &self.doc_comment; + quote! { #[doc = #doc_comment] } }; let me = if is_method { quote! { &self, } @@ -1100,26 +1475,21 @@ impl TryToTokens for ast::ImportFunction { // like rustc itself doesn't do great in that regard so let's just do // the best we can in the meantime. let extern_fn = respan( - quote! { - #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] - #(#attrs)* - #[link(wasm_import_module = "__wbindgen_placeholder__")] - extern "C" { - fn #import_name(#(#abi_arguments),*) -> #abi_ret; - } - - #[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))] - unsafe fn #import_name(#(#abi_arguments),*) -> #abi_ret { - #( - drop(#abi_argument_names); - )* - panic!("cannot call wasm-bindgen imported functions on \ - non-wasm targets"); - } - }, + extern_fn( + import_name, + attrs, + abi_arguments, + abi_argument_names, + abi_ret, + ), &self.rust_name, ); + let maybe_unsafe = if self.function.r#unsafe { + Some(quote! {unsafe}) + } else { + None + }; let maybe_async = if self.function.r#async { Some(quote! {async}) } else { @@ -1131,8 +1501,8 @@ impl TryToTokens for ast::ImportFunction { #[allow(nonstandard_style)] #[allow(clippy::all, clippy::nursery, clippy::pedantic, clippy::restriction)] #(#attrs)* - #[doc = #doc_comment] - #vis #maybe_async fn #rust_name(#me #(#arguments),*) #ret { + #doc + #vis #maybe_async #maybe_unsafe fn #rust_name(#me #(#arguments),*) #ret { #extern_fn unsafe { @@ -1165,17 +1535,19 @@ impl TryToTokens for ast::ImportFunction { // See comment above in ast::Export for what's going on here. struct DescribeImport<'a> { kind: &'a ast::ImportKind, + wasm_bindgen: &'a syn::Path, } -impl<'a> ToTokens for DescribeImport<'a> { +impl ToTokens for DescribeImport<'_> { fn to_tokens(&self, tokens: &mut TokenStream) { let f = match *self.kind { ast::ImportKind::Function(ref f) => f, ast::ImportKind::Static(_) => return, + ast::ImportKind::String(_) => return, ast::ImportKind::Type(_) => return, ast::ImportKind::Enum(_) => return, }; - let argtys = f.function.arguments.iter().map(|arg| &arg.ty); + let argtys = f.function.arguments.iter().map(|arg| &arg.pat_type.ty); let nargs = f.function.arguments.len() as u32; let inform_ret = match &f.js_ret { Some(ref t) => quote! { <#t as WasmDescribe>::describe(); }, @@ -1195,6 +1567,7 @@ impl<'a> ToTokens for DescribeImport<'a> { #inform_ret }, attrs: f.function.rust_attrs.clone(), + wasm_bindgen: self.wasm_bindgen, } .to_tokens(tokens); } @@ -1203,58 +1576,140 @@ impl<'a> ToTokens for DescribeImport<'a> { impl ToTokens for ast::Enum { fn to_tokens(&self, into: &mut TokenStream) { let enum_name = &self.rust_name; + let name_str = self.js_name.to_string(); + let name_len = name_str.len() as u32; + let name_chars = name_str.chars().map(|c| c as u32); let hole = &self.hole; + let underlying = if self.signed { + quote! { i32 } + } else { + quote! { u32 } + }; let cast_clauses = self.variants.iter().map(|variant| { let variant_name = &variant.name; quote! { - if js == #enum_name::#variant_name as u32 { + if js == #enum_name::#variant_name as #underlying { #enum_name::#variant_name } } }); + let try_from_cast_clauses = cast_clauses.clone(); + let wasm_bindgen = &self.wasm_bindgen; (quote! { #[automatically_derived] - impl wasm_bindgen::convert::IntoWasmAbi for #enum_name { - type Abi = u32; + impl #wasm_bindgen::convert::IntoWasmAbi for #enum_name { + type Abi = #underlying; #[inline] - fn into_abi(self) -> u32 { - self as u32 + fn into_abi(self) -> #underlying { + self as #underlying } } #[automatically_derived] - impl wasm_bindgen::convert::FromWasmAbi for #enum_name { - type Abi = u32; + impl #wasm_bindgen::convert::FromWasmAbi for #enum_name { + type Abi = #underlying; #[inline] - unsafe fn from_abi(js: u32) -> Self { + unsafe fn from_abi(js: #underlying) -> Self { #(#cast_clauses else)* { - wasm_bindgen::throw_str("invalid enum value passed") + #wasm_bindgen::throw_str("invalid enum value passed") } } } #[automatically_derived] - impl wasm_bindgen::convert::OptionFromWasmAbi for #enum_name { + impl #wasm_bindgen::convert::OptionFromWasmAbi for #enum_name { #[inline] - fn is_none(val: &u32) -> bool { *val == #hole } + fn is_none(val: &Self::Abi) -> bool { *val == #hole as #underlying } } #[automatically_derived] - impl wasm_bindgen::convert::OptionIntoWasmAbi for #enum_name { + impl #wasm_bindgen::convert::OptionIntoWasmAbi for #enum_name { #[inline] - fn none() -> Self::Abi { #hole } + fn none() -> Self::Abi { #hole as #underlying } } #[automatically_derived] - impl wasm_bindgen::describe::WasmDescribe for #enum_name { + impl #wasm_bindgen::describe::WasmDescribe for #enum_name { fn describe() { - use wasm_bindgen::describe::*; + use #wasm_bindgen::describe::*; inform(ENUM); + inform(#name_len); + #(inform(#name_chars);)* inform(#hole); } } + + #[automatically_derived] + impl #wasm_bindgen::__rt::core::convert::From<#enum_name> for + #wasm_bindgen::JsValue + { + fn from(value: #enum_name) -> Self { + #wasm_bindgen::JsValue::from_f64((value as #underlying).into()) + } + } + + #[automatically_derived] + impl #wasm_bindgen::convert::TryFromJsValue for #enum_name { + type Error = #wasm_bindgen::JsValue; + + fn try_from_js_value(value: #wasm_bindgen::JsValue) + -> #wasm_bindgen::__rt::core::result::Result::Error> { + use #wasm_bindgen::__rt::core::convert::TryFrom; + let js = f64::try_from(&value)? as #underlying; + + #wasm_bindgen::__rt::core::result::Result::Ok( + #(#try_from_cast_clauses else)* { + return #wasm_bindgen::__rt::core::result::Result::Err(value) + } + ) + } + } + + #[automatically_derived] + impl #wasm_bindgen::describe::WasmDescribeVector for #enum_name { + fn describe_vector() { + use #wasm_bindgen::describe::*; + inform(VECTOR); + <#wasm_bindgen::JsValue as #wasm_bindgen::describe::WasmDescribe>::describe(); + } + } + + #[automatically_derived] + impl #wasm_bindgen::convert::VectorIntoWasmAbi for #enum_name { + type Abi = < + #wasm_bindgen::__rt::alloc::boxed::Box<[#wasm_bindgen::JsValue]> + as #wasm_bindgen::convert::IntoWasmAbi + >::Abi; + + fn vector_into_abi( + vector: #wasm_bindgen::__rt::alloc::boxed::Box<[#enum_name]> + ) -> Self::Abi { + #wasm_bindgen::convert::js_value_vector_into_abi(vector) + } + } + + #[automatically_derived] + impl #wasm_bindgen::convert::VectorFromWasmAbi for #enum_name { + type Abi = < + #wasm_bindgen::__rt::alloc::boxed::Box<[#wasm_bindgen::JsValue]> + as #wasm_bindgen::convert::FromWasmAbi + >::Abi; + + unsafe fn vector_from_abi( + js: Self::Abi + ) -> #wasm_bindgen::__rt::alloc::boxed::Box<[#enum_name]> { + #wasm_bindgen::convert::js_value_vector_from_abi(js) + } + } + + #[automatically_derived] + impl #wasm_bindgen::__rt::VectorIntoJsValue for #enum_name { + fn vector_into_jsvalue(vector: #wasm_bindgen::__rt::alloc::boxed::Box<[#enum_name]>) -> #wasm_bindgen::JsValue { + #wasm_bindgen::__rt::js_value_vector_into_jsvalue(vector) + } + } }) .to_tokens(into); } @@ -1262,56 +1717,141 @@ impl ToTokens for ast::Enum { impl ToTokens for ast::ImportStatic { fn to_tokens(&self, into: &mut TokenStream) { - let name = &self.rust_name; let ty = &self.ty; - let shim_name = &self.shim; - let vis = &self.vis; - (quote! { - #[automatically_derived] - #vis static #name: wasm_bindgen::JsStatic<#ty> = { - fn init() -> #ty { - #[link(wasm_import_module = "__wbindgen_placeholder__")] - #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] - extern "C" { - fn #shim_name() -> <#ty as wasm_bindgen::convert::FromWasmAbi>::Abi; - } - #[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))] - unsafe fn #shim_name() -> <#ty as wasm_bindgen::convert::FromWasmAbi>::Abi { - panic!("cannot access imported statics on non-wasm targets") - } - unsafe { - <#ty as wasm_bindgen::convert::FromWasmAbi>::from_abi(#shim_name()) - } - } - thread_local!(static _VAL: #ty = init();); - wasm_bindgen::JsStatic { - __inner: &_VAL, - } - }; - }) - .to_tokens(into); + if let Some(thread_local) = self.thread_local { + thread_local_import( + &self.vis, + &self.rust_name, + &self.wasm_bindgen, + ty, + ty, + &self.shim, + thread_local, + ) + .to_tokens(into) + } else { + let vis = &self.vis; + let name = &self.rust_name; + let wasm_bindgen = &self.wasm_bindgen; + let ty = &self.ty; + let shim_name = &self.shim; + let init = static_init(wasm_bindgen, ty, shim_name); + + into.extend(quote! { + #[automatically_derived] + #[deprecated = "use with `#[wasm_bindgen(thread_local_v2)]` instead"] + }); + into.extend( + quote_spanned! { name.span() => #vis static #name: #wasm_bindgen::JsStatic<#ty> = { + fn init() -> #ty { + #init + } + #wasm_bindgen::__rt::std::thread_local!(static _VAL: #ty = init();); + #wasm_bindgen::JsStatic { + __inner: &_VAL, + } + }; + }, + ); + } Descriptor { - ident: &shim_name, + ident: &self.shim, inner: quote! { <#ty as WasmDescribe>::describe(); }, attrs: vec![], + wasm_bindgen: &self.wasm_bindgen, } .to_tokens(into); } } +impl ToTokens for ast::ImportString { + fn to_tokens(&self, into: &mut TokenStream) { + let js_sys = &self.js_sys; + let actual_ty: syn::Type = parse_quote!(#js_sys::JsString); + + thread_local_import( + &self.vis, + &self.rust_name, + &self.wasm_bindgen, + &actual_ty, + &self.ty, + &self.shim, + self.thread_local, + ) + .to_tokens(into); + } +} + +fn thread_local_import( + vis: &syn::Visibility, + name: &Ident, + wasm_bindgen: &syn::Path, + actual_ty: &syn::Type, + ty: &syn::Type, + shim_name: &Ident, + thread_local: ast::ThreadLocal, +) -> TokenStream { + let init = static_init(wasm_bindgen, ty, shim_name); + + match thread_local { + ast::ThreadLocal::V1 => quote! { + #wasm_bindgen::__rt::std::thread_local! { + #[automatically_derived] + #[deprecated = "use with `#[wasm_bindgen(thread_local_v2)]` instead"] + #vis static #name: #actual_ty = { + #init + }; + } + }, + ast::ThreadLocal::V2 => { + quote! { + #vis static #name: #wasm_bindgen::JsThreadLocal<#actual_ty> = { + fn init() -> #actual_ty { + #init + } + #wasm_bindgen::__wbindgen_thread_local!(#wasm_bindgen, #actual_ty) + }; + } + } + } +} + +fn static_init(wasm_bindgen: &syn::Path, ty: &syn::Type, shim_name: &Ident) -> TokenStream { + let abi_ret = quote! { + #wasm_bindgen::convert::WasmRet<<#ty as #wasm_bindgen::convert::FromWasmAbi>::Abi> + }; + quote! { + #[link(wasm_import_module = "__wbindgen_placeholder__")] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] + extern "C" { + fn #shim_name() -> #abi_ret; + } + + #[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))] + unsafe fn #shim_name() -> #abi_ret { + panic!("cannot access imported statics on non-wasm targets") + } + + unsafe { + <#ty as #wasm_bindgen::convert::FromWasmAbi>::from_abi(#shim_name().join()) + } + } +} + /// 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, attrs: Vec, + wasm_bindgen: &'a syn::Path, } -impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> { +impl ToTokens for Descriptor<'_, T> { fn to_tokens(&self, tokens: &mut TokenStream) { // It's possible for the same descriptor to be emitted in two different // modules (aka a value imported twice in a crate, each in a separate @@ -1321,46 +1861,93 @@ impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> { // It's up to the descriptors themselves to ensure they have unique // names for unique items imported, currently done via `ShortHash` and // hashing appropriate data into the symbol name. - lazy_static::lazy_static! { - static ref DESCRIPTORS_EMITTED: Mutex> = Default::default(); + thread_local! { + static DESCRIPTORS_EMITTED: RefCell> = RefCell::default(); } let ident = self.ident; - if !DESCRIPTORS_EMITTED - .lock() - .unwrap() - .insert(ident.to_string()) - { + if !DESCRIPTORS_EMITTED.with(|list| list.borrow_mut().insert(ident.to_string())) { return; } let name = Ident::new(&format!("__wbindgen_describe_{}", ident), ident.span()); - let const_name = Ident::new( - &format!("__wbindgen_const_describe_{}", ident), - ident.span(), - ); let inner = &self.inner; let attrs = &self.attrs; + let wasm_bindgen = &self.wasm_bindgen; (quote! { - #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] #[automatically_derived] - const #const_name: () = { + const _: () = { + #wasm_bindgen::__wbindgen_coverage! { #(#attrs)* #[no_mangle] #[doc(hidden)] pub extern "C" fn #name() { - use wasm_bindgen::describe::*; + use #wasm_bindgen::describe::*; // See definition of `link_mem_intrinsics` for what this is doing - wasm_bindgen::__rt::link_mem_intrinsics(); + #wasm_bindgen::__rt::link_mem_intrinsics(); #inner } + } }; }) .to_tokens(tokens); } } +fn extern_fn( + import_name: &Ident, + attrs: &[syn::Attribute], + abi_arguments: &[TokenStream], + abi_argument_names: &[Ident], + abi_ret: TokenStream, +) -> TokenStream { + quote! { + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] + #(#attrs)* + #[link(wasm_import_module = "__wbindgen_placeholder__")] + extern "C" { + fn #import_name(#(#abi_arguments),*) -> #abi_ret; + } + + #[cfg(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))))] + unsafe fn #import_name(#(#abi_arguments),*) -> #abi_ret { + #( + drop(#abi_argument_names); + )* + panic!("cannot call wasm-bindgen imported functions on \ + non-wasm targets"); + } + } +} + +/// Splats an argument with the given name and ABI type into 4 arguments, one +/// for each primitive that the ABI type splits into. +/// +/// Returns an `(args, names)` pair, where `args` is the list of arguments to +/// be inserted into the function signature, and `names` is a list of the names +/// of those arguments. +fn splat( + wasm_bindgen: &syn::Path, + name: &Ident, + abi: &TokenStream, +) -> (Vec, Vec) { + let mut args = Vec::new(); + let mut names = Vec::new(); + + for n in 1_u32..=4 { + let arg_name = format_ident!("{}_{}", name, n); + let prim_name = format_ident!("Prim{}", n); + args.push(quote! { + #arg_name: <#abi as #wasm_bindgen::convert::WasmAbi>::#prim_name + }); + names.push(arg_name); + } + + (args, names) +} + /// Converts `span` into a stream of tokens, and attempts to ensure that `input` /// has all the appropriate span information so errors in it point to `span`. fn respan(input: TokenStream, span: &dyn ToTokens) -> TokenStream { @@ -1371,9 +1958,9 @@ fn respan(input: TokenStream, span: &dyn ToTokens) -> TokenStream { for (i, token) in spans.into_iter().enumerate() { if i == 0 { - first_span = token.span(); + first_span = Span::call_site().located_at(token.span()); } - last_span = token.span(); + last_span = Span::call_site().located_at(token.span()); } let mut new_tokens = Vec::new(); diff --git a/crates/backend/src/encode.rs b/crates/backend/src/encode.rs index 6fa1245b32c..1285f19fc93 100644 --- a/crates/backend/src/encode.rs +++ b/crates/backend/src/encode.rs @@ -5,12 +5,20 @@ use std::collections::HashMap; use std::env; use std::fs; use std::path::PathBuf; +use syn::ext::IdentExt; use crate::ast; use crate::Diagnostic; +#[derive(Clone)] +pub enum EncodeChunk { + EncodedBuf(Vec), + StrExpr(syn::Expr), + // TODO: support more expr type; +} + pub struct EncodeResult { - pub custom_section: Vec, + pub custom_section: Vec, pub included_files: Vec, } @@ -44,6 +52,7 @@ struct LocalFile { path: PathBuf, definition: Span, new_identifier: String, + linked_module: bool, } impl Interner { @@ -77,19 +86,24 @@ impl Interner { /// /// Note that repeated invocations of this function will be memoized, so the /// same `id` will always return the same resulting unique `id`. - fn resolve_import_module(&self, id: &str, span: Span) -> Result<&str, Diagnostic> { + fn resolve_import_module( + &self, + id: &str, + span: Span, + linked_module: bool, + ) -> Result { let mut files = self.files.borrow_mut(); if let Some(file) = files.get(id) { - return Ok(self.intern_str(&file.new_identifier)); + return Ok(ImportModule::Named(self.intern_str(&file.new_identifier))); } self.check_for_package_json(); - let path = if id.starts_with("/") { - self.root.join(&id[1..]) + let path = if let Some(id) = id.strip_prefix('/') { + self.root.join(id) } else if id.starts_with("./") || id.starts_with("../") { let msg = "relative module paths aren't supported yet"; return Err(Diagnostic::span_error(span, msg)); } else { - return Ok(self.intern_str(&id)); + return Ok(ImportModule::RawNamed(self.intern_str(id))); }; // Generate a unique ID which is somewhat readable as well, so mix in @@ -99,10 +113,11 @@ impl Interner { path, definition: span, new_identifier, + linked_module, }; files.insert(id.to_string(), file); drop(files); - self.resolve_import_module(id, span) + self.resolve_import_module(id, span, linked_module) } fn unique_crate_identifier(&self) -> String { @@ -144,8 +159,14 @@ fn shared_program<'a>( typescript_custom_sections: prog .typescript_custom_sections .iter() - .map(|x| -> &'a str { &x }) + .map(|x| shared_lit_or_expr(x, intern)) .collect(), + linked_modules: prog + .linked_modules + .iter() + .enumerate() + .map(|(i, a)| shared_linked_module(&prog.link_function_name(i), a, intern)) + .collect::, _>>()?, local_modules: intern .files .borrow() @@ -155,6 +176,7 @@ fn shared_program<'a>( .map(|s| LocalModule { identifier: intern.intern_str(&file.new_identifier), contents: intern.intern_str(&s), + linked_module: file.linked_module, }) .map_err(|e| { let msg = format!("failed to read file `{}`: {}", file.path.display(), e); @@ -180,13 +202,10 @@ fn shared_export<'a>( export: &'a ast::Export, intern: &'a Interner, ) -> Result, Diagnostic> { - let consumed = match export.method_self { - Some(ast::MethodSelf::ByValue) => true, - _ => false, - }; + let consumed = matches!(export.method_self, Some(ast::MethodSelf::ByValue)); let method_kind = from_ast_method_kind(&export.function, intern, &export.method_kind)?; Ok(Export { - class: export.js_class.as_ref().map(|s| &**s), + class: export.js_class.as_deref(), comments: export.comments.iter().map(|s| &**s).collect(), consumed, function: shared_function(&export.function, intern), @@ -196,28 +215,41 @@ fn shared_export<'a>( } fn shared_function<'a>(func: &'a ast::Function, _intern: &'a Interner) -> Function<'a> { - let arg_names = func - .arguments - .iter() - .enumerate() - .map(|(idx, arg)| { - if let syn::Pat::Ident(x) = &*arg.pat { - return x.ident.to_string(); - } - format!("arg{}", idx) - }) - .collect::>(); + let args = + func.arguments + .iter() + .enumerate() + .map(|(idx, arg)| FunctionArgumentData { + // use argument's "js_name" if it was provided via attributes + // if not use the original Rust argument ident + name: arg.js_name.clone().unwrap_or( + if let syn::Pat::Ident(x) = &*arg.pat_type.pat { + x.ident.unraw().to_string() + } else { + format!("arg{}", idx) + }, + ), + ty_override: arg.js_type.as_deref(), + desc: arg.desc.as_deref(), + }) + .collect::>(); + Function { - arg_names, + args, asyncness: func.r#async, name: &func.name, generate_typescript: func.generate_typescript, + generate_jsdoc: func.generate_jsdoc, + variadic: func.variadic, + ret_ty_override: func.ret.as_ref().and_then(|v| v.js_type.as_deref()), + ret_desc: func.ret.as_ref().and_then(|v| v.desc.as_deref()), } } fn shared_enum<'a>(e: &'a ast::Enum, intern: &'a Interner) -> Enum<'a> { Enum { name: &e.js_name, + signed: e.signed, variants: e .variants .iter() @@ -238,19 +270,48 @@ fn shared_variant<'a>(v: &'a ast::Variant, intern: &'a Interner) -> EnumVariant< fn shared_import<'a>(i: &'a ast::Import, intern: &'a Interner) -> Result, Diagnostic> { Ok(Import { - module: match &i.module { - ast::ImportModule::Named(m, span) => { - ImportModule::Named(intern.resolve_import_module(m, *span)?) - } - ast::ImportModule::RawNamed(m, _span) => ImportModule::RawNamed(intern.intern_str(m)), - ast::ImportModule::Inline(idx, _) => ImportModule::Inline(*idx as u32), - ast::ImportModule::None => ImportModule::None, - }, + module: i + .module + .as_ref() + .map(|m| shared_module(m, intern, false)) + .transpose()?, js_namespace: i.js_namespace.clone(), kind: shared_import_kind(&i.kind, intern)?, }) } +fn shared_lit_or_expr<'a>(i: &'a ast::LitOrExpr, _intern: &'a Interner) -> LitOrExpr<'a> { + match i { + ast::LitOrExpr::Lit(lit) => LitOrExpr::Lit(lit), + ast::LitOrExpr::Expr(expr) => LitOrExpr::Expr(expr), + } +} + +fn shared_linked_module<'a>( + name: &str, + i: &'a ast::ImportModule, + intern: &'a Interner, +) -> Result, Diagnostic> { + Ok(LinkedModule { + module: shared_module(i, intern, true)?, + link_function_name: intern.intern_str(name), + }) +} + +fn shared_module<'a>( + m: &'a ast::ImportModule, + intern: &'a Interner, + linked_module: bool, +) -> Result, Diagnostic> { + Ok(match m { + ast::ImportModule::Named(m, span) => { + intern.resolve_import_module(m, *span, linked_module)? + } + ast::ImportModule::RawNamed(m, _span) => ImportModule::RawNamed(intern.intern_str(m)), + ast::ImportModule::Inline(idx, _) => ImportModule::Inline(*idx as u32), + }) +} + fn shared_import_kind<'a>( i: &'a ast::ImportKind, intern: &'a Interner, @@ -258,6 +319,7 @@ fn shared_import_kind<'a>( Ok(match i { ast::ImportKind::Function(f) => ImportKind::Function(shared_import_function(f, intern)?), ast::ImportKind::Static(f) => ImportKind::Static(shared_import_static(f, intern)), + ast::ImportKind::String(f) => ImportKind::String(shared_import_string(f, intern)), ast::ImportKind::Type(f) => ImportKind::Type(shared_import_type(f, intern)), ast::ImportKind::Enum(f) => ImportKind::Enum(shared_import_enum(f, intern)), }) @@ -293,6 +355,13 @@ fn shared_import_static<'a>(i: &'a ast::ImportStatic, intern: &'a Interner) -> I } } +fn shared_import_string<'a>(i: &'a ast::ImportString, intern: &'a Interner) -> ImportString<'a> { + ImportString { + shim: intern.intern(&i.shim), + string: &i.string, + } +} + fn shared_import_type<'a>(i: &'a ast::ImportType, intern: &'a Interner) -> ImportType<'a> { ImportType { name: &i.js_name, @@ -301,8 +370,13 @@ fn shared_import_type<'a>(i: &'a ast::ImportType, intern: &'a Interner) -> Impor } } -fn shared_import_enum<'a>(_i: &'a ast::ImportEnum, _intern: &'a Interner) -> ImportEnum { - ImportEnum {} +fn shared_import_enum<'a>(i: &'a ast::StringEnum, _intern: &'a Interner) -> StringEnum<'a> { + StringEnum { + name: &i.js_name, + generate_typescript: i.generate_typescript, + variant_values: i.variant_values.iter().map(|x| &**x).collect(), + comments: i.comments.iter().map(|s| &**s).collect(), + } } fn shared_struct<'a>(s: &'a ast::Struct, intern: &'a Interner) -> Struct<'a> { @@ -325,6 +399,7 @@ fn shared_struct_field<'a>(s: &'a ast::StructField, _intern: &'a Interner) -> St readonly: s.readonly, comments: s.comments.iter().map(|s| &**s).collect(), generate_typescript: s.generate_typescript, + generate_jsdoc: s.generate_jsdoc, } } @@ -333,27 +408,48 @@ trait Encode { } struct Encoder { - dst: Vec, + dst: Vec, +} + +enum LitOrExpr<'a> { + Expr(&'a syn::Expr), + Lit(&'a str), +} + +impl Encode for LitOrExpr<'_> { + fn encode(&self, dst: &mut Encoder) { + match self { + LitOrExpr::Expr(expr) => { + dst.dst.push(EncodeChunk::StrExpr((*expr).clone())); + } + LitOrExpr::Lit(s) => s.encode(dst), + } + } } impl Encoder { fn new() -> Encoder { - Encoder { - dst: vec![0, 0, 0, 0], - } + Encoder { dst: vec![] } } - fn finish(mut self) -> Vec { - let len = self.dst.len() - 4; - self.dst[0] = (len >> 0) as u8; - self.dst[1] = (len >> 8) as u8; - self.dst[2] = (len >> 16) as u8; - self.dst[3] = (len >> 24) as u8; + fn finish(self) -> Vec { self.dst } fn byte(&mut self, byte: u8) { - self.dst.push(byte); + if let Some(EncodeChunk::EncodedBuf(buf)) = self.dst.last_mut() { + buf.push(byte); + } else { + self.dst.push(EncodeChunk::EncodedBuf(vec![byte])); + } + } + + fn extend_from_slice(&mut self, slice: &[u8]) { + if let Some(EncodeChunk::EncodedBuf(buf)) = self.dst.last_mut() { + buf.extend_from_slice(slice); + } else { + self.dst.push(EncodeChunk::EncodedBuf(slice.to_owned())); + } } } @@ -377,25 +473,25 @@ impl Encode for u32 { impl Encode for usize { fn encode(&self, dst: &mut Encoder) { - assert!(*self <= u32::max_value() as usize); + assert!(*self <= u32::MAX as usize); (*self as u32).encode(dst); } } -impl<'a> Encode for &'a [u8] { +impl Encode for &[u8] { fn encode(&self, dst: &mut Encoder) { self.len().encode(dst); - dst.dst.extend_from_slice(*self); + dst.extend_from_slice(self); } } -impl<'a> Encode for &'a str { +impl Encode for &str { fn encode(&self, dst: &mut Encoder) { self.as_bytes().encode(dst); } } -impl<'a> Encode for String { +impl Encode for String { fn encode(&self, dst: &mut Encoder) { self.as_bytes().encode(dst); } @@ -509,12 +605,12 @@ fn from_ast_method_kind<'a>( let is_static = *is_static; let kind = match kind { ast::OperationKind::Getter(g) => { - let g = g.as_ref().map(|g| intern.intern(g)); + let g = g.as_ref().map(|g| intern.intern_str(g)); OperationKind::Getter(g.unwrap_or_else(|| function.infer_getter_property())) } ast::OperationKind::Regular => OperationKind::Regular, ast::OperationKind::Setter(s) => { - let s = s.as_ref().map(|s| intern.intern(s)); + let s = s.as_ref().map(|s| intern.intern_str(s)); OperationKind::Setter(match s { Some(s) => s, None => intern.intern_str(&function.infer_setter_property()?), diff --git a/crates/backend/src/error.rs b/crates/backend/src/error.rs index 3e65cd745cc..19d991b3ce4 100644 --- a/crates/backend/src/error.rs +++ b/crates/backend/src/error.rs @@ -70,7 +70,7 @@ impl Diagnostic { /// Attempt to generate a `Diagnostic` from a vector of other `Diagnostic` instances. /// If the `Vec` is empty, returns `Ok(())`, otherwise returns the new `Diagnostic` pub fn from_vec(diagnostics: Vec) -> Result<(), Diagnostic> { - if diagnostics.len() == 0 { + if diagnostics.is_empty() { Ok(()) } else { Err(Diagnostic { diff --git a/crates/backend/src/util.rs b/crates/backend/src/util.rs index 73cf20bb0ea..8424e602a08 100644 --- a/crates/backend/src/util.rs +++ b/crates/backend/src/util.rs @@ -12,25 +12,24 @@ use std::sync::atomic::Ordering::SeqCst; use crate::ast; use proc_macro2::{self, Ident}; -use syn; /// Check whether a given `&str` is a Rust keyword +#[rustfmt::skip] fn is_rust_keyword(name: &str) -> bool { - match name { + matches!(name, "abstract" | "alignof" | "as" | "become" | "box" | "break" | "const" | "continue" | "crate" | "do" | "else" | "enum" | "extern" | "false" | "final" | "fn" | "for" | "if" | "impl" | "in" | "let" | "loop" | "macro" | "match" | "mod" | "move" | "mut" | "offsetof" | "override" | "priv" | "proc" | "pub" | "pure" | "ref" | "return" | "Self" | "self" | "sizeof" | "static" | "struct" | "super" | "trait" | "true" | "type" | "typeof" | "unsafe" | "unsized" | "use" | "virtual" | "where" | "while" - | "yield" | "bool" | "_" => true, - _ => false, - } + | "yield" | "bool" | "_" + ) } /// Create an `Ident`, possibly mangling it if it conflicts with a Rust keyword. pub fn rust_ident(name: &str) -> Ident { - if name == "" { + if name.is_empty() { panic!("tried to create empty Ident (from \"\")"); } else if is_rust_keyword(name) { Ident::new(&format!("{}_", name), proc_macro2::Span::call_site()) @@ -120,7 +119,7 @@ pub fn ident_ty(ident: Ident) -> syn::Type { /// Convert an ImportFunction into the more generic Import type, wrapping the provided function pub fn wrap_import_function(function: ast::ImportFunction) -> ast::Import { ast::Import { - module: ast::ImportModule::None, + module: None, js_namespace: None, kind: ast::ImportKind::Function(function), } diff --git a/crates/cli-support/Cargo.toml b/crates/cli-support/Cargo.toml index 4a1e3dbb45e..bb4ba82842e 100644 --- a/crates/cli-support/Cargo.toml +++ b/crates/cli-support/Cargo.toml @@ -1,30 +1,33 @@ [package] -name = "wasm-bindgen-cli-support" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli-support" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen-cli-support" description = """ Shared support for the wasm-bindgen-cli package, an internal dependency """ -edition = '2018' +documentation = "https://docs.rs/wasm-bindgen-cli-support" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-cli-support" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli-support" +rust-version = "1.76" +version = "0.2.100" [dependencies] anyhow = "1.0" -base64 = "0.9" +base64 = "0.22" log = "0.4" rustc-demangle = "0.1.13" +serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tempfile = "3.0" -walrus = "0.19.0" -wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.80' } -wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.80' } -wasm-bindgen-shared = { path = "../shared", version = '=0.2.80' } -wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.80' } -wasm-bindgen-wasm-conventions = { path = '../wasm-conventions', version = '=0.2.80' } -wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.80' } -wit-text = "0.8.0" -wit-walrus = "0.6.0" -wit-validator = "0.2.0" +walrus = { version = "0.23", features = ['parallel'] } +wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.100' } +wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.100' } +wasm-bindgen-shared = { path = "../shared", version = '=0.2.100' } +wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.100' } +wasm-bindgen-wasm-conventions = { path = '../wasm-conventions', version = '=0.2.100' } +wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.100' } + +[lints] +workspace = true diff --git a/crates/cli-support/src/decode.rs b/crates/cli-support/src/decode.rs index d58b49ff06d..f527acea2d2 100644 --- a/crates/cli-support/src/decode.rs +++ b/crates/cli-support/src/decode.rs @@ -1,19 +1,37 @@ -use std::str; +use std::{ops::Deref, str}; pub trait Decode<'src>: Sized { fn decode(data: &mut &'src [u8]) -> Self; fn decode_all(mut data: &'src [u8]) -> Self { let ret = Self::decode(&mut data); - assert!(data.len() == 0); - return ret; + assert!(data.is_empty()); + ret } } -fn get<'a>(b: &mut &'a [u8]) -> u8 { +pub struct LitOrExpr<'src> { + str: &'src str, +} + +fn get(b: &mut &[u8]) -> u8 { let r = b[0]; *b = &b[1..]; - return r; + r +} + +impl Deref for LitOrExpr<'_> { + type Target = str; + fn deref(&self) -> &Self::Target { + self.str + } +} + +impl<'src> Decode<'src> for LitOrExpr<'src> { + fn decode(data: &mut &'src [u8]) -> Self { + let str = <&'src str>::decode(data); + Self { str } + } } impl<'src> Decode<'src> for bool { diff --git a/crates/cli-support/src/descriptor.rs b/crates/cli-support/src/descriptor.rs index a3b73a2221a..3ddf75405b3 100644 --- a/crates/cli-support/src/descriptor.rs +++ b/crates/cli-support/src/descriptor.rs @@ -1,5 +1,7 @@ use std::char; +use wasm_bindgen_shared::identifier::is_valid_ident; + macro_rules! tys { ($($a:ident)*) => (tys! { @ ($($a)*) 0 }); (@ () $v:expr) => {}; @@ -19,6 +21,8 @@ tys! { U32 I64 U64 + I128 + U128 F32 F64 BOOLEAN @@ -28,17 +32,20 @@ tys! { STRING REF REFMUT + LONGREF SLICE VECTOR EXTERNREF NAMED_EXTERNREF ENUM + STRING_ENUM RUST_STRUCT CHAR OPTIONAL RESULT UNIT CLAMPED + NONNULL } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -52,6 +59,8 @@ pub enum Descriptor { U32, I64, U64, + I128, + U128, F32, F64, Boolean, @@ -65,12 +74,21 @@ pub enum Descriptor { String, Externref, NamedExternref(String), - Enum { hole: u32 }, + Enum { + name: String, + hole: u32, + }, + StringEnum { + name: String, + invalid: u32, + hole: u32, + }, RustStruct(String), Char, Option(Box), Result(Box), Unit, + NonNull, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -89,7 +107,7 @@ pub struct Closure { pub mutable: bool, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum VectorKind { I8, U8, @@ -120,11 +138,13 @@ impl Descriptor { I16 => Descriptor::I16, I32 => Descriptor::I32, I64 => Descriptor::I64, + I128 => Descriptor::I128, U8 if clamped => Descriptor::ClampedU8, U8 => Descriptor::U8, U16 => Descriptor::U16, U32 => Descriptor::U32, U64 => Descriptor::U64, + U128 => Descriptor::U128, F32 => Descriptor::F32, F64 => Descriptor::F64, BOOLEAN => Descriptor::Boolean, @@ -132,6 +152,15 @@ impl Descriptor { CLOSURE => Descriptor::Closure(Box::new(Closure::decode(data))), REF => Descriptor::Ref(Box::new(Descriptor::_decode(data, clamped))), REFMUT => Descriptor::RefMut(Box::new(Descriptor::_decode(data, clamped))), + LONGREF => { + // This descriptor basically just serves as a macro, where most things + // become normal `Ref`s, but long refs to externrefs become owned. + let contents = Descriptor::_decode(data, clamped); + match contents { + Descriptor::Externref | Descriptor::NamedExternref(_) => contents, + _ => Descriptor::Ref(Box::new(contents)), + } + } SLICE => Descriptor::Slice(Box::new(Descriptor::_decode(data, clamped))), VECTOR => Descriptor::Vector(Box::new(Descriptor::_decode(data, clamped))), OPTIONAL => Descriptor::Option(Box::new(Descriptor::_decode(data, clamped))), @@ -139,7 +168,22 @@ impl Descriptor { CACHED_STRING => Descriptor::CachedString, STRING => Descriptor::String, EXTERNREF => Descriptor::Externref, - ENUM => Descriptor::Enum { hole: get(data) }, + ENUM => { + let name = get_string(data); + let hole = get(data); + Descriptor::Enum { name, hole } + } + STRING_ENUM => { + let name = get_string(data); + let variant_count = get(data); + let invalid = variant_count; + let hole = variant_count + 1; + Descriptor::StringEnum { + name, + invalid, + hole, + } + } RUST_STRUCT => { let name = get_string(data); Descriptor::RustStruct(name) @@ -151,6 +195,7 @@ impl Descriptor { CHAR => Descriptor::Char, UNIT => Descriptor::Unit, CLAMPED => Descriptor::_decode(data, true), + NONNULL => Descriptor::NonNull, other => panic!("unknown descriptor: {}", other), } } @@ -263,7 +308,11 @@ impl VectorKind { VectorKind::F64 => "Float64Array".to_string(), VectorKind::Externref => "any[]".to_string(), VectorKind::NamedExternref(ref name) => { - format!("({})[]", name) + if is_valid_ident(name.as_str()) { + format!("{}[]", name) + } else { + format!("({})[]", name) + } } } } diff --git a/crates/cli-support/src/descriptors.rs b/crates/cli-support/src/descriptors.rs index 2486ff8d059..6dec401463f 100644 --- a/crates/cli-support/src/descriptors.rs +++ b/crates/cli-support/src/descriptors.rs @@ -3,7 +3,7 @@ //! The purpose of this module is to basically execute a pass on a raw wasm //! module that just came out of the compiler. The pass will execute all //! relevant descriptor functions contained in the module which wasm-bindgen -//! uses to convey type infomation here, to the CLI. +//! uses to convey type information here, to the CLI. //! //! All descriptor functions are removed after this pass runs and in their stead //! a new custom section, defined in this module, is inserted into the @@ -11,10 +11,10 @@ //! functions. use crate::descriptor::{Closure, Descriptor}; -use anyhow::Error; +use anyhow::{bail, Error}; use std::borrow::Cow; -use std::collections::{HashMap, HashSet}; -use walrus::ImportId; +use std::collections::HashMap; +use walrus::{ConstExpr, ElementItems, ElementKind, ImportId, RefType}; use walrus::{CustomSection, FunctionId, Module, TypedCustomSectionId}; use wasm_bindgen_wasm_interpreter::Interpreter; @@ -22,7 +22,6 @@ use wasm_bindgen_wasm_interpreter::Interpreter; pub struct WasmBindgenDescriptorsSection { pub descriptors: HashMap, pub closure_imports: HashMap, - cached_closures: HashMap, } pub type WasmBindgenDescriptorsSectionId = TypedCustomSectionId; @@ -88,7 +87,7 @@ impl WasmBindgenDescriptorsSection { // Find all functions which call `wbindgen_describe_closure`. These are // specially codegen'd so we know the rough structure of them. For each // one we delegate to the interpreter to figure out the actual result. - let mut element_removal_list = HashSet::new(); + let mut element_removal_list = HashMap::new(); let mut func_to_descriptor = HashMap::new(); for (id, local) in module.funcs.iter_local() { let mut find = FindDescribeClosure { @@ -107,9 +106,55 @@ impl WasmBindgenDescriptorsSection { // For all indirect functions that were closure descriptors, delete them // from the function table since we've executed them and they're not // necessary in the final binary. - for (segment, idx) in element_removal_list { - log::trace!("delete element {}", idx); - module.elements.get_mut(segment).members[idx] = None; + for (segment, idxs) in element_removal_list { + let segment = module.elements.get_mut(segment); + + let items = match &mut segment.items { + ElementItems::Functions(items) => items, + ElementItems::Expressions(_, items) => { + for idx in idxs { + log::trace!("delete element {}", idx); + items[idx] = ConstExpr::RefNull(RefType::Funcref) + } + + continue; + } + }; + + let (table, offset) = match &segment.kind { + ElementKind::Active { + table, + offset: ConstExpr::Value(Value::I32(n)), + } => (*table, *n), + _ => bail!("somehow found a closure in an unexpected element segment"), + }; + + let mut to_insert = Vec::new(); + + for idx in idxs.into_iter().rev() { + log::trace!("delete element {}", idx); + + items.remove(idx); + + // Last item, no need to do anything fancy. + if items.len() == idx { + continue; + } + + let block = items.split_off(idx); + let offset = offset + idx as i32 + 1; + let offset = ConstExpr::Value(Value::I32(offset)); + + to_insert.push((offset, block)); + } + + for (offset, block) in to_insert.into_iter().rev() { + let id = module.elements.add( + ElementKind::Active { table, offset }, + ElementItems::Functions(block), + ); + module.tables.get_mut(table).elem_segments.insert(id); + } } // And finally replace all calls of `wbindgen_describe_closure` with a @@ -120,21 +165,12 @@ impl WasmBindgenDescriptorsSection { let mut items = func_to_descriptor.into_iter().collect::>(); items.sort_by_key(|i| i.0); for (func, descriptor) in items { - // This uses a cache so that if the same closure exists multiple times it will - // deduplicate it so it only exists once. - let id = match self.cached_closures.get(&descriptor) { - Some(id) => *id, - None => { - let import_name = format!("__wbindgen_closure_wrapper{}", func.index()); - let (id, import_id) = - module.add_import_func("__wbindgen_placeholder__", &import_name, ty); - module.funcs.get_mut(id).name = Some(import_name); - self.closure_imports - .insert(import_id, descriptor.clone().unwrap_closure()); - self.cached_closures.insert(descriptor, id); - id - } - }; + let import_name = format!("__wbindgen_closure_wrapper{}", func.index()); + let (id, import_id) = + module.add_import_func("__wbindgen_placeholder__", &import_name, ty); + module.funcs.get_mut(id).name = Some(import_name); + self.closure_imports + .insert(import_id, descriptor.clone().unwrap_closure()); let local = match &mut module.funcs.get_mut(func).kind { walrus::FunctionKind::Local(l) => l, @@ -157,12 +193,18 @@ impl WasmBindgenDescriptorsSection { found: bool, } - impl<'a> Visitor<'a> for FindDescribeClosure { + impl Visitor<'_> for FindDescribeClosure { fn visit_call(&mut self, call: &Call) { if call.func == self.wbindgen_describe_closure { self.found = true; } } + + fn visit_return_call(&mut self, instr: &walrus::ir::ReturnCall) { + if instr.func == self.wbindgen_describe_closure { + self.found = true; + } + } } struct UpdateDescribeClosure { @@ -170,12 +212,18 @@ impl WasmBindgenDescriptorsSection { replacement: FunctionId, } - impl<'a> VisitorMut for UpdateDescribeClosure { + impl VisitorMut for UpdateDescribeClosure { fn visit_call_mut(&mut self, call: &mut Call) { if call.func == self.wbindgen_describe_closure { call.func = self.replacement; } } + + fn visit_return_call_mut(&mut self, instr: &mut walrus::ir::ReturnCall) { + if instr.func == self.wbindgen_describe_closure { + instr.func = self.replacement; + } + } } } } diff --git a/crates/cli-support/src/externref.rs b/crates/cli-support/src/externref.rs index 8aff6a4853a..845780c844f 100644 --- a/crates/cli-support/src/externref.rs +++ b/crates/cli-support/src/externref.rs @@ -5,7 +5,8 @@ use crate::wit::{AdapterKind, Instruction, NonstandardWitSection}; use crate::wit::{AdapterType, InstructionData, StackChange, WasmBindgenAux}; use anyhow::Result; use std::collections::HashMap; -use walrus::{ir::Value, ElementKind, InitExpr, Module}; +use walrus::ElementItems; +use walrus::{ir::Value, ConstExpr, ElementKind, Module}; use wasm_bindgen_externref_xform::Context; pub fn process(module: &mut Module) -> Result<()> { @@ -25,12 +26,12 @@ pub fn process(module: &mut Module) -> Result<()> { // Transform all exported functions in the module, using the bindings listed // for each exported function. - for (id, adapter) in section.adapters.iter_mut() { + for (id, adapter) in &mut section.adapters { let instructions = match &mut adapter.kind { AdapterKind::Local { instructions } => instructions, AdapterKind::Import { .. } => continue, }; - if let Some(id) = implements.get(&id) { + if let Some(id) = implements.get(id) { import_xform( &mut cfg, *id, @@ -74,10 +75,10 @@ pub fn process(module: &mut Module) -> Result<()> { aux.externref_drop_slice = meta.drop_slice; } - // Additonally we may need to update some adapter instructions other than + // Additionally we may need to update some adapter instructions other than // those found for the externref pass. These are some general "fringe support" // things necessary to get absolutely everything working. - for (_, adapter) in section.adapters.iter_mut() { + for adapter in &mut section.adapters.values_mut() { let instrs = match &mut adapter.kind { AdapterKind::Local { instructions } => instructions, AdapterKind::Import { .. } => continue, @@ -85,7 +86,7 @@ pub fn process(module: &mut Module) -> Result<()> { for instr in instrs { match instr.instr { // Calls to the heap live count intrinsic are now routed to the - // actual wasm function which keeps track of this. + // actual Wasm function which keeps track of this. Instruction::CallAdapter(adapter) => { let id = match meta.live_count { Some(id) => id, @@ -99,10 +100,10 @@ pub fn process(module: &mut Module) -> Result<()> { AuxImport::Intrinsic(Intrinsic::ExternrefHeapLiveCount) => {} _ => continue, } - instr.instr = Instruction::Standard(wit_walrus::Instruction::CallCore(id)); + instr.instr = Instruction::CallCore(id); } - // Optional externref values are now managed in the wasm module, so + // Optional externref values are now managed in the Wasm module, so // we need to store where they're managed. Instruction::I32FromOptionExternref { ref mut table_and_alloc, @@ -110,7 +111,10 @@ pub fn process(module: &mut Module) -> Result<()> { *table_and_alloc = meta.alloc.map(|id| (meta.table, id)); } - Instruction::UnwrapResult { + Instruction::ExternrefLoadOwned { + ref mut table_and_drop, + } + | Instruction::UnwrapResult { ref mut table_and_drop, } | Instruction::UnwrapResultString { @@ -118,6 +122,7 @@ pub fn process(module: &mut Module) -> Result<()> { } => { *table_and_drop = meta.drop.map(|id| (meta.table, id)); } + Instruction::CachedStringLoad { ref mut table, .. } => *table = Some(meta.table), _ => continue, }; } @@ -132,7 +137,7 @@ fn find_call_export(instrs: &[InstructionData]) -> Option { instrs .iter() .enumerate() - .filter_map(|(i, instr)| match instr.instr { + .find_map(|(i, instr)| match instr.instr { Instruction::CallExport(e) => Some(Export::Export(e)), Instruction::CallTableElement(e) => Some(Export::TableElement { idx: e, @@ -140,7 +145,6 @@ fn find_call_export(instrs: &[InstructionData]) -> Option { }), _ => None, }) - .next() } enum Export { @@ -174,14 +178,11 @@ fn import_xform( let mut to_delete = Vec::new(); let mut iter = instrs.iter().enumerate(); let mut args = Vec::new(); - while let Some((i, instr)) = iter.next() { + for (i, instr) in iter.by_ref() { match instr.instr { Instruction::CallAdapter(_) => break, - Instruction::ExternrefLoadOwned | Instruction::TableGet => { - let owned = match instr.instr { - Instruction::TableGet => false, - _ => true, - }; + Instruction::ExternrefLoadOwned { .. } | Instruction::TableGet => { + let owned = !matches!(instr.instr, Instruction::TableGet); let mut arg: Arg = match args.pop().unwrap() { Some(arg) => arg, None => panic!("previous instruction must be `arg.get`"), @@ -195,7 +196,7 @@ fn import_xform( args.push(Some(arg)); to_delete.push(i); } - Instruction::Standard(wit_walrus::Instruction::ArgGet(n)) => { + Instruction::ArgGet(n) => { args.push(Some(Arg { idx: n as usize, externref: None, @@ -218,19 +219,13 @@ fn import_xform( } let mut ret_externref = false; - while let Some((i, instr)) = iter.next() { - match instr.instr { - Instruction::I32FromExternrefOwned => { - assert_eq!(results.len(), 1); - match results[0] { - AdapterType::I32 => {} - _ => panic!("must be `i32` type"), - } - results[0] = AdapterType::Externref; - ret_externref = true; - to_delete.push(i); - } - _ => {} + for (i, instr) in iter { + if matches!(instr.instr, Instruction::I32FromExternrefOwned) { + assert_eq!(results.len(), 1); + assert!(matches!(results[0], AdapterType::I32), "must be `i32` type"); + results[0] = AdapterType::Externref; + ret_externref = true; + to_delete.push(i); } } @@ -270,7 +265,7 @@ fn export_xform(cx: &mut Context, export: Export, instrs: &mut Vec break, Instruction::I32FromExternrefOwned => { @@ -299,13 +294,16 @@ fn export_xform(cx: &mut Context, export: Export, instrs: &mut Vec { + Instruction::LoadRetptr { .. } => uses_retptr = true, + Instruction::ExternrefLoadOwned { .. } if !uses_retptr => { ret_externref = true; to_delete.push(i); } @@ -335,7 +333,7 @@ fn export_xform(cx: &mut Context, export: Export, instrs: &mut Vec 0 { + // indices directly into the Wasm module. + if !aux.imports_with_catch.is_empty() { return true; } @@ -359,41 +357,37 @@ fn module_needs_externref_metadata(aux: &WasmBindgenAux, section: &NonstandardWi AdapterKind::Local { instructions } => instructions, AdapterKind::Import { .. } => return false, }; - instructions.iter().any(|instr| match instr.instr { - VectorToMemory { - kind: VectorKind::Externref | VectorKind::NamedExternref(_), - .. - } - | MutableSliceToMemory { - kind: VectorKind::Externref | VectorKind::NamedExternref(_), - .. - } - | OptionVector { - kind: VectorKind::Externref | VectorKind::NamedExternref(_), - .. - } - | VectorLoad { - kind: VectorKind::Externref | VectorKind::NamedExternref(_), - .. - } - | OptionVectorLoad { - kind: VectorKind::Externref | VectorKind::NamedExternref(_), - .. - } - | View { - kind: VectorKind::Externref | VectorKind::NamedExternref(_), - .. - } - | OptionView { - kind: VectorKind::Externref | VectorKind::NamedExternref(_), - .. - } => true, - _ => false, + instructions.iter().any(|instr| { + matches!( + instr.instr, + VectorToMemory { + kind: VectorKind::Externref | VectorKind::NamedExternref(_), + .. + } | MutableSliceToMemory { + kind: VectorKind::Externref | VectorKind::NamedExternref(_), + .. + } | OptionVector { + kind: VectorKind::Externref | VectorKind::NamedExternref(_), + .. + } | VectorLoad { + kind: VectorKind::Externref | VectorKind::NamedExternref(_), + .. + } | OptionVectorLoad { + kind: VectorKind::Externref | VectorKind::NamedExternref(_), + .. + } | View { + kind: VectorKind::Externref | VectorKind::NamedExternref(_), + .. + } | OptionView { + kind: VectorKind::Externref | VectorKind::NamedExternref(_), + .. + } + ) }) }) } -/// In MVP wasm all element segments must be contiguous lists of function +/// In MVP Wasm all element segments must be contiguous lists of function /// indices. Post-MVP with reference types element segments can have holes. /// While `walrus` will select the encoding that fits, this function forces the /// listing of segments to be MVP-compatible. @@ -404,11 +398,22 @@ pub fn force_contiguous_elements(module: &mut Module) -> Result<()> { // Here we take a look at all element segments in the module to see if we // need to split them. for segment in module.elements.iter_mut() { - // If this segment has all-`Some` members then it's alrady contiguous - // and we can skip it. - if segment.members.iter().all(|m| m.is_some()) { - continue; - } + let (ty, items) = match &mut segment.items { + ElementItems::Expressions(ty, items) => { + // If this segment has no null reference members then it's already + // contiguous and we can skip it. + if items + .iter() + .all(|item| !matches!(item, ConstExpr::RefNull(_))) + { + continue; + } + + (*ty, items) + } + // Function index segments don't have holes. + ElementItems::Functions(_) => continue, + }; // For now active segments are all we're interested in since // passive/declared have no hope of being MVP-compatible anyway. @@ -417,7 +422,7 @@ pub fn force_contiguous_elements(module: &mut Module) -> Result<()> { let (table, offset) = match &segment.kind { ElementKind::Active { table, - offset: InitExpr::Value(Value::I32(n)), + offset: ConstExpr::Value(Value::I32(n)), } => (*table, *n), _ => continue, }; @@ -432,16 +437,13 @@ pub fn force_contiguous_elements(module: &mut Module) -> Result<()> { // offset. let mut commit = |last_idx: usize, block: Vec<_>| { let new_offset = offset + (last_idx - block.len()) as i32; - let new_offset = InitExpr::Value(Value::I32(new_offset)); - new_segments.push((table, new_offset, segment.ty, block)); + let new_offset = ConstExpr::Value(Value::I32(new_offset)); + new_segments.push((table, new_offset, ty, block)); }; - for (i, id) in segment.members.iter().enumerate() { - match id { - // If we find a function, then we either start a new block or - // push it onto the existing block. - Some(id) => block.get_or_insert(Vec::new()).push(Some(*id)), - None => { - let block = match block.take() { + for (i, expr) in items.iter().enumerate() { + match expr { + ConstExpr::RefNull(_) => { + let block: Vec<_> = match block.take() { Some(b) => b, None => continue, }; @@ -456,21 +458,25 @@ pub fn force_contiguous_elements(module: &mut Module) -> Result<()> { commit(i, block); } } + // If we find a function, then we either start a new block or + // push it onto the existing block. + _ => block.get_or_insert(Vec::new()).push(*expr), } } // If there's no trailing empty slots then we commit the last block onto // the new segment list. if let Some(block) = block { - commit(segment.members.len(), block); + commit(items.len(), block); } - segment.members.truncate(truncate); + items.truncate(truncate); } for (table, offset, ty, members) in new_segments { - let id = module - .elements - .add(ElementKind::Active { table, offset }, ty, members); + let id = module.elements.add( + ElementKind::Active { table, offset }, + ElementItems::Expressions(ty, members), + ); module.tables.get_mut(table).elem_segments.insert(id); } Ok(()) diff --git a/crates/cli-support/src/intrinsic.rs b/crates/cli-support/src/intrinsic.rs index efdc131ca21..6141fdb4a52 100644 --- a/crates/cli-support/src/intrinsic.rs +++ b/crates/cli-support/src/intrinsic.rs @@ -51,15 +51,6 @@ macro_rules! intrinsics { )* } } - - /// Returns the symbol name of this intrinsic - pub fn name(&self) -> &'static str { - match self { - $( - Intrinsic::$name => $sym, - )* - } - } } }; } @@ -80,6 +71,18 @@ fn opt_f64() -> Descriptor { Descriptor::Option(Box::new(Descriptor::F64)) } +fn opt_i64() -> Descriptor { + Descriptor::Option(Box::new(Descriptor::I64)) +} + +fn slice(contents: Descriptor) -> Descriptor { + Descriptor::Ref(Box::new(Descriptor::Slice(Box::new(contents)))) +} + +fn vector(contents: Descriptor) -> Descriptor { + Descriptor::Vector(Box::new(contents)) +} + intrinsics! { pub enum Intrinsic { #[symbol = "__wbindgen_jsval_eq"] @@ -91,6 +94,9 @@ intrinsics! { #[symbol = "__wbindgen_is_function"] #[signature = fn(ref_externref()) -> Boolean] IsFunction, + #[symbol = "__wbindgen_is_array"] + #[signature = fn(ref_externref()) -> Boolean] + IsArray, #[symbol = "__wbindgen_is_undefined"] #[signature = fn(ref_externref()) -> Boolean] IsUndefined, @@ -193,9 +199,24 @@ intrinsics! { #[symbol = "__wbindgen_number_new"] #[signature = fn(F64) -> Externref] NumberNew, - #[symbol = "__wbindgen_bigint_new"] + #[symbol = "__wbindgen_bigint_from_str"] #[signature = fn(ref_string()) -> Externref] - BigIntNew, + BigIntFromStr, + #[symbol = "__wbindgen_bigint_from_i64"] + #[signature = fn(I64) -> Externref] + BigIntFromI64, + #[symbol = "__wbindgen_bigint_from_u64"] + #[signature = fn(U64) -> Externref] + BigIntFromU64, + #[symbol = "__wbindgen_bigint_from_i128"] + #[signature = fn(I64, U64) -> Externref] + BigIntFromI128, + #[symbol = "__wbindgen_bigint_from_u128"] + #[signature = fn(U64, U64) -> Externref] + BigIntFromU128, + #[symbol = "__wbindgen_bigint_get_as_i64"] + #[signature = fn(ref_externref()) -> opt_i64()] + BigIntGetAsI64, #[symbol = "__wbindgen_string_new"] #[signature = fn(ref_string()) -> Externref] StringNew, @@ -226,6 +247,9 @@ intrinsics! { #[symbol = "__wbindgen_memory"] #[signature = fn() -> Externref] Memory, + #[symbol = "__wbindgen_exports"] + #[signature = fn() -> Externref] + Exports, #[symbol = "__wbindgen_module"] #[signature = fn() -> Externref] Module, @@ -241,6 +265,48 @@ intrinsics! { #[symbol = "__wbindgen_json_serialize"] #[signature = fn(ref_externref()) -> String] JsonSerialize, + #[symbol = "__wbindgen_copy_to_typed_array"] + #[signature = fn(slice(U8), ref_externref()) -> Unit] + CopyToTypedArray, + #[symbol = "__wbindgen_uint8_array_new"] + #[signature = fn(vector(U8)) -> Externref] + Uint8ArrayNew, + #[symbol = "__wbindgen_uint8_clamped_array_new"] + #[signature = fn(vector(ClampedU8)) -> Externref] + Uint8ClampedArrayNew, + #[symbol = "__wbindgen_uint16_array_new"] + #[signature = fn(vector(U16)) -> Externref] + Uint16ArrayNew, + #[symbol = "__wbindgen_uint32_array_new"] + #[signature = fn(vector(U32)) -> Externref] + Uint32ArrayNew, + #[symbol = "__wbindgen_biguint64_array_new"] + #[signature = fn(vector(U64)) -> Externref] + BigUint64ArrayNew, + #[symbol = "__wbindgen_int8_array_new"] + #[signature = fn(vector(I8)) -> Externref] + Int8ArrayNew, + #[symbol = "__wbindgen_int16_array_new"] + #[signature = fn(vector(I16)) -> Externref] + Int16ArrayNew, + #[symbol = "__wbindgen_int32_array_new"] + #[signature = fn(vector(I32)) -> Externref] + Int32ArrayNew, + #[symbol = "__wbindgen_bigint64_array_new"] + #[signature = fn(vector(I64)) -> Externref] + BigInt64ArrayNew, + #[symbol = "__wbindgen_float32_array_new"] + #[signature = fn(vector(F32)) -> Externref] + Float32ArrayNew, + #[symbol = "__wbindgen_float64_array_new"] + #[signature = fn(vector(F64)) -> Externref] + Float64ArrayNew, + #[symbol = "__wbindgen_array_new"] + #[signature = fn() -> Externref] + ArrayNew, + #[symbol = "__wbindgen_array_push"] + #[signature = fn(ref_externref(), Externref) -> Unit] + ArrayPush, #[symbol = "__wbindgen_externref_heap_live_count"] #[signature = fn() -> I32] ExternrefHeapLiveCount, diff --git a/crates/cli-support/src/js/binding.rs b/crates/cli-support/src/js/binding.rs index 9eb290ae350..09501a67b40 100644 --- a/crates/cli-support/src/js/binding.rs +++ b/crates/cli-support/src/js/binding.rs @@ -6,9 +6,13 @@ use crate::js::Context; use crate::wit::InstructionData; -use crate::wit::{Adapter, AdapterId, AdapterKind, AdapterType, Instruction}; +use crate::wit::{ + Adapter, AdapterId, AdapterKind, AdapterType, AuxFunctionArgumentData, Instruction, +}; use anyhow::{anyhow, bail, Error}; -use walrus::Module; +use std::collections::HashSet; +use std::fmt::Write; +use walrus::{Module, ValType}; /// A one-size-fits-all builder for processing WebIDL bindings and generating /// JS. @@ -35,10 +39,16 @@ pub struct JsBuilder<'a, 'b> { /// JS functions, etc. cx: &'a mut Context<'b>, + /// A debug name for the function being generated, used for error messages + debug_name: &'a str, + /// The "prelude" of the function, or largely just the JS function we've /// built so far. prelude: String, + /// Code which should go before the `try {` in a try-finally block. + pre_try: String, + /// JS code to execute in a `finally` block in case any exceptions happen. finally: String, @@ -50,7 +60,7 @@ pub struct JsBuilder<'a, 'b> { /// use to translate the `arg.get` instruction. args: Vec, - /// The wasm interface types "stack". The expressions pushed onto this stack + /// The Wasm interface types "stack". The expressions pushed onto this stack /// are intended to be *pure*, and if they're not, they should be pushed /// into the `prelude`, assigned to a variable, and the variable should be /// pushed to the stack. We're not super principled about this though, so @@ -62,13 +72,26 @@ pub struct JsFunction { pub code: String, pub ts_sig: String, pub js_doc: String, + pub ts_doc: String, pub ts_arg_tys: Vec, pub ts_ret_ty: Option, + pub ts_refs: HashSet, + /// Whether this function has a single optional argument. + /// + /// If the function is a setter, that means that the field it sets is optional. pub might_be_optional_field: bool, pub catch: bool, pub log_error: bool, } +/// A references to an (likely) exported symbol used in TS type expression. +/// +/// Right now, only string enum require this type of anaylsis. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum TsReference { + StringEnum(String), +} + impl<'a, 'b> Builder<'a, 'b> { pub fn new(cx: &'a mut Context<'b>) -> Builder<'a, 'b> { Builder { @@ -100,8 +123,13 @@ impl<'a, 'b> Builder<'a, 'b> { &mut self, adapter: &Adapter, instructions: &[InstructionData], - explicit_arg_names: &Option>, + args_data: &Option>, asyncness: bool, + variadic: bool, + generate_jsdoc: bool, + debug_name: &str, + ret_ty_override: &Option, + ret_desc: &Option, ) -> Result { if self .cx @@ -119,30 +147,31 @@ impl<'a, 'b> Builder<'a, 'b> { // If this is a method then we're generating this as part of a class // method, so the leading parameter is the this pointer stored on // the JS object, so synthesize that here. - let mut js = JsBuilder::new(self.cx); - match self.method { - Some(consumes_self) => { - drop(params.next()); - if js.cx.config.debug { - js.prelude( - "if (this.ptr == 0) throw new Error('Attempt to use a moved value');", - ); - } - if consumes_self { - js.prelude("const ptr = this.__destroy_into_raw();"); - js.args.push("ptr".into()); - } else { - js.args.push("this.ptr".into()); - } + let mut js = JsBuilder::new(self.cx, debug_name); + if let Some(consumes_self) = self.method { + let _ = params.next(); + if js.cx.config.debug { + js.prelude( + "if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value');", + ); + } + if consumes_self { + js.prelude("const ptr = this.__destroy_into_raw();"); + js.args.push("ptr".into()); + } else { + js.args.push("this.__wbg_ptr".into()); } - None => {} } for (i, param) in params.enumerate() { - let arg = match explicit_arg_names { + let arg = match args_data { Some(list) => list[i].clone(), - None => format!("arg{}", i), + None => AuxFunctionArgumentData { + name: format!("arg{}", i), + ty_override: None, + desc: None, + }, }; - js.args.push(arg.clone()); + js.args.push(arg.name.clone()); function_args.push(arg); arg_tys.push(param); } @@ -158,12 +187,22 @@ impl<'a, 'b> Builder<'a, 'b> { // We don't actually manage a literal stack at runtime, but instead we // act as more of a compiler to generate straight-line code to make it // more JIT-friendly. The generated code should be equivalent to the - // wasm interface types stack machine, however. + // Wasm interface types stack machine, however. for instr in instructions { - instruction(&mut js, &instr.instr, &mut self.log_error)?; - } - - assert_eq!(js.stack.len(), adapter.results.len()); + instruction( + &mut js, + &instr.instr, + &mut self.log_error, + &self.constructor, + )?; + } + + assert_eq!( + js.stack.len(), + adapter.results.len(), + "stack size mismatch for {}", + debug_name + ); match js.stack.len() { 0 => {} 1 => { @@ -192,14 +231,28 @@ impl<'a, 'b> Builder<'a, 'b> { // } let mut code = String::new(); - code.push_str("("); - code.push_str(&function_args.join(", ")); - code.push_str(") {\n"); + code.push('('); + for (i, v) in function_args.iter().enumerate() { + if i != 0 { + code.push_str(", "); + } + + if variadic && i == function_args.len() - 1 { + code.push_str("..."); + } - let mut call = js.prelude; - if js.finally.len() != 0 { - call = format!("try {{\n{}}} finally {{\n{}}}\n", call, js.finally); + code.push_str(&v.name); } + code.push_str(") {\n"); + + let call = if !js.finally.is_empty() { + format!( + "{}try {{\n{}}} finally {{\n{}}}\n", + js.pre_try, js.prelude, js.finally + ) + } else { + js.pre_try + &js.prelude + }; if self.catch { js.cx.expose_handle_error()?; @@ -214,27 +267,51 @@ impl<'a, 'b> Builder<'a, 'b> { } code.push_str(&call); - code.push_str("}"); + code.push('}'); // Rust Structs' fields converted into Getter and Setter functions before // we decode them from webassembly, finding if a function is a field // should start from here. Struct fields(Getter) only have one arg, and // this is the clue we can infer if a function might be a field. let mut might_be_optional_field = false; - let (ts_sig, ts_arg_tys, ts_ret_ty) = self.typescript_signature( + let (ts_sig, ts_arg_tys, ts_ret_ty, ts_refs) = self.typescript_signature( &function_args, &arg_tys, &adapter.inner_results, &mut might_be_optional_field, asyncness, + variadic, + ret_ty_override, ); - let js_doc = self.js_doc_comments(&function_args, &arg_tys, &ts_ret_ty); + let js_doc = if generate_jsdoc { + self.js_doc_comments( + &function_args, + &arg_tys, + &ts_ret_ty, + variadic, + ret_ty_override, + ret_desc, + ) + } else { + String::new() + }; + + // generate ts_doc + // ts doc is slightly different than js doc, where there is no + // arguments types followed after @param tag, as well as no special + // casings for arguments names such as "@param {string} [arg]" that + // tags the argument as optional, for ts doc we only need arg names + // and rest are just derived from function ts signature + let ts_doc = self.ts_doc_comments(&function_args, ret_desc); + Ok(JsFunction { code, ts_sig, js_doc, + ts_doc, ts_arg_tys, ts_ret_ty, + ts_refs, might_be_optional_field, catch: self.catch, log_error: self.log_error, @@ -248,17 +325,26 @@ impl<'a, 'b> Builder<'a, 'b> { /// return value, it doesn't include the function name in any way. fn typescript_signature( &self, - arg_names: &[String], + args_data: &[AuxFunctionArgumentData], arg_tys: &[&AdapterType], result_tys: &[AdapterType], might_be_optional_field: &mut bool, asyncness: bool, - ) -> (String, Vec, Option) { + variadic: bool, + ret_ty_override: &Option, + ) -> (String, Vec, Option, HashSet) { // Build up the typescript signature as well let mut omittable = true; let mut ts_args = Vec::new(); let mut ts_arg_tys = Vec::new(); - for (name, ty) in arg_names.iter().zip(arg_tys).rev() { + let mut ts_refs = HashSet::new(); + for ( + AuxFunctionArgumentData { + name, ty_override, .. + }, + ty, + ) in args_data.iter().zip(arg_tys).rev() + { // In TypeScript, we can mark optional parameters as omittable // using the `?` suffix, but only if they're not followed by // non-omittable parameters. Therefore iterate the parameter list @@ -266,15 +352,23 @@ impl<'a, 'b> Builder<'a, 'b> { // soon as a non-optional parameter is encountered. let mut arg = name.to_string(); let mut ts = String::new(); - match ty { - AdapterType::Option(ty) if omittable => { - arg.push_str("?: "); - adapter2ts(ty, &mut ts); - } - ty => { - omittable = false; - arg.push_str(": "); - adapter2ts(ty, &mut ts); + if let Some(v) = ty_override { + omittable = false; + arg.push_str(": "); + ts.push_str(v); + } else { + match ty { + AdapterType::Option(ty) if omittable => { + // e.g. `foo?: string | null` + arg.push_str("?: "); + adapter2ts(ty, TypePosition::Argument, &mut ts, Some(&mut ts_refs)); + ts.push_str(" | null"); + } + ty => { + adapter2ts(ty, TypePosition::Argument, &mut ts, Some(&mut ts_refs)); + omittable = false; + arg.push_str(": "); + } } } arg.push_str(&ts); @@ -283,7 +377,19 @@ impl<'a, 'b> Builder<'a, 'b> { } ts_args.reverse(); ts_arg_tys.reverse(); - let mut ts = format!("({})", ts_args.join(", ")); + let mut ts = String::from("("); + if variadic { + if let Some((last, non_variadic_args)) = ts_args.split_last() { + ts.push_str(&non_variadic_args.join(", ")); + if !non_variadic_args.is_empty() { + ts.push_str(", "); + } + ts.push_str((String::from("...") + last).as_str()) + } + } else { + ts.push_str(&ts_args.join(", ")); + }; + ts.push(')'); // If this function is an optional field's setter, it should have only // one arg, and omittable should be `true`. @@ -296,10 +402,19 @@ impl<'a, 'b> Builder<'a, 'b> { if self.constructor.is_none() { ts.push_str(": "); let mut ret = String::new(); - match result_tys.len() { - 0 => ret.push_str("void"), - 1 => adapter2ts(&result_tys[0], &mut ret), - _ => ret.push_str("[any]"), + if let Some(v) = &ret_ty_override { + ret.push_str(v); + } else { + match result_tys.len() { + 0 => ret.push_str("void"), + 1 => adapter2ts( + &result_tys[0], + TypePosition::Return, + &mut ret, + Some(&mut ts_refs), + ), + _ => ret.push_str("[any]"), + } } if asyncness { ret = format!("Promise<{}>", ret); @@ -307,40 +422,149 @@ impl<'a, 'b> Builder<'a, 'b> { ts.push_str(&ret); ts_ret = Some(ret); } - return (ts, ts_arg_tys, ts_ret); + (ts, ts_arg_tys, ts_ret, ts_refs) } /// Returns a helpful JS doc comment which lists types for all parameters /// and the return value. fn js_doc_comments( &self, - arg_names: &[String], + args_data: &[AuxFunctionArgumentData], arg_tys: &[&AdapterType], ts_ret: &Option, + variadic: bool, + ret_ty_override: &Option, + ret_desc: &Option, ) -> String { - let mut ret = String::new(); - for (name, ty) in arg_names.iter().zip(arg_tys) { - ret.push_str("@param {"); - adapter2ts(ty, &mut ret); + let (variadic_arg, fn_arg_names) = match args_data.split_last() { + Some((last, args)) if variadic => (Some(last), args), + _ => (None, args_data), + }; + + let mut omittable = true; + let mut js_doc_args = Vec::new(); + + for ( + AuxFunctionArgumentData { + name, + ty_override, + desc, + }, + ty, + ) in fn_arg_names.iter().zip(arg_tys).rev() + { + let mut arg = "@param {".to_string(); + + if let Some(v) = ty_override { + omittable = false; + arg.push_str(v); + arg.push_str("} "); + arg.push_str(name); + } else { + match ty { + AdapterType::Option(ty) if omittable => { + adapter2ts(ty, TypePosition::Argument, &mut arg, None); + arg.push_str(" | null} "); + arg.push('['); + arg.push_str(name); + arg.push(']'); + } + _ => { + omittable = false; + adapter2ts(ty, TypePosition::Argument, &mut arg, None); + arg.push_str("} "); + arg.push_str(name); + } + } + } + // append description + if let Some(v) = desc { + arg.push_str(" - "); + arg.push_str(v); + } + arg.push('\n'); + js_doc_args.push(arg); + } + + let mut ret: String = js_doc_args.into_iter().rev().collect(); + + if let ( + Some(AuxFunctionArgumentData { + name, + ty_override, + desc, + }), + Some(ty), + ) = (variadic_arg, arg_tys.last()) + { + ret.push_str("@param {..."); + if let Some(v) = ty_override { + ret.push_str(v); + } else { + adapter2ts(ty, TypePosition::Argument, &mut ret, None); + } ret.push_str("} "); ret.push_str(name); - ret.push_str("\n"); + + // append desc + if let Some(v) = desc { + ret.push_str(" - "); + ret.push_str(v); + } + ret.push('\n'); } - if let Some(ts) = ts_ret { - if ts != "void" { + if let Some(ts) = ret_ty_override.as_ref().or(ts_ret.as_ref()) { + // skip if type is void and there is no description + if ts != "void" || ret_desc.is_some() { ret.push_str(&format!("@returns {{{}}}", ts)); } + // append return description + if let Some(v) = ret_desc { + ret.push(' '); + ret.push_str(v); + } } ret } + + /// Returns a helpful TS doc comment which lists all parameters and + /// the return value descriptions. + fn ts_doc_comments( + &self, + args_data: &[AuxFunctionArgumentData], + ret_desc: &Option, + ) -> String { + let mut ts_doc = String::new(); + // ofc we dont need arg type for ts doc, only arg name + for AuxFunctionArgumentData { name, desc, .. } in args_data.iter() { + ts_doc.push_str("@param "); + ts_doc.push_str(name); + + // append desc + if let Some(v) = desc { + ts_doc.push_str(" - "); + ts_doc.push_str(v); + } + ts_doc.push('\n'); + } + + // only if there is return description, as we dont want empty @return tag + if let Some(ret_desc) = ret_desc { + ts_doc.push_str("@returns "); + ts_doc.push_str(ret_desc); + } + ts_doc + } } impl<'a, 'b> JsBuilder<'a, 'b> { - pub fn new(cx: &'a mut Context<'b>) -> JsBuilder<'a, 'b> { + pub fn new(cx: &'a mut Context<'b>, debug_name: &'a str) -> JsBuilder<'a, 'b> { JsBuilder { cx, + debug_name, args: Vec::new(), tmp: 0, + pre_try: String::new(), finally: String::new(), prelude: String::new(), stack: Vec::new(), @@ -355,7 +579,7 @@ impl<'a, 'b> JsBuilder<'a, 'b> { for line in prelude.trim().lines().map(|l| l.trim()) { if !line.is_empty() { self.prelude.push_str(line); - self.prelude.push_str("\n"); + self.prelude.push('\n'); } } } @@ -364,7 +588,7 @@ impl<'a, 'b> JsBuilder<'a, 'b> { for line in finally.trim().lines().map(|l| l.trim()) { if !line.is_empty() { self.finally.push_str(line); - self.finally.push_str("\n"); + self.finally.push('\n'); } } } @@ -372,11 +596,14 @@ impl<'a, 'b> JsBuilder<'a, 'b> { pub fn tmp(&mut self) -> usize { let ret = self.tmp; self.tmp += 1; - return ret; + ret } fn pop(&mut self) -> String { - self.stack.pop().unwrap() + match self.stack.pop() { + Some(s) => s, + None => panic!("popping an empty stack in {}", self.debug_name), + } } fn push(&mut self, arg: String) { @@ -396,6 +623,14 @@ impl<'a, 'b> JsBuilder<'a, 'b> { self.prelude(&format!("_assertNum({});", arg)); } + fn assert_bigint(&mut self, arg: &str) { + if !self.cx.config.debug { + return; + } + self.cx.expose_assert_bigint(); + self.prelude(&format!("_assertBigInt({});", arg)); + } + fn assert_bool(&mut self, arg: &str) { if !self.cx.config.debug { return; @@ -414,6 +649,26 @@ impl<'a, 'b> JsBuilder<'a, 'b> { self.prelude("}"); } + fn assert_non_null(&mut self, arg: &str) { + self.cx.expose_assert_non_null(); + self.prelude(&format!("_assertNonNull({});", arg)); + } + + fn assert_char(&mut self, arg: &str) { + self.cx.expose_assert_char(); + self.prelude(&format!("_assertChar({});", arg)); + } + + fn assert_optional_bigint(&mut self, arg: &str) { + if !self.cx.config.debug { + return; + } + self.cx.expose_is_like_none(); + self.prelude(&format!("if (!isLikeNone({})) {{", arg)); + self.assert_bigint(arg); + self.prelude("}"); + } + fn assert_optional_bool(&mut self, arg: &str) { if !self.cx.config.debug { return; @@ -430,7 +685,7 @@ impl<'a, 'b> JsBuilder<'a, 'b> { } self.prelude(&format!( "\ - if ({0}.ptr === 0) {{ + if ({0}.__wbg_ptr === 0) {{ throw new Error('Attempt to use a moved value'); }} ", @@ -467,31 +722,89 @@ impl<'a, 'b> JsBuilder<'a, 'b> { } } -fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> Result<(), Error> { +fn instruction( + js: &mut JsBuilder, + instr: &Instruction, + log_error: &mut bool, + constructor: &Option, +) -> Result<(), Error> { + fn wasm_to_string_enum(name: &str, index: &str) -> String { + // e.g. ["a","b","c"][someIndex] + format!("__wbindgen_enum_{name}[{index}]") + } + fn string_enum_to_wasm(name: &str, invalid: u32, enum_val: &str) -> String { + // e.g. (["a","b","c"].indexOf(someEnumVal) + 1 || 4) - 1 + // | + // invalid + 1 + // + // The idea is that `indexOf` returns -1 if someEnumVal is invalid, + // and with +1 we get 0 which is falsey, so we can use || to + // substitute invalid+1. Finally, we just do -1 to get the correct + // values for everything. + format!( + "(__wbindgen_enum_{name}.indexOf({enum_val}) + 1 || {invalid}) - 1", + invalid = invalid + 1 + ) + } + + fn int128_to_int64x2(val: &str) -> (String, String) { + // we don't need to perform any conversion here, because the JS + // WebAssembly API will automatically convert the bigints to 64 bits + // for us. This even allows us to ignore signedness. + let low = val.to_owned(); + let high = format!("{val} >> BigInt(64)"); + (low, high) + } + fn int64x2_to_int128(low: String, high: String, signed: bool) -> String { + let low = format!("BigInt.asUintN(64, {low})"); + if signed { + format!("({low} | ({high} << BigInt(64)))") + } else { + format!("({low} | (BigInt.asUintN(64, {high}) << BigInt(64)))") + } + } + match instr { - Instruction::Standard(wit_walrus::Instruction::ArgGet(n)) => { + Instruction::ArgGet(n) => { let arg = js.arg(*n).to_string(); js.push(arg); } - Instruction::Standard(wit_walrus::Instruction::CallAdapter(_)) => { - panic!("standard call adapter functions should be mapped to our adapters"); - } - - Instruction::Standard(wit_walrus::Instruction::CallCore(_)) + Instruction::CallCore(_) | Instruction::CallExport(_) | Instruction::CallAdapter(_) | Instruction::CallTableElement(_) - | Instruction::Standard(wit_walrus::Instruction::DeferCallCore(_)) => { + | Instruction::DeferFree { .. } => { let invoc = Invocation::from(instr, js.cx.module)?; - let (params, results) = invoc.params_results(js.cx); + let (mut params, results) = invoc.params_results(js.cx); - // Pop off the number of parameters for the function we're calling let mut args = Vec::new(); - for _ in 0..params { - args.push(js.pop()); + let tmp = js.tmp(); + if invoc.defer() { + if let Instruction::DeferFree { .. } = instr { + // Ignore `free`'s final `align` argument, since that's manually inserted later. + params -= 1; + } + // If the call is deferred, the arguments to the function still need to be + // accessible in the `finally` block, so we declare variables to hold the args + // outside of the try-finally block and then set those to the args. + for (i, arg) in js.stack[js.stack.len() - params..].iter().enumerate() { + let name = format!("deferred{tmp}_{i}"); + writeln!(js.pre_try, "let {name};").unwrap(); + writeln!(js.prelude, "{name} = {arg};").unwrap(); + args.push(name); + } + if let Instruction::DeferFree { align, .. } = instr { + // add alignment + args.push(align.to_string()); + } + } else { + // Otherwise, pop off the number of parameters for the function we're calling. + for _ in 0..params { + args.push(js.pop()); + } + args.reverse(); } - args.reverse(); // Call the function through an export of the underlying module. let call = invoc.invoke(js.cx, &args, &mut js.prelude, log_error)?; @@ -502,7 +815,6 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> match (invoc.defer(), results) { (true, 0) => { js.finally(&format!("{};", call)); - js.stack.extend(args); } (true, _) => panic!("deferred calls must have no results"), (false, 0) => js.prelude(&format!("{};", call)), @@ -519,43 +831,111 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> } } - Instruction::Standard(wit_walrus::Instruction::IntToWasm { trap: false, .. }) => { + Instruction::Int32ToWasm => { let val = js.pop(); js.assert_number(&val); js.push(val); } + Instruction::WasmToInt32 { unsigned_32 } => { + let val = js.pop(); + if *unsigned_32 { + // When converting to a JS number we need to specially handle the `u32` + // case because if the high bit is set then it comes out as a negative + // number, but we want to switch that to an unsigned representation. + js.push(format!("{} >>> 0", val)) + } else { + js.push(val) + } + } - // When converting to a JS number we need to specially handle the `u32` - // case because if the high bit is set then it comes out as a negative - // number, but we want to switch that to an unsigned representation. - Instruction::Standard(wit_walrus::Instruction::WasmToInt { - trap: false, - output, - .. - }) => { + Instruction::Int64ToWasm => { let val = js.pop(); - match output { - wit_walrus::ValType::U32 => js.push(format!("{} >>> 0", val)), - _ => js.push(val), + js.assert_bigint(&val); + js.push(val); + } + Instruction::WasmToInt64 { unsigned } => { + let val = js.pop(); + if *unsigned { + js.push(format!("BigInt.asUintN(64, {val})")) + } else { + js.push(val) } } - Instruction::Standard(wit_walrus::Instruction::WasmToInt { trap: true, .. }) - | Instruction::Standard(wit_walrus::Instruction::IntToWasm { trap: true, .. }) => { - bail!("trapping wasm-to-int and int-to-wasm instructions not supported") + Instruction::Int128ToWasm => { + let val = js.pop(); + js.assert_bigint(&val); + let (low, high) = int128_to_int64x2(&val); + js.push(low); + js.push(high); + } + Instruction::WasmToInt128 { signed } => { + let high = js.pop(); + let low = js.pop(); + js.push(int64x2_to_int128(low, high, *signed)); + } + + Instruction::OptionInt128ToWasm => { + let val = js.pop(); + js.cx.expose_is_like_none(); + js.assert_optional_bigint(&val); + let (low, high) = int128_to_int64x2(&val); + js.push(format!("!isLikeNone({val})")); + js.push(format!("isLikeNone({val}) ? BigInt(0) : {low}")); + js.push(format!("isLikeNone({val}) ? BigInt(0) : {high}")); + } + Instruction::OptionWasmToInt128 { signed } => { + let high = js.pop(); + let low = js.pop(); + let present = js.pop(); + let val = int64x2_to_int128(low, high, *signed); + js.push(format!("{present} === 0 ? undefined : {val}")); + } + + Instruction::WasmToStringEnum { name } => { + let index = js.pop(); + js.cx.expose_string_enum(name); + js.push(wasm_to_string_enum(name, &index)) + } + + Instruction::OptionWasmToStringEnum { name } => { + // Since hole is currently variant_count+1 and the lookup is + // ["a","b","c"][index], the lookup will implicitly return map + // the hole to undefined, because OOB indexes will return undefined. + let index = js.pop(); + js.cx.expose_string_enum(name); + js.push(wasm_to_string_enum(name, &index)) } - Instruction::Standard(wit_walrus::Instruction::MemoryToString(mem)) => { + Instruction::StringEnumToWasm { name, invalid } => { + let enum_val = js.pop(); + js.cx.expose_string_enum(name); + js.push(string_enum_to_wasm(name, *invalid, &enum_val)) + } + + Instruction::OptionStringEnumToWasm { + name, + invalid, + hole, + } => { + let enum_val = js.pop(); + js.cx.expose_string_enum(name); + let enum_val_expr = string_enum_to_wasm(name, *invalid, &enum_val); + js.cx.expose_is_like_none(); + + // e.g. isLikeNone(someEnumVal) ? 4 : (string_enum_to_wasm(someEnumVal)) + js.push(format!( + "isLikeNone({enum_val}) ? {hole} : ({enum_val_expr})" + )) + } + + Instruction::MemoryToString(mem) => { let len = js.pop(); let ptr = js.pop(); let get = js.cx.expose_get_string_from_wasm(*mem)?; js.push(format!("{}({}, {})", get, ptr, len)); } - Instruction::Standard(wit_walrus::Instruction::StringToMemory { mem, malloc }) => { - js.string_to_memory(*mem, *malloc, None)?; - } - Instruction::StringToMemory { mem, malloc, @@ -575,18 +955,21 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> } Instruction::StoreRetptr { ty, offset, mem } => { - let (mem, size) = match ty { - AdapterType::I32 => (js.cx.expose_int32_memory(*mem), 4), - AdapterType::F32 => (js.cx.expose_f32_memory(*mem), 4), - AdapterType::F64 => (js.cx.expose_f64_memory(*mem), 8), + let mem = js.cx.expose_dataview_memory(*mem); + let (method, size) = match ty { + AdapterType::I32 => ("setInt32", 4), + AdapterType::I64 => ("setBigInt64", 8), + AdapterType::F32 => ("setFloat32", 4), + AdapterType::F64 => ("setFloat64", 8), other => bail!("invalid aggregate return type {:?}", other), }; // Note that we always assume the return pointer is argument 0, // which is currently the case for LLVM. let val = js.pop(); let expr = format!( - "{}()[{} / {} + {}] = {};", + "{}().{}({} + {} * {}, {}, true);", mem, + method, js.arg(0), size, offset, @@ -596,10 +979,12 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> } Instruction::LoadRetptr { ty, offset, mem } => { - let (mem, quads) = match ty { - AdapterType::I32 => (js.cx.expose_int32_memory(*mem), 1), - AdapterType::F32 => (js.cx.expose_f32_memory(*mem), 1), - AdapterType::F64 => (js.cx.expose_f64_memory(*mem), 2), + let mem = js.cx.expose_dataview_memory(*mem); + let (method, quads) = match ty { + AdapterType::I32 => ("getInt32", 1), + AdapterType::I64 => ("getBigInt64", 2), + AdapterType::F32 => ("getFloat32", 1), + AdapterType::F64 => ("getFloat64", 2), other => bail!("invalid aggregate return type {:?}", other), }; let size = quads * 4; @@ -609,7 +994,10 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> // If we're loading from the return pointer then we must have pushed // it earlier, and we always push the same value, so load that value // here - let expr = format!("{}()[retptr / {} + {}]", mem, size, scaled_offset); + let expr = format!( + "{}().{}(retptr + {} * {}, true)", + mem, method, size, scaled_offset + ); js.prelude(&format!("var r{} = {};", offset, expr)); js.push(format!("r{}", offset)); } @@ -623,7 +1011,11 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> Instruction::I32FromStringFirstChar => { let val = js.pop(); - js.push(format!("{}.codePointAt(0)", val)); + let i = js.tmp(); + js.prelude(&format!("const char{i} = {val}.codePointAt(0);")); + let val = format!("char{i}"); + js.assert_char(&val); + js.push(val); } Instruction::I32FromExternrefOwned => { @@ -642,19 +1034,18 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> Instruction::I32FromExternrefRustOwned { class } => { let val = js.pop(); - js.assert_class(&val, &class); + js.assert_class(&val, class); js.assert_not_moved(&val); let i = js.tmp(); - js.prelude(&format!("var ptr{} = {}.ptr;", i, val)); - js.prelude(&format!("{}.ptr = 0;", val)); + js.prelude(&format!("var ptr{} = {}.__destroy_into_raw();", i, val)); js.push(format!("ptr{}", i)); } Instruction::I32FromExternrefRustBorrow { class } => { let val = js.pop(); - js.assert_class(&val, &class); + js.assert_class(&val, class); js.assert_not_moved(&val); - js.push(format!("{}.ptr", val)); + js.push(format!("{}.__wbg_ptr", val)); } Instruction::I32FromOptionRust { class } => { @@ -665,58 +1056,11 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> js.prelude(&format!("if (!isLikeNone({0})) {{", val)); js.assert_class(&val, class); js.assert_not_moved(&val); - js.prelude(&format!("ptr{} = {}.ptr;", i, val)); - js.prelude(&format!("{}.ptr = 0;", val)); + js.prelude(&format!("ptr{} = {}.__destroy_into_raw();", i, val)); js.prelude("}"); js.push(format!("ptr{}", i)); } - Instruction::I32Split64 { signed } => { - let val = js.pop(); - let f = if *signed { - js.cx.expose_int64_cvt_shim() - } else { - js.cx.expose_uint64_cvt_shim() - }; - let i = js.tmp(); - js.prelude(&format!( - " - {f}[0] = {val}; - const low{i} = u32CvtShim[0]; - const high{i} = u32CvtShim[1]; - ", - i = i, - f = f, - val = val, - )); - js.push(format!("low{}", i)); - js.push(format!("high{}", i)); - } - - Instruction::I32SplitOption64 { signed } => { - let val = js.pop(); - js.cx.expose_is_like_none(); - let f = if *signed { - js.cx.expose_int64_cvt_shim() - } else { - js.cx.expose_uint64_cvt_shim() - }; - let i = js.tmp(); - js.prelude(&format!( - "\ - {f}[0] = isLikeNone({val}) ? BigInt(0) : {val}; - const low{i} = u32CvtShim[0]; - const high{i} = u32CvtShim[1]; - ", - i = i, - f = f, - val = val, - )); - js.push(format!("!isLikeNone({0})", val)); - js.push(format!("low{}", i)); - js.push(format!("high{}", i)); - } - Instruction::I32FromOptionExternref { table_and_alloc } => { let val = js.pop(); js.cx.expose_is_like_none(); @@ -748,11 +1092,18 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> Instruction::I32FromOptionChar => { let val = js.pop(); + let i = js.tmp(); js.cx.expose_is_like_none(); - js.push(format!( - "isLikeNone({0}) ? 0xFFFFFF : {0}.codePointAt(0)", + js.prelude(&format!( + "const char{i} = isLikeNone({0}) ? 0xFFFFFF : {0}.codePointAt(0);", val )); + let val = format!("char{i}"); + js.cx.expose_assert_char(); + js.prelude(&format!( + "if ({val} !== 0xFFFFFF) {{ _assertChar({val}); }}" + )); + js.push(val); } Instruction::I32FromOptionEnum { hole } => { @@ -762,12 +1113,63 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> js.push(format!("isLikeNone({0}) ? {1} : {0}", val, hole)); } - Instruction::FromOptionNative { .. } => { + Instruction::F64FromOptionSentinelInt { signed } => { + let val = js.pop(); + js.cx.expose_is_like_none(); + js.assert_optional_number(&val); + + // We need to convert the given number to a 32-bit integer before + // passing it to the ABI for 2 reasons: + // 1. Rust's behavior for `value_f64 as i32/u32` is different from + // the WebAssembly behavior for values outside the 32-bit range. + // We could implement this behavior in Rust too, but it's easier + // to do it in JS. + // 2. If we allowed values outside the 32-bit range, the sentinel + // value itself would be allowed. This would make it impossible + // to distinguish between the sentinel value and a valid value. + // + // To perform the actual conversion, we use JS bit shifts. Handily, + // >> and >>> perform a conversion to i32 and u32 respectively + // to apply the bit shift, so we can use e.g. x >>> 0 to convert to + // u32. + + let op = if *signed { ">>" } else { ">>>" }; + js.push(format!("isLikeNone({val}) ? 0x100000001 : ({val}) {op} 0")); + } + Instruction::F64FromOptionSentinelF32 => { let val = js.pop(); js.cx.expose_is_like_none(); js.assert_optional_number(&val); + + // Similar to the above 32-bit integer variant, we convert the + // number to a 32-bit *float* before passing it to the ABI. This + // ensures consistent behavior with WebAssembly and makes it + // possible to use a sentinel value. + + js.push(format!( + "isLikeNone({val}) ? 0x100000001 : Math.fround({val})" + )); + } + + Instruction::FromOptionNative { ty } => { + let val = js.pop(); + js.cx.expose_is_like_none(); + if *ty == ValType::I64 { + js.assert_optional_bigint(&val); + } else { + js.assert_optional_number(&val); + } js.push(format!("!isLikeNone({0})", val)); - js.push(format!("isLikeNone({0}) ? 0 : {0}", val)); + js.push(format!( + "isLikeNone({val}) ? {zero} : {val}", + zero = if *ty == ValType::I64 { + // We can't use bigint literals for now. See: + // https://github.com/rustwasm/wasm-bindgen/issues/4246 + "BigInt(0)" + } else { + "0" + } + )); } Instruction::VectorToMemory { kind, malloc, mem } => { @@ -895,15 +1297,8 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> js.push(format!("len{}", i)); } - Instruction::MutableSliceToMemory { - kind, - malloc, - mem, - free, - } => { - // First up, pass the JS value into wasm, getting out a pointer and - // a length. These two pointer/length values get pushed onto the - // value stack. + Instruction::MutableSliceToMemory { kind, malloc, mem } => { + // Copy the contents of the typed array into wasm. let val = js.pop(); let func = js.cx.pass_to_wasm_function(kind.clone(), *mem)?; let malloc = js.cx.export_name_of(*malloc); @@ -916,25 +1311,12 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> malloc = malloc, )); js.prelude(&format!("var len{} = WASM_VECTOR_LEN;", i)); + // Then pass it the pointer and the length of where we copied it. js.push(format!("ptr{}", i)); js.push(format!("len{}", i)); - - // Next we set up a `finally` clause which will both update the - // original mutable slice with any modifications, and then free the - // Rust-backed memory. - let free = js.cx.export_name_of(*free); - let get = js.cx.memview_function(kind.clone(), *mem); - js.finally(&format!( - " - {val}.set({get}().subarray(ptr{i} / {size}, ptr{i} / {size} + len{i})); - wasm.{free}(ptr{i}, len{i} * {size}); - ", - val = val, - get = get, - free = free, - size = kind.size(), - i = i, - )); + // Then we give Wasm a reference to the original typed array, so that it can + // update it with modifications made on the Wasm side before returning. + js.push(val); } Instruction::BoolFromI32 => { @@ -942,10 +1324,17 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> js.push(format!("{} !== 0", val)); } - Instruction::ExternrefLoadOwned => { - js.cx.expose_take_object(); + Instruction::ExternrefLoadOwned { table_and_drop } => { + let take_object = if let Some((table, drop)) = *table_and_drop { + js.cx + .expose_take_from_externref_table(table, drop)? + .to_string() + } else { + js.cx.expose_take_object(); + "takeObject".to_string() + }; let val = js.pop(); - js.push(format!("takeObject({})", val)); + js.push(format!("{}({})", take_object, val)); } Instruction::StringFromChar => { @@ -953,62 +1342,53 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> js.push(format!("String.fromCodePoint({})", val)); } - Instruction::I64FromLoHi { signed } => { - let f = if *signed { - js.cx.expose_int64_cvt_shim() - } else { - js.cx.expose_uint64_cvt_shim() - }; - let i = js.tmp(); - let high = js.pop(); - let low = js.pop(); - js.prelude(&format!( - "\ - u32CvtShim[0] = {low}; - u32CvtShim[1] = {high}; - const n{i} = {f}[0]; - ", - low = low, - high = high, - f = f, - i = i, - )); - js.push(format!("n{}", i)) - } - Instruction::RustFromI32 { class } => { - js.cx.require_class_wrap(class); let val = js.pop(); - js.push(format!("{}.__wrap({})", class, val)); + match constructor { + Some(name) if name == class => { + js.prelude(&format!( + " + this.__wbg_ptr = {val} >>> 0; + {name}Finalization.register(this, this.__wbg_ptr, this); + " + )); + js.push(String::from("this")); + } + Some(_) | None => { + js.cx.require_class_wrap(class); + js.push(format!("{}.__wrap({})", class, val)); + } + } } Instruction::OptionRustFromI32 { class } => { - js.cx.require_class_wrap(class); + assert!(constructor.is_none()); let val = js.pop(); + js.cx.require_class_wrap(class); js.push(format!( "{0} === 0 ? undefined : {1}.__wrap({0})", val, class, - )) + )); } Instruction::CachedStringLoad { owned, - optional: _, mem, free, + table, } => { let len = js.pop(); let ptr = js.pop(); let tmp = js.tmp(); - let get = js.cx.expose_get_cached_string_from_wasm(*mem)?; + let get = js.cx.expose_get_cached_string_from_wasm(*mem, *table)?; js.prelude(&format!("var v{} = {}({}, {});", tmp, get, ptr, len)); if *owned { let free = js.cx.export_name_of(*free); js.prelude(&format!( - "if ({ptr} !== 0) {{ wasm.{}({ptr}, {len}); }}", + "if ({ptr} !== 0) {{ wasm.{}({ptr}, {len}, 1); }}", free, ptr = ptr, len = len, @@ -1081,11 +1461,11 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> let free = js.cx.export_name_of(*free); js.prelude(&format!("var v{} = {}({}, {}).slice();", i, f, ptr, len)); js.prelude(&format!( - "wasm.{}({}, {} * {});", + "wasm.{}({}, {} * {size}, {size});", free, ptr, len, - kind.size() + size = kind.size() )); js.push(format!("v{}", i)) } @@ -1100,11 +1480,11 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> js.prelude(&format!("if ({} !== 0) {{", ptr)); js.prelude(&format!("v{} = {}({}, {}).slice();", i, f, ptr, len)); js.prelude(&format!( - "wasm.{}({}, {} * {});", + "wasm.{}({}, {} * {size}, {size});", free, ptr, len, - kind.size() + size = kind.size() )); js.prelude("}"); js.push(format!("v{}", i)); @@ -1129,19 +1509,31 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> )); } + Instruction::OptionF64Sentinel => { + let val = js.pop(); + js.push(format!("{0} === 0x100000001 ? undefined : {0}", val)); + } + Instruction::OptionU32Sentinel => { let val = js.pop(); js.push(format!("{0} === 0xFFFFFF ? undefined : {0}", val)); } - Instruction::ToOptionNative { ty: _, signed } => { + Instruction::ToOptionNative { ty, signed } => { let val = js.pop(); let present = js.pop(); js.push(format!( - "{} === 0 ? undefined : {}{}", + "{} === 0 ? undefined : {}", present, - val, - if *signed { "" } else { " >>> 0" }, + if *signed { + val + } else { + match ty { + ValType::I32 => format!("{val} >>> 0"), + ValType::I64 => format!("BigInt.asUintN(64, {val})"), + _ => unreachable!("unsigned non-integer"), + } + }, )); } @@ -1163,29 +1555,22 @@ fn instruction(js: &mut JsBuilder, instr: &Instruction, log_error: &mut bool) -> js.push(format!("{0} === {1} ? undefined : {0}", val, hole)); } - Instruction::Option64FromI32 { signed } => { - let f = if *signed { - js.cx.expose_int64_cvt_shim() - } else { - js.cx.expose_uint64_cvt_shim() - }; - let i = js.tmp(); - let high = js.pop(); - let low = js.pop(); - let present = js.pop(); - js.prelude(&format!( - " - u32CvtShim[0] = {low}; - u32CvtShim[1] = {high}; - const n{i} = {present} === 0 ? undefined : {f}[0]; - ", - present = present, - low = low, - high = high, - f = f, - i = i, - )); - js.push(format!("n{}", i)); + Instruction::I32FromNonNull => { + let val = js.pop(); + js.assert_non_null(&val); + js.push(val); + } + + Instruction::I32FromOptionNonNull => { + let val = js.pop(); + js.cx.expose_is_like_none(); + js.assert_optional_number(&val); + js.push(format!("isLikeNone({0}) ? 0 : {0}", val)); + } + + Instruction::OptionNonNullFromI32 => { + let val = js.pop(); + js.push(format!("{0} === 0 ? undefined : {0} >>> 0", val)); } } Ok(()) @@ -1200,13 +1585,13 @@ impl Invocation { fn from(instr: &Instruction, module: &Module) -> Result { use Instruction::*; Ok(match instr { - Standard(wit_walrus::Instruction::CallCore(f)) => Invocation::Core { + CallCore(f) => Invocation::Core { id: *f, defer: false, }, - Standard(wit_walrus::Instruction::DeferCallCore(f)) => Invocation::Core { - id: *f, + DeferFree { free, .. } => Invocation::Core { + id: *free, defer: true, }, @@ -1284,7 +1669,18 @@ impl Invocation { } } -fn adapter2ts(ty: &AdapterType, dst: &mut String) { +#[derive(Debug, Clone, Copy)] +enum TypePosition { + Argument, + Return, +} + +fn adapter2ts( + ty: &AdapterType, + position: TypePosition, + dst: &mut String, + refs: Option<&mut HashSet>, +) { match ty { AdapterType::I32 | AdapterType::S8 @@ -1294,18 +1690,34 @@ fn adapter2ts(ty: &AdapterType, dst: &mut String) { | AdapterType::U16 | AdapterType::U32 | AdapterType::F32 - | AdapterType::F64 => dst.push_str("number"), - AdapterType::I64 | AdapterType::S64 | AdapterType::U64 => dst.push_str("BigInt"), + | AdapterType::F64 + | AdapterType::NonNull => dst.push_str("number"), + AdapterType::I64 + | AdapterType::S64 + | AdapterType::U64 + | AdapterType::S128 + | AdapterType::U128 => dst.push_str("bigint"), AdapterType::String => dst.push_str("string"), AdapterType::Externref => dst.push_str("any"), AdapterType::Bool => dst.push_str("boolean"), AdapterType::Vector(kind) => dst.push_str(&kind.js_ty()), AdapterType::Option(ty) => { - adapter2ts(ty, dst); - dst.push_str(" | undefined"); + adapter2ts(ty, position, dst, refs); + dst.push_str(match position { + TypePosition::Argument => " | null | undefined", + TypePosition::Return => " | undefined", + }); } AdapterType::NamedExternref(name) => dst.push_str(name), AdapterType::Struct(name) => dst.push_str(name), + AdapterType::Enum(name) => dst.push_str(name), + AdapterType::StringEnum(name) => { + if let Some(refs) = refs { + refs.insert(TsReference::StringEnum(name.clone())); + } + + dst.push_str(name); + } AdapterType::Function => dst.push_str("any"), } } diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index ed540b0cfe3..3ba5be3a719 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -1,17 +1,23 @@ use crate::descriptor::VectorKind; use crate::intrinsic::Intrinsic; -use crate::wit::{Adapter, AdapterId, AdapterJsImportKind, AuxValue}; +use crate::wit::{ + Adapter, AdapterId, AdapterJsImportKind, AuxExportedMethodKind, AuxReceiverKind, AuxStringEnum, + AuxValue, +}; use crate::wit::{AdapterKind, Instruction, InstructionData}; use crate::wit::{AuxEnum, AuxExport, AuxExportKind, AuxImport, AuxStruct}; use crate::wit::{JsImport, JsImportName, NonstandardWitSection, WasmBindgenAux}; use crate::{reset_indentation, Bindgen, EncodeInto, OutputMode, PLACEHOLDER_MODULE}; use anyhow::{anyhow, bail, Context as _, Error}; +use binding::TsReference; use std::borrow::Cow; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::fmt; +use std::fmt::Write; use std::fs; use std::path::{Path, PathBuf}; use walrus::{FunctionId, ImportId, MemoryId, Module, TableId, ValType}; +use wasm_bindgen_shared::identifier::is_valid_ident; mod binding; @@ -32,7 +38,7 @@ pub struct Context<'a> { /// renames for each identifier. js_imports: HashMap)>>, - /// A map of each wasm import and what JS to hook up to it. + /// A map of each Wasm import and what JS to hook up to it. wasm_import_definitions: HashMap, /// A map from an import to the name we've locally imported it as. @@ -43,40 +49,93 @@ pub struct Context<'a> { /// identifiers. defined_identifiers: HashMap, + /// A set of all (tracked) symbols referenced from within type definitions, + /// function signatures, etc. + typescript_refs: HashSet, + + /// String enums that are used internally by the generated bindings. + /// + /// This tracks which string enums are used independently from whether their + /// type is used, because users may only use them in a way that doesn't + /// require the type or requires only the type. + used_string_enums: HashSet, + exported_classes: Option>, /// A map of the name of npm dependencies we've loaded so far to the path /// they're defined in as well as their version specification. pub npm_dependencies: HashMap, - /// A mapping of a index for memories as we see them. Used in function - /// names. - memory_indices: HashMap, + /// A mapping from the memory IDs as we see them to an index for that memory, + /// used in function names, as well as all the kinds of views we've created + /// of that memory. + /// + /// `BTreeMap` and `BTreeSet` are used to make the ordering deterministic. + memories: BTreeMap)>, table_indices: HashMap, /// A flag to track if the stack pointer setter shim has been injected. stack_pointer_shim_injected: bool, + + /// If threading is enabled. + threads_enabled: bool, } #[derive(Default)] -pub struct ExportedClass { +struct ExportedClass { comments: String, contents: String, + /// The TypeScript for the class's methods. typescript: String, + /// Whether TypeScript for this class should be emitted (i.e., `skip_typescript` wasn't specified). + generate_typescript: bool, has_constructor: bool, wrap_needed: bool, + unwrap_needed: bool, /// Whether to generate helper methods for inspecting the class is_inspectable: bool, /// All readable properties of the class readable_properties: Vec, - /// Map from field name to type as a string, docs plus whether it has a setter - /// and it is optional - typescript_fields: HashMap, + /// Map from field to information about those fields + typescript_fields: HashMap, +} + +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +struct FieldLocation { + name: String, + is_static: bool, +} +#[derive(Debug)] +struct FieldInfo { + name: String, + is_static: bool, + order: usize, + getter: Option, + setter: Option, +} +/// A getter or setter for a field. +#[derive(Debug)] +struct FieldAccessor { + ty: String, + docs: String, + is_optional: bool, +} + +/// Different JS constructs that can be exported. +enum ExportJs<'a> { + /// A class of the form `class Name {...}`. + Class(&'a str), + /// An anonymous function expression of the form `function(...) {...}`. + /// + /// Note that the function name is not included in the string. + Function(&'a str), + /// An arbitrary JS expression. + Expression(&'a str), } const INITIAL_HEAP_VALUES: &[&str] = &["undefined", "null", "true", "false"]; // Must be kept in sync with `src/lib.rs` of the `wasm-bindgen` crate -const INITIAL_HEAP_OFFSET: usize = 32; +const INITIAL_HEAP_OFFSET: usize = 128; impl<'a> Context<'a> { pub fn new( @@ -94,14 +153,17 @@ impl<'a> Context<'a> { js_imports: Default::default(), defined_identifiers: Default::default(), wasm_import_definitions: Default::default(), + typescript_refs: Default::default(), + used_string_enums: Default::default(), exported_classes: Some(Default::default()), config, + threads_enabled: wasm_bindgen_threads_xform::is_enabled(module), module, npm_dependencies: Default::default(), next_export_idx: 0, wit, aux, - memory_indices: Default::default(), + memories: Default::default(), table_indices: Default::default(), stack_pointer_shim_injected: false, }) @@ -114,43 +176,46 @@ impl<'a> Context<'a> { fn export( &mut self, export_name: &str, - contents: &str, + export: ExportJs, comments: Option<&str>, ) -> Result<(), Error> { let definition_name = self.generate_identifier(export_name); - if contents.starts_with("class") && definition_name != export_name { + if matches!(export, ExportJs::Class(_)) && definition_name != export_name { bail!("cannot shadow already defined class `{}`", export_name); } - let contents = contents.trim(); + // write out comments if let Some(c) = comments { self.globals.push_str(c); } + let global = match self.config.mode { - OutputMode::Node { - experimental_modules: false, - } => { - if contents.starts_with("class") { - format!("{}\nmodule.exports.{1} = {1};\n", contents, export_name) - } else { - format!("module.exports.{} = {};\n", export_name, contents) + OutputMode::Node { module: false } => match export { + ExportJs::Class(class) => { + format!("{}\nmodule.exports.{1} = {1};\n", class, export_name) } - } - OutputMode::NoModules { .. } => { - if contents.starts_with("class") { - format!("{}\n__exports.{1} = {1};\n", contents, export_name) - } else { - format!("__exports.{} = {};\n", export_name, contents) + ExportJs::Function(expr) | ExportJs::Expression(expr) => { + format!("module.exports.{} = {};\n", export_name, expr) } - } + }, + OutputMode::NoModules { .. } => match export { + ExportJs::Class(class) => { + format!("{}\n__exports.{1} = {1};\n", class, export_name) + } + ExportJs::Function(expr) | ExportJs::Expression(expr) => { + format!("__exports.{} = {};\n", export_name, expr) + } + }, OutputMode::Bundler { .. } - | OutputMode::Node { - experimental_modules: true, - } + | OutputMode::Node { module: true } | OutputMode::Web - | OutputMode::Deno => { - if contents.starts_with("function") { - let body = &contents[8..]; + | OutputMode::Deno => match export { + ExportJs::Class(class) => { + assert_eq!(export_name, definition_name); + format!("export {}\n", class) + } + ExportJs::Function(function) => { + let body = function.strip_prefix("function").unwrap(); if export_name == definition_name { format!("export function {}{}\n", export_name, body) } else { @@ -159,14 +224,12 @@ impl<'a> Context<'a> { definition_name, body, definition_name, export_name, ) } - } else if contents.starts_with("class") { - assert_eq!(export_name, definition_name); - format!("export {}\n", contents) - } else { + } + ExportJs::Expression(expr) => { assert_eq!(export_name, definition_name); - format!("export const {} = {};\n", export_name, contents) + format!("export const {} = {};\n", export_name, expr) } - } + }, }; self.global(&global); Ok(()) @@ -197,31 +260,37 @@ impl<'a> Context<'a> { fn generate_node_imports(&self) -> String { let mut imports = BTreeSet::new(); - for import in self.module.imports.iter() { + for import in self + .module + .imports + .iter() + .filter(|i| !(matches!(i.kind, walrus::ImportKind::Memory(_)))) + { imports.insert(&import.module); } let mut shim = String::new(); - shim.push_str("let imports = {};\n"); + shim.push_str("\nlet imports = {};\n"); - if self.config.mode.nodejs_experimental_modules() { + if self.config.mode.uses_es_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() { + for (i, module) in imports.iter().enumerate() { + if module.as_str() != PLACEHOLDER_MODULE { shim.push_str(&format!("imports['{}'] = import{};\n", module, i)); + } + } + } else { + for module in imports.iter() { + if module.as_str() == PLACEHOLDER_MODULE { + shim.push_str(&format!( + "imports['{0}'] = module.exports;\n", + PLACEHOLDER_MODULE + )); } else { shim.push_str(&format!("imports['{0}'] = require('{0}');\n", module)); } @@ -231,20 +300,37 @@ impl<'a> Context<'a> { reset_indentation(&shim) } - fn generate_node_wasm_loading(&self, path: &Path) -> String { + fn generate_node_wasm_loading(&mut self, path: &Path) -> String { let mut shim = String::new(); - if self.config.mode.nodejs_experimental_modules() { + let module_name = "wbg"; + if let Some(mem) = self.module.memories.iter().next() { + if let Some(id) = mem.import { + self.module.imports.get_mut(id).module = module_name.to_string(); + shim.push_str(&format!( + "imports.{module_name} = {{ memory: new WebAssembly.Memory({{" + )); + shim.push_str(&format!("initial:{}", mem.initial)); + if let Some(max) = mem.maximum { + shim.push_str(&format!(",maximum:{}", max)); + } + if mem.shared { + shim.push_str(",shared:true"); + } + shim.push_str("}) };"); + } + } + + if self.config.mode.uses_es_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'; + import * as path from 'node:path'; + import * as fs from 'node:fs'; + import * as process from 'node:process'; - let file = path.dirname(url.parse(import.meta.url).pathname); + let file = path.dirname(new URL(import.meta.url).pathname); if (process.platform === 'win32') {{ file = file.substring(1); }} @@ -252,6 +338,14 @@ impl<'a> Context<'a> { ", path.file_name().unwrap().to_str().unwrap() )); + shim.push_str( + " + const wasmModule = new WebAssembly.Module(bytes); + const wasmInstance = new WebAssembly.Instance(wasmModule, imports); + const wasm = wasmInstance.exports; + export const __wasm = wasm; + ", + ); } else { shim.push_str(&format!( " @@ -260,17 +354,16 @@ impl<'a> Context<'a> { ", 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; + ", + ); } - 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) } @@ -294,7 +387,7 @@ impl<'a> Context<'a> { wasm_import_object.push_str(&format!(" {}: {{\n", crate::PLACEHOLDER_MODULE)); - for (id, js) in crate::sorted_iter(&self.wasm_import_definitions) { + for (id, js) in iter_by_import(&self.wasm_import_definitions, self.module) { let import = self.module.imports.get(*id); wasm_import_object.push_str(&format!("{}: {},\n", &import.name, js.trim())); } @@ -337,7 +430,8 @@ impl<'a> Context<'a> { }} const wasmInstance = (await WebAssembly.instantiate(wasmCode, imports)).instance; - const wasm = wasmInstance.exports;", + const wasm = wasmInstance.exports; + export const __wasm = wasm;", module_name = module_name ) } @@ -359,7 +453,7 @@ impl<'a> Context<'a> { } // Depending on the output mode, generate necessary glue to actually - // import the wasm file in one way or another. + // import the Wasm file in one way or another. let mut init = (String::new(), String::new()); let mut footer = String::new(); let mut imports = self.js_import_header()?; @@ -367,24 +461,33 @@ impl<'a> Context<'a> { // In `--target no-modules` mode we need to both expose a name on // the global object as well as generate our own custom start // function. + // `document.currentScript` property can be null in browser extensions OutputMode::NoModules { global } => { js.push_str("const __exports = {};\n"); - js.push_str("let wasm;\n"); + js.push_str("let script_src;\n"); + js.push_str( + "\ + if (typeof document !== 'undefined' && document.currentScript !== null) { + script_src = new URL(document.currentScript.src, location.href).toString(); + }\n", + ); + js.push_str("let wasm = undefined;\n"); init = self.gen_init(needs_manual_start, None)?; - footer.push_str(&format!("{} = Object.assign(init, __exports);\n", global)); + footer.push_str(&format!( + "{} = Object.assign(__wbg_init, {{ initSync }}, __exports);\n", + global + )); } // With normal CommonJS node we need to defer requiring the wasm // until the end so most of our own exports are hooked up - OutputMode::Node { - experimental_modules: false, - } => { + OutputMode::Node { module: 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); + for (id, js) in iter_by_import(&self.wasm_import_definitions, self.module) { + let import = self.module.imports.get(*id); footer.push_str("\nmodule.exports."); footer.push_str(&import.name); footer.push_str(" = "); @@ -393,14 +496,14 @@ impl<'a> Context<'a> { } footer.push_str( - &self.generate_node_wasm_loading(&Path::new(&format!( + &self.generate_node_wasm_loading(Path::new(&format!( "./{}_bg.wasm", module_name ))), ); if needs_manual_start { - footer.push_str("wasm.__wbindgen_start();\n"); + footer.push_str("\nwasm.__wbindgen_start();\n"); } } @@ -411,27 +514,21 @@ impl<'a> Context<'a> { footer.push_str(&self.generate_deno_wasm_loading(module_name)); + footer.push_str("\n\n"); + if needs_manual_start { - footer.push_str("wasm.__wbindgen_start();\n"); + footer.push_str("\nwasm.__wbindgen_start();\n"); } } - // With Bundlers and modern ES6 support in Node we can simply import - // the wasm file as if it were an ES module and let the - // bundler/runtime take care of it. - OutputMode::Bundler { .. } - | OutputMode::Node { - experimental_modules: true, - } => { - imports.push_str(&format!( - "import * as wasm from './{}_bg.wasm';\n", - module_name - )); - for (id, js) in crate::sorted_iter(&self.wasm_import_definitions) { + // With Bundlers we can simply import the Wasm file as if it were an ES module + // and let the bundler/runtime take care of it. + // With Node we manually read the Wasm file from the filesystem and instantiate it. + OutputMode::Bundler { .. } | OutputMode::Node { module: true } => { + for (id, js) in iter_by_import(&self.wasm_import_definitions, self.module) { let import = self.module.imports.get_mut(*id); import.module = format!("./{}_bg.js", module_name); - if js.starts_with("function") { - let body = &js[8..]; + if let Some(body) = js.strip_prefix("function") { footer.push_str("\nexport function "); footer.push_str(&import.name); footer.push_str(body.trim()); @@ -444,19 +541,68 @@ impl<'a> Context<'a> { footer.push_str(";\n"); } } + + match self.config.mode { + OutputMode::Bundler { .. } => { + self.imports_post.push_str( + "\ + let wasm; + export function __wbg_set_wasm(val) { + wasm = val; + } + ", + ); + + start.get_or_insert_with(String::new).push_str(&format!( + "\ +import {{ __wbg_set_wasm }} from \"./{module_name}_bg.js\"; +__wbg_set_wasm(wasm);" + )); + } + + OutputMode::Node { module: true } => { + self.imports_post.push_str( + "\ + let wasm; + let wasmModule; + export function __wbg_set_wasm(exports, module) { + wasm = exports; + wasmModule = module; + } + ", + ); + + let start = start.get_or_insert_with(String::new); + start.push_str(&self.generate_node_imports()); + start.push_str(&self.generate_node_wasm_loading(Path::new(&format!( + "./{}_bg.wasm", + module_name + )))); + + start.push_str(&format!( + "imports[\"./{module_name}_bg.js\"].__wbg_set_wasm(wasm, wasmModule);" + )); + } + + _ => {} + } + if needs_manual_start { - start = Some("\nwasm.__wbindgen_start();\n".to_string()); + start + .get_or_insert_with(String::new) + .push_str("\nwasm.__wbindgen_start();\n"); } } // With a browser-native output we're generating an ES module, but - // browsers don't support natively importing wasm right now so we + // browsers don't support natively importing Wasm right now so we // expose the same initialization function as `--target no-modules` // as the default export of the module. OutputMode::Web => { self.imports_post.push_str("let wasm;\n"); init = self.gen_init(needs_manual_start, Some(&mut imports))?; - footer.push_str("export default init;\n"); + footer.push_str("export { initSync };\n"); + footer.push_str("export default __wbg_init;"); } } @@ -464,7 +610,7 @@ impl<'a> Context<'a> { // Not sure if this should happen in all cases, so just adding it to NoModules for now... if self.config.mode.no_modules() { ts = String::from("declare namespace wasm_bindgen {\n\t"); - ts.push_str(&self.typescript.replace("\n", "\n\t")); + ts.push_str(&self.typescript.replace('\n', "\n\t")); ts.push_str("\n}\n"); } else { ts = self.typescript.clone(); @@ -477,22 +623,27 @@ impl<'a> Context<'a> { // Emit all the JS for importing all our functionality assert!( !self.config.mode.uses_es_modules() || js.is_empty(), - "ES modules require imports to be at the start of the file" + "ES modules require imports to be at the start of the file, but we \ + generated some JS before the imports: {}", + js ); - js.push_str(&imports); - js.push_str("\n"); - js.push_str(&self.imports_post); - js.push_str("\n"); + + let mut push_with_newline = |s| { + js.push_str(s); + if !s.is_empty() { + js.push('\n'); + } + }; + + push_with_newline(&imports); + push_with_newline(&self.imports_post); // Emit all our exports from this module - js.push_str(&self.globals); - js.push_str("\n"); + push_with_newline(&self.globals); // Generate the initialization glue, if there was any - js.push_str(&init_js); - js.push_str("\n"); - js.push_str(&footer); - js.push_str("\n"); + push_with_newline(&init_js); + push_with_newline(&footer); if self.config.mode.no_modules() { js.push_str("})();\n"); } @@ -513,7 +664,7 @@ impl<'a> Context<'a> { match &self.config.mode { OutputMode::NoModules { .. } => { - for (module, _items) in self.js_imports.iter() { + if let Some((module, _items)) = self.js_imports.iter().next() { bail!( "importing from `{}` isn't supported with `--target no-modules`", module @@ -521,9 +672,7 @@ impl<'a> Context<'a> { } } - OutputMode::Node { - experimental_modules: false, - } => { + OutputMode::Node { module: false } => { for (module, items) in crate::sorted_iter(&self.js_imports) { imports.push_str("const { "); for (i, (item, rename)) in items.iter().enumerate() { @@ -536,7 +685,7 @@ impl<'a> Context<'a> { imports.push_str(other) } } - if module.starts_with(".") || PathBuf::from(module).is_absolute() { + if module.starts_with('.') || PathBuf::from(module).is_absolute() { imports.push_str(" } = require(String.raw`"); } else { imports.push_str(" } = require(`"); @@ -547,9 +696,7 @@ impl<'a> Context<'a> { } OutputMode::Bundler { .. } - | OutputMode::Node { - experimental_modules: true, - } + | OutputMode::Node { module: true } | OutputMode::Web | OutputMode::Deno => { for (module, items) in crate::sorted_iter(&self.js_imports) { @@ -578,28 +725,53 @@ impl<'a> Context<'a> { has_memory: bool, has_module_or_path_optional: bool, ) -> Result { - let output = crate::wasm2es6js::interface(&self.module)?; + let output = crate::wasm2es6js::interface(self.module)?; let (memory_doc, memory_param) = if has_memory { ( - "* @param {WebAssembly.Memory} maybe_memory\n", - ", maybe_memory?: WebAssembly.Memory", + "* @param {WebAssembly.Memory} memory - Deprecated.\n", + ", memory?: WebAssembly.Memory", ) } else { ("", "") }; + let stack_size = if self.threads_enabled { + ", thread_stack_size?: number" + } else { + "" + }; let arg_optional = if has_module_or_path_optional { "?" } else { "" }; // With TypeScript 3.8.3, I'm seeing that any "export"s at the root level cause TypeScript to ignore all "declare" statements. // So using "declare" everywhere for at least the NoModules option. // Also in (at least) the NoModules, the `init()` method is renamed to `wasm_bindgen()`. let setup_function_declaration; + let mut sync_init_function = String::new(); let declare_or_export; if self.config.mode.no_modules() { declare_or_export = "declare"; setup_function_declaration = "declare function wasm_bindgen"; } else { declare_or_export = "export"; - setup_function_declaration = "export default function init"; + + sync_init_function.push_str(&format!( + "\ + {declare_or_export} type SyncInitInput = BufferSource | WebAssembly.Module;\n\ + /**\n\ + * Instantiates the given `module`, which can either be bytes or\n\ + * a precompiled `WebAssembly.Module`.\n\ + *\n\ + * @param {{{{ module: SyncInitInput{memory_param}{stack_size} }}}} module - Passing `SyncInitInput` directly is deprecated.\n\ + {memory_doc}\ + *\n\ + * @returns {{InitOutput}}\n\ + */\n\ + export function initSync(module: {{ module: SyncInitInput{memory_param}{stack_size} }} | SyncInitInput{memory_param}): InitOutput;\n\n\ + ", + memory_doc = memory_doc, + memory_param = memory_param + )); + + setup_function_declaration = "export default function __wbg_init"; } Ok(format!( "\n\ @@ -608,19 +780,21 @@ impl<'a> Context<'a> { {declare_or_export} interface InitOutput {{\n\ {output}}}\n\ \n\ + {sync_init_function}\ /**\n\ * If `module_or_path` is {{RequestInfo}} or {{URL}}, makes a request and\n\ * for everything else, calls `WebAssembly.instantiate` directly.\n\ *\n\ - * @param {{InitInput | Promise}} module_or_path\n\ + * @param {{{{ module_or_path: InitInput | Promise{memory_param}{stack_size} }}}} module_or_path - Passing `InitInput` directly is deprecated.\n\ {}\ *\n\ * @returns {{Promise}}\n\ */\n\ {setup_function_declaration} \ - (module_or_path{}: InitInput | Promise{}): Promise;\n", + (module_or_path{}: {{ module_or_path: InitInput | Promise{memory_param}{stack_size} }} | InitInput | Promise{}): Promise;\n", memory_doc, arg_optional, memory_param, output = output, + sync_init_function = sync_init_function, declare_or_export = declare_or_export, setup_function_declaration = setup_function_declaration, )) @@ -639,7 +813,7 @@ impl<'a> Context<'a> { if let Some(id) = mem.import { self.module.imports.get_mut(id).module = module_name.to_string(); init_memory = format!( - "imports.{}.memory = maybe_memory || new WebAssembly.Memory({{", + "imports.{}.memory = memory || new WebAssembly.Memory({{", module_name ); init_memory.push_str(&format!("initial:{}", mem.initial)); @@ -650,7 +824,7 @@ impl<'a> Context<'a> { init_memory.push_str(",shared:true"); } init_memory.push_str("});"); - init_memory_arg = ", maybe_memory"; + init_memory_arg = ", memory"; has_memory = true; } } @@ -659,20 +833,14 @@ impl<'a> Context<'a> { match self.config.mode { OutputMode::Web => format!( "\ - if (typeof input === 'undefined') {{ - input = new URL('{stem}_bg.wasm', import.meta.url); + if (typeof module_or_path === 'undefined') {{ + module_or_path = new URL('{stem}_bg.wasm', import.meta.url); }}", stem = self.config.stem()? ), OutputMode::NoModules { .. } => "\ - if (typeof input === 'undefined') { - let src; - if (typeof document === 'undefined') { - src = location.href; - } else { - src = document.currentScript.src; - } - input = src.replace(/\\.js$/, '_bg.wasm'); + if (typeof module_or_path === 'undefined' && typeof script_src !== 'undefined') { + module_or_path = script_src.replace(/\\.js$/, '_bg.wasm'); }" .to_string(), _ => "".to_string(), @@ -689,17 +857,17 @@ impl<'a> Context<'a> { // Initialize the `imports` object for all import definitions that we're // directed to wire up. let mut imports_init = String::new(); - if self.wasm_import_definitions.len() > 0 { - imports_init.push_str("imports."); - imports_init.push_str(module_name); - imports_init.push_str(" = {};\n"); - } - for (id, js) in crate::sorted_iter(&self.wasm_import_definitions) { + + imports_init.push_str("imports."); + imports_init.push_str(module_name); + imports_init.push_str(" = {};\n"); + + for (id, js) in iter_by_import(&self.wasm_import_definitions, self.module) { let import = self.module.imports.get_mut(*id); import.module = module_name.to_string(); imports_init.push_str("imports."); imports_init.push_str(module_name); - imports_init.push_str("."); + imports_init.push('.'); imports_init.push_str(&import.name); imports_init.push_str(" = "); imports_init.push_str(js.trim()); @@ -714,10 +882,7 @@ impl<'a> Context<'a> { .filter(|i| { // Importing memory is handled specially in this area, so don't // consider this a candidate for importing from extra modules. - match i.kind { - walrus::ImportKind::Memory(_) => false, - _ => true, - } + !(matches!(i.kind, walrus::ImportKind::Memory(_))) }) .map(|i| &i.module) .collect::>(); @@ -733,9 +898,25 @@ impl<'a> Context<'a> { imports_init.push_str(&format!("imports['{}'] = __wbg_star{};\n", extra, i)); } + let mut init_memviews = String::new(); + for &(num, ref views) in self.memories.values() { + for kind in views { + writeln!( + init_memviews, + // Reset the memory views to null in case `init` gets called multiple times. + // Without this, the `length = 0` check would never detect that the view was + // outdated. + "cached{kind}Memory{num} = null;", + kind = kind, + num = num, + ) + .unwrap() + } + } + let js = format!( "\ - async function load(module, imports) {{ + async function __wbg_load(module, imports) {{ if (typeof Response === 'function' && module instanceof Response) {{ if (typeof WebAssembly.instantiateStreaming === 'function') {{ try {{ @@ -744,7 +925,7 @@ impl<'a> Context<'a> { }} catch (e) {{ if (module.headers.get('Content-Type') != 'application/wasm') {{ console.warn(\"`WebAssembly.instantiateStreaming` failed \ - because your server does not serve wasm with \ + because your server does not serve Wasm with \ `application/wasm` MIME type. Falling back to \ `WebAssembly.instantiate` which is slower. Original \ error:\\n\", e); @@ -770,34 +951,106 @@ impl<'a> Context<'a> { }} }} - async function init(input{init_memory_arg}) {{ - {default_module_path} + function __wbg_get_imports() {{ const imports = {{}}; {imports_init} + return imports; + }} - if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {{ - input = fetch(input); - }} - + function __wbg_init_memory(imports, memory) {{ {init_memory} + }} - const {{ instance, module }} = await load(await input, imports); - + function __wbg_finalize_init(instance, module{init_stack_size_arg}) {{ wasm = instance.exports; - init.__wbindgen_wasm_module = module; + __wbg_init.__wbindgen_wasm_module = module; + {init_memviews} + {init_stack_size_check} {start} return wasm; }} + + function initSync(module{init_memory_arg}) {{ + if (wasm !== undefined) return wasm; + + {init_stack_size} + if (typeof module !== 'undefined') {{ + if (Object.getPrototypeOf(module) === Object.prototype) {{ + ({{module{init_memory_arg}{init_stack_size_arg}}} = module) + }} else {{ + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + }} + }} + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports{init_memory_arg}); + + if (!(module instanceof WebAssembly.Module)) {{ + module = new WebAssembly.Module(module); + }} + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module{init_stack_size_arg}); + }} + + async function __wbg_init(module_or_path{init_memory_arg}) {{ + if (wasm !== undefined) return wasm; + + {init_stack_size} + if (typeof module_or_path !== 'undefined') {{ + if (Object.getPrototypeOf(module_or_path) === Object.prototype) {{ + ({{module_or_path{init_memory_arg}{init_stack_size_arg}}} = module_or_path) + }} else {{ + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + }} + }} + + {default_module_path} + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {{ + module_or_path = fetch(module_or_path); + }} + + __wbg_init_memory(imports{init_memory_arg}); + + const {{ instance, module }} = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module{init_stack_size_arg}); + }} ", init_memory_arg = init_memory_arg, default_module_path = default_module_path, init_memory = init_memory, - start = if needs_manual_start { + init_memviews = init_memviews, + start = if needs_manual_start && self.threads_enabled { + "wasm.__wbindgen_start(thread_stack_size);" + } else if needs_manual_start { "wasm.__wbindgen_start();" } else { "" }, imports_init = imports_init, + init_stack_size = if self.threads_enabled { + "let thread_stack_size" + } else { + "" + }, + init_stack_size_arg = if self.threads_enabled { + ", thread_stack_size" + } else { + "" + }, + init_stack_size_check = if self.threads_enabled { + format!( + "if (typeof thread_stack_size !== 'undefined' && (typeof thread_stack_size !== 'number' || thread_stack_size === 0 || thread_stack_size % {} !== 0)) {{ throw 'invalid stack size' }}", + wasm_bindgen_threads_xform::PAGE_SIZE, + ) + } else { + String::new() + }, ); Ok((js, ts)) @@ -814,43 +1067,57 @@ impl<'a> Context<'a> { let mut dst = format!("class {} {{\n", name); let mut ts_dst = format!("export {}", dst); - if self.config.debug && !class.has_constructor { - dst.push_str( - " - constructor() { - throw new Error('cannot invoke `new` directly'); - } - ", - ); + if !class.has_constructor { + // declare the constructor as private to prevent direct instantiation + ts_dst.push_str(" private constructor();\n"); + + if self.config.debug { + dst.push_str( + " + constructor() { + throw new Error('cannot invoke `new` directly'); + } + ", + ); + } } if class.wrap_needed { dst.push_str(&format!( " static __wrap(ptr) {{ - const obj = Object.create({}.prototype); - obj.ptr = ptr; - {} + ptr = ptr >>> 0; + const obj = Object.create({name}.prototype); + obj.__wbg_ptr = ptr; + {name}Finalization.register(obj, obj.__wbg_ptr, obj); return obj; }} - ", - name, - if self.config.weak_refs { - format!("{}Finalization.register(obj, obj.ptr, obj);", name) - } else { - String::new() - }, + " )); } - if self.config.weak_refs { - self.global(&format!( - "const {}Finalization = new FinalizationRegistry(ptr => wasm.{}(ptr));", + if class.unwrap_needed { + dst.push_str(&format!( + " + static __unwrap(jsValue) {{ + if (!(jsValue instanceof {})) {{ + return 0; + }} + return jsValue.__destroy_into_raw(); + }} + ", name, - wasm_bindgen_shared::free_function(&name), )); } + self.global(&format!( + " + const {name}Finalization = (typeof FinalizationRegistry === 'undefined') + ? {{ register: () => {{}}, unregister: () => {{}} }} + : new FinalizationRegistry(ptr => wasm.{}(ptr >>> 0, 1));", + wasm_bindgen_shared::free_function(name), + )); + // If the class is inspectable, generate `toJSON` and `toString` // to expose all readable properties of the class. Otherwise, // the class shows only the "ptr" property when logged or serialized @@ -874,6 +1141,16 @@ impl<'a> Context<'a> { format!("{}{name}: this.{name},\n", fields, name = field_name) }) )); + // Also add definitions to the .d.ts file. + ts_dst.push_str( + "\ + /**\n*\ + * Return copy of self without private attributes.\n\ + */\n toJSON(): Object;\n\ + /**\n\ + * Return stringified version of self.\n\ + */\n toString(): string;\n", + ); if self.config.mode.nodejs() { // `util.inspect` must be imported in Node.js to define [inspect.custom] @@ -902,56 +1179,166 @@ impl<'a> Context<'a> { dst.push_str(&format!( " __destroy_into_raw() {{ - const ptr = this.ptr; - this.ptr = 0; - {} + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + {name}Finalization.unregister(this); return ptr; }} free() {{ const ptr = this.__destroy_into_raw(); - wasm.{}(ptr); + wasm.{}(ptr, 0); }} ", - if self.config.weak_refs { - format!("{}Finalization.unregister(this);", name) - } else { - String::new() - }, - wasm_bindgen_shared::free_function(&name), + wasm_bindgen_shared::free_function(name), )); ts_dst.push_str(" free(): void;\n"); + if self.config.symbol_dispose { + dst.push_str( + " + [Symbol.dispose]() {{ + this.free(); + }} + ", + ); + ts_dst.push_str(" [Symbol.dispose](): void;\n"); + } dst.push_str(&class.contents); ts_dst.push_str(&class.typescript); - let mut fields = class.typescript_fields.keys().collect::>(); - fields.sort(); // make sure we have deterministic output - for name in fields { - let (ty, docs, has_setter, is_optional) = &class.typescript_fields[name]; - ts_dst.push_str(docs); - ts_dst.push_str(" "); - if !has_setter { - ts_dst.push_str("readonly "); - } - ts_dst.push_str(name); - if *is_optional { - ts_dst.push_str("?: "); - } else { - ts_dst.push_str(": "); - } - ts_dst.push_str(&ty); - ts_dst.push_str(";\n"); - } - dst.push_str("}\n"); + self.write_class_field_types(class, &mut ts_dst); + + dst.push('}'); ts_dst.push_str("}\n"); - self.export(&name, &dst, Some(&class.comments))?; - self.typescript.push_str(&class.comments); - self.typescript.push_str(&ts_dst); + self.export(name, ExportJs::Class(&dst), Some(&class.comments))?; + + if class.generate_typescript { + self.typescript.push_str(&class.comments); + self.typescript.push_str(&ts_dst); + } Ok(()) } + fn write_class_field_types(&mut self, class: &ExportedClass, ts_dst: &mut String) { + let mut fields: Vec<&FieldInfo> = class.typescript_fields.values().collect(); + fields.sort_by_key(|f| f.order); // make sure we have deterministic output + + for FieldInfo { + name, + is_static, + getter, + setter, + .. + } in fields + { + let is_static = if *is_static { "static " } else { "" }; + + let write_docs = |ts_dst: &mut String, docs: &str| { + if docs.is_empty() { + return; + } + // indent by 2 spaces + for line in docs.lines() { + ts_dst.push_str(" "); + ts_dst.push_str(line); + ts_dst.push('\n'); + } + }; + let write_getter = |ts_dst: &mut String, getter: &FieldAccessor| { + write_docs(ts_dst, &getter.docs); + ts_dst.push_str(" "); + ts_dst.push_str(is_static); + ts_dst.push_str("get "); + ts_dst.push_str(name); + ts_dst.push_str("(): "); + ts_dst.push_str(&getter.ty); + ts_dst.push_str(";\n"); + }; + let write_setter = |ts_dst: &mut String, setter: &FieldAccessor| { + write_docs(ts_dst, &setter.docs); + ts_dst.push_str(" "); + ts_dst.push_str(is_static); + ts_dst.push_str("set "); + ts_dst.push_str(name); + ts_dst.push_str("(value: "); + ts_dst.push_str(&setter.ty); + if setter.is_optional { + ts_dst.push_str(" | undefined"); + } + ts_dst.push_str(");\n"); + }; + + match (getter, setter) { + (None, None) => unreachable!("field without getter or setter"), + (Some(getter), None) => { + // readonly property + write_docs(ts_dst, &getter.docs); + ts_dst.push_str(" "); + ts_dst.push_str(is_static); + ts_dst.push_str("readonly "); + ts_dst.push_str(name); + ts_dst.push_str(if getter.is_optional { "?: " } else { ": " }); + ts_dst.push_str(&getter.ty); + ts_dst.push_str(";\n"); + } + (None, Some(setter)) => { + // write-only property + + // Note: TypeScript does not handle the types of write-only + // properties correctly and will allow reads from write-only + // properties. This isn't a wasm-bindgen issue, but a + // TypeScript issue. + write_setter(ts_dst, setter); + } + (Some(getter), Some(setter)) => { + // read-write property + + // Here's the tricky part. The getter and setter might have + // different types. Obviously, we can only declare a + // property as `foo: T` if both the getter and setter have + // the same type `T`. If they don't, we have to declare the + // getter and setter separately. + + // We current generate types for optional arguments and + // return values differently. This is why for the field + // `foo: Option`, the setter will have type `T` with + // `is_optional` set, while the getter has type + // `T | undefined`. Because of this difference, we have to + // "normalize" the type of the setter. + let same_type = if setter.is_optional { + getter.ty == setter.ty.clone() + " | undefined" + } else { + getter.ty == setter.ty + }; + + if same_type { + // simple property, e.g. foo: T + + // Prefer the docs of the getter over the setter's + let docs = if !getter.docs.is_empty() { + &getter.docs + } else { + &setter.docs + }; + write_docs(ts_dst, docs); + ts_dst.push_str(" "); + ts_dst.push_str(is_static); + ts_dst.push_str(name); + ts_dst.push_str(if setter.is_optional { "?: " } else { ": " }); + ts_dst.push_str(&setter.ty); + ts_dst.push_str(";\n"); + } else { + // separate getter and setter + write_getter(ts_dst, getter); + write_setter(ts_dst, setter); + } + } + }; + } + } + fn expose_drop_ref(&mut self) { if !self.should_write_global("drop_ref") { return; @@ -1021,28 +1408,41 @@ impl<'a> Context<'a> { if !self.should_write_global("assert_num") { return; } - self.global(&format!( + self.global( " - function _assertNum(n) {{ - if (typeof(n) !== 'number') throw new Error('expected a number argument'); - }} + function _assertNum(n) { + if (typeof(n) !== 'number') throw new Error(`expected a number argument, found ${typeof(n)}`); + } + ", + ); + } + + fn expose_assert_bigint(&mut self) { + if !self.should_write_global("assert_bigint") { + return; + } + self.global( " - )); + function _assertBigInt(n) { + if (typeof(n) !== 'bigint') throw new Error(`expected a bigint argument, found ${typeof(n)}`); + } + ", + ); } fn expose_assert_bool(&mut self) { if !self.should_write_global("assert_bool") { return; } - self.global(&format!( - " - function _assertBoolean(n) {{ - if (typeof(n) !== 'boolean') {{ - throw new Error('expected a boolean argument'); - }} - }} + self.global( " - )); + function _assertBoolean(n) { + if (typeof(n) !== 'boolean') { + throw new Error(`expected a boolean argument, found ${typeof(n)}`); + } + } + ", + ); } fn expose_wasm_vector_len(&mut self) { @@ -1057,7 +1457,7 @@ impl<'a> Context<'a> { let debug = if self.config.debug { " - if (typeof(arg) !== 'string') throw new Error('expected a string argument'); + if (typeof(arg) !== 'string') throw new Error(`expected a string argument, found ${typeof(arg)}`); " } else { "" @@ -1065,7 +1465,7 @@ impl<'a> Context<'a> { let mem = self.expose_uint8_memory(memory); let ret = MemView { - name: "passStringToWasm", + name: "passStringToWasm".into(), num: mem.num, }; if !self.should_write_global(ret.to_string()) { @@ -1086,7 +1486,7 @@ impl<'a> Context<'a> { // Another possibility is to use `TextEncoder#encodeInto` which is much // newer and isn't implemented everywhere yet. It's more efficient, - // however, becaues it allows us to elide an intermediate allocation. + // however, because it allows us to elide an intermediate allocation. let encode_into = "function (arg, view) { return cachedTextEncoder.encodeInto(arg, view); }"; @@ -1125,7 +1525,7 @@ impl<'a> Context<'a> { } } - // A fast path that directly writes char codes into WASM memory as long + // A fast path that directly writes char codes into Wasm memory as long // as it finds only ASCII characters. // // This is much faster for common ASCII strings because it can avoid @@ -1138,14 +1538,14 @@ impl<'a> Context<'a> { "\ if (realloc === undefined) {{ const buf = cachedTextEncoder.encode(arg); - const ptr = malloc(buf.length); + const ptr = malloc(buf.length, 1) >>> 0; {mem}().subarray(ptr, ptr + buf.length).set(buf); WASM_VECTOR_LEN = buf.length; return ptr; }} let len = arg.length; - let ptr = malloc(len); + let ptr = malloc(len, 1) >>> 0; const mem = {mem}(); @@ -1160,11 +1560,6 @@ impl<'a> Context<'a> { mem = mem, ); - // TODO: - // When converting a JS string to UTF-8, the maximum size is `arg.length * 3`, - // so we just allocate that. This wastes memory, so we should investigate - // looping over the string to calculate the precise size, or perhaps using - // `shrink_to_fit` on the Rust side. self.global(&format!( "function {name}(arg, malloc, realloc) {{ {debug} @@ -1173,11 +1568,12 @@ impl<'a> Context<'a> { if (offset !== 0) {{ arg = arg.slice(offset); }} - ptr = realloc(ptr, len, len = offset + arg.length * 3); + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; const view = {mem}().subarray(ptr + offset, ptr + len); const ret = encodeString(arg, view); {debug_end} offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; }} WASM_VECTOR_LEN = offset; @@ -1228,9 +1624,9 @@ impl<'a> Context<'a> { } fn expose_pass_array_jsvalue_to_wasm(&mut self, memory: MemoryId) -> Result { - let mem = self.expose_uint32_memory(memory); + let mem = self.expose_dataview_memory(memory); let ret = MemView { - name: "passArrayJsValueToWasm", + name: "passArrayJsValueToWasm".into(), num: mem.num, }; if !self.should_write_global(ret.to_string()) { @@ -1244,34 +1640,32 @@ impl<'a> Context<'a> { let add = self.expose_add_to_externref_table(table, alloc)?; self.global(&format!( " - function {}(array, malloc) {{ - const ptr = malloc(array.length * 4); - const mem = {}(); + function {ret}(array, malloc) {{ + const ptr = malloc(array.length * 4, 4) >>> 0; for (let i = 0; i < array.length; i++) {{ - mem[ptr / 4 + i] = {}(array[i]); + const add = {add}(array[i]); + {mem}().setUint32(ptr + 4 * i, add, true); }} WASM_VECTOR_LEN = array.length; return ptr; }} ", - ret, mem, add, )); } _ => { self.expose_add_heap_object(); self.global(&format!( " - function {}(array, malloc) {{ - const ptr = malloc(array.length * 4); - const mem = {}(); + function {ret}(array, malloc) {{ + const ptr = malloc(array.length * 4, 4) >>> 0; + const mem = {mem}(); for (let i = 0; i < array.length; i++) {{ - mem[ptr / 4 + i] = addHeapObject(array[i]); + mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true); }} WASM_VECTOR_LEN = array.length; return ptr; }} ", - ret, mem, )); } } @@ -1285,7 +1679,7 @@ impl<'a> Context<'a> { size: usize, ) -> Result { let ret = MemView { - name, + name: name.into(), num: view.num, }; if !self.should_write_global(ret.to_string()) { @@ -1295,7 +1689,7 @@ impl<'a> Context<'a> { self.global(&format!( " function {}(arg, malloc) {{ - const ptr = malloc(arg.length * {size}); + const ptr = malloc(arg.length * {size}, {size}) >>> 0; {}().set(arg, ptr / {size}); WASM_VECTOR_LEN = arg.length; return ptr; @@ -1308,11 +1702,19 @@ impl<'a> Context<'a> { Ok(ret) } + fn expose_symbol_dispose(&mut self) -> Result<(), Error> { + if !self.should_write_global("symbol_dispose") { + return Ok(()); + } + self.global("if(!Symbol.dispose) { Symbol.dispose = Symbol('Symbol.dispose'); }"); + Ok(()) + } + fn expose_text_encoder(&mut self) -> Result<(), Error> { if !self.should_write_global("text_encoder") { return Ok(()); } - self.expose_text_processor("TextEncoder", "('utf-8')") + self.expose_text_processor("TextEncoder", "encode", "('utf-8')", None) } fn expose_text_decoder(&mut self) -> Result<(), Error> { @@ -1320,18 +1722,29 @@ impl<'a> Context<'a> { return Ok(()); } - // `ignoreBOM` is needed so that the BOM will be preserved when sending a string from Rust to JS - // `fatal` is needed to catch any weird encoding bugs when sending a string from Rust to JS - self.expose_text_processor("TextDecoder", "('utf-8', { ignoreBOM: true, fatal: true })")?; - // This is needed to workaround a bug in Safari // See: https://github.com/rustwasm/wasm-bindgen/issues/1825 - self.global("cachedTextDecoder.decode();"); + let init = Some("cachedTextDecoder.decode();"); + + // `ignoreBOM` is needed so that the BOM will be preserved when sending a string from Rust to JS + // `fatal` is needed to catch any weird encoding bugs when sending a string from Rust to JS + self.expose_text_processor( + "TextDecoder", + "decode", + "('utf-8', { ignoreBOM: true, fatal: true })", + init, + )?; Ok(()) } - fn expose_text_processor(&mut self, s: &str, args: &str) -> Result<(), Error> { + fn expose_text_processor( + &mut self, + s: &str, + op: &str, + args: &str, + init: Option<&str>, + ) -> Result<(), Error> { match &self.config.mode { OutputMode::Node { .. } => { let name = self.import_name(&JsImport { @@ -1359,10 +1772,26 @@ impl<'a> Context<'a> { | OutputMode::Web | OutputMode::NoModules { .. } | OutputMode::Bundler { browser_only: true } => { - self.global(&format!("const cached{0} = new {0}{1};", s, args)) + self.global(&format!("const cached{0} = (typeof {0} !== 'undefined' ? new {0}{1} : {{ {2}: () => {{ throw Error('{0} not available') }} }} );", s, args, op)) } }; + if let Some(init) = init { + match &self.config.mode { + OutputMode::Node { .. } + | OutputMode::Bundler { + browser_only: false, + } => self.global(init), + OutputMode::Deno + | OutputMode::Web + | OutputMode::NoModules { .. } + | OutputMode::Bundler { browser_only: true } => self.global(&format!( + "if (typeof {} !== 'undefined') {{ {} }};", + s, init + )), + } + } + Ok(()) } @@ -1370,7 +1799,7 @@ impl<'a> Context<'a> { self.expose_text_decoder()?; let mem = self.expose_uint8_memory(memory); let ret = MemView { - name: "getStringFromWasm", + name: "getStringFromWasm".into(), num: mem.num, }; @@ -1392,6 +1821,7 @@ impl<'a> Context<'a> { self.global(&format!( " function {}(ptr, len) {{ + ptr = ptr >>> 0; return cachedTextDecoder.decode({}().{}(ptr, ptr + len)); }} ", @@ -1400,12 +1830,21 @@ impl<'a> Context<'a> { Ok(ret) } - fn expose_get_cached_string_from_wasm(&mut self, memory: MemoryId) -> Result { - self.expose_get_object(); - let get = self.expose_get_string_from_wasm(memory)?; + fn expose_get_cached_string_from_wasm( + &mut self, + memory: MemoryId, + table: Option, + ) -> Result { + let get_object = if let Some(table) = table { + self.expose_get_from_externref_table(table)?.to_string() + } else { + self.expose_get_object(); + "getObject".to_string() + }; + let get_string = self.expose_get_string_from_wasm(memory)?; let ret = MemView { - name: "getCachedStringFromWasm", - num: get.num, + name: "getCachedStringFromWasm".into(), + num: get_string.num, }; if !self.should_write_global(ret.to_string()) { @@ -1422,23 +1861,25 @@ impl<'a> Context<'a> { // the fact that `getObject(0)` is guaranteed to be `undefined`. self.global(&format!( " - function {}(ptr, len) {{ + function {name}(ptr, len) {{ if (ptr === 0) {{ - return getObject(len); + return {get_object}(len); }} else {{ - return {}(ptr, len); + return {get_string}(ptr, len); }} }} ", - ret, get, + name = ret, + get_string = get_string, + get_object = get_object )); Ok(ret) } fn expose_get_array_js_value_from_wasm(&mut self, memory: MemoryId) -> Result { - let mem = self.expose_uint32_memory(memory); + let mem = self.expose_dataview_memory(memory); let ret = MemView { - name: "getArrayJsValueFromWasm", + name: "getArrayJsValueFromWasm".into(), num: mem.num, }; if !self.should_write_global(ret.to_string()) { @@ -1451,11 +1892,11 @@ impl<'a> Context<'a> { self.global(&format!( " function {}(ptr, len) {{ + ptr = ptr >>> 0; const mem = {}(); - const slice = mem.subarray(ptr / 4, ptr / 4 + len); const result = []; - for (let i = 0; i < slice.length; i++) {{ - result.push(wasm.{}.get(slice[i])); + for (let i = ptr; i < ptr + 4 * len; i += 4) {{ + result.push(wasm.{}.get(mem.getUint32(i, true))); }} wasm.{}(ptr, len); return result; @@ -1469,11 +1910,11 @@ impl<'a> Context<'a> { self.global(&format!( " function {}(ptr, len) {{ + ptr = ptr >>> 0; const mem = {}(); - const slice = mem.subarray(ptr / 4, ptr / 4 + len); const result = []; - for (let i = 0; i < slice.length; i++) {{ - result.push(takeObject(slice[i])); + for (let i = ptr; i < ptr + 4 * len; i += 4) {{ + result.push(takeObject(mem.getUint32(i, true))); }} return result; }} @@ -1542,7 +1983,7 @@ impl<'a> Context<'a> { fn arrayget(&mut self, name: &'static str, view: MemView, size: usize) -> MemView { let ret = MemView { - name, + name: name.into(), num: view.num, }; if !self.should_write_global(name) { @@ -1551,6 +1992,7 @@ impl<'a> Context<'a> { self.global(&format!( " function {name}(ptr, len) {{ + ptr = ptr >>> 0; return {mem}().subarray(ptr / {size}, ptr / {size} + len); }} ", @@ -1558,105 +2000,125 @@ impl<'a> Context<'a> { mem = view, size = size, )); - return ret; + ret } fn expose_int8_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getInt8Memory", "new Int8Array", memory) + self.memview("Int8Array", memory) } fn expose_uint8_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getUint8Memory", "new Uint8Array", memory) + self.memview("Uint8Array", memory) } fn expose_clamped_uint8_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getUint8ClampedMemory", "new Uint8ClampedArray", memory) + self.memview("Uint8ClampedArray", memory) } fn expose_int16_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getInt16Memory", "new Int16Array", memory) + self.memview("Int16Array", memory) } fn expose_uint16_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getUint16Memory", "new Uint16Array", memory) + self.memview("Uint16Array", memory) } fn expose_int32_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getInt32Memory", "new Int32Array", memory) + self.memview("Int32Array", memory) } fn expose_uint32_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getUint32Memory", "new Uint32Array", memory) + self.memview("Uint32Array", memory) } fn expose_int64_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getInt64Memory", "new BigInt64Array", memory) + self.memview("BigInt64Array", memory) } fn expose_uint64_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getUint64Memory", "new BigUint64Array", memory) + self.memview("BigUint64Array", memory) } fn expose_f32_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getFloat32Memory", "new Float32Array", memory) + self.memview("Float32Array", memory) } fn expose_f64_memory(&mut self, memory: MemoryId) -> MemView { - self.memview("getFloat64Memory", "new Float64Array", memory) + self.memview("Float64Array", memory) } - fn memview_function(&mut self, t: VectorKind, memory: MemoryId) -> MemView { - match t { - VectorKind::String => self.expose_uint8_memory(memory), - VectorKind::I8 => self.expose_int8_memory(memory), - VectorKind::U8 => self.expose_uint8_memory(memory), - VectorKind::ClampedU8 => self.expose_clamped_uint8_memory(memory), - VectorKind::I16 => self.expose_int16_memory(memory), - VectorKind::U16 => self.expose_uint16_memory(memory), - VectorKind::I32 => self.expose_int32_memory(memory), - VectorKind::U32 => self.expose_uint32_memory(memory), - VectorKind::I64 => self.expose_int64_memory(memory), - VectorKind::U64 => self.expose_uint64_memory(memory), - VectorKind::F32 => self.expose_f32_memory(memory), - VectorKind::F64 => self.expose_f64_memory(memory), - VectorKind::Externref => self.expose_uint32_memory(memory), - VectorKind::NamedExternref(_) => self.expose_uint32_memory(memory), - } - } - - fn memview(&mut self, name: &'static str, js: &str, memory: walrus::MemoryId) -> MemView { - let view = self.memview_memory(name, memory); - if !self.should_write_global(name.to_string()) { + fn expose_dataview_memory(&mut self, memory: MemoryId) -> MemView { + self.memview("DataView", memory) + } + + fn memview(&mut self, kind: &'static str, memory: walrus::MemoryId) -> MemView { + let view = self.memview_memory(kind, memory); + if !self.should_write_global(view.name.clone()) { return view; } let mem = self.export_name_of(memory); + + let cache = format!("cached{}Memory{}", kind, view.num); + let resized_check = if self.module.memories.get(memory).shared { + // When it's backed by a `SharedArrayBuffer`, growing the Wasm module's memory + // doesn't detach old references; instead, it just leaves them pointing to a + // slice of the up-to-date memory. So in order to check if it's been grown, we + // have to compare it to the up-to-date buffer. + format!( + "{cache}.buffer !== wasm.{mem}.buffer", + cache = cache, + mem = mem + ) + } else if kind == "DataView" { + // `DataView`s throw when accessing detached memory, including `byteLength`. + // However this requires JS engine support, so we fallback to comparing the buffer. + format!("{cache}.buffer.detached === true || ({cache}.buffer.detached === undefined && {cache}.buffer !== wasm.{mem}.buffer)", cache = cache) + } else { + // Otherwise, we can do a quicker check of whether the buffer's been detached, + // which is indicated by a length of 0. + format!("{cache}.byteLength === 0", cache = cache) + }; + + self.global(&format!("let {cache} = null;\n")); + self.global(&format!( " - let cache{name} = null; function {name}() {{ - if (cache{name} === null || cache{name}.buffer !== wasm.{mem}.buffer) {{ - cache{name} = {js}(wasm.{mem}.buffer); + if ({cache} === null || {resized_check}) {{ + {cache} = new {kind}(wasm.{mem}.buffer); }} - return cache{name}; + return {cache}; }} ", name = view, - js = js, + cache = cache, + resized_check = resized_check, + kind = kind, mem = mem, )); - return view; + view } - fn memview_memory(&mut self, name: &'static str, memory: walrus::MemoryId) -> MemView { - let next = self.memory_indices.len(); - let num = *self.memory_indices.entry(memory).or_insert(next); - MemView { name, num } + fn memview_memory(&mut self, kind: &'static str, memory: walrus::MemoryId) -> MemView { + let next = self.memories.len(); + let &mut (num, ref mut kinds) = self + .memories + .entry(memory) + .or_insert((next, Default::default())); + kinds.insert(kind); + MemView { + name: format!("get{}Memory", kind).into(), + num, + } } fn memview_table(&mut self, name: &'static str, table: walrus::TableId) -> MemView { let next = self.table_indices.len(); let num = *self.table_indices.entry(table).or_insert(next); - MemView { name, num } + MemView { + name: name.into(), + num, + } } fn expose_assert_class(&mut self) { @@ -1669,7 +2131,6 @@ impl<'a> Context<'a> { if (!(instance instanceof klass)) { throw new Error(`expected instance of ${klass.name}`); } - return instance.ptr; } ", ); @@ -1896,51 +2357,42 @@ impl<'a> Context<'a> { ); } - fn expose_u32_cvt_shim(&mut self) -> &'static str { - let name = "u32CvtShim"; - if !self.should_write_global(name) { - return name; - } - self.global(&format!("const {} = new Uint32Array(2);", name)); - name - } - - fn expose_int64_cvt_shim(&mut self) -> &'static str { - let name = "int64CvtShim"; - if !self.should_write_global(name) { - return name; + fn expose_is_like_none(&mut self) { + if !self.should_write_global("is_like_none") { + return; } - let n = self.expose_u32_cvt_shim(); - self.global(&format!( - "const {} = new BigInt64Array({}.buffer);", - name, n - )); - name + self.global( + " + function isLikeNone(x) { + return x === undefined || x === null; + } + ", + ); } - fn expose_uint64_cvt_shim(&mut self) -> &'static str { - let name = "uint64CvtShim"; - if !self.should_write_global(name) { - return name; + fn expose_assert_non_null(&mut self) { + if !self.should_write_global("assert_non_null") { + return; } - let n = self.expose_u32_cvt_shim(); - self.global(&format!( - "const {} = new BigUint64Array({}.buffer);", - name, n - )); - name + self.global( + " + function _assertNonNull(n) { + if (typeof(n) !== 'number' || n === 0) throw new Error(`expected a number argument that is not 0, found ${n}`); + } + ", + ); } - fn expose_is_like_none(&mut self) { - if !self.should_write_global("is_like_none") { + fn expose_assert_char(&mut self) { + if !self.should_write_global("assert_char") { return; } self.global( " - function isLikeNone(x) { - return x === undefined || x === null; + function _assertChar(c) { + if (typeof(c) === 'number' && (c >= 0x110000 || (c >= 0xD800 && c < 0xE000))) throw new Error(`expected a valid Unicode scalar value, found ${c}`); } - ", + ", ); } @@ -1951,15 +2403,7 @@ impl<'a> Context<'a> { let table = self.export_function_table()?; - let (register, unregister) = if self.config.weak_refs { - self.expose_closure_finalization()?; - ( - "CLOSURE_DTORS.register(real, state, state);", - "CLOSURE_DTORS.unregister(state)", - ) - } else { - ("", "") - }; + self.expose_closure_finalization()?; // For mutable closures they can't be invoked recursively. // To handle that we swap out the `this.a` pointer with zero @@ -1982,20 +2426,17 @@ impl<'a> Context<'a> { }} finally {{ if (--state.cnt === 0) {{ wasm.{table}.get(state.dtor)(a, state.b); - {unregister} + CLOSURE_DTORS.unregister(state); }} else {{ state.a = a; }} }} }}; real.original = state; - {register} + CLOSURE_DTORS.register(real, state, state); return real; }} ", - table = table, - register = register, - unregister = unregister, )); Ok(()) @@ -2008,15 +2449,7 @@ impl<'a> Context<'a> { let table = self.export_function_table()?; - let (register, unregister) = if self.config.weak_refs { - self.expose_closure_finalization()?; - ( - "CLOSURE_DTORS.register(real, state, state);", - "CLOSURE_DTORS.unregister(state)", - ) - } else { - ("", "") - }; + self.expose_closure_finalization()?; // For shared closures they can be invoked recursively so we // just immediately pass through `this.a`. If we end up @@ -2038,18 +2471,15 @@ impl<'a> Context<'a> { if (--state.cnt === 0) {{ wasm.{table}.get(state.dtor)(state.a, state.b); state.a = 0; - {unregister} + CLOSURE_DTORS.unregister(state); }} }} }}; real.original = state; - {register} + CLOSURE_DTORS.register(real, state, state); return real; }} ", - table = table, - register = register, - unregister = unregister, )); Ok(()) @@ -2059,15 +2489,15 @@ impl<'a> Context<'a> { if !self.should_write_global("closure_finalization") { return Ok(()); } - assert!(self.config.weak_refs); let table = self.export_function_table()?; self.global(&format!( " - const CLOSURE_DTORS = new FinalizationRegistry(state => {{ - wasm.{}.get(state.dtor)(state.a, state.b) - }}); - ", - table + const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? {{ register: () => {{}}, unregister: () => {{}} }} + : new FinalizationRegistry(state => {{ + wasm.{table}.get(state.dtor)(state.a, state.b) + }}); + " )); Ok(()) @@ -2078,16 +2508,20 @@ impl<'a> Context<'a> { // Ensure a blank line between adjacent items, and ensure everything is // terminated with a newline. while !self.globals.ends_with("\n\n\n") && !self.globals.ends_with("*/\n") { - self.globals.push_str("\n"); + self.globals.push('\n'); } self.globals.push_str(s); - self.globals.push_str("\n"); + self.globals.push('\n'); } fn require_class_wrap(&mut self, name: &str) { require_class(&mut self.exported_classes, name).wrap_needed = true; } + fn require_class_unwrap(&mut self, name: &str) { + require_class(&mut self.exported_classes, name).unwrap_needed = true; + } + fn add_module_import(&mut self, module: String, name: &str, actual: &str) { let rename = if name == actual { None @@ -2096,7 +2530,7 @@ impl<'a> Context<'a> { }; self.js_imports .entry(module) - .or_insert(Vec::new()) + .or_default() .push((name.to_string(), rename)); } @@ -2104,7 +2538,7 @@ impl<'a> Context<'a> { if let Some(name) = self.imported_names.get(&import.name) { let mut name = name.clone(); for field in import.fields.iter() { - name.push_str("."); + name.push('.'); name.push_str(field); } return Ok(name.clone()); @@ -2157,7 +2591,7 @@ impl<'a> Context<'a> { } else { switch(dst, name, &left[0], &left[1..]); } - dst.push_str(")"); + dst.push(')'); } format!("l{}", name) } @@ -2175,14 +2609,38 @@ impl<'a> Context<'a> { // After we've got an actual name handle field projections for field in import.fields.iter() { - name.push_str("."); + name.push('.'); name.push_str(field); } Ok(name) } + fn import_static(&mut self, import: &JsImport, optional: bool) -> Result { + let mut name = self.import_name(&JsImport { + name: import.name.clone(), + fields: Vec::new(), + })?; + + // After we've got an actual name handle field projections + if optional { + name = format!("typeof {name} === 'undefined' ? null : {name}"); + + for field in import.fields.iter() { + name.push_str("?."); + name.push_str(field); + } + } else { + for field in import.fields.iter() { + name.push('.'); + name.push_str(field); + } + } + + Ok(name) + } + /// If a start function is present, it removes it from the `start` section - /// of the wasm module and then moves it to an exported function, named + /// of the Wasm module and then moves it to an exported function, named /// `__wbindgen_start`. fn unstart_start_function(&mut self) -> bool { let start = match self.module.start.take() { @@ -2193,6 +2651,22 @@ impl<'a> Context<'a> { true } + fn expose_get_from_externref_table(&mut self, table: TableId) -> Result { + let view = self.memview_table("getFromExternrefTable", table); + assert!(self.config.externref); + if !self.should_write_global(view.to_string()) { + return Ok(view); + } + let table = self.export_name_of(table); + self.global(&format!( + "function {view}(idx) {{ return wasm.{table}.get(idx); }}", + view = view, + table = table, + )); + + Ok(view) + } + fn expose_take_from_externref_table( &mut self, table: TableId, @@ -2249,21 +2723,29 @@ impl<'a> Context<'a> { pub fn generate(&mut self) -> Result<(), Error> { self.prestore_global_import_identifiers()?; - for (id, adapter) in crate::sorted_iter(&self.wit.adapters) { + // conditionally override Symbol.dispose + if self.config.symbol_dispose && !self.aux.structs.is_empty() { + self.expose_symbol_dispose()?; + } + + for (id, adapter, kind) in iter_adapeter(self.aux, self.wit, self.module) { let instrs = match &adapter.kind { AdapterKind::Import { .. } => continue, AdapterKind::Local { instructions } => instructions, }; - self.generate_adapter(*id, adapter, instrs)?; + self.generate_adapter(id, adapter, instrs, kind)?; } let mut pairs = self.aux.export_map.iter().collect::>(); pairs.sort_by_key(|(k, _)| *k); check_duplicated_getter_and_setter_names(&pairs)?; - for e in self.aux.enums.iter() { + for (_, e) in crate::sorted_iter(&self.aux.enums) { self.generate_enum(e)?; } + for (_, e) in crate::sorted_iter(&self.aux.string_enums) { + self.generate_string_enum(e)?; + } for s in self.aux.structs.iter() { self.generate_struct(s)?; @@ -2309,7 +2791,7 @@ impl<'a> Context<'a> { | AuxImport::Value(AuxValue::Setter(js, ..)) | AuxImport::ValueWithThis(js, ..) | AuxImport::Instanceof(js) - | AuxImport::Static(js) + | AuxImport::Static { js, .. } | AuxImport::StructuralClassGetter(js, ..) | AuxImport::StructuralClassSetter(js, ..) | AuxImport::IndexingGetterOfClass(js) @@ -2329,26 +2811,10 @@ impl<'a> Context<'a> { id: AdapterId, adapter: &Adapter, instrs: &[InstructionData], + kind: ContextAdapterKind, ) -> Result<(), Error> { - enum Kind<'a> { - Export(&'a AuxExport), - Import(walrus::ImportId), - Adapter, - } - - let kind = match self.aux.export_map.get(&id) { - Some(export) => Kind::Export(export), - None => { - let core = self.wit.implements.iter().find(|pair| pair.2 == id); - match core { - Some((core, _, _)) => Kind::Import(*core), - None => Kind::Adapter, - } - } - }; - let catch = self.aux.imports_with_catch.contains(&id); - if let Kind::Import(core) = kind { + if let ContextAdapterKind::Import(core) = kind { if !catch && self.attempt_direct_import(core, instrs)? { return Ok(()); } @@ -2358,116 +2824,184 @@ impl<'a> Context<'a> { // export that we're generating. let mut builder = binding::Builder::new(self); builder.log_error(match kind { - Kind::Export(_) | Kind::Adapter => false, - Kind::Import(_) => builder.cx.config.debug, + ContextAdapterKind::Export(_) | ContextAdapterKind::Adapter => false, + ContextAdapterKind::Import(_) => builder.cx.config.debug, }); builder.catch(catch); - let mut arg_names = &None; + let mut args = &None; let mut asyncness = false; + let mut variadic = false; + let mut generate_jsdoc = false; + let mut ret_ty_override = &None; + let mut ret_desc = &None; match kind { - Kind::Export(export) => { - arg_names = &export.arg_names; + ContextAdapterKind::Export(export) => { + args = &export.args; asyncness = export.asyncness; + variadic = export.variadic; + generate_jsdoc = export.generate_jsdoc; + ret_ty_override = &export.fn_ret_ty_override; + ret_desc = &export.fn_ret_desc; match &export.kind { AuxExportKind::Function(_) => {} - AuxExportKind::StaticFunction { .. } => {} AuxExportKind::Constructor(class) => builder.constructor(class), - AuxExportKind::Getter { consumed, .. } - | AuxExportKind::Setter { consumed, .. } - | AuxExportKind::Method { consumed, .. } => builder.method(*consumed), + AuxExportKind::Method { receiver, .. } => match receiver { + AuxReceiverKind::None => {} + AuxReceiverKind::Borrowed => builder.method(false), + AuxReceiverKind::Owned => builder.method(true), + }, } } - Kind::Import(_) => {} - Kind::Adapter => {} + ContextAdapterKind::Import(_) => {} + ContextAdapterKind::Adapter => {} } + // an internal debug name to help with error messages + let debug_name = match kind { + ContextAdapterKind::Import(i) => { + let i = builder.cx.module.imports.get(i); + format!("import of `{}::{}`", i.module, i.name) + } + ContextAdapterKind::Export(e) => format!("`{}`", e.debug_name), + ContextAdapterKind::Adapter => format!("adapter {}", id.0), + }; + // Process the `binding` and generate a bunch of JS/TypeScript/etc. let binding::JsFunction { ts_sig, ts_arg_tys, ts_ret_ty, + ts_refs, js_doc, + ts_doc, code, might_be_optional_field, catch, log_error, } = builder - .process(&adapter, instrs, arg_names, asyncness) - .with_context(|| match kind { - Kind::Export(e) => format!("failed to generate bindings for `{}`", e.debug_name), - Kind::Import(i) => { - let i = builder.cx.module.imports.get(i); - format!( - "failed to generate bindings for import of `{}::{}`", - i.module, i.name - ) - } - Kind::Adapter => format!("failed to generates bindings for adapter"), - })?; + .process( + adapter, + instrs, + args, + asyncness, + variadic, + generate_jsdoc, + &debug_name, + ret_ty_override, + ret_desc, + ) + .with_context(|| "failed to generates bindings for ".to_string() + &debug_name)?; + + self.typescript_refs.extend(ts_refs); // Once we've got all the JS then put it in the right location depending // on what's being exported. match kind { - Kind::Export(export) => { - assert_eq!(catch, false); - assert_eq!(log_error, false); + ContextAdapterKind::Export(export) => { + assert!(!catch); + assert!(!log_error); - let ts_sig = match export.generate_typescript { - true => Some(ts_sig.as_str()), - false => None, - }; + let ts_sig = export.generate_typescript.then_some(ts_sig.as_str()); + + // only include `ts_doc` for format if there were arguments or a return var description + // this is because if there are no arguments or return var description, `ts_doc` + // provides no additional value on top of what `ts_sig` already does + let ts_doc_opts = (ret_desc.is_some() + || args + .as_ref() + .is_some_and(|v| v.iter().any(|arg| arg.desc.is_some()))) + .then_some(ts_doc); + + let js_docs = format_doc_comments(&export.comments, Some(js_doc)); + let ts_docs = format_doc_comments(&export.comments, ts_doc_opts); - let docs = format_doc_comments(&export.comments, Some(js_doc)); match &export.kind { AuxExportKind::Function(name) => { if let Some(ts_sig) = ts_sig { - self.typescript.push_str(&docs); + self.typescript.push_str(&ts_docs); self.typescript.push_str("export function "); - self.typescript.push_str(&name); + self.typescript.push_str(name); self.typescript.push_str(ts_sig); self.typescript.push_str(";\n"); } - self.export(&name, &format!("function{}", code), Some(&docs))?; - self.globals.push_str("\n"); + + self.export( + name, + ExportJs::Function(&format!("function{}", code)), + Some(&js_docs), + )?; + self.globals.push('\n'); } AuxExportKind::Constructor(class) => { let exported = require_class(&mut self.exported_classes, class); + if exported.has_constructor { bail!("found duplicate constructor for class `{}`", class); } + exported.has_constructor = true; - exported.push(&docs, "constructor", "", &code, ts_sig); + exported.push("constructor", "", &js_docs, &code, &ts_docs, ts_sig); } - AuxExportKind::Getter { class, field, .. } => { - let ret_ty = match export.generate_typescript { - true => match &ts_ret_ty { - Some(s) => Some(s.as_str()), - _ => None, - }, - false => None, - }; + AuxExportKind::Method { + class, + name, + receiver, + kind, + } => { let exported = require_class(&mut self.exported_classes, class); - exported.push_getter(&docs, field, &code, ret_ty); - } - AuxExportKind::Setter { class, field, .. } => { - let arg_ty = match export.generate_typescript { - true => Some(ts_arg_tys[0].as_str()), - false => None, + + let mut prefix = String::new(); + if receiver.is_static() { + prefix += "static "; + } + let ts = match kind { + AuxExportedMethodKind::Method => ts_sig, + AuxExportedMethodKind::Getter => { + prefix += "get "; + // For getters and setters, we generate a separate TypeScript definition. + if export.generate_typescript { + let location = FieldLocation { + name: name.clone(), + is_static: receiver.is_static(), + }; + let accessor = FieldAccessor { + // This is only set to `None` when generating a constructor. + ty: ts_ret_ty.expect("missing return type for getter"), + docs: ts_docs.clone(), + is_optional: false, + }; + + exported.push_accessor_ts(location, accessor, false); + } + // Add the getter to the list of readable fields (used to generate `toJSON`) + exported.readable_properties.push(name.clone()); + // Ignore the raw signature. + None + } + AuxExportedMethodKind::Setter => { + prefix += "set "; + if export.generate_typescript { + let location = FieldLocation { + name: name.clone(), + is_static: receiver.is_static(), + }; + let accessor = FieldAccessor { + ty: ts_arg_tys[0].clone(), + docs: ts_docs.clone(), + is_optional: might_be_optional_field, + }; + + exported.push_accessor_ts(location, accessor, true); + } + None + } }; - let exported = require_class(&mut self.exported_classes, class); - exported.push_setter(&docs, field, &code, arg_ty, might_be_optional_field); - } - AuxExportKind::StaticFunction { class, name } => { - let exported = require_class(&mut self.exported_classes, class); - exported.push(&docs, name, "static ", &code, ts_sig); - } - AuxExportKind::Method { class, name, .. } => { - let exported = require_class(&mut self.exported_classes, class); - exported.push(&docs, name, "", &code, ts_sig); + + exported.push(name, &prefix, &js_docs, &code, &ts_docs, ts); } } } - Kind::Import(core) => { + ContextAdapterKind::Import(core) => { let code = if catch { format!( "function() {{ return handleError(function {}, arguments) }}", @@ -2484,9 +3018,9 @@ impl<'a> Context<'a> { self.wasm_import_definitions.insert(core, code); } - Kind::Adapter => { - assert_eq!(catch, false); - assert_eq!(log_error, false); + ContextAdapterKind::Adapter => { + assert!(!catch); + assert!(!log_error); self.globals.push_str("function "); self.globals.push_str(&self.adapter_name(id)); @@ -2494,7 +3028,7 @@ impl<'a> Context<'a> { self.globals.push_str("\n\n"); } } - return Ok(()); + Ok(()) } /// Returns whether we should disable the logic, in debug mode, to catch an @@ -2513,7 +3047,7 @@ impl<'a> Context<'a> { } } - /// Attempts to directly hook up the `id` import in the wasm module with + /// Attempts to directly hook up the `id` import in the Wasm module with /// the `instrs` specified. /// /// If this succeeds it returns `Ok(true)`, otherwise if it cannot be @@ -2536,10 +3070,7 @@ impl<'a> Context<'a> { } Instruction::CallExport(_) | Instruction::CallTableElement(_) - | Instruction::Standard(wit_walrus::Instruction::CallCore(_)) - | Instruction::Standard(wit_walrus::Instruction::CallAdapter(_)) => { - return Ok(false) - } + | Instruction::CallCore(_) => return Ok(false), _ => {} } } @@ -2581,30 +3112,30 @@ impl<'a> Context<'a> { // If there's no field projection happening here and this is a direct // import from an ES-looking module, then we can actually just hook this - // up directly in the wasm file itself. Note that this is covered in the + // up directly in the Wasm file itself. Note that this is covered in the // various output formats as well: // - // * `bundler` - they think wasm is an ES module anyway + // * `bundler` - they think Wasm is an ES module anyway // * `web` - we're sure to emit more `import` directives during // `gen_init` and we update the import object accordingly. - // * `nodejs` - the polyfill we have for requiring a wasm file as a node + // * `nodejs` - the polyfill we have for requiring a Wasm file as a node // module will naturally emit `require` directives for the module - // listed on each wasm import. + // listed on each Wasm import. // * `no-modules` - imports aren't allowed here anyway from other // modules and an error is generated. - if js.fields.len() == 0 { + if js.fields.is_empty() { match &js.name { JsImportName::Module { module, name } => { let import = self.module.imports.get_mut(id); - import.module = module.clone(); - import.name = name.clone(); + import.module.clone_from(module); + import.name.clone_from(name); return Ok(true); } JsImportName::LocalModule { module, name } => { let module = self.config.local_module_name(module); let import = self.module.imports.get_mut(id); import.module = module; - import.name = name.clone(); + import.name.clone_from(name); return Ok(true); } JsImportName::InlineJs { @@ -2617,7 +3148,7 @@ impl<'a> Context<'a> { .inline_js_module_name(unique_crate_identifier, *snippet_idx_in_crate); let import = self.module.imports.get_mut(id); import.module = module; - import.name = name.clone(); + import.name.clone_from(name); return Ok(true); } @@ -2629,6 +3160,21 @@ impl<'a> Context<'a> { } } + if let JsImportName::Global { .. } | JsImportName::VendorPrefixed { .. } = js.name { + // We generally cannot import globals directly, because users can + // change most globals at runtime. + // + // An obvious example of this when the object literally changes + // (e.g. binding `foo.bar`), but polyfills can also change the + // object or fundtion. + // + // Late binding is another issue. The function might not even be + // defined when the Wasm module is instantiated. In such cases, + // there is an observable difference between a direct import and a + // JS shim calling the function. + return Ok(false); + } + self.expose_not_defined(); let name = self.import_name(js)?; let js = format!( @@ -2641,20 +3187,15 @@ impl<'a> Context<'a> { fn representable_without_js_glue(&self, instrs: &[InstructionData]) -> bool { use Instruction::*; - let standard_enabled = self.config.wasm_interface_types; let mut last_arg = None; let mut saw_call = false; for instr in instrs { match instr.instr { - // Is an adapter section getting emitted? If so, then every - // standard operation is natively supported! - Standard(_) if standard_enabled => {} - // Fetching arguments is just that, a fetch, so no need for // glue. Note though that the arguments must be fetched in order // for this to actually work, - Standard(wit_walrus::Instruction::ArgGet(i)) => { + ArgGet(i) => { if saw_call { return false; } @@ -2669,18 +3210,16 @@ impl<'a> Context<'a> { // needed. CallAdapter(_) => saw_call = true, - // Conversions to wasm integers are always supported since + // Conversions to Wasm integers are always supported since // they're coerced into i32/f32/f64 appropriately. - Standard(wit_walrus::Instruction::IntToWasm { .. }) => {} + Int32ToWasm => {} + Int64ToWasm => {} - // Converts from wasm to JS, however, only supports most - // integers. Converting into a u32 isn't supported because we + // Converting into a u32 isn't supported because we // need to generate glue to change the sign. - Standard(wit_walrus::Instruction::WasmToInt { - output: wit_walrus::ValType::U32, - .. - }) => return false, - Standard(wit_walrus::Instruction::WasmToInt { .. }) => {} + WasmToInt32 { unsigned_32: false } => {} + // A Wasm `i64` is already a signed JS BigInt, so no glue needed. + WasmToInt64 { unsigned: false } => {} // JS spec automatically coerces boolean values to i32 of 0 or 1 // depending on true/false @@ -2690,13 +3229,13 @@ impl<'a> Context<'a> { } } - return true; + true } /// Generates a JS snippet appropriate for invoking `import`. /// /// This is generating code for `binding` where `bindings` has more type - /// infomation. The `args` array is the list of JS expressions representing + /// information. The `args` array is the list of JS expressions representing /// the arguments to pass to JS. Finally `variadic` indicates whether the /// last argument is a list to be splatted in a variadic way, and `prelude` /// is a location to push some more initialization JS if necessary. @@ -2713,13 +3252,13 @@ impl<'a> Context<'a> { ) -> Result { let variadic_args = |js_arguments: &[String]| { Ok(if !variadic { - format!("{}", js_arguments.join(", ")) + js_arguments.join(", ") } else { let (last_arg, args) = match js_arguments.split_last() { Some(pair) => pair, None => bail!("a function with no arguments cannot be variadic"), }; - if args.len() > 0 { + if !args.is_empty() { format!("{}, ...{}", args.join(", "), last_arg) } else { format!("...{}", last_arg) @@ -2733,7 +3272,7 @@ impl<'a> Context<'a> { AuxValue::Bare(js) => self.import_name(js)?, _ => bail!("invalid import set for constructor"), }; - Ok(format!("new {}({})", js, variadic_args(&args)?)) + Ok(format!("new {}({})", js, variadic_args(args)?)) } AdapterJsImportKind::Method => { let descriptor = |anchor: &str, extra: &str, field: &str, which: &str| { @@ -2765,20 +3304,25 @@ impl<'a> Context<'a> { descriptor(&class, "", field, "set") } }; - Ok(format!("{}.call({})", js, variadic_args(&args)?)) + Ok(format!("{}.call({})", js, variadic_args(args)?)) } AdapterJsImportKind::Normal => { let js = match val { AuxValue::Bare(js) => self.import_name(js)?, _ => bail!("invalid import set for free function"), }; - Ok(format!("{}({})", js, variadic_args(&args)?)) + Ok(format!("{}({})", js, variadic_args(args)?)) } }, AuxImport::ValueWithThis(class, name) => { let class = self.import_name(class)?; - Ok(format!("{}.{}({})", class, name, variadic_args(&args)?)) + Ok(format!( + "{}{}({})", + class, + property_accessor(name), + variadic_args(args)? + )) } AuxImport::Instanceof(js) => { @@ -2786,21 +3330,46 @@ impl<'a> Context<'a> { assert!(!variadic); assert_eq!(args.len(), 1); let js = self.import_name(js)?; - Ok(format!("{} instanceof {}", args[0], js)) + write!( + prelude, + "\ + let result; + try {{ + result = {} instanceof {}; + }} catch (_) {{ + result = false; + }} + ", + args[0], js, + ) + .unwrap(); + Ok("result".to_owned()) } - AuxImport::Static(js) => { + AuxImport::Static { js, optional } => { assert!(kind == AdapterJsImportKind::Normal); assert!(!variadic); assert_eq!(args.len(), 0); - self.import_name(js) + self.import_static(js, *optional) + } + + AuxImport::String(string) => { + assert!(kind == AdapterJsImportKind::Normal); + assert!(!variadic); + assert_eq!(args.len(), 0); + + let mut escaped = String::with_capacity(string.len()); + string.chars().for_each(|c| match c { + '`' | '\\' | '$' => escaped.extend(['\\', c]), + _ => escaped.extend([c]), + }); + Ok(format!("`{escaped}`")) } AuxImport::Closure { dtor, mutable, adapter, - nargs: _, } => { assert!(kind == AdapterJsImportKind::Normal); assert!(!variadic); @@ -2837,14 +3406,19 @@ impl<'a> Context<'a> { Some(pair) => pair, None => bail!("structural method calls must have at least one argument"), }; - Ok(format!("{}.{}({})", receiver, name, variadic_args(args)?)) + Ok(format!( + "{}{}({})", + receiver, + property_accessor(name), + variadic_args(args)? + )) } AuxImport::StructuralGetter(field) => { assert!(kind == AdapterJsImportKind::Normal); assert!(!variadic); assert_eq!(args.len(), 1); - Ok(format!("{}.{}", args[0], field)) + Ok(format!("{}{}", args[0], property_accessor(field))) } AuxImport::StructuralClassGetter(class, field) => { @@ -2852,14 +3426,19 @@ impl<'a> Context<'a> { assert!(!variadic); assert_eq!(args.len(), 0); let class = self.import_name(class)?; - Ok(format!("{}.{}", class, field)) + Ok(format!("{}{}", class, property_accessor(field))) } AuxImport::StructuralSetter(field) => { assert!(kind == AdapterJsImportKind::Normal); assert!(!variadic); assert_eq!(args.len(), 2); - Ok(format!("{}.{} = {}", args[0], field, args[1])) + Ok(format!( + "{}{} = {}", + args[0], + property_accessor(field), + args[1] + )) } AuxImport::StructuralClassSetter(class, field) => { @@ -2867,7 +3446,12 @@ impl<'a> Context<'a> { assert!(!variadic); assert_eq!(args.len(), 1); let class = self.import_name(class)?; - Ok(format!("{}.{} = {}", class, field, args[0])) + Ok(format!( + "{}{} = {}", + class, + property_accessor(field), + args[0] + )) } AuxImport::IndexingGetterOfClass(class) => { @@ -2928,6 +3512,59 @@ impl<'a> Context<'a> { assert!(!variadic); self.invoke_intrinsic(intrinsic, args, prelude) } + + AuxImport::LinkTo(path, content) => { + assert!(kind == AdapterJsImportKind::Normal); + assert!(!variadic); + assert_eq!(args.len(), 0); + if self.config.split_linked_modules { + let base = match self.config.mode { + OutputMode::Web + | OutputMode::Bundler { .. } + | OutputMode::Deno + | OutputMode::Node { module: true } => "import.meta.url", + OutputMode::Node { module: false } => { + "require('url').pathToFileURL(__filename)" + } + OutputMode::NoModules { .. } => { + prelude.push_str( + "if (script_src === undefined) { + throw new Error( + \"When `--split-linked-modules` is enabled on the `no-modules` target, \ + linked modules cannot be used outside of a web page's main thread.\n\ + \n\ + To fix this, disable `--split-linked-modules`.\" + ); + }", + ); + "script_src" + } + }; + Ok(format!("new URL('{}', {}).toString()", path, base)) + } else if let Some(content) = content { + let mut escaped = String::with_capacity(content.len()); + content.chars().for_each(|c| match c { + '`' | '\\' | '$' => escaped.extend(['\\', c]), + _ => escaped.extend([c]), + }); + prelude.push_str(&format!("const val = `{escaped}`;\n")); + Ok("typeof URL.createObjectURL === 'undefined' ? \ + \"data:application/javascript,\" + encodeURIComponent(val) : \ + URL.createObjectURL(new Blob([val], { type: \"text/javascript\" }))" + .to_owned()) + } else { + Err(anyhow!("wasm-bindgen needs to be invoked with `--split-linked-modules`, because \"{}\" cannot be embedded.\n\ + See https://rustwasm.github.io/wasm-bindgen/reference/cli.html#--split-linked-modules for details.", path)) + } + } + + AuxImport::UnwrapExportedClass(class) => { + assert!(kind == AdapterJsImportKind::Normal); + assert!(!variadic); + assert_eq!(args.len(), 1); + self.require_class_unwrap(class); + Ok(format!("{}.__unwrap({})", class, args[0])) + } } } @@ -2955,6 +3592,11 @@ impl<'a> Context<'a> { format!("typeof({}) === 'function'", args[0]) } + Intrinsic::IsArray => { + assert_eq!(args.len(), 1); + format!("Array.isArray({})", args[0]) + } + Intrinsic::IsUndefined => { assert_eq!(args.len(), 1); format!("{} === undefined", args[0]) @@ -2968,7 +3610,7 @@ impl<'a> Context<'a> { Intrinsic::IsObject => { assert_eq!(args.len(), 1); prelude.push_str(&format!("const val = {};\n", args[0])); - format!("typeof(val) === 'object' && val !== null") + "typeof(val) === 'object' && val !== null".to_string() } Intrinsic::IsSymbol => { @@ -3008,7 +3650,14 @@ impl<'a> Context<'a> { Intrinsic::TryIntoNumber => { assert_eq!(args.len(), 1); - format!("try {{ +{} }} catch(e) {{ e }}", args[0]) + prelude.push_str("let result;\n"); + writeln!( + prelude, + "try {{ result = +{} }} catch (e) {{ result = e }}", + args[0] + ) + .unwrap(); + "result".to_owned() } Intrinsic::Neg => { @@ -3068,7 +3717,22 @@ impl<'a> Context<'a> { Intrinsic::CheckedDiv => { assert_eq!(args.len(), 2); - format!("try {{ {} / {} }} catch (e) {{ if (e instanceof RangeError) {{ e }} else {{ throw e }} }}", args[0], args[1]) + prelude.push_str("let result;\n"); + writeln!( + prelude, + "try {{ + result = {} / {}; + }} catch (e) {{ + if (e instanceof RangeError) {{ + result = e; + }} else {{ + throw e; + }} + }}", + args[0], args[1] + ) + .unwrap(); + "result".to_owned() } Intrinsic::Mul => { @@ -3131,11 +3795,21 @@ impl<'a> Context<'a> { args[0].clone() } - Intrinsic::BigIntNew => { + Intrinsic::BigIntFromStr => { assert_eq!(args.len(), 1); format!("BigInt({})", args[0]) } + Intrinsic::BigIntFromI64 | Intrinsic::BigIntFromU64 => { + assert_eq!(args.len(), 1); + args[0].clone() + } + + Intrinsic::BigIntFromI128 | Intrinsic::BigIntFromU128 => { + assert_eq!(args.len(), 2); + format!("{} << BigInt(64) | {}", args[0], args[1]) + } + Intrinsic::StringNew => { assert_eq!(args.len(), 1); args[0].clone() @@ -3154,19 +3828,25 @@ impl<'a> Context<'a> { Intrinsic::NumberGet => { assert_eq!(args.len(), 1); prelude.push_str(&format!("const obj = {};\n", args[0])); - format!("typeof(obj) === 'number' ? obj : undefined") + "typeof(obj) === 'number' ? obj : undefined".to_string() } Intrinsic::StringGet => { assert_eq!(args.len(), 1); prelude.push_str(&format!("const obj = {};\n", args[0])); - format!("typeof(obj) === 'string' ? obj : undefined") + "typeof(obj) === 'string' ? obj : undefined".to_string() } Intrinsic::BooleanGet => { assert_eq!(args.len(), 1); prelude.push_str(&format!("const v = {};\n", args[0])); - format!("typeof(v) === 'boolean' ? (v ? 1 : 0) : 2") + "typeof(v) === 'boolean' ? (v ? 1 : 0) : 2".to_string() + } + + Intrinsic::BigIntGetAsI64 => { + assert_eq!(args.len(), 1); + prelude.push_str(&format!("const v = {};\n", args[0])); + "typeof(v) === 'bigint' ? v : undefined".to_string() } Intrinsic::Throw => { @@ -3186,13 +3866,23 @@ impl<'a> Context<'a> { Intrinsic::Module => { assert_eq!(args.len(), 0); - if !self.config.mode.no_modules() && !self.config.mode.web() { - bail!( + + match self.config.mode { + OutputMode::Web | OutputMode::NoModules { .. } => { + "__wbg_init.__wbindgen_wasm_module" + } + OutputMode::Node { .. } => "wasmModule", + _ => bail!( "`wasm_bindgen::module` is currently only supported with \ - `--target no-modules` and `--target web`" - ); + `--target no-modules`, `--target web` and `--target nodejs`" + ), } - format!("init.__wbindgen_wasm_module") + .to_string() + } + + Intrinsic::Exports => { + assert_eq!(args.len(), 0); + "wasm".to_string() } Intrinsic::Memory => { @@ -3238,6 +3928,40 @@ impl<'a> Context<'a> { "JSON.stringify(obj === undefined ? null : obj)".to_string() } + Intrinsic::CopyToTypedArray => { + assert_eq!(args.len(), 2); + format!( + "new Uint8Array({dst}.buffer, {dst}.byteOffset, {dst}.byteLength).set({src})", + src = args[0], + dst = args[1] + ) + } + + Intrinsic::Uint8ArrayNew + | Intrinsic::Uint8ClampedArrayNew + | Intrinsic::Uint16ArrayNew + | Intrinsic::Uint32ArrayNew + | Intrinsic::BigUint64ArrayNew + | Intrinsic::Int8ArrayNew + | Intrinsic::Int16ArrayNew + | Intrinsic::Int32ArrayNew + | Intrinsic::BigInt64ArrayNew + | Intrinsic::Float32ArrayNew + | Intrinsic::Float64ArrayNew => { + assert_eq!(args.len(), 1); + args[0].clone() + } + + Intrinsic::ArrayNew => { + assert_eq!(args.len(), 0); + "[]".to_string() + } + + Intrinsic::ArrayPush => { + assert_eq!(args.len(), 2); + format!("{}.push({})", args[0], args[1]) + } + Intrinsic::ExternrefHeapLiveCount => { assert_eq!(args.len(), 0); self.expose_global_heap(); @@ -3287,11 +4011,11 @@ impl<'a> Context<'a> { } fn generate_enum(&mut self, enum_: &AuxEnum) -> Result<(), Error> { - let docs = format_doc_comments(&enum_.comments, None); let mut variants = String::new(); if enum_.generate_typescript { - self.typescript.push_str(&docs); + self.typescript + .push_str(&format_doc_comments(&enum_.comments, None)); self.typescript .push_str(&format!("export enum {} {{", enum_.name)); } @@ -3299,38 +4023,95 @@ impl<'a> Context<'a> { let variant_docs = if comments.is_empty() { String::new() } else { - format_doc_comments(&comments, None) + format_doc_comments(comments, None) }; - if !variant_docs.is_empty() { - variants.push_str("\n"); - variants.push_str(&variant_docs); - } - variants.push_str(&format!("{}:{},", name, value)); - variants.push_str(&format!("\"{}\":\"{}\",", value, name)); + variants.push_str(&variant_docs); + variants.push_str(&format!("{}: {}, ", name, value)); + variants.push_str(&format!("\"{}\": \"{}\",\n", value, name)); if enum_.generate_typescript { - self.typescript.push_str("\n"); + self.typescript.push('\n'); if !variant_docs.is_empty() { - self.typescript.push_str(&variant_docs); + for line in variant_docs.lines() { + self.typescript.push_str(" "); + self.typescript.push_str(line); + self.typescript.push('\n'); + } } - self.typescript.push_str(&format!(" {},", name)); + self.typescript.push_str(&format!(" {name} = {value},")); } } if enum_.generate_typescript { self.typescript.push_str("\n}\n"); } + + // add an `@enum {1 | 2 | 3}` to ensure that enums type-check even without .d.ts + let mut at_enum = "@enum {".to_string(); + for (i, (_, value, _)) in enum_.variants.iter().enumerate() { + if i != 0 { + at_enum.push_str(" | "); + } + at_enum.push_str(&value.to_string()); + } + at_enum.push('}'); + let docs = format_doc_comments(&enum_.comments, Some(at_enum)); + self.export( &enum_.name, - &format!("Object.freeze({{ {} }})", variants), + ExportJs::Expression(&format!("Object.freeze({{\n{}}})", variants)), Some(&docs), )?; Ok(()) } + fn generate_string_enum(&mut self, string_enum: &AuxStringEnum) -> Result<(), Error> { + let variants: Vec<_> = string_enum + .variant_values + .iter() + .map(|v| format!("\"{v}\"")) + .collect(); + + if string_enum.generate_typescript + && self + .typescript_refs + .contains(&TsReference::StringEnum(string_enum.name.clone())) + { + let docs = format_doc_comments(&string_enum.comments, None); + let type_expr = if variants.is_empty() { + "never".to_string() + } else { + variants.join(" | ") + }; + + self.typescript.push_str(&docs); + self.typescript.push_str("type "); + self.typescript.push_str(&string_enum.name); + self.typescript.push_str(" = "); + self.typescript.push_str(&type_expr); + self.typescript.push_str(";\n"); + } + + if self.used_string_enums.contains(&string_enum.name) { + // only generate the internal string enum array if it's actually used + self.global(&format!( + "const __wbindgen_enum_{name} = [{values}];\n", + name = string_enum.name, + values = variants.join(", ") + )); + } + + Ok(()) + } + + fn expose_string_enum(&mut self, string_enum_name: &str) { + self.used_string_enums.insert(string_enum_name.to_string()); + } + fn generate_struct(&mut self, struct_: &AuxStruct) -> Result<(), Error> { let class = require_class(&mut self.exported_classes, &struct_.name); class.comments = format_doc_comments(&struct_.comments, None); class.is_inspectable = struct_.is_inspectable; + class.generate_typescript = struct_.generate_typescript; Ok(()) } @@ -3353,9 +4134,9 @@ impl<'a> Context<'a> { path.display() ), }; - let mut iter = object.iter(); + let iter = object.iter(); let mut value = None; - while let Some((key, v)) = iter.next() { + for (key, v) in iter { if key == "dependencies" { value = Some(v); break; @@ -3447,7 +4228,7 @@ impl<'a> Context<'a> { // Test for built-in const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val)); let className; - if (builtInMatches.length > 1) { + if (builtInMatches && builtInMatches.length > 1) { className = builtInMatches[1]; } else { // Failed to match the standard '[object ClassName]' @@ -3504,8 +4285,18 @@ impl<'a> Context<'a> { "memory".to_owned() } walrus::ExportItem::Function(f) => match &self.module.funcs.get(f).name { - Some(s) => to_js_identifier(s), - None => default_name, + Some(s) => { + let mut name = to_js_identifier(s); + + // Account for duplicate export names. + // See https://github.com/rustwasm/wasm-bindgen/issues/4371. + if self.module.exports.get_func(&name).is_ok() { + name.push_str(&self.next_export_idx.to_string()); + } + + name + } + _ => default_name, }, _ => default_name, }; @@ -3549,13 +4340,13 @@ impl<'a> Context<'a> { if self.stack_pointer_shim_injected { return Ok(()); } - let stack_pointer = match self.aux.shadow_stack_pointer { + let stack_pointer = match self.aux.stack_pointer { Some(s) => s, // In theory this shouldn't happen since malloc is included in - // most wasm binaries (and may be gc'd out) and that almost + // most Wasm binaries (and may be gc'd out) and that almost // always pulls in a stack pointer. We can try to synthesize // something here later if necessary. - None => bail!("failed to find shadow stack pointer"), + None => bail!("failed to find stack pointer"), }; use walrus::ir::*; @@ -3587,48 +4378,169 @@ impl<'a> Context<'a> { } } +/// A categorization of adapters for the purpose of code generation. +/// +/// This is different from [`AdapterKind`] and is only used internally in the +/// code generation process. +enum ContextAdapterKind<'a> { + /// An exported function, method, constrctor, or getter/setter. + Export(&'a AuxExport), + /// An imported function or intrinsic. + Import(walrus::ImportId), + Adapter, +} +impl<'a> ContextAdapterKind<'a> { + fn get(id: AdapterId, aux: &'a WasmBindgenAux, wit: &'a NonstandardWitSection) -> Self { + match aux.export_map.get(&id) { + Some(export) => ContextAdapterKind::Export(export), + None => { + let core = wit.implements.iter().find(|pair| pair.2 == id); + match core { + Some((core, _, _)) => ContextAdapterKind::Import(*core), + None => ContextAdapterKind::Adapter, + } + } + } + } +} + +/// Iterate over the adapters in a deterministic order. +fn iter_adapeter<'a>( + aux: &'a WasmBindgenAux, + wit: &'a NonstandardWitSection, + module: &Module, +) -> Vec<(AdapterId, &'a Adapter, ContextAdapterKind<'a>)> { + let mut adapters: Vec<_> = wit + .adapters + .iter() + .map(|(id, adapter)| { + // we need the kind of the adapter to properly sort them + let kind = ContextAdapterKind::get(*id, aux, wit); + (*id, adapter, kind) + }) + .collect(); + + // Since `wit.adapters` is a BTreeMap, the adapters are already sorted by + // their ID. This is good enough for exports and adapters, but imports need + // to be sorted by their name. + // + // Note: we do *NOT* want to sort exports by name. By default, exports are + // the order in which they were defined in the Rust code. Sorting them by + // name would break that order and take away control from the user. + + adapters.sort_by(|(_, _, a), (_, _, b)| { + fn get_kind_order(kind: &ContextAdapterKind) -> u8 { + match kind { + ContextAdapterKind::Import(_) => 0, + ContextAdapterKind::Export(_) => 1, + ContextAdapterKind::Adapter => 2, + } + } + + match (a, b) { + (ContextAdapterKind::Import(a), ContextAdapterKind::Import(b)) => { + let a = module.imports.get(*a); + let b = module.imports.get(*b); + a.name.cmp(&b.name) + } + _ => get_kind_order(a).cmp(&get_kind_order(b)), + } + }); + + adapters +} + +/// Iterate over the imports in a deterministic order. +fn iter_by_import<'a, T>( + map: &'a HashMap, + module: &Module, +) -> Vec<(&'a ImportId, &'a T)> { + let mut items: Vec<_> = map.iter().collect(); + + // Sort by import name. + // + // Imports have a name and a module, and it's important that we *ignore* + // the module. The module of an import is set to its final value *during* + // code generation, so using it here would cause the imports to be sorted + // differently depending on which part of the code generation process we're + // in. + items.sort_by(|&(a, _), &(b, _)| { + let a = module.imports.get(*a); + let b = module.imports.get(*b); + + a.name.cmp(&b.name) + }); + + items +} + fn check_duplicated_getter_and_setter_names( exports: &[(&AdapterId, &AuxExport)], ) -> Result<(), Error> { - let verify_exports = - |first_class, first_field, second_class, second_field| -> Result<(), Error> { - let both_are_in_the_same_class = first_class == second_class; - let both_are_referencing_the_same_field = first_field == second_field; - if both_are_in_the_same_class && both_are_referencing_the_same_field { - bail!(format!( - "There can be only one getter/setter definition for `{}` in `{}`", - first_field, first_class - )); - } - Ok(()) - }; + fn verify_exports( + first_class: &str, + first_field: &str, + first_receiver: &AuxReceiverKind, + second_class: &str, + second_field: &str, + second_receiver: &AuxReceiverKind, + ) -> Result<(), Error> { + let both_are_in_the_same_class = first_class == second_class; + let both_are_referencing_the_same_field = first_field == second_field + && first_receiver.is_static() == second_receiver.is_static(); + if both_are_in_the_same_class && both_are_referencing_the_same_field { + bail!(format!( + "There can be only one getter/setter definition for `{}` in `{}`", + first_field, first_class + )); + } + Ok(()) + } for (idx, (_, first_export)) in exports.iter().enumerate() { for (_, second_export) in exports.iter().skip(idx + 1) { match (&first_export.kind, &second_export.kind) { ( - AuxExportKind::Getter { + AuxExportKind::Method { class: first_class, - field: first_field, - consumed: _, + name: first_name, + kind: AuxExportedMethodKind::Getter, + receiver: first_receiver, }, - AuxExportKind::Getter { + AuxExportKind::Method { class: second_class, - field: second_field, - consumed: _, + name: second_name, + kind: AuxExportedMethodKind::Getter, + receiver: second_receiver, }, - ) => verify_exports(first_class, first_field, second_class, second_field)?, + ) => verify_exports( + first_class, + first_name, + first_receiver, + second_class, + second_name, + second_receiver, + )?, ( - AuxExportKind::Setter { + AuxExportKind::Method { class: first_class, - field: first_field, - consumed: _, + name: first_name, + kind: AuxExportedMethodKind::Setter, + receiver: first_receiver, }, - AuxExportKind::Setter { + AuxExportKind::Method { class: second_class, - field: second_field, - consumed: _, + name: second_name, + kind: AuxExportedMethodKind::Setter, + receiver: second_receiver, }, - ) => verify_exports(first_class, first_field, second_class, second_field)?, + ) => verify_exports( + first_class, + first_name, + first_receiver, + second_class, + second_name, + second_receiver, + )?, _ => {} } } @@ -3637,13 +4549,29 @@ fn check_duplicated_getter_and_setter_names( } fn format_doc_comments(comments: &str, js_doc_comments: Option) -> String { - let body: String = comments.lines().map(|c| format!("*{}\n", c)).collect(); + let body: String = comments.lines().fold(String::new(), |mut output, c| { + output.push_str(" *"); + if !c.is_empty() && !c.starts_with(' ') { + output.push(' '); + } + output.push_str(c); + output.push('\n'); + output + }); let doc = if let Some(docs) = js_doc_comments { - docs.lines().map(|l| format!("* {}\n", l)).collect() + docs.lines().fold(String::new(), |mut output: String, l| { + let _ = writeln!(output, " * {}", l); + output + }) } else { String::new() }; - format!("/**\n{}{}*/\n", body, doc) + if body.is_empty() && doc.is_empty() { + // don't emit empty doc comments + String::new() + } else { + format!("/**\n{}{} */\n", body, doc) + } } fn require_class<'a>( @@ -3654,25 +4582,46 @@ fn require_class<'a>( .as_mut() .expect("classes already written") .entry(name.to_string()) - .or_insert_with(ExportedClass::default) + .or_default() +} + +/// Returns a string to tack on to the end of an expression to access a +/// property named `name` of the object that expression resolves to. +/// +/// In most cases, this is `.`, generating accesses like `foo.bar`. +/// However, if `name` is not a valid JavaScript identifier, it becomes +/// `[""]` instead, creating accesses like `foo["kebab-case"]`. +fn property_accessor(name: &str) -> String { + if is_valid_ident(name) { + format!(".{name}") + } else { + format!("[\"{}\"]", name.escape_default()) + } } impl ExportedClass { fn push( &mut self, - docs: &str, function_name: &str, function_prefix: &str, + js_docs: &str, js: &str, + ts_docs: &str, ts: Option<&str>, ) { - self.contents.push_str(docs); + self.contents.push_str(js_docs); self.contents.push_str(function_prefix); self.contents.push_str(function_name); self.contents.push_str(js); - self.contents.push_str("\n"); + self.contents.push('\n'); if let Some(ts) = ts { - self.typescript.push_str(docs); + if !ts_docs.is_empty() { + for line in ts_docs.lines() { + self.typescript.push_str(" "); + self.typescript.push_str(line); + self.typescript.push('\n'); + } + } self.typescript.push_str(" "); self.typescript.push_str(function_prefix); self.typescript.push_str(function_name); @@ -3681,65 +4630,34 @@ impl ExportedClass { } } - /// Used for adding a getter to a class, mainly to ensure that TypeScript - /// generation is handled specially. - fn push_getter(&mut self, docs: &str, field: &str, js: &str, ret_ty: Option<&str>) { - self.push_accessor(docs, field, js, "get "); - if let Some(ret_ty) = ret_ty { - self.push_accessor_ts(docs, field, ret_ty, false); - } - self.readable_properties.push(field.to_string()); - } - - /// Used for adding a setter to a class, mainly to ensure that TypeScript - /// generation is handled specially. - fn push_setter( - &mut self, - docs: &str, - field: &str, - js: &str, - ret_ty: Option<&str>, - might_be_optional_field: bool, - ) { - self.push_accessor(docs, field, js, "set "); - if let Some(ret_ty) = ret_ty { - let is_optional = self.push_accessor_ts(docs, field, ret_ty, true); - *is_optional = might_be_optional_field; - } - } - fn push_accessor_ts( &mut self, - docs: &str, - field: &str, - ret_ty: &str, + location: FieldLocation, + accessor: FieldAccessor, is_setter: bool, - ) -> &mut bool { - let (ty, accessor_docs, has_setter, is_optional) = self + ) { + let size = self.typescript_fields.len(); + let field = self .typescript_fields - .entry(field.to_string()) - .or_insert_with(Default::default); - - *ty = ret_ty.to_string(); - // Deterministic output: always use the getter's docs if available - if !docs.is_empty() && (accessor_docs.is_empty() || !is_setter) { - *accessor_docs = docs.to_owned(); + .entry(location) + .or_insert_with_key(|location| FieldInfo { + name: location.name.to_string(), + is_static: location.is_static, + order: size, + getter: None, + setter: None, + }); + + if is_setter { + field.setter = Some(accessor); + } else { + field.getter = Some(accessor); } - *has_setter |= is_setter; - is_optional - } - - fn push_accessor(&mut self, docs: &str, field: &str, js: &str, prefix: &str) { - self.contents.push_str(docs); - self.contents.push_str(prefix); - self.contents.push_str(field); - self.contents.push_str(js); - self.contents.push_str("\n"); } } struct MemView { - name: &'static str, + name: Cow<'static, str>, num: usize, } diff --git a/crates/cli-support/src/lib.rs b/crates/cli-support/src/lib.rs index d767be55d7e..a07f48306a1 100755 --- a/crates/cli-support/src/lib.rs +++ b/crates/cli-support/src/lib.rs @@ -18,7 +18,6 @@ mod externref; mod intrinsic; mod js; mod multivalue; -mod throw2unreachable; pub mod wasm2es6js; mod wit; @@ -30,21 +29,17 @@ pub struct Bindgen { typescript: bool, omit_imports: bool, demangle: bool, + keep_lld_exports: bool, keep_debug: bool, remove_name_section: bool, remove_producers_section: bool, omit_default_module_path: bool, emit_start: bool, - // Experimental support for weakrefs, an upcoming ECMAScript feature. - // Currently only enable-able through an env var. - weak_refs: bool, - // Support for the wasm threads proposal, transforms the wasm module to be - // "ready to be instantiated on any thread" - threads: wasm_bindgen_threads_xform::Config, externref: bool, multi_value: bool, - wasm_interface_types: bool, encode_into: EncodeInto, + split_linked_modules: bool, + symbol_dispose: bool, } pub struct Output { @@ -53,12 +48,7 @@ pub struct Output { generated: Generated, } -enum Generated { - InterfaceTypes, - Js(JsGenerated), -} - -struct JsGenerated { +struct Generated { mode: OutputMode, js: String, ts: String, @@ -74,13 +64,14 @@ enum OutputMode { Bundler { browser_only: bool }, Web, NoModules { global: String }, - Node { experimental_modules: bool }, + Node { module: bool }, Deno, } enum Input { Path(PathBuf), Module(Module, String), + Bytes(Vec, String), None, } @@ -94,8 +85,8 @@ impl Bindgen { pub fn new() -> Bindgen { let externref = env::var("WASM_BINDGEN_ANYREF").is_ok() || env::var("WASM_BINDGEN_EXTERNREF").is_ok(); - let wasm_interface_types = env::var("WASM_INTERFACE_TYPES").is_ok(); let multi_value = env::var("WASM_BINDGEN_MULTI_VALUE").is_ok(); + let symbol_dispose = env::var("WASM_BINDGEN_EXPERIMENTAL_SYMBOL_DISPOSE").is_ok(); Bindgen { input: Input::None, out_name: None, @@ -106,17 +97,17 @@ impl Bindgen { typescript: false, omit_imports: false, demangle: true, + keep_lld_exports: false, keep_debug: false, remove_name_section: false, remove_producers_section: false, emit_start: true, - weak_refs: env::var("WASM_BINDGEN_WEAKREF").is_ok(), - threads: threads_config(), - externref: externref || wasm_interface_types, - multi_value: multi_value || wasm_interface_types, - wasm_interface_types, + externref, + multi_value, encode_into: EncodeInto::Test, omit_default_module_path: true, + split_linked_modules: false, + symbol_dispose, } } @@ -130,11 +121,7 @@ impl Bindgen { self } - pub fn weak_refs(&mut self, enable: bool) -> &mut Bindgen { - self.weak_refs = enable; - self - } - + #[deprecated = "automatically detected via `-Ctarget-feature=+reference-types`"] pub fn reference_types(&mut self, enable: bool) -> &mut Bindgen { self.externref = enable; self @@ -144,7 +131,14 @@ impl Bindgen { pub fn input_module(&mut self, name: &str, module: Module) -> &mut Bindgen { let name = name.to_string(); self.input = Input::Module(module, name); - return self; + self + } + + /// Specify the input as the provided Wasm bytes. + pub fn input_bytes(&mut self, name: &str, bytes: Vec) -> &mut Bindgen { + let name = name.to_string(); + self.input = Input::Bytes(bytes, name); + self } fn switch_mode(&mut self, mode: OutputMode, flag: &str) -> Result<(), Error> { @@ -160,23 +154,16 @@ impl Bindgen { pub fn nodejs(&mut self, node: bool) -> Result<&mut Bindgen, Error> { if node { - self.switch_mode( - OutputMode::Node { - experimental_modules: false, - }, - "--target nodejs", - )?; + self.switch_mode(OutputMode::Node { module: false }, "--target nodejs")?; } Ok(self) } - pub fn nodejs_experimental_modules(&mut self, node: bool) -> Result<&mut Bindgen, Error> { + pub fn nodejs_module(&mut self, node: bool) -> Result<&mut Bindgen, Error> { if node { self.switch_mode( - OutputMode::Node { - experimental_modules: true, - }, - "--nodejs-experimental-modules", + OutputMode::Node { module: true }, + "--target experimental-nodejs-module", )?; } Ok(self) @@ -259,6 +246,11 @@ impl Bindgen { self } + pub fn keep_lld_exports(&mut self, keep_lld_exports: bool) -> &mut Bindgen { + self.keep_lld_exports = keep_lld_exports; + self + } + pub fn keep_debug(&mut self, keep_debug: bool) -> &mut Bindgen { self.keep_debug = keep_debug; self @@ -289,6 +281,11 @@ impl Bindgen { self } + pub fn split_linked_modules(&mut self, split_linked_modules: bool) -> &mut Bindgen { + self.split_linked_modules = split_linked_modules; + self + } + pub fn generate>(&mut self, path: P) -> Result<(), Error> { self.generate_output()?.emit(path.as_ref()) } @@ -296,7 +293,7 @@ impl Bindgen { pub fn stem(&self) -> Result<&str, Error> { Ok(match &self.input { Input::None => bail!("must have an input by now"), - Input::Module(_, name) => name, + Input::Module(_, name) | Input::Bytes(_, name) => name, Input::Path(path) => match &self.out_name { Some(name) => name, None => path.file_stem().unwrap().to_str().unwrap(), @@ -312,30 +309,36 @@ impl Bindgen { mem::replace(m, blank_module) } Input::Path(ref path) => { - let wasm = wit_text::parse_file(&path) - .with_context(|| format!("failed to read `{}`", path.display()))?; - wit_validator::validate(&wasm) - .with_context(|| format!("failed to validate `{}`", path.display()))?; - let module = walrus::ModuleConfig::new() - // Skip validation of the module as LLVM's output is - // generally already well-formed and so we won't gain much - // from re-validating. Additionally LLVM's current output - // for threads includes atomic instructions but doesn't - // include shared memory, so it fails that part of - // validation! - .strict_validate(false) - .generate_dwarf(self.keep_debug) - .generate_name_section(!self.remove_name_section) - .generate_producers_section(!self.remove_producers_section) - .on_parse(wit_walrus::on_parse) - .parse(&wasm) - .context("failed to parse input file as wasm")?; - module + let bytes = std::fs::read(path) + .with_context(|| format!("failed reading '{}'", path.display()))?; + self.module_from_bytes(&bytes).with_context(|| { + format!("failed getting Wasm module for '{}'", path.display()) + })? } + Input::Bytes(ref bytes, _) => self + .module_from_bytes(bytes) + .context("failed getting Wasm module")?, }; - self.threads - .run(&mut module) + // Enable reference type transformations if the module is already using it. + if let Ok(true) = wasm_bindgen_wasm_conventions::target_feature(&module, "reference-types") + { + self.externref = true; + } + + // Enable multivalue transformations if the module is already using it. + if let Ok(true) = wasm_bindgen_wasm_conventions::target_feature(&module, "multivalue") { + self.multi_value = true; + } + + // Check that no exported symbol is called "default" if we target web. + if matches!(self.mode, OutputMode::Web) + && module.exports.iter().any(|export| export.name == "default") + { + bail!("exported symbol \"default\" not allowed for --target web") + } + + let thread_count = wasm_bindgen_threads_xform::run(&mut module) .with_context(|| "failed to prepare module for threading")?; // If requested, turn all mangled symbols into prettier unmangled @@ -343,31 +346,38 @@ impl Bindgen { if self.demangle { demangle(&mut module); } - unexported_unused_lld_things(&mut module); + if !self.keep_lld_exports { + unexported_unused_lld_things(&mut module); + } // We're making quite a few changes, list ourselves as a producer. module .producers .add_processed_by("wasm-bindgen", &wasm_bindgen_shared::version()); + // Parse and remove our custom section before executing descriptors. + // That includes checking that the binary has the same schema version + // as this version of the CLI, which is why we do it first - to make + // sure that this binary was produced by a compatible version of the + // wasm-bindgen macro before attempting to interpret our unstable + // descriptor format. That way, we give a more helpful version mismatch + // error instead of an unhelpful panic if an incompatible descriptor is + // found. + let mut storage = Vec::new(); + let programs = wit::extract_programs(&mut module, &mut storage)?; + // Learn about the type signatures of all wasm-bindgen imports and // exports by executing `__wbindgen_describe_*` functions. This'll // effectively move all the descriptor functions to their own custom // sections. descriptors::execute(&mut module)?; - // Process and remove our raw custom sections emitted by the - // #[wasm_bindgen] macro and the compiler. In their stead insert a - // forward-compatible wasm interface types section as well as an + // Process the custom section we extracted earlier. In its stead insert + // a forward-compatible Wasm interface types section as well as an // auxiliary section for all sorts of miscellaneous information and // features #[wasm_bindgen] supports that aren't covered by wasm // interface types. - wit::process( - &mut module, - self.externref, - self.wasm_interface_types, - self.emit_start, - )?; + wit::process(self, &mut module, programs, thread_count)?; // Now that we've got type information from the webidl processing pass, // touch up the output of rustc to insert externref shims where necessary. @@ -397,66 +407,41 @@ impl Bindgen { externref::force_contiguous_elements(&mut module)?; } - // If wasm interface types are enabled then the `__wbindgen_throw` - // intrinsic isn't available but it may be used by our runtime, so - // change all calls to this function to calls to `unreachable` instead. - // See more documentation in the pass documentation itself. - if self.wasm_interface_types { - throw2unreachable::run(&mut module); - } - // Using all of our metadata convert our module to a multi-value using // module if applicable. if self.multi_value { - if !self.wasm_interface_types { - anyhow::bail!( - "Wasm multi-value is currently only available when \ - Wasm interface types is also enabled" - ); - } multivalue::run(&mut module) .context("failed to transform return pointers into multi-value Wasm")?; } - // We've done a whole bunch of transformations to the wasm module, many + // We've done a whole bunch of transformations to the Wasm module, many // of which leave "garbage" lying around, so let's prune out all our // unnecessary things here. gc_module_and_adapters(&mut module); let stem = self.stem()?; - // We're ready for the final emission passes now. If we're in wasm - // interface types mode then we execute the various passes there and - // generate a valid interface types section into the wasm module. - // - // Otherwise we execute the JS generation passes to actually emit - // JS/TypeScript/etc. The output here is unused in wasm interfac - let generated = if self.wasm_interface_types { - wit::section::add(&mut module) - .context("failed to generate a standard interface types section")?; - Generated::InterfaceTypes - } else { - let aux = module - .customs - .delete_typed::() - .expect("aux section should be present"); - let adapters = module - .customs - .delete_typed::() - .unwrap(); - let mut cx = js::Context::new(&mut module, self, &adapters, &aux)?; - cx.generate()?; - let (js, ts, start) = cx.finalize(stem)?; - Generated::Js(JsGenerated { - snippets: aux.snippets.clone(), - local_modules: aux.local_modules.clone(), - mode: self.mode.clone(), - typescript: self.typescript, - npm_dependencies: cx.npm_dependencies.clone(), - js, - ts, - start, - }) + // Now we execute the JS generation passes to actually emit JS/TypeScript/etc. + let aux = module + .customs + .delete_typed::() + .expect("aux section should be present"); + let adapters = module + .customs + .delete_typed::() + .unwrap(); + let mut cx = js::Context::new(&mut module, self, &adapters, &aux)?; + cx.generate()?; + let (js, ts, start) = cx.finalize(stem)?; + let generated = Generated { + snippets: aux.snippets.clone(), + local_modules: aux.local_modules.clone(), + mode: self.mode.clone(), + typescript: self.typescript, + npm_dependencies: cx.npm_dependencies.clone(), + js, + ts, + start, }; Ok(Output { @@ -466,6 +451,22 @@ impl Bindgen { }) } + fn module_from_bytes(&self, bytes: &[u8]) -> Result { + walrus::ModuleConfig::new() + // Skip validation of the module as LLVM's output is + // generally already well-formed and so we won't gain much + // from re-validating. Additionally LLVM's current output + // for threads includes atomic instructions but doesn't + // include shared memory, so it fails that part of + // validation! + .strict_validate(false) + .generate_dwarf(self.keep_debug) + .generate_name_section(!self.remove_name_section) + .generate_producers_section(!self.remove_producers_section) + .parse(bytes) + .context("failed to parse input as wasm") + } + fn local_module_name(&self, module: &str) -> String { format!("./snippets/{}", module) } @@ -486,11 +487,28 @@ fn reset_indentation(s: &str) -> String { let mut indent: u32 = 0; let mut dst = String::new(); + fn is_doc_comment(line: &str) -> bool { + line.starts_with("*") + } + for line in s.lines() { let line = line.trim(); - if line.starts_with('}') || (line.ends_with('}') && !line.starts_with('*')) { + + // handle doc comments separately + if is_doc_comment(line) { + for _ in 0..indent { + dst.push_str(" "); + } + dst.push(' '); + dst.push_str(line); + dst.push('\n'); + continue; + } + + if line.starts_with('}') { indent = indent.saturating_sub(1); } + let extra = if line.starts_with(':') || line.starts_with('?') { 1 } else { @@ -502,27 +520,13 @@ fn reset_indentation(s: &str) -> String { } dst.push_str(line); } - dst.push_str("\n"); - // Ignore { inside of comments and if it's an exported enum - if line.ends_with('{') && !line.starts_with('*') && !line.ends_with("Object.freeze({") { + dst.push('\n'); + + if line.ends_with('{') { indent += 1; } } - return dst; -} - -// Eventually these will all be CLI options, but while they're unstable features -// they're left as environment variables. We don't guarantee anything about -// backwards-compatibility with these options. -fn threads_config() -> wasm_bindgen_threads_xform::Config { - let mut cfg = wasm_bindgen_threads_xform::Config::new(); - if let Ok(s) = env::var("WASM_BINDGEN_THREADS_MAX_MEMORY") { - cfg.maximum_memory(s.parse().unwrap()); - } - if let Ok(s) = env::var("WASM_BINDGEN_THREADS_STACK_SIZE") { - cfg.thread_stack_size(s.parse().unwrap()); - } - cfg + dst } fn demangle(module: &mut Module) { @@ -539,55 +543,28 @@ fn demangle(module: &mut Module) { impl OutputMode { fn uses_es_modules(&self) -> bool { - match self { + matches!( + self, OutputMode::Bundler { .. } - | OutputMode::Web - | OutputMode::Node { - experimental_modules: true, - } - | OutputMode::Deno => true, - _ => false, - } - } - - fn nodejs_experimental_modules(&self) -> bool { - match self { - OutputMode::Node { - experimental_modules, - } => *experimental_modules, - _ => false, - } + | OutputMode::Web + | OutputMode::Node { module: true } + | OutputMode::Deno + ) } fn nodejs(&self) -> bool { - match self { - OutputMode::Node { .. } => true, - _ => false, - } + matches!(self, OutputMode::Node { .. }) } fn no_modules(&self) -> bool { - match self { - OutputMode::NoModules { .. } => true, - _ => false, - } - } - - fn web(&self) -> bool { - match self { - OutputMode::Web => true, - _ => false, - } + matches!(self, OutputMode::NoModules { .. }) } fn esm_integration(&self) -> bool { - match self { - OutputMode::Bundler { .. } - | OutputMode::Node { - experimental_modules: true, - } => true, - _ => false, - } + matches!( + self, + OutputMode::Bundler { .. } | OutputMode::Node { module: true } + ) } } @@ -611,12 +588,33 @@ fn unexported_unused_lld_things(module: &mut Module) { impl Output { pub fn js(&self) -> &str { - match &self.generated { - Generated::InterfaceTypes => panic!("no js with interface types output"), - Generated::Js(gen) => &gen.js, + &self.generated.js + } + + pub fn ts(&self) -> Option<&str> { + if self.generated.typescript { + Some(&self.generated.ts) + } else { + None } } + pub fn start(&self) -> Option<&String> { + self.generated.start.as_ref() + } + + pub fn snippets(&self) -> &HashMap> { + &self.generated.snippets + } + + pub fn local_modules(&self) -> &HashMap { + &self.generated.local_modules + } + + pub fn npm_dependencies(&self) -> &HashMap { + &self.generated.npm_dependencies + } + pub fn wasm(&self) -> &walrus::Module { &self.module } @@ -630,20 +628,14 @@ impl Output { } fn _emit(&mut self, out_dir: &Path) -> Result<(), Error> { - let wasm_name = match &self.generated { - Generated::InterfaceTypes => self.stem.clone(), - Generated::Js(_) => format!("{}_bg", self.stem), - }; + let wasm_name = format!("{}_bg", self.stem); let wasm_path = out_dir.join(&wasm_name).with_extension("wasm"); fs::create_dir_all(out_dir)?; let wasm_bytes = self.module.emit_wasm(); fs::write(&wasm_path, wasm_bytes) .with_context(|| format!("failed to write `{}`", wasm_path.display()))?; - let gen = match &self.generated { - Generated::InterfaceTypes => return Ok(()), - Generated::Js(gen) => gen, - }; + let gen = &self.generated; // Write out all local JS snippets to the final destination now that // we've collected them from all the programs. @@ -664,23 +656,29 @@ impl Output { .with_context(|| format!("failed to write `{}`", path.display()))?; } - if gen.npm_dependencies.len() > 0 { - let map = gen - .npm_dependencies - .iter() - .map(|(k, v)| (k, &v.1)) - .collect::>(); - let json = serde_json::to_string_pretty(&map)?; + let is_genmode_nodemodule = matches!(gen.mode, OutputMode::Node { module: true }); + if !gen.npm_dependencies.is_empty() || is_genmode_nodemodule { + #[derive(serde::Serialize)] + struct PackageJson<'a> { + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + ty: Option<&'static str>, + dependencies: BTreeMap<&'a str, &'a str>, + } + let pj = PackageJson { + ty: is_genmode_nodemodule.then_some("module"), + dependencies: gen + .npm_dependencies + .iter() + .map(|(k, v)| (k.as_str(), v.1.as_str())) + .collect(), + }; + let json = serde_json::to_string_pretty(&pj)?; fs::write(out_dir.join("package.json"), json)?; } // And now that we've got all our JS and TypeScript, actually write it // out to the filesystem. - let extension = if gen.mode.nodejs_experimental_modules() { - "mjs" - } else { - "js" - }; + let extension = "js"; fn write(path: P, contents: C) -> Result<(), anyhow::Error> where @@ -698,15 +696,27 @@ impl Output { let start = gen.start.as_deref().unwrap_or(""); - write( - &js_path, - format!( - "import * as wasm from \"./{}.wasm\";\nexport * from \"./{}\";{}", - wasm_name, js_name, start - ), - )?; - - write(&out_dir.join(&js_name), reset_indentation(&gen.js))?; + if matches!(gen.mode, OutputMode::Node { .. }) { + write( + &js_path, + format!( + "\ +{start} +export * from \"./{js_name}\";", + ), + )?; + } else { + write( + &js_path, + format!( + "\ +import * as wasm from \"./{wasm_name}.wasm\"; +export * from \"./{js_name}\"; +{start}" + ), + )?; + } + write(out_dir.join(&js_name), reset_indentation(&gen.js))?; } else { write(&js_path, reset_indentation(&gen.js))?; } @@ -730,8 +740,8 @@ impl Output { fn gc_module_and_adapters(module: &mut Module) { loop { - // Fist up, cleanup the native wasm module. Note that roots can come - // from custom sections, namely our wasm interface types custom section + // Fist up, cleanup the native Wasm module. Note that roots can come + // from custom sections, namely our Wasm interface types custom section // as well as the aux section. walrus::passes::gc::run(module); diff --git a/crates/cli-support/src/multivalue.rs b/crates/cli-support/src/multivalue.rs index 601b2bf5a51..cc0194a6aea 100644 --- a/crates/cli-support/src/multivalue.rs +++ b/crates/cli-support/src/multivalue.rs @@ -1,7 +1,8 @@ use crate::wit::{Adapter, NonstandardWitSection}; use crate::wit::{AdapterKind, Instruction, WasmBindgenAux}; use anyhow::{anyhow, Error}; -use walrus::Module; +use walrus::ir::Value; +use walrus::{ConstExpr, FunctionId, Module}; use wasm_bindgen_multi_value_xform as multi_value_xform; use wasm_bindgen_wasm_conventions as wasm_conventions; @@ -13,30 +14,31 @@ pub fn run(module: &mut Module) -> Result<(), Error> { let mut to_xform = Vec::new(); let mut slots = Vec::new(); - for (_, adapter) in adapters.adapters.iter_mut() { + for adapter in adapters.adapters.values_mut() { extract_xform(module, adapter, &mut to_xform, &mut slots); } if to_xform.is_empty() { - // Early exit to avoid failing if we don't have a memory or shadow stack + // Early exit to avoid failing if we don't have a memory or stack // pointer because this is a minimal module that doesn't use linear // memory. module.customs.add(*adapters); return Ok(()); } - let shadow_stack_pointer = module + let stack_pointer = module .customs .get_typed::() .expect("aux section should be present") - .shadow_stack_pointer - .ok_or_else(|| anyhow!("failed to find shadow stack pointer in wasm module"))?; + .stack_pointer + .ok_or_else(|| anyhow!("failed to find stack pointer in Wasm module"))?; let memory = wasm_conventions::get_memory(module)?; - let wrappers = multi_value_xform::run(module, memory, shadow_stack_pointer, &to_xform)?; + let wrappers = multi_value_xform::run(module, memory, stack_pointer, &to_xform)?; for (slot, id) in slots.into_iter().zip(wrappers) { match slot { Slot::Id(s) => *s = id, Slot::Export(e) => module.exports.get_mut(e).item = id.into(), + Slot::TableElement(index) => set_table_entry(module, index, id), } } @@ -48,6 +50,7 @@ pub fn run(module: &mut Module) -> Result<(), Error> { enum Slot<'a> { Id(&'a mut walrus::FunctionId), Export(walrus::ExportId), + TableElement(u32), } fn extract_xform<'a>( @@ -76,13 +79,13 @@ fn extract_xform<'a>( }); let slot = instructions .iter_mut() - .filter_map(|i| match &mut i.instr { - Instruction::Standard(wit_walrus::Instruction::CallCore(f)) => Some(Slot::Id(f)), + .find_map(|i| match &mut i.instr { + Instruction::CallCore(f) => Some(Slot::Id(f)), Instruction::CallExport(e) => Some(Slot::Export(*e)), + Instruction::CallTableElement(index) => Some(Slot::TableElement(*index)), _ => None, }) - .next() - .expect("should have found call-core"); + .expect("adapter never calls the underlying function"); // LLVM currently always uses the first parameter for the return // pointer. We hard code that here, since we have no better option. @@ -92,10 +95,10 @@ fn extract_xform<'a>( walrus::ExportItem::Function(f) => f, _ => panic!("found call to non-function export"), }, + Slot::TableElement(func_index) => resolve_table_entry(module, *func_index), }; to_xform.push((id, 0, types)); slots.push(slot); - return; } // If the last instruction is a `StoreRetptr`, then this must be an adapter @@ -104,3 +107,96 @@ fn extract_xform<'a>( // FIXME(#1872) handle this // if let Some(Instruction::StoreRetptr { .. }) = instructions.last() {} } + +/// Resolves an index in the function table to a function ID. +fn resolve_table_entry(module: &Module, func_index: u32) -> FunctionId { + let table_id = module + .tables + .main_function_table() + .ok() + .flatten() + .expect("there should only be one function table"); + module + .tables + .get(table_id) + .elem_segments + .iter() + .find_map(|&id| { + let elem = module.elements.get(id); + let offset = match elem.kind { + walrus::ElementKind::Active { offset, .. } => match offset { + ConstExpr::Value(Value::I32(value)) => value as u32, + _ => panic!("table offset was not an i32 value"), + }, + _ => panic!("found non-active element section for function table"), + }; + + let find = |(i, func_id): (usize, Option<&FunctionId>)| { + let table_index = i as u32 + offset; + if table_index == func_index { + func_id.cloned() + } else { + None + } + }; + match &elem.items { + walrus::ElementItems::Functions(items) => { + items.iter().map(Some).enumerate().find_map(find) + } + walrus::ElementItems::Expressions(_, items) => items + .iter() + .map(|expr| { + if let ConstExpr::RefFunc(id) = expr { + Some(id) + } else { + None + } + }) + .enumerate() + .find_map(find), + } + }) + .expect("function in function table is not initialized") +} + +/// Changes the function ID at an index in the function table. +fn set_table_entry(module: &mut Module, func_index: u32, new_id: FunctionId) { + let table_id = module + .tables + .main_function_table() + .ok() + .flatten() + .expect("there should only be one function table"); + for &id in module.tables.get(table_id).elem_segments.iter() { + let elem = module.elements.get_mut(id); + let offset = match elem.kind { + walrus::ElementKind::Active { offset, .. } => match offset { + ConstExpr::Value(Value::I32(value)) => value as u32, + _ => panic!("table offset was not an i32 value"), + }, + _ => panic!("found non-active element section for function table"), + }; + match &mut elem.items { + walrus::ElementItems::Functions(items) => { + items.iter_mut().enumerate().for_each(|(i, func_id)| { + let table_index = i as u32 + offset; + if table_index == func_index { + *func_id = new_id; + } + }) + } + walrus::ElementItems::Expressions(_, items) => { + items.iter_mut().enumerate().for_each(|(i, func_id)| { + let table_index = i as u32 + offset; + if table_index == func_index { + assert!( + matches!(func_id, ConstExpr::RefFunc(_)), + "didn't find a function at the expected position" + ); + *func_id = ConstExpr::RefFunc(new_id); + } + }) + } + } + } +} diff --git a/crates/cli-support/src/throw2unreachable.rs b/crates/cli-support/src/throw2unreachable.rs deleted file mode 100644 index 6050911b482..00000000000 --- a/crates/cli-support/src/throw2unreachable.rs +++ /dev/null @@ -1,87 +0,0 @@ -use crate::intrinsic::Intrinsic; -use crate::wit::Instruction; -use crate::wit::{AdapterKind, AuxImport, NonstandardWitSection, WasmBindgenAux}; -use walrus::ir::*; -use walrus::Module; - -/// Runs a small pass over `Module` to replace all calls to the -/// `__wbindgen_throw` intrinsic with an `unreachable` instruction. -/// -/// This pass is executed as part of the wasm interface types support. This is -/// done to support debug mode executables with wasm interface types. Debug mode -/// executables will use malloc as well as externref intrinsics. These intrinsics -/// internally, when they fail, abort the instance. This abort is done through -/// the `__wbindgen_throw` intrinsic in debug mode to provide a hopefully -/// useful error message. In release mode it's simply an `unreachable` -/// instruction. -/// -/// With wasm interface types we can't rely on intrinsics being available, so we -/// need to do something about this in debug mode. Our answer is to remove calls -/// to `__wbindgen_throw` and replace them with `unreachable`. -/// -/// This has the unintended side effect of making the user-visible function -/// `wasm_bindgen::throw_str` "just work", but that's hoped to get fix with a -/// split of crates like described in #1841 -pub fn run(module: &mut Module) { - // Find the adapter ID which is the import for the call to the throw - // intrinsic. - let aux = module.customs.get_typed::().unwrap(); - let throw_import = aux.import_map.iter().find(|(_, import)| match import { - AuxImport::Intrinsic(Intrinsic::Throw) => true, - _ => false, - }); - let throw_adapter = match throw_import { - Some((id, _)) => *id, - None => return, - }; - - // Find the adapter, if any, which calls this intrinsic - let wit = module.customs.get_typed::().unwrap(); - let adapter_calling_throw = wit.adapters.iter().find(|(_, adapter)| { - let instrs = match &adapter.kind { - AdapterKind::Local { instructions } => instructions, - _ => return false, - }; - instrs.iter().any(|i| match i.instr { - Instruction::CallAdapter(a) => a == throw_adapter, - _ => false, - }) - }); - let adapter_calling_throw = match adapter_calling_throw { - Some((id, _)) => *id, - None => return, - }; - - // ... then using the adapter that calls the intrinsic, find which core - // import in the wasm module it's implementing. - let import = wit - .implements - .iter() - .find(|(_, _, adapter)| *adapter == adapter_calling_throw); - let function = match import { - Some((_, function, _)) => *function, - None => return, - }; - - // .. and now replace all calls to `function` with `unreachable` - // instructions - for (_, func) in module.funcs.iter_local_mut() { - let entry = func.entry_block(); - dfs_pre_order_mut(&mut Rewrite { function }, func, entry); - } - - struct Rewrite { - function: walrus::FunctionId, - } - - impl VisitorMut for Rewrite { - fn visit_instr_mut(&mut self, instr: &mut Instr, _: &mut InstrLocId) { - match instr { - Instr::Call(c) if c.func == self.function => { - *instr = Unreachable {}.into(); - } - _ => {} - } - } - } -} diff --git a/crates/cli-support/src/wasm2es6js.rs b/crates/cli-support/src/wasm2es6js.rs index 094180d343f..c16eb0a4504 100644 --- a/crates/cli-support/src/wasm2es6js.rs +++ b/crates/cli-support/src/wasm2es6js.rs @@ -1,4 +1,5 @@ use anyhow::{bail, Error}; +use base64::{prelude::BASE64_STANDARD, Engine as _}; use std::collections::HashSet; use std::fmt::Write; use walrus::Module; @@ -33,7 +34,7 @@ impl Config { } pub fn generate(&mut self, wasm: &[u8]) -> Result { - if !self.base64 && !self.fetch_path.is_some() { + if !self.base64 && self.fetch_path.is_none() { bail!("one of --base64 or --fetch is required"); } let module = Module::from_buffer(wasm)?; @@ -55,96 +56,100 @@ fn push_index_identifier(i: usize, s: &mut String) { } } +fn args_are_optional(name: &str) -> bool { + name == "__wbindgen_thread_destroy" +} + pub fn interface(module: &Module) -> Result { let mut exports = String::new(); + module_export_types(module, |name, ty| { + writeln!(exports, " readonly {}: {};", name, ty).unwrap(); + }); + Ok(exports) +} + +pub fn typescript(module: &Module) -> Result { + let mut exports = "/* tslint:disable */\n/* eslint-disable */\n".to_string(); + module_export_types(module, |name, ty| { + writeln!(exports, "export const {}: {};", name, ty).unwrap(); + }); + Ok(exports) +} +/// Iterates over all the exports in a module and generates TypeScript types. All +/// name-type pairs are passed to the `export` function. +fn module_export_types(module: &Module, mut export: impl FnMut(&str, &str)) { for entry in module.exports.iter() { - let id = match entry.item { - walrus::ExportItem::Function(i) => i, - walrus::ExportItem::Memory(_) => { - exports.push_str(&format!(" readonly {}: WebAssembly.Memory;\n", entry.name,)); - continue; - } - walrus::ExportItem::Table(_) => { - exports.push_str(&format!(" readonly {}: WebAssembly.Table;\n", entry.name,)); - continue; + match entry.item { + walrus::ExportItem::Function(id) => { + let func = module.funcs.get(id); + let ty = module.types.get(func.ty()); + let ts_type = function_type_to_ts(ty, args_are_optional(&entry.name)); + export(&entry.name, &ts_type); } + walrus::ExportItem::Memory(_) => export(&entry.name, "WebAssembly.Memory"), + walrus::ExportItem::Table(_) => export(&entry.name, "WebAssembly.Table"), walrus::ExportItem::Global(_) => continue, }; + } +} +fn val_type_to_ts(ty: walrus::ValType) -> &'static str { + // see https://webassembly.github.io/spec/js-api/index.html#towebassemblyvalue + // and https://webassembly.github.io/spec/js-api/index.html#tojsvalue + match ty { + walrus::ValType::I32 | walrus::ValType::F32 | walrus::ValType::F64 => "number", + walrus::ValType::I64 => "bigint", + // there could be anything behind a reference + walrus::ValType::Ref(_) => "any", + // V128 currently isn't supported in JS and therefore doesn't have a + // specific type in the spec. When it does get support, this type will + // still be technically correct, but should be updated to something more + // specific. + walrus::ValType::V128 => "any", + } +} +fn function_type_to_ts(function: &walrus::Type, all_args_optional: bool) -> String { + let mut out = String::new(); - let func = module.funcs.get(id); - let ty = module.types.get(func.ty()); - let mut args = String::new(); - for (i, _) in ty.params().iter().enumerate() { - if i > 0 { - args.push_str(", "); - } - - push_index_identifier(i, &mut args); - args.push_str(": number"); + // parameters + out.push('('); + for (i, arg_type) in function.params().iter().enumerate() { + if i > 0 { + out.push_str(", "); } - exports.push_str(&format!( - " readonly {name}: ({args}) => {ret};\n", - name = entry.name, - args = args, - ret = match ty.results().len() { - 0 => "void", - 1 => "number", - _ => "Array", - }, - )); + push_index_identifier(i, &mut out); + if all_args_optional { + out.push('?'); + } + out.push_str(": "); + out.push_str(val_type_to_ts(*arg_type)); } + out.push(')'); - Ok(exports) -} + // arrow + out.push_str(" => "); -pub fn typescript(module: &Module) -> Result { - let mut exports = format!("/* tslint:disable */\n/* eslint-disable */\n"); - for entry in module.exports.iter() { - let id = match entry.item { - walrus::ExportItem::Function(i) => i, - walrus::ExportItem::Memory(_) => { - exports.push_str(&format!( - "export const {}: WebAssembly.Memory;\n", - entry.name, - )); - continue; + // results + let results = function.results(); + // this match follows the spec: + // https://webassembly.github.io/spec/js-api/index.html#exported-function-exotic-objects + match results.len() { + 0 => out.push_str("void"), + 1 => out.push_str(val_type_to_ts(results[0])), + _ => { + out.push('['); + for (i, result) in results.iter().enumerate() { + if i > 0 { + out.push_str(", "); + } + out.push_str(val_type_to_ts(*result)); } - walrus::ExportItem::Table(_) => { - exports.push_str(&format!( - "export const {}: WebAssembly.Table;\n", - entry.name, - )); - continue; - } - walrus::ExportItem::Global(_) => continue, - }; - - let func = module.funcs.get(id); - let ty = module.types.get(func.ty()); - let mut args = String::new(); - for (i, _) in ty.params().iter().enumerate() { - if i > 0 { - args.push_str(", "); - } - push_index_identifier(i, &mut args); - args.push_str(": number"); + out.push(']'); } - - exports.push_str(&format!( - "export function {name}({args}): {ret};\n", - name = entry.name, - args = args, - ret = match ty.results().len() { - 0 => "void", - 1 => "number", - _ => "Array", - }, - )); } - Ok(exports) + out } impl Output { @@ -197,7 +202,7 @@ impl Output { // This ends up helping out in situations such as: // // * The start function calls an imported function - // * That imported function in turn tries to access the wasm module + // * That imported function in turn tries to access the Wasm module // // If we don't do this then the second step won't work because the start // function is automatically executed before the promise of @@ -234,7 +239,7 @@ impl Output { bytes = Buffer.from(base64, 'base64'); }} ", - base64 = base64::encode(&wasm) + base64 = BASE64_STANDARD.encode(&wasm) ), inst, ) diff --git a/crates/cli-support/src/wit/incoming.rs b/crates/cli-support/src/wit/incoming.rs index 1778516caad..0309ef8c9c9 100644 --- a/crates/cli-support/src/wit/incoming.rs +++ b/crates/cli-support/src/wit/incoming.rs @@ -1,8 +1,8 @@ -//! Definition of how to convert Rust types (`Description`) into wasm types +//! Definition of how to convert Rust types (`Description`) into Wasm types //! through adapter functions. //! //! Note that many Rust types use "nonstandard" instructions which only work in -//! the JS output, not for the "pure wasm interface types" output. +//! the JS output, not for the "pure Wasm interface types" output. //! //! Note that the mirror operation, going from WebAssembly to JS, is found in //! the `outgoing.rs` module. @@ -23,7 +23,7 @@ impl InstructionBuilder<'_, '_> { } // This is a wrapper around `_incoming` to have a number of sanity checks // that we don't forget things. We should always produce at least one - // wasm arge and exactly one webidl arg. Additionally the number of + // Wasm arge and exactly one webidl arg. Additionally the number of // bindings should always match the number of webidl types for now. let input_before = self.input.len(); let output_before = self.output.len(); @@ -43,8 +43,6 @@ impl InstructionBuilder<'_, '_> { } fn _incoming(&mut self, arg: &Descriptor) -> Result<(), Error> { - use walrus::ValType as WasmVT; - use wit_walrus::ValType as WitVT; match arg { Descriptor::Boolean => { self.instruction( @@ -83,14 +81,28 @@ impl InstructionBuilder<'_, '_> { &[AdapterType::I32], ); } - Descriptor::I8 => self.number(WitVT::S8, WasmVT::I32), - Descriptor::U8 => self.number(WitVT::U8, WasmVT::I32), - Descriptor::I16 => self.number(WitVT::S16, WasmVT::I32), - Descriptor::U16 => self.number(WitVT::U16, WasmVT::I32), - Descriptor::I32 => self.number(WitVT::S32, WasmVT::I32), - Descriptor::U32 => self.number(WitVT::U32, WasmVT::I32), - Descriptor::I64 => self.number64(true), - Descriptor::U64 => self.number64(false), + Descriptor::I8 => self.number_i32(AdapterType::S8), + Descriptor::U8 => self.number_i32(AdapterType::U8), + Descriptor::I16 => self.number_i32(AdapterType::S16), + Descriptor::U16 => self.number_i32(AdapterType::U16), + Descriptor::I32 => self.number_i32(AdapterType::S32), + Descriptor::U32 => self.number_i32(AdapterType::U32), + Descriptor::I64 => self.number_i64(AdapterType::S64), + Descriptor::U64 => self.number_i64(AdapterType::U64), + Descriptor::I128 => { + self.instruction( + &[AdapterType::S128], + Instruction::Int128ToWasm, + &[AdapterType::I64, AdapterType::I64], + ); + } + Descriptor::U128 => { + self.instruction( + &[AdapterType::U128], + Instruction::Int128ToWasm, + &[AdapterType::I64, AdapterType::I64], + ); + } Descriptor::F32 => { self.get(AdapterType::F32); self.output.push(AdapterType::F32); @@ -99,7 +111,23 @@ impl InstructionBuilder<'_, '_> { self.get(AdapterType::F64); self.output.push(AdapterType::F64); } - Descriptor::Enum { .. } => self.number(WitVT::U32, WasmVT::I32), + Descriptor::Enum { name, .. } => { + self.instruction( + &[AdapterType::Enum(name.clone())], + Instruction::Int32ToWasm, + &[AdapterType::I32], + ); + }, + Descriptor::StringEnum { name, invalid, .. } => { + self.instruction( + &[AdapterType::StringEnum(name.clone())], + Instruction::StringEnumToWasm { + name: name.clone(), + invalid: *invalid, + }, + &[AdapterType::I32], + ); + }, Descriptor::Ref(d) => self.incoming_ref(false, d)?, Descriptor::RefMut(d) => self.incoming_ref(true, d)?, Descriptor::Option(d) => self.incoming_option(d)?, @@ -147,6 +175,12 @@ impl InstructionBuilder<'_, '_> { // Largely synthetic and can't show up Descriptor::ClampedU8 => unreachable!(), + + Descriptor::NonNull => self.instruction( + &[AdapterType::NonNull], + Instruction::I32FromNonNull, + &[AdapterType::I32], + ), } Ok(()) } @@ -204,9 +238,13 @@ impl InstructionBuilder<'_, '_> { kind, malloc: self.cx.malloc()?, mem: self.cx.memory()?, - free: self.cx.free()?, }, - &[AdapterType::I32, AdapterType::I32], + &[AdapterType::I32, AdapterType::I32, AdapterType::Externref], + ); + self.late_instruction( + &[AdapterType::Externref], + Instruction::I32FromExternrefOwned, + &[AdapterType::I32], ); } else { self.instruction( @@ -248,23 +286,27 @@ impl InstructionBuilder<'_, '_> { &[AdapterType::I32], ); } - Descriptor::I8 => self.in_option_sentinel(AdapterType::S8), - Descriptor::U8 => self.in_option_sentinel(AdapterType::U8), - Descriptor::I16 => self.in_option_sentinel(AdapterType::S16), - Descriptor::U16 => self.in_option_sentinel(AdapterType::U16), - Descriptor::I32 => self.in_option_native(ValType::I32), - Descriptor::U32 => self.in_option_native(ValType::I32), - Descriptor::F32 => self.in_option_native(ValType::F32), + Descriptor::I8 => self.in_option_sentinel32(AdapterType::S8), + Descriptor::U8 => self.in_option_sentinel32(AdapterType::U8), + Descriptor::I16 => self.in_option_sentinel32(AdapterType::S16), + Descriptor::U16 => self.in_option_sentinel32(AdapterType::U16), + Descriptor::I32 => self.in_option_sentinel64_int(AdapterType::I32, true), + Descriptor::U32 => self.in_option_sentinel64_int(AdapterType::U32, false), + Descriptor::F32 => self.in_option_sentinel64_f32(AdapterType::F32), Descriptor::F64 => self.in_option_native(ValType::F64), - Descriptor::I64 | Descriptor::U64 => { - let (signed, ty) = match arg { - Descriptor::I64 => (true, AdapterType::S64.option()), - _ => (false, AdapterType::U64.option()), - }; + Descriptor::I64 | Descriptor::U64 => self.in_option_native(ValType::I64), + Descriptor::I128 => { + self.instruction( + &[AdapterType::S128.option()], + Instruction::OptionInt128ToWasm, + &[AdapterType::I32, AdapterType::I64, AdapterType::I64], + ); + } + Descriptor::U128 => { self.instruction( - &[ty], - Instruction::I32SplitOption64 { signed }, - &[AdapterType::I32, AdapterType::I32, AdapterType::I32], + &[AdapterType::U128.option()], + Instruction::OptionInt128ToWasm, + &[AdapterType::I32, AdapterType::I64, AdapterType::I64], ); } Descriptor::Boolean => { @@ -281,13 +323,28 @@ impl InstructionBuilder<'_, '_> { &[AdapterType::I32], ); } - Descriptor::Enum { hole } => { + Descriptor::Enum { name, hole } => { self.instruction( - &[AdapterType::U32.option()], + &[AdapterType::Enum(name.clone()).option()], Instruction::I32FromOptionEnum { hole: *hole }, &[AdapterType::I32], ); } + Descriptor::StringEnum { + name, + invalid, + hole, + } => { + self.instruction( + &[AdapterType::StringEnum(name.clone()).option()], + Instruction::OptionStringEnumToWasm { + name: name.clone(), + invalid: *invalid, + hole: *hole, + }, + &[AdapterType::I32], + ); + } Descriptor::RustStruct(name) => { self.instruction( &[AdapterType::Struct(name.clone()).option()], @@ -329,6 +386,12 @@ impl InstructionBuilder<'_, '_> { ); } + Descriptor::NonNull => self.instruction( + &[AdapterType::NonNull.option()], + Instruction::I32FromOptionNonNull, + &[AdapterType::I32], + ), + _ => bail!( "unsupported optional argument type for calling Rust function from JS: {:?}", arg @@ -345,9 +408,8 @@ impl InstructionBuilder<'_, '_> { // fetch them from the parameters. if !self.return_position { let idx = self.input.len() as u32 - 1; - let std = wit_walrus::Instruction::ArgGet(idx); self.instructions.push(InstructionData { - instr: Instruction::Standard(std), + instr: Instruction::ArgGet(idx), stack_change: StackChange::Modified { pushed: 1, popped: 0, @@ -383,29 +445,32 @@ impl InstructionBuilder<'_, '_> { self.output.extend_from_slice(outputs); } - fn number(&mut self, input: wit_walrus::ValType, output: walrus::ValType) { - let std = wit_walrus::Instruction::IntToWasm { - input, - output, - trap: false, - }; - self.instruction( - &[AdapterType::from_wit(input)], - Instruction::Standard(std), - &[AdapterType::from_wasm(output).unwrap()], - ); + /// Add an instruction whose inputs are the results of previous instructions + /// instead of the parameters from JS / results from Rust. + pub fn late_instruction( + &mut self, + inputs: &[AdapterType], + instr: Instruction, + outputs: &[AdapterType], + ) { + for input in inputs { + assert_eq!(self.output.pop().unwrap(), *input); + } + self.instructions.push(InstructionData { + instr, + stack_change: StackChange::Modified { + popped: inputs.len(), + pushed: outputs.len(), + }, + }); + self.output.extend_from_slice(outputs); } - fn number64(&mut self, signed: bool) { - self.instruction( - &[if signed { - AdapterType::S64 - } else { - AdapterType::U64 - }], - Instruction::I32Split64 { signed }, - &[AdapterType::I32, AdapterType::I32], - ); + fn number_i32(&mut self, input: AdapterType) { + self.instruction(&[input], Instruction::Int32ToWasm, &[AdapterType::I32]); + } + fn number_i64(&mut self, input: AdapterType) { + self.instruction(&[input], Instruction::Int64ToWasm, &[AdapterType::I64]); } fn in_option_native(&mut self, wasm: ValType) { @@ -417,11 +482,25 @@ impl InstructionBuilder<'_, '_> { ); } - fn in_option_sentinel(&mut self, ty: AdapterType) { + fn in_option_sentinel32(&mut self, ty: AdapterType) { self.instruction( &[ty.option()], Instruction::I32FromOptionU32Sentinel, &[AdapterType::I32], ); } + fn in_option_sentinel64_int(&mut self, ty: AdapterType, signed: bool) { + self.instruction( + &[ty.option()], + Instruction::F64FromOptionSentinelInt { signed }, + &[AdapterType::F64], + ); + } + fn in_option_sentinel64_f32(&mut self, ty: AdapterType) { + self.instruction( + &[ty.option()], + Instruction::F64FromOptionSentinelF32, + &[AdapterType::F64], + ); + } } diff --git a/crates/cli-support/src/wit/mod.rs b/crates/cli-support/src/wit/mod.rs index b041a77841c..a514e875b3d 100644 --- a/crates/cli-support/src/wit/mod.rs +++ b/crates/cli-support/src/wit/mod.rs @@ -1,18 +1,19 @@ +use crate::decode::LocalModule; use crate::descriptor::{Descriptor, Function}; use crate::descriptors::WasmBindgenDescriptorsSection; use crate::intrinsic::Intrinsic; -use crate::{decode, PLACEHOLDER_MODULE}; +use crate::{decode, Bindgen, PLACEHOLDER_MODULE}; use anyhow::{anyhow, bail, Error}; -use std::collections::{HashMap, HashSet}; +use std::collections::{BTreeSet, HashMap}; use std::str; use walrus::MemoryId; use walrus::{ExportId, FunctionId, ImportId, Module}; use wasm_bindgen_shared::struct_function_export_name; +use wasm_bindgen_threads_xform::ThreadCount; mod incoming; mod nonstandard; mod outgoing; -pub mod section; mod standard; pub use self::nonstandard::*; pub use self::standard::*; @@ -22,15 +23,20 @@ struct Context<'a> { module: &'a mut Module, adapters: NonstandardWitSection, aux: WasmBindgenAux, + /// All of the Wasm module's exported functions. function_exports: HashMap, + /// All of the Wasm module's imported functions. function_imports: HashMap, + /// A map from the signature of a function in the function table to its adapter, if we've already created it. + table_adapters: HashMap, memory: Option, vendor_prefixes: HashMap>, unique_crate_identifier: &'a str, descriptors: HashMap, externref_enabled: bool, - wasm_interface_types: bool, + thread_count: Option, support_start: bool, + linked_modules: bool, } struct InstructionBuilder<'a, 'b> { @@ -42,28 +48,27 @@ struct InstructionBuilder<'a, 'b> { } pub fn process( + bindgen: &mut Bindgen, module: &mut Module, - externref_enabled: bool, - wasm_interface_types: bool, - support_start: bool, + programs: Vec, + thread_count: Option, ) -> Result<(NonstandardWitSectionId, WasmBindgenAuxId), Error> { - let mut storage = Vec::new(); - let programs = extract_programs(module, &mut storage)?; - let mut cx = Context { adapters: Default::default(), aux: Default::default(), function_exports: Default::default(), function_imports: Default::default(), + table_adapters: Default::default(), vendor_prefixes: Default::default(), descriptors: Default::default(), unique_crate_identifier: "", memory: wasm_bindgen_wasm_conventions::get_memory(module).ok(), module, start_found: false, - externref_enabled, - wasm_interface_types, - support_start, + externref_enabled: bindgen.externref, + thread_count, + support_start: bindgen.emit_start, + linked_modules: bindgen.split_linked_modules, }; cx.init()?; @@ -75,10 +80,6 @@ pub fn process( cx.discover_main()?; } - if let Some(standard) = cx.module.customs.delete_typed() { - cx.standard(&standard)?; - } - cx.verify()?; cx.unexport_intrinsics(); @@ -90,8 +91,7 @@ pub fn process( impl<'a> Context<'a> { fn init(&mut self) -> Result<(), Error> { - self.aux.shadow_stack_pointer = - wasm_bindgen_wasm_conventions::get_shadow_stack_pointer(self.module); + self.aux.stack_pointer = wasm_bindgen_wasm_conventions::get_stack_pointer(self.module); // Make a map from string name to ids of all exports for export in self.module.exports.iter() { @@ -106,7 +106,9 @@ impl<'a> Context<'a> { // location listed of what to import there for each item. let mut intrinsics = Vec::new(); let mut duplicate_import_map = HashMap::new(); - let mut imports_to_delete = HashSet::new(); + // The order in which imports are deleted later might matter, so we + // use an ordered set here to make everything deterministic. + let mut imports_to_delete = BTreeSet::new(); for import in self.module.imports.iter() { if import.module != PLACEHOLDER_MODULE { continue; @@ -165,7 +167,7 @@ impl<'a> Context<'a> { // If any closures exist we need to prevent the function table from // getting gc'd - if closure_imports.len() > 0 { + if !closure_imports.is_empty() { self.aux.function_table = self.module.tables.main_function_table()?; } @@ -195,7 +197,6 @@ impl<'a> Context<'a> { // aren't present in the signature but are present in the wasm // signature. let mut function = descriptor.function.clone(); - let nargs = function.arguments.len(); function.arguments.insert(0, Descriptor::I32); function.arguments.insert(0, Descriptor::I32); let adapter = self.table_element_adapter(descriptor.shim_idx, function)?; @@ -204,7 +205,6 @@ impl<'a> Context<'a> { AuxImport::Closure { dtor: descriptor.dtor_idx, mutable: descriptor.mutable, - nargs, adapter, }, ); @@ -253,17 +253,29 @@ impl<'a> Context<'a> { // find a `main(i32, i32) -> i32` let main_id = self .module - .functions() - .find(|x| { + .exports + .iter() + .filter_map(|export| match export.item { + walrus::ExportItem::Function(id) => Some((export, self.module.funcs.get(id))), + _ => None, + }) + .find(|(export, func)| { use walrus::ValType::I32; + // name has to be `main` - let name_matches = x.name.as_ref().map_or(false, |x| x == "main"); + let name_matches = export.name == "main"; // type has to be `(i32, i32) -> i32` - let ty = self.module.types.get(x.ty()); + let ty = self.module.types.get(func.ty()); let type_matches = ty.params() == [I32, I32] && ty.results() == [I32]; - name_matches && type_matches + // Having the correct name and signature doesn't necessarily mean that it's + // actually a `main` function. Unfortunately, there doesn't seem to be any 100% + // reliable way to make sure that it is, but we can at least rule out any + // `#[wasm_bindgen]` exported functions. + let unknown = !self.adapters.exports.iter().any(|(name, _)| name == "main"); + name_matches && type_matches && unknown }) - .map(|x| x.id()); + .map(|(_, func)| func.id()); + let main_id = match main_id { Some(x) => x, None => return Ok(()), @@ -295,7 +307,7 @@ impl<'a> Context<'a> { // since that's a slightly different environment for now which doesn't have // quite the same initialization. fn inject_externref_initialization(&mut self) -> Result<(), Error> { - if !self.externref_enabled || self.wasm_interface_types { + if !self.externref_enabled { return Ok(()); } @@ -304,14 +316,13 @@ impl<'a> Context<'a> { self.module .add_import_func(PLACEHOLDER_MODULE, "__wbindgen_init_externref_table", ty); - self.module.start = Some(match self.module.start { - Some(prev_start) => { - let mut builder = walrus::FunctionBuilder::new(&mut self.module.types, &[], &[]); - builder.func_body().call(import).call(prev_start); - builder.finish(Vec::new(), &mut self.module.funcs) - } - None => import, - }); + if self.module.start.is_some() { + let builder = wasm_bindgen_wasm_conventions::get_or_insert_start_builder(self.module); + builder.func_body().call_at(0, import); + } else { + self.module.start = Some(import); + } + self.bind_intrinsic(import_id, Intrinsic::InitExternrefTable)?; Ok(()) @@ -328,6 +339,45 @@ impl<'a> Context<'a> { Ok(()) } + fn link_module( + &mut self, + id: ImportId, + module: &decode::ImportModule, + offset: usize, + local_modules: &[LocalModule], + inline_js: &[&str], + ) -> Result<(), Error> { + let descriptor = Function { + shim_idx: 0, + arguments: Vec::new(), + ret: Descriptor::String, + inner_ret: None, + }; + let id = self.import_adapter(id, descriptor, AdapterJsImportKind::Normal)?; + let (path, content) = match module { + decode::ImportModule::Named(n) => ( + format!("snippets/{}", n), + local_modules + .iter() + .find(|m| m.identifier == *n) + .map(|m| m.contents), + ), + decode::ImportModule::RawNamed(n) => (n.to_string(), None), + decode::ImportModule::Inline(idx) => ( + format!( + "snippets/{}/inline{}.js", + self.unique_crate_identifier, + *idx as usize + offset + ), + Some(inline_js[*idx as usize]), + ), + }; + self.aux + .import_map + .insert(id, AuxImport::LinkTo(path, content.map(str::to_string))); + Ok(()) + } + fn program(&mut self, program: decode::Program<'a>) -> Result<(), Error> { self.unique_crate_identifier = program.unique_crate_identifier; let decode::Program { @@ -340,9 +390,13 @@ impl<'a> Context<'a> { inline_js, unique_crate_identifier, package_json, + linked_modules, } = program; - for module in local_modules { + for module in local_modules + .iter() + .filter(|module| self.linked_modules || !module.linked_module) + { // All local modules we find should be unique, but the same module // may have showed up in a few different blocks. If that's the case // all the same identifiers should have the same contents. @@ -361,17 +415,35 @@ impl<'a> Context<'a> { self.export(export)?; } + let offset = self + .aux + .snippets + .get(unique_crate_identifier) + .map(|s| s.len()) + .unwrap_or(0); + for module in linked_modules { + if let Some((id, _)) = self.function_imports.remove(module.link_function_name) { + self.link_module( + id, + &module.module, + offset, + &local_modules[..], + &inline_js[..], + )?; + } + } + // Register vendor prefixes for all types before we walk over all the // imports to ensure that if a vendor prefix is listed somewhere it'll // apply to all the imports. for import in imports.iter() { if let decode::ImportKind::Type(ty) = &import.kind { - if ty.vendor_prefixes.len() == 0 { + if ty.vendor_prefixes.is_empty() { continue; } self.vendor_prefixes .entry(ty.name.to_string()) - .or_insert(Vec::new()) + .or_default() .extend(ty.vendor_prefixes.iter().map(|s| s.to_string())); } } @@ -386,13 +458,13 @@ impl<'a> Context<'a> { self.struct_(struct_)?; } for section in typescript_custom_sections { - self.aux.extra_typescript.push_str(section); + self.aux.extra_typescript.push_str(§ion); self.aux.extra_typescript.push_str("\n\n"); } self.aux .snippets .entry(unique_crate_identifier.to_string()) - .or_insert(Vec::new()) + .or_default() .extend(inline_js.iter().map(|s| s.to_string())); Ok(()) } @@ -415,52 +487,66 @@ impl<'a> Context<'a> { Some(class) => { let class = class.to_string(); match export.method_kind { - decode::MethodKind::Constructor => AuxExportKind::Constructor(class), - decode::MethodKind::Operation(op) => match op.kind { - decode::OperationKind::Getter(f) => { - descriptor.arguments.insert(0, Descriptor::I32); - AuxExportKind::Getter { - class, - field: f.to_string(), - consumed: export.consumed, - } - } - decode::OperationKind::Setter(f) => { + decode::MethodKind::Constructor => { + verify_constructor_return(&class, &descriptor.ret)?; + AuxExportKind::Constructor(class) + } + decode::MethodKind::Operation(op) => { + if !op.is_static { + // Make the first argument be the index of the receiver. descriptor.arguments.insert(0, Descriptor::I32); - AuxExportKind::Setter { - class, - field: f.to_string(), - consumed: export.consumed, - } } - _ if op.is_static => AuxExportKind::StaticFunction { + + let (name, kind) = match op.kind { + decode::OperationKind::Getter(f) => (f, AuxExportedMethodKind::Getter), + decode::OperationKind::Setter(f) => (f, AuxExportedMethodKind::Setter), + _ => (export.function.name, AuxExportedMethodKind::Method), + }; + + AuxExportKind::Method { class, - name: export.function.name.to_string(), - }, - _ => { - descriptor.arguments.insert(0, Descriptor::I32); - AuxExportKind::Method { - class, - name: export.function.name.to_string(), - consumed: export.consumed, - } + name: name.to_owned(), + receiver: if op.is_static { + AuxReceiverKind::None + } else if export.consumed { + AuxReceiverKind::Owned + } else { + AuxReceiverKind::Borrowed + }, + kind, } - }, + } } } None => AuxExportKind::Function(export.function.name.to_string()), }; + let args = Some( + export + .function + .args + .into_iter() + .map(|v| AuxFunctionArgumentData { + name: v.name, + ty_override: v.ty_override.map(String::from), + desc: v.desc.map(String::from), + }) + .collect::>(), + ); let id = self.export_adapter(export_id, descriptor)?; self.aux.export_map.insert( id, AuxExport { debug_name: wasm_name, comments: concatenate_comments(&export.comments), - arg_names: Some(export.function.arg_names), + args, asyncness: export.function.asyncness, kind, generate_typescript: export.function.generate_typescript, + generate_jsdoc: export.function.generate_jsdoc, + variadic: export.function.variadic, + fn_ret_ty_override: export.function.ret_ty_override.map(String::from), + fn_ret_desc: export.function.ret_desc.map(String::from), }, ); Ok(()) @@ -477,22 +563,21 @@ impl<'a> Context<'a> { return Ok(()); } - let prev_start = match self.module.start { - Some(f) => f, - None => { - self.module.start = Some(id); - return Ok(()); - } - }; + if let Some(thread_count) = self.thread_count { + let builder = wasm_bindgen_wasm_conventions::get_or_insert_start_builder(self.module); + thread_count.wrap_start(builder, id); + } else if self.module.start.is_some() { + let builder = wasm_bindgen_wasm_conventions::get_or_insert_start_builder(self.module); + + // Note that we leave the previous start function, if any, first. This is + // because the start function currently only shows up when it's injected + // through thread/externref transforms. These injected start functions + // need to happen before user code, so we always schedule them first. + builder.func_body().call(id); + } else { + self.module.start = Some(id); + } - // Note that we call the previous start function, if any, first. This is - // because the start function currently only shows up when it's injected - // through thread/externref transforms. These injected start functions - // need to happen before user code, so we always schedule them first. - let mut builder = walrus::FunctionBuilder::new(&mut self.module.types, &[], &[]); - builder.func_body().call(prev_start).call(id); - let new_start = builder.finish(Vec::new(), &mut self.module.funcs); - self.module.start = Some(new_start); Ok(()) } @@ -500,8 +585,9 @@ impl<'a> Context<'a> { match &import.kind { decode::ImportKind::Function(f) => self.import_function(&import, f), decode::ImportKind::Static(s) => self.import_static(&import, s), + decode::ImportKind::String(s) => self.import_string(s), decode::ImportKind::Type(t) => self.import_type(&import, t), - decode::ImportKind::Enum(_) => Ok(()), + decode::ImportKind::Enum(e) => self.string_enum(e), } } @@ -536,7 +622,7 @@ impl<'a> Context<'a> { // to the WebAssembly instance. let (id, import) = match method { Some(data) => { - let class = self.determine_import(import, &data.class)?; + let class = self.determine_import(import, data.class)?; match &data.kind { // NB: `structural` is ignored for constructors since the // js type isn't expected to change anyway. @@ -716,6 +802,7 @@ impl<'a> Context<'a> { None => return Ok(()), Some(d) => d, }; + let optional = matches!(descriptor, Descriptor::Option(_)); // Register the signature of this imported shim let id = self.import_adapter( @@ -731,8 +818,36 @@ impl<'a> Context<'a> { // And then save off that this function is is an instanceof shim for an // imported item. - let import = self.determine_import(import, &static_.name)?; - self.aux.import_map.insert(id, AuxImport::Static(import)); + let js = self.determine_import(import, static_.name)?; + self.aux + .import_map + .insert(id, AuxImport::Static { js, optional }); + Ok(()) + } + + fn import_string(&mut self, string: &decode::ImportString<'_>) -> Result<(), Error> { + let (import_id, _id) = match self.function_imports.get(string.shim) { + Some(pair) => *pair, + None => return Ok(()), + }; + + // Register the signature of this imported shim + let id = self.import_adapter( + import_id, + Function { + arguments: Vec::new(), + shim_idx: 0, + ret: Descriptor::Externref, + inner_ret: None, + }, + AdapterJsImportKind::Normal, + )?; + + // And then save off that this function is is an instanceof shim for an + // imported item. + self.aux + .import_map + .insert(id, AuxImport::String(string.string.to_owned())); Ok(()) } @@ -760,14 +875,41 @@ impl<'a> Context<'a> { // And then save off that this function is is an instanceof shim for an // imported item. - let import = self.determine_import(import, &type_.name)?; + let import = self.determine_import(import, type_.name)?; self.aux .import_map .insert(id, AuxImport::Instanceof(import)); Ok(()) } + fn string_enum(&mut self, string_enum: &decode::StringEnum<'_>) -> Result<(), Error> { + let aux = AuxStringEnum { + name: string_enum.name.to_string(), + comments: concatenate_comments(&string_enum.comments), + variant_values: string_enum + .variant_values + .iter() + .map(|v| v.to_string()) + .collect(), + generate_typescript: string_enum.generate_typescript, + }; + let mut result = Ok(()); + self.aux + .string_enums + .entry(aux.name.clone()) + .and_modify(|existing| { + result = Err(anyhow!( + "duplicate string enums:\n{:?}\n{:?}", + existing, + aux + )); + }) + .or_insert(aux); + result + } + fn enum_(&mut self, enum_: decode::Enum<'_>) -> Result<(), Error> { + let signed = enum_.signed; let aux = AuxEnum { name: enum_.name.to_string(), comments: concatenate_comments(&enum_.comments), @@ -775,23 +917,31 @@ impl<'a> Context<'a> { .variants .iter() .map(|v| { - ( - v.name.to_string(), - v.value, - concatenate_comments(&v.comments), - ) + let value = if signed { + v.value as i32 as i64 + } else { + v.value as i64 + }; + (v.name.to_string(), value, concatenate_comments(&v.comments)) }) .collect(), generate_typescript: enum_.generate_typescript, }; - self.aux.enums.push(aux); - Ok(()) + let mut result = Ok(()); + self.aux + .enums + .entry(aux.name.clone()) + .and_modify(|existing| { + result = Err(anyhow!("duplicate enums:\n{:?}\n{:?}", existing, aux)); + }) + .or_insert(aux); + result } fn struct_(&mut self, struct_: decode::Struct<'_>) -> Result<(), Error> { for field in struct_.fields { - let getter = wasm_bindgen_shared::struct_field_get(&struct_.name, &field.name); - let setter = wasm_bindgen_shared::struct_field_set(&struct_.name, &field.name); + let getter = wasm_bindgen_shared::struct_field_get(struct_.name, field.name); + let setter = wasm_bindgen_shared::struct_field_set(struct_.name, field.name); let descriptor = match self.descriptors.remove(&getter) { None => continue, Some(d) => d, @@ -803,22 +953,27 @@ impl<'a> Context<'a> { arguments: vec![Descriptor::I32], shim_idx: 0, ret: descriptor.clone(), - inner_ret: None, + inner_ret: Some(descriptor.clone()), }; let getter_id = self.export_adapter(getter_id, getter_descriptor)?; self.aux.export_map.insert( getter_id, AuxExport { debug_name: format!("getter for `{}::{}`", struct_.name, field.name), - arg_names: None, + args: None, asyncness: false, comments: concatenate_comments(&field.comments), - kind: AuxExportKind::Getter { + kind: AuxExportKind::Method { class: struct_.name.to_string(), - field: field.name.to_string(), - consumed: false, + name: field.name.to_string(), + receiver: AuxReceiverKind::Borrowed, + kind: AuxExportedMethodKind::Getter, }, generate_typescript: field.generate_typescript, + generate_jsdoc: field.generate_jsdoc, + variadic: false, + fn_ret_ty_override: None, + fn_ret_desc: None, }, ); @@ -839,15 +994,20 @@ impl<'a> Context<'a> { setter_id, AuxExport { debug_name: format!("setter for `{}::{}`", struct_.name, field.name), - arg_names: None, + args: None, asyncness: false, comments: concatenate_comments(&field.comments), - kind: AuxExportKind::Setter { + kind: AuxExportKind::Method { class: struct_.name.to_string(), - field: field.name.to_string(), - consumed: false, + name: field.name.to_string(), + receiver: AuxReceiverKind::Borrowed, + kind: AuxExportedMethodKind::Setter, }, generate_typescript: field.generate_typescript, + generate_jsdoc: field.generate_jsdoc, + variadic: false, + fn_ret_ty_override: None, + fn_ret_desc: None, }, ); } @@ -860,38 +1020,56 @@ impl<'a> Context<'a> { self.aux.structs.push(aux); let wrap_constructor = wasm_bindgen_shared::new_function(struct_.name); - if let Some((import_id, _id)) = self.function_imports.get(&wrap_constructor).cloned() { + self.add_aux_import_to_import_map( + &wrap_constructor, + vec![Descriptor::I32], + Descriptor::Externref, + AuxImport::WrapInExportedClass(struct_.name.to_string()), + )?; + + let unwrap_fn = wasm_bindgen_shared::unwrap_function(struct_.name); + self.add_aux_import_to_import_map( + &unwrap_fn, + vec![Descriptor::Externref], + Descriptor::I32, + AuxImport::UnwrapExportedClass(struct_.name.to_string()), + )?; + + Ok(()) + } + + fn add_aux_import_to_import_map( + &mut self, + fn_name: &String, + arguments: Vec, + ret: Descriptor, + aux_import: AuxImport, + ) -> Result<(), Error> { + if let Some((import_id, _id)) = self.function_imports.get(fn_name).cloned() { let signature = Function { shim_idx: 0, - arguments: vec![Descriptor::I32], - ret: Descriptor::Externref, + arguments, + ret, inner_ret: None, }; let id = self.import_adapter(import_id, signature, AdapterJsImportKind::Normal)?; - self.aux - .import_map - .insert(id, AuxImport::WrapInExportedClass(struct_.name.to_string())); + self.aux.import_map.insert(id, aux_import); } Ok(()) } fn determine_import(&self, import: &decode::Import<'_>, item: &str) -> Result { - let is_local_snippet = match import.module { - decode::ImportModule::Named(s) => self.aux.local_modules.contains_key(s), - decode::ImportModule::RawNamed(_) => false, - decode::ImportModule::Inline(_) => true, - decode::ImportModule::None => false, - }; - // Similar to `--target no-modules`, only allow vendor prefixes // basically for web apis, shouldn't be necessary for things like npm // packages or other imported items. let vendor_prefixes = self.vendor_prefixes.get(item); if let Some(vendor_prefixes) = vendor_prefixes { - assert!(vendor_prefixes.len() > 0); + assert!(!vendor_prefixes.is_empty()); - if is_local_snippet { + if let Some(decode::ImportModule::Inline(_) | decode::ImportModule::Named(_)) = + &import.module + { bail!( "local JS snippets do not support vendor prefixes for \ the import of `{}` with a polyfill of `{}`", @@ -899,7 +1077,7 @@ impl<'a> Context<'a> { &vendor_prefixes[0] ); } - if let decode::ImportModule::Named(module) = &import.module { + if let Some(decode::ImportModule::RawNamed(module)) = &import.module { bail!( "import of `{}` from `{}` has a polyfill of `{}` listed, but vendor prefixes aren't supported when importing from modules", @@ -927,7 +1105,7 @@ impl<'a> Context<'a> { let (name, fields) = match import.js_namespace { Some(ref ns) => { - let mut tail = (&ns[1..]).to_owned(); + let mut tail = ns[1..].to_owned(); tail.push(item.to_string()); (ns[0].to_owned(), tail) } @@ -935,17 +1113,15 @@ impl<'a> Context<'a> { }; let name = match import.module { - decode::ImportModule::Named(module) if is_local_snippet => JsImportName::LocalModule { + Some(decode::ImportModule::Named(module)) => JsImportName::LocalModule { module: module.to_string(), - name: name.to_string(), + name, }, - decode::ImportModule::Named(module) | decode::ImportModule::RawNamed(module) => { - JsImportName::Module { - module: module.to_string(), - name: name.to_string(), - } - } - decode::ImportModule::Inline(idx) => { + Some(decode::ImportModule::RawNamed(module)) => JsImportName::Module { + module: module.to_string(), + name, + }, + Some(decode::ImportModule::Inline(idx)) => { let offset = self .aux .snippets @@ -955,154 +1131,18 @@ impl<'a> Context<'a> { JsImportName::InlineJs { unique_crate_identifier: self.unique_crate_identifier.to_string(), snippet_idx_in_crate: idx as usize + offset, - name: name.to_string(), + name, } } - decode::ImportModule::None => JsImportName::Global { - name: name.to_string(), - }, + None => JsImportName::Global { name }, }; Ok(JsImport { name, fields }) } - fn standard(&mut self, std: &wit_walrus::WasmInterfaceTypes) -> Result<(), Error> { - let mut walrus2us = HashMap::new(); - let params_and_results = |id: wit_walrus::TypeId| -> (Vec<_>, Vec<_>) { - let ty = std.types.get(id); - let params = ty - .params() - .iter() - .cloned() - .map(AdapterType::from_wit) - .collect(); - let results = ty - .results() - .iter() - .cloned() - .map(AdapterType::from_wit) - .collect(); - (params, results) - }; - - // Register all imports, allocating our own id for them and configuring - // where the JS value for the import is coming from. - for import in std.imports.iter() { - let func = std.funcs.get(import.func); - let (params, results) = params_and_results(func.ty); - let id = self.adapters.append( - params, - results, - vec![], - AdapterKind::Import { - module: import.module.clone(), - name: import.name.clone(), - kind: AdapterJsImportKind::Normal, - }, - ); - walrus2us.insert(import.func, id); - let js = JsImport { - name: JsImportName::Module { - module: import.module.clone(), - name: import.name.clone(), - }, - fields: Vec::new(), - }; - let value = AuxValue::Bare(js); - assert!(self - .aux - .import_map - .insert(id, AuxImport::Value(value)) - .is_none()); - } - - // Register all functions, allocating our own id system for each of the - // functions. - for func in std.funcs.iter() { - if let wit_walrus::FuncKind::Import(_) = func.kind { - continue; - } - let (params, results) = params_and_results(func.ty); - walrus2us.insert( - func.id(), - self.adapters.append( - params, - results, - vec![], - AdapterKind::Local { - instructions: Vec::new(), - }, - ), - ); - } - - // .. and then actually translate all functions using our id mapping, - // now that we're able to remap all the `CallAdapter` instructions. - for func in std.funcs.iter() { - let instrs = match &func.kind { - wit_walrus::FuncKind::Local(instrs) => instrs, - wit_walrus::FuncKind::Import(_) => continue, - }; - let instrs = instrs - .iter() - .map(|i| match i { - wit_walrus::Instruction::CallAdapter(f) => { - Instruction::CallAdapter(walrus2us[&f]) - } - other => Instruction::Standard(other.clone()), - }) - .map(|instr| InstructionData { - instr, - stack_change: StackChange::Unknown, - }) - .collect::>(); - - // Store the instrs into the adapter function directly. - let adapter = self - .adapters - .adapters - .get_mut(&walrus2us[&func.id()]) - .unwrap(); - match &mut adapter.kind { - AdapterKind::Local { instructions } => *instructions = instrs, - _ => unreachable!(), - } - } - - // next up register all exports, ensuring that our export map says - // what's happening as well for JS - for export in std.exports.iter() { - let id = walrus2us[&export.func]; - self.adapters.exports.push((export.name.clone(), id)); - - let kind = AuxExportKind::Function(export.name.clone()); - let export = AuxExport { - debug_name: format!("standard export {:?}", id), - comments: String::new(), - arg_names: None, - asyncness: false, - kind, - generate_typescript: true, - }; - assert!(self.aux.export_map.insert(id, export).is_none()); - } - - // ... and finally the `implements` section - for i in std.implements.iter() { - let import_id = match &self.module.funcs.get(i.core_func).kind { - walrus::FunctionKind::Import(i) => i.import, - _ => panic!("malformed wasm interface typess section"), - }; - self.adapters - .implements - .push((import_id, i.core_func, walrus2us[&i.adapter_func])); - } - Ok(()) - } - /// Perform a small verification pass over the module to perform some /// internal sanity checks. fn verify(&self) -> Result<(), Error> { - // First up verify that all imports in the wasm module from our + // First up verify that all imports in the Wasm module from our // `$PLACEHOLDER_MODULE` are connected to an adapter via the // `implements` section. let mut implemented = HashMap::new(); @@ -1130,7 +1170,7 @@ impl<'a> Context<'a> { bail!("import of `{}` doesn't have an adapter listed", import.name); } } - if implemented.len() != 0 { + if !implemented.is_empty() { bail!("more implementations listed than imports"); } @@ -1183,7 +1223,7 @@ impl<'a> Context<'a> { kind: AdapterJsImportKind, ) -> Result { let import = self.module.imports.get(import); - let (import_module, import_name) = (import.module.clone(), import.name.clone()); + let import_name = import.name.clone(); let import_id = import.id(); let core_id = match import.kind { walrus::ImportKind::Function(f) => f, @@ -1191,7 +1231,7 @@ impl<'a> Context<'a> { }; // Process the returned type first to see if it needs an out-pointer. This - // happens if the results of the incoming arguments translated to wasm take + // happens if the results of the incoming arguments translated to Wasm take // up more than one type. let mut ret = self.instruction_builder(true); ret.incoming(&signature.ret)?; @@ -1209,7 +1249,7 @@ impl<'a> Context<'a> { } // Build up the list of instructions for our adapter function. We start out - // with all the outgoing instructions which convert all wasm params to the + // with all the outgoing instructions which convert all Wasm params to the // desired types to call our import... let mut instructions = args.instructions; @@ -1220,7 +1260,6 @@ impl<'a> Context<'a> { ret.input, vec![], AdapterKind::Import { - module: import_module, name: import_name, kind, }, @@ -1235,7 +1274,7 @@ impl<'a> Context<'a> { instructions.extend(ret.instructions); // ... and if a return pointer is in use then we need to store the types on - // the stack into the wasm return pointer. Note that we iterate in reverse + // the stack into the Wasm return pointer. Note that we iterate in reverse // here because the last result is the top value on the stack. let results = if uses_retptr { let mem = args.cx.memory()?; @@ -1278,10 +1317,51 @@ impl<'a> Context<'a> { Ok(id) } - fn table_element_adapter(&mut self, idx: u32, signature: Function) -> Result { + fn table_element_adapter( + &mut self, + idx: u32, + mut signature: Function, + ) -> Result { + fn strip_externref_names(descriptor: &mut Descriptor) { + match descriptor { + Descriptor::NamedExternref(_) => *descriptor = Descriptor::Externref, + + Descriptor::Function(function) => strip_function_externref_names(function), + Descriptor::Closure(closure) => { + strip_function_externref_names(&mut closure.function) + } + Descriptor::Ref(descriptor) + | Descriptor::RefMut(descriptor) + | Descriptor::Slice(descriptor) + | Descriptor::Vector(descriptor) + | Descriptor::Option(descriptor) + | Descriptor::Result(descriptor) => strip_externref_names(descriptor), + + _ => {} + } + } + + fn strip_function_externref_names(descriptor: &mut Function) { + descriptor + .arguments + .iter_mut() + .for_each(strip_externref_names); + strip_externref_names(&mut descriptor.ret); + descriptor.inner_ret.as_mut().map(strip_externref_names); + } + + // We don't care about the names of externrefs here; we only care whether + // the compiler will actually keep them as separate functions. + strip_function_externref_names(&mut signature); + + if let Some(&id) = self.table_adapters.get(&signature) { + return Ok(id); + } let call = Instruction::CallTableElement(idx); // like above, largely just defer the work elsewhere - Ok(self.register_export_adapter(call, signature)?) + let id = self.register_export_adapter(call, signature.clone())?; + self.table_adapters.insert(signature, id); + Ok(id) } fn register_export_adapter( @@ -1310,10 +1390,10 @@ impl<'a> Context<'a> { let uses_retptr = ret.input.len() > 1; // Our instruction stream starts out with the return pointer as the first - // argument to the wasm function, if one is in use. Then we convert - // everything to wasm types. + // argument to the Wasm function, if one is in use. Then we convert + // everything to Wasm types. // - // After calling the core wasm function we need to load all the return + // After calling the core Wasm function we need to load all the return // pointer arguments if there were any, otherwise we simply convert // everything into the outgoing arguments. let mut instructions = Vec::new(); @@ -1455,7 +1535,41 @@ impl<'a> Context<'a> { } } -fn extract_programs<'a>( +/// Verifies exported constructor return value is not a JS primitive type +fn verify_constructor_return(class: &str, ret: &Descriptor) -> Result<(), Error> { + match ret { + Descriptor::I8 + | Descriptor::U8 + | Descriptor::ClampedU8 + | Descriptor::I16 + | Descriptor::U16 + | Descriptor::I32 + | Descriptor::U32 + | Descriptor::F32 + | Descriptor::F64 + | Descriptor::I64 + | Descriptor::U64 + | Descriptor::Boolean + | Descriptor::Char + | Descriptor::CachedString + | Descriptor::String + | Descriptor::Option(_) + | Descriptor::Enum { .. } + | Descriptor::Unit => { + bail!("The constructor for class `{}` tries to return a JS primitive type, which would cause the return value to be ignored. Use a builder instead (remove the `constructor` attribute).", class); + } + Descriptor::Result(ref d) | Descriptor::Ref(ref d) | Descriptor::RefMut(ref d) => { + verify_constructor_return(class, d) + } + _ => Ok(()), + } +} + +/// Extract all of the `Program`s encoded in our custom section. +/// +/// `program_storage` is used to squirrel away the raw bytes of the custom +/// section, so that they can be referenced by the `Program`s we return. +pub fn extract_programs<'a>( module: &mut Module, program_storage: &'a mut Vec>, ) -> Result>, Error> { @@ -1464,7 +1578,7 @@ fn extract_programs<'a>( while let Some(raw) = module.customs.remove_raw("__wasm_bindgen_unstable") { log::debug!( - "custom section '{}' looks like a wasm bindgen section", + "custom section '{}' looks like a Wasm bindgen section", raw.name ); program_storage.push(raw.data); @@ -1476,7 +1590,7 @@ fn extract_programs<'a>( while let Some(data) = get_remaining(&mut payload) { // Historical versions of wasm-bindgen have used JSON as the custom // data section format. Newer versions, however, are using a custom - // serialization protocol that looks much more like the wasm spec. + // serialization protocol that looks much more like the Wasm spec. // // We, however, want a sanity check to ensure that if we're running // against the wrong wasm-bindgen we get a nicer error than an @@ -1493,29 +1607,28 @@ fn extract_programs<'a>( bail!( " -it looks like the Rust project used to create this wasm file was linked against +it looks like the Rust project used to create this Wasm file was linked against version of wasm-bindgen that uses a different bindgen format than this binary: - rust wasm file schema version: {} - this binary schema version: {} + rust Wasm file schema version: {their_version} + this binary schema version: {my_version} Currently the bindgen format is unstable enough that these two schema versions -must exactly match. You can accomplish this by either updating the wasm-bindgen -dependency or this binary. +must exactly match. You can accomplish this by either updating this binary or +the wasm-bindgen dependency in the Rust project. You should be able to update the wasm-bindgen dependency with: - cargo update -p wasm-bindgen + cargo update -p wasm-bindgen --precise {my_version} -or you can update the binary with +don't forget to recompile your Wasm file! Alternatively, you can update the +binary with: - cargo install -f wasm-bindgen-cli + cargo install -f wasm-bindgen-cli --version {their_version} if this warning fails to go away though and you're not sure what to do feel free to open an issue at https://github.com/rustwasm/wasm-bindgen/issues! -", - their_version, - my_version, +" ); } let next = get_remaining(&mut payload).unwrap(); @@ -1527,19 +1640,16 @@ to open an issue at https://github.com/rustwasm/wasm-bindgen/issues! } fn get_remaining<'a>(data: &mut &'a [u8]) -> Option<&'a [u8]> { - if data.len() == 0 { + if data.is_empty() { return None; } - let len = ((data[0] as usize) << 0) - | ((data[1] as usize) << 8) - | ((data[2] as usize) << 16) - | ((data[3] as usize) << 24); + let len = u32::from_le_bytes([data[0], data[1], data[2], data[3]]) as usize; let (a, b) = data[4..].split_at(len); *data = b; Some(a) } -fn verify_schema_matches<'a>(data: &'a [u8]) -> Result, Error> { +fn verify_schema_matches(data: &[u8]) -> Result, Error> { macro_rules! bad { () => { bail!("failed to decode what looked like wasm-bindgen data") @@ -1550,7 +1660,7 @@ fn verify_schema_matches<'a>(data: &'a [u8]) -> Result, Error> { Err(_) => bad!(), }; log::debug!("found version specifier {}", data); - if !data.starts_with("{") || !data.ends_with("}") { + if !data.starts_with('{') || !data.ends_with('}') { bad!() } let needle = "\"schema_version\":\""; @@ -1558,7 +1668,7 @@ fn verify_schema_matches<'a>(data: &'a [u8]) -> Result, Error> { Some(i) => &data[i + needle.len()..], None => bad!(), }; - let their_schema_version = match rest.find("\"") { + let their_schema_version = match rest.find('"') { Some(i) => &rest[..i], None => bad!(), }; @@ -1570,7 +1680,7 @@ fn verify_schema_matches<'a>(data: &'a [u8]) -> Result, Error> { Some(i) => &data[i + needle.len()..], None => bad!(), }; - let their_version = match rest.find("\"") { + let their_version = match rest.find('"') { Some(i) => &rest[..i], None => bad!(), }; @@ -1578,7 +1688,7 @@ fn verify_schema_matches<'a>(data: &'a [u8]) -> Result, Error> { } fn concatenate_comments(comments: &[&str]) -> String { - comments.iter().map(|&s| s).collect::>().join("\n") + comments.to_vec().join("\n") } /// The C struct packing algorithm, in terms of u32. @@ -1604,7 +1714,7 @@ impl StructUnpacker { fn read_ty(&mut self, ty: &AdapterType) -> Result { let (quads, alignment) = match ty { AdapterType::I32 | AdapterType::U32 | AdapterType::F32 => (1, 1), - AdapterType::F64 => (2, 2), + AdapterType::I64 | AdapterType::U64 | AdapterType::F64 => (2, 2), other => bail!("invalid aggregate return type {:?}", other), }; Ok(self.append(quads, alignment)) diff --git a/crates/cli-support/src/wit/nonstandard.rs b/crates/cli-support/src/wit/nonstandard.rs index abae06daf9c..2742ddb3262 100644 --- a/crates/cli-support/src/wit/nonstandard.rs +++ b/crates/cli-support/src/wit/nonstandard.rs @@ -41,7 +41,10 @@ pub struct WasmBindgenAux { /// Auxiliary information to go into JS/TypeScript bindings describing the /// exported enums from Rust. - pub enums: Vec, + pub enums: HashMap, + /// Auxiliary information to go into JS/TypeScript bindings describing the + /// exported string enums from Rust. + pub string_enums: HashMap, /// Auxiliary information to go into JS/TypeScript bindings describing the /// exported structs from Rust and their fields they've got exported. @@ -57,7 +60,7 @@ pub struct WasmBindgenAux { /// Various intrinsics used for JS glue generation pub exn_store: Option, - pub shadow_stack_pointer: Option, + pub stack_pointer: Option, pub thread_destroy: Option, } @@ -70,74 +73,108 @@ pub struct AuxExport { pub debug_name: String, /// Comments parsed in Rust and forwarded here to show up in JS bindings. pub comments: String, - /// Argument names in Rust forwarded here to configure the names that show - /// up in TypeScript bindings. - pub arg_names: Option>, + /// Function's argument info in Rust forwarded here to configure the signature + /// that shows up in bindings. + pub args: Option>, /// Whether this is an async function, to configure the TypeScript return value. pub asyncness: bool, /// What kind of function this is and where it shows up pub kind: AuxExportKind, /// Whether typescript bindings should be generated for this export. pub generate_typescript: bool, + /// Whether jsdoc comments should be generated for this export. + pub generate_jsdoc: bool, + /// Whether typescript bindings should be generated for this export. + pub variadic: bool, + /// Function's return overriding type + pub fn_ret_ty_override: Option, + /// Function's return description + pub fn_ret_desc: Option, +} + +/// Information about a functions' argument +#[derive(Debug, Clone)] +pub struct AuxFunctionArgumentData { + /// Specifies the argument name + pub name: String, + /// Specifies the function argument type override + pub ty_override: Option, + /// Specifies the argument description + pub desc: Option, } -/// All possible kinds of exports from a wasm module. +/// All possible kinds of exports from a Wasm module. /// -/// This `enum` says where to place an exported wasm function. For example it +/// This `enum` says where to place an exported Wasm function. For example it /// may want to get hooked up to a JS class, or it may want to be exported as a /// free function (etc). /// /// TODO: it feels like this should not really be here per se. We probably want -/// to either construct the JS object itself from within wasm or somehow move +/// to either construct the JS object itself from within Wasm or somehow move /// more of this information into some other section. Really what this is is /// sort of an "export map" saying how to wire up all the free functions from -/// the wasm module into the output expected JS module. All our functions here +/// the Wasm module into the output expected JS module. All our functions here /// currently take integer parameters and require a JS wrapper, but ideally /// we'd change them one day to taking/receiving `externref` which then use some /// sort of webidl import to customize behavior or something like that. In any -/// case this doesn't feel quite right in terms of priviledge separation, so +/// case this doesn't feel quite right in terms of privilege separation, so /// we'll want to work on this. For now though it works. #[derive(Debug)] pub enum AuxExportKind { /// A free function that's just listed on the exported module Function(String), - /// A function that's used to create an instane of a class. The function + /// A function that's used to create an instance of a class. The function /// actually return just an integer which is put on an JS object currently. Constructor(String), - /// This function is intended to be a getter for a field on a class. The - /// first argument is the internal pointer and the returned value is - /// expected to be the field. - Getter { + /// A function that's associated with a class. + /// + /// This can either be a static method (indicated by `AuxReceiverKind::None`), + /// which is basically just a free function namespaced under the class, or + /// a proper method. + /// + /// It can also be a getter or a setter for a (possibly static) field of + /// the class, in which case `name` is the name of the field. + /// + /// If the function isn't static, the first argument is the index of the + /// Rust object in the JS heap. + Method { class: String, - field: String, - // same as `consumed` in `Method` - consumed: bool, + name: String, + receiver: AuxReceiverKind, + kind: AuxExportedMethodKind, }, +} - /// This function is intended to be a setter for a field on a class. The - /// first argument is the internal pointer and the second argument is - /// expected to be the field's new value. - Setter { - class: String, - field: String, - // same as `consumed` in `Method` - consumed: bool, - }, +/// All the possible kinds of exported methods. +#[derive(Debug, Clone, Copy)] +pub enum AuxExportedMethodKind { + /// A regular method. + Method, + /// A getter for a field. + Getter, + /// A setter for a field. + Setter, +} - /// This is a free function (ish) but scoped inside of a class name. - StaticFunction { class: String, name: String }, +/// The 'receiver' of a method; in other words, the type that the method is called on. +/// +/// This is `None` if the method is static, or `Borrowed` or `Owned` if the +/// method takes `&[mut] self` or `self` respectively. +#[derive(Debug, Clone, Copy)] +pub enum AuxReceiverKind { + None, + Borrowed, + Owned, +} - /// This is a member function of a class where the first parameter is the - /// implicit integer stored in the class instance. - Method { - class: String, - name: String, - /// Whether or not this is calling a by-value method in Rust and should - /// clear the internal pointer in JS automatically. - consumed: bool, - }, +impl AuxReceiverKind { + /// Returns whether this is `AuxReceiverKind::None` (in other words, + /// whether the method with this receiver is static). + pub fn is_static(self) -> bool { + matches!(self, Self::None) + } } #[derive(Debug)] @@ -148,7 +185,19 @@ pub struct AuxEnum { pub comments: String, /// A list of variants with their name, value and comments /// and whether typescript bindings should be generated for each variant - pub variants: Vec<(String, u32, String)>, + pub variants: Vec<(String, i64, String)>, + /// Whether typescript bindings should be generated for this enum. + pub generate_typescript: bool, +} + +#[derive(Debug)] +pub struct AuxStringEnum { + /// The name of this enum + pub name: String, + /// The copied Rust comments to forward to JS + pub comments: String, + /// A list of variants values + pub variant_values: Vec, /// Whether typescript bindings should be generated for this enum. pub generate_typescript: bool, } @@ -165,7 +214,7 @@ pub struct AuxStruct { pub generate_typescript: bool, } -/// All possible types of imports that can be imported by a wasm module. +/// All possible types of imports that can be imported by a Wasm module. /// /// This `enum` is intended to map out what an imported value is. For example /// this contains a ton of shims and various ways you can call a function. The @@ -174,7 +223,7 @@ pub struct AuxStruct { /// /// Note that this is *not* the same as the webidl bindings section. This is /// intended to be coupled with that to map out what actually gets hooked up to -/// an import in the wasm module. The two work in tandem. +/// an import in the Wasm module. The two work in tandem. /// /// Some of these items here are native to JS (like `Value`, indexing /// operations, etc). Others are shims generated by wasm-bindgen (like `Closure` @@ -199,15 +248,20 @@ pub enum AuxImport { /// This import is expected to be a shim that returns the JS value named by /// `JsImport`. - Static(JsImport), + Static { js: JsImport, optional: bool }, + + /// This import is expected to be a shim that returns an exported `JsString`. + String(String), /// This import is intended to manufacture a JS closure with the given /// signature and then return that back to Rust. Closure { - mutable: bool, // whether or not this was a `FnMut` closure - dtor: u32, // table element index of the destructor function - adapter: AdapterId, // the adapter which translates the types for this closure - nargs: usize, + /// whether or not this was a `FnMut` closure + mutable: bool, + /// table element index of the destructor function + dtor: u32, + /// the adapter which translates the types for this closure + adapter: AdapterId, }, /// This import is expected to be a shim that simply calls the `foo` method @@ -311,6 +365,17 @@ pub enum AuxImport { /// This is an intrinsic function expected to be implemented with a JS glue /// shim. Each intrinsic has its own expected signature and implementation. Intrinsic(Intrinsic), + + /// This is a function which returns a URL pointing to a specific file, + /// usually a JS snippet. The supplied path is relative to the JS glue shim. + /// The Option may contain the contents of the linked file, so it can be + /// embedded. + LinkTo(String, Option), + + /// This import is a generated shim which will attempt to unwrap JsValue to an + /// instance of the given exported class. The class name is one that is + /// exported from the Rust/wasm. + UnwrapExportedClass(String), } /// Values that can be imported verbatim to hook up to an import. @@ -400,7 +465,7 @@ impl walrus::CustomSection for WasmBindgenAux { if let Some(id) = self.exn_store { roots.push_func(id); } - if let Some(id) = self.shadow_stack_pointer { + if let Some(id) = self.stack_pointer { roots.push_global(id); } if let Some(id) = self.thread_destroy { diff --git a/crates/cli-support/src/wit/outgoing.rs b/crates/cli-support/src/wit/outgoing.rs index 26dbb151122..b5eaeefa84b 100644 --- a/crates/cli-support/src/wit/outgoing.rs +++ b/crates/cli-support/src/wit/outgoing.rs @@ -6,10 +6,10 @@ use walrus::ValType; impl InstructionBuilder<'_, '_> { /// Processes one more `Descriptor` as an argument to a JS function that - /// wasm is calling. + /// Wasm is calling. /// /// This will internally skip `Unit` and otherwise build up the `bindings` - /// map and ensure that it's correctly mapped from wasm to JS. + /// map and ensure that it's correctly mapped from Wasm to JS. pub fn outgoing(&mut self, arg: &Descriptor) -> Result<(), Error> { if let Descriptor::Unit = arg { return Ok(()); @@ -42,14 +42,18 @@ impl InstructionBuilder<'_, '_> { Descriptor::Externref => { self.instruction( &[AdapterType::I32], - Instruction::ExternrefLoadOwned, + Instruction::ExternrefLoadOwned { + table_and_drop: None, + }, &[AdapterType::Externref], ); } Descriptor::NamedExternref(name) => { self.instruction( &[AdapterType::I32], - Instruction::ExternrefLoadOwned, + Instruction::ExternrefLoadOwned { + table_and_drop: None, + }, &[AdapterType::NamedExternref(name.clone())], ); } @@ -59,6 +63,22 @@ impl InstructionBuilder<'_, '_> { Descriptor::U16 => self.outgoing_i32(AdapterType::U16), Descriptor::I32 => self.outgoing_i32(AdapterType::S32), Descriptor::U32 => self.outgoing_i32(AdapterType::U32), + Descriptor::I64 => self.outgoing_i64(AdapterType::I64), + Descriptor::U64 => self.outgoing_i64(AdapterType::U64), + Descriptor::I128 => { + self.instruction( + &[AdapterType::I64, AdapterType::I64], + Instruction::WasmToInt128 { signed: true }, + &[AdapterType::S128], + ); + } + Descriptor::U128 => { + self.instruction( + &[AdapterType::I64, AdapterType::I64], + Instruction::WasmToInt128 { signed: false }, + &[AdapterType::U128], + ); + } Descriptor::F32 => { self.get(AdapterType::F32); self.output.push(AdapterType::F32); @@ -67,7 +87,8 @@ impl InstructionBuilder<'_, '_> { self.get(AdapterType::F64); self.output.push(AdapterType::F64); } - Descriptor::Enum { .. } => self.outgoing_i32(AdapterType::U32), + Descriptor::Enum { name, .. } => self.outgoing_i32(AdapterType::Enum(name.clone())), + Descriptor::StringEnum { name, .. } => self.outgoing_string_enum(name), Descriptor::Char => { self.instruction( @@ -77,22 +98,6 @@ impl InstructionBuilder<'_, '_> { ); } - Descriptor::I64 | Descriptor::U64 => { - let signed = match arg { - Descriptor::I64 => true, - _ => false, - }; - self.instruction( - &[AdapterType::I32, AdapterType::I32], - Instruction::I64FromLoHi { signed }, - &[if signed { - AdapterType::S64 - } else { - AdapterType::U64 - }], - ); - } - Descriptor::RustStruct(class) => { self.instruction( &[AdapterType::I32], @@ -105,7 +110,7 @@ impl InstructionBuilder<'_, '_> { Descriptor::Ref(d) => self.outgoing_ref(false, d)?, Descriptor::RefMut(d) => self.outgoing_ref(true, d)?, - Descriptor::CachedString => self.cached_string(false, true)?, + Descriptor::CachedString => self.cached_string(true)?, Descriptor::String => { // fetch the ptr/length ... @@ -114,9 +119,8 @@ impl InstructionBuilder<'_, '_> { // ... then defer a call to `free` to happen later let free = self.cx.free()?; - let std = wit_walrus::Instruction::DeferCallCore(free); self.instructions.push(InstructionData { - instr: Instruction::Standard(std), + instr: Instruction::DeferFree { free, align: 1 }, stack_change: StackChange::Modified { popped: 2, pushed: 2, @@ -124,9 +128,8 @@ impl InstructionBuilder<'_, '_> { }); // ... and then convert it to a string type - let std = wit_walrus::Instruction::MemoryToString(self.cx.memory()?); self.instructions.push(InstructionData { - instr: Instruction::Standard(std), + instr: Instruction::MemoryToString(self.cx.memory()?), stack_change: StackChange::Modified { popped: 2, pushed: 1, @@ -168,6 +171,8 @@ impl InstructionBuilder<'_, '_> { // Largely synthetic and can't show up Descriptor::ClampedU8 => unreachable!(), + + Descriptor::NonNull => self.outgoing_i32(AdapterType::NonNull), } Ok(()) } @@ -188,13 +193,12 @@ impl InstructionBuilder<'_, '_> { &[AdapterType::NamedExternref(name.clone())], ); } - Descriptor::CachedString => self.cached_string(false, false)?, + Descriptor::CachedString => self.cached_string(false)?, Descriptor::String => { - let std = wit_walrus::Instruction::MemoryToString(self.cx.memory()?); self.instruction( &[AdapterType::I32, AdapterType::I32], - Instruction::Standard(std), + Instruction::MemoryToString(self.cx.memory()?), &[AdapterType::String], ); } @@ -218,7 +222,7 @@ impl InstructionBuilder<'_, '_> { Descriptor::Function(descriptor) => { // synthesize the a/b arguments that aren't present in the - // signature from wasm-bindgen but are present in the wasm file. + // signature from wasm-bindgen but are present in the Wasm file. let mut descriptor = (**descriptor).clone(); let nargs = descriptor.arguments.len(); descriptor.arguments.insert(0, Descriptor::I32); @@ -252,34 +256,43 @@ impl InstructionBuilder<'_, '_> { // is the valid owned index. self.instruction( &[AdapterType::I32], - Instruction::ExternrefLoadOwned, + Instruction::ExternrefLoadOwned { + table_and_drop: None, + }, &[AdapterType::Externref.option()], ); } Descriptor::NamedExternref(name) => { self.instruction( &[AdapterType::I32], - Instruction::ExternrefLoadOwned, + Instruction::ExternrefLoadOwned { + table_and_drop: None, + }, &[AdapterType::NamedExternref(name.clone()).option()], ); } - Descriptor::I8 => self.out_option_sentinel(AdapterType::S8), - Descriptor::U8 => self.out_option_sentinel(AdapterType::U8), - Descriptor::I16 => self.out_option_sentinel(AdapterType::S16), - Descriptor::U16 => self.out_option_sentinel(AdapterType::U16), - Descriptor::I32 => self.option_native(true, ValType::I32), - Descriptor::U32 => self.option_native(false, ValType::I32), - Descriptor::F32 => self.option_native(true, ValType::F32), + Descriptor::I8 => self.out_option_sentinel32(AdapterType::S8), + Descriptor::U8 => self.out_option_sentinel32(AdapterType::U8), + Descriptor::I16 => self.out_option_sentinel32(AdapterType::S16), + Descriptor::U16 => self.out_option_sentinel32(AdapterType::U16), + Descriptor::I32 => self.out_option_sentinel64(AdapterType::S32), + Descriptor::U32 => self.out_option_sentinel64(AdapterType::U32), + Descriptor::I64 => self.option_native(true, ValType::I64), + Descriptor::U64 => self.option_native(false, ValType::I64), + Descriptor::F32 => self.out_option_sentinel64(AdapterType::F32), Descriptor::F64 => self.option_native(true, ValType::F64), - Descriptor::I64 | Descriptor::U64 => { - let (signed, ty) = match arg { - Descriptor::I64 => (true, AdapterType::S64.option()), - _ => (false, AdapterType::U64.option()), - }; + Descriptor::I128 => { + self.instruction( + &[AdapterType::I32, AdapterType::I64, AdapterType::I64], + Instruction::OptionWasmToInt128 { signed: true }, + &[AdapterType::S128.option()], + ); + } + Descriptor::U128 => { self.instruction( - &[AdapterType::I32, AdapterType::I32, AdapterType::I32], - Instruction::Option64FromI32 { signed }, - &[ty], + &[AdapterType::I32, AdapterType::I64, AdapterType::I64], + Instruction::OptionWasmToInt128 { signed: false }, + &[AdapterType::U128.option()], ); } Descriptor::Boolean => { @@ -296,11 +309,18 @@ impl InstructionBuilder<'_, '_> { &[AdapterType::String.option()], ); } - Descriptor::Enum { hole } => { + Descriptor::Enum { name, hole } => { self.instruction( &[AdapterType::I32], Instruction::OptionEnumFromI32 { hole: *hole }, - &[AdapterType::U32.option()], + &[AdapterType::Enum(name.clone()).option()], + ); + } + Descriptor::StringEnum { name, .. } => { + self.instruction( + &[AdapterType::I32], + Instruction::OptionWasmToStringEnum { name: name.clone() }, + &[AdapterType::StringEnum(name.clone()).option()], ); } Descriptor::RustStruct(name) => { @@ -315,7 +335,7 @@ impl InstructionBuilder<'_, '_> { Descriptor::Ref(d) => self.outgoing_option_ref(false, d)?, Descriptor::RefMut(d) => self.outgoing_option_ref(true, d)?, - Descriptor::CachedString => self.cached_string(true, true)?, + Descriptor::CachedString => self.cached_string(true)?, Descriptor::String | Descriptor::Vector(_) => { let kind = arg.vector_kind().ok_or_else(|| { @@ -337,6 +357,12 @@ impl InstructionBuilder<'_, '_> { ); } + Descriptor::NonNull => self.instruction( + &[AdapterType::I32], + Instruction::OptionNonNullFromI32, + &[AdapterType::NonNull.option()], + ), + _ => bail!( "unsupported optional argument type for calling JS function from Rust: {:?}", arg @@ -359,16 +385,20 @@ impl InstructionBuilder<'_, '_> { | Descriptor::F64 | Descriptor::I64 | Descriptor::U64 + | Descriptor::I128 + | Descriptor::U128 | Descriptor::Boolean | Descriptor::Char | Descriptor::Enum { .. } + | Descriptor::StringEnum { .. } | Descriptor::RustStruct(_) | Descriptor::Ref(_) | Descriptor::RefMut(_) | Descriptor::CachedString | Descriptor::Option(_) | Descriptor::Vector(_) - | Descriptor::Unit => { + | Descriptor::Unit + | Descriptor::NonNull => { // We must throw before reading the Ok type, if there is an error. However, the // structure of ResultAbi is that the Err value + discriminant come last (for // alignment reasons). So the UnwrapResult instruction must come first, but the @@ -405,10 +435,9 @@ impl InstructionBuilder<'_, '_> { // check we did not add any deferred calls, because we have undermined the idea of // running them unconditionally in a finally {} block. String does this, but we // special case it. - assert!(!self.instructions[len..].iter().any(|idata| matches!( - idata.instr, - Instruction::Standard(wit_walrus::Instruction::DeferCallCore(_)) - ))); + assert!(!self.instructions[len..] + .iter() + .any(|idata| matches!(idata.instr, Instruction::DeferFree { .. }))); // Finally, we add the two inputs to UnwrapResult, and everything checks out // @@ -447,9 +476,8 @@ impl InstructionBuilder<'_, '_> { // implementation is always safe. We do this in UnwrapResultString's // implementation. let free = self.cx.free()?; - let std = wit_walrus::Instruction::DeferCallCore(free); self.instructions.push(InstructionData { - instr: Instruction::Standard(std), + instr: Instruction::DeferFree { free, align: 1 }, stack_change: StackChange::Modified { popped: 2, pushed: 2, @@ -457,9 +485,8 @@ impl InstructionBuilder<'_, '_> { }); // ... and then convert it to a string type - let std = wit_walrus::Instruction::MemoryToString(self.cx.memory()?); self.instructions.push(InstructionData { - instr: Instruction::Standard(std), + instr: Instruction::MemoryToString(self.cx.memory()?), stack_change: StackChange::Modified { popped: 2, pushed: 1, @@ -498,7 +525,7 @@ impl InstructionBuilder<'_, '_> { &[AdapterType::NamedExternref(name.clone()).option()], ); } - Descriptor::CachedString => self.cached_string(true, false)?, + Descriptor::CachedString => self.cached_string(false)?, Descriptor::String | Descriptor::Slice(_) => { let kind = arg.vector_kind().ok_or_else(|| { format_err!( @@ -524,25 +551,39 @@ impl InstructionBuilder<'_, '_> { Ok(()) } + fn outgoing_string_enum(&mut self, name: &str) { + self.instruction( + &[AdapterType::I32], + Instruction::WasmToStringEnum { + name: name.to_string(), + }, + &[AdapterType::StringEnum(name.to_string())], + ); + } + fn outgoing_i32(&mut self, output: AdapterType) { - let std = wit_walrus::Instruction::WasmToInt { - input: walrus::ValType::I32, - output: output.to_wit().unwrap(), - trap: false, + let instr = Instruction::WasmToInt32 { + unsigned_32: output == AdapterType::U32 || output == AdapterType::NonNull, + }; + self.instruction(&[AdapterType::I32], instr, &[output]); + } + fn outgoing_i64(&mut self, output: AdapterType) { + let instr = Instruction::WasmToInt64 { + unsigned: output == AdapterType::U64, }; - self.instruction(&[AdapterType::I32], Instruction::Standard(std), &[output]); + self.instruction(&[AdapterType::I64], instr, &[output]); } - fn cached_string(&mut self, optional: bool, owned: bool) -> Result<(), Error> { + fn cached_string(&mut self, owned: bool) -> Result<(), Error> { let mem = self.cx.memory()?; let free = self.cx.free()?; self.instruction( &[AdapterType::I32, AdapterType::I32], Instruction::CachedStringLoad { owned, - optional, mem, free, + table: None, }, &[AdapterType::String], ); @@ -558,11 +599,19 @@ impl InstructionBuilder<'_, '_> { ); } - fn out_option_sentinel(&mut self, ty: AdapterType) { + fn out_option_sentinel32(&mut self, ty: AdapterType) { self.instruction( &[AdapterType::I32], Instruction::OptionU32Sentinel, &[ty.option()], ); } + + fn out_option_sentinel64(&mut self, ty: AdapterType) { + self.instruction( + &[AdapterType::F64], + Instruction::OptionF64Sentinel, + &[ty.option()], + ); + } } diff --git a/crates/cli-support/src/wit/section.rs b/crates/cli-support/src/wit/section.rs index 30a6f82acc5..a534e87ce39 100644 --- a/crates/cli-support/src/wit/section.rs +++ b/crates/cli-support/src/wit/section.rs @@ -1,24 +1,24 @@ -//! Support for generating a standard wasm interface types +//! Support for generating a standard Wasm interface types //! //! This module has all the necessary support for generating a full-fledged -//! standard wasm interface types section as defined by the `wit_walrus` +//! standard Wasm interface types section as defined by the `wit_walrus` //! crate. This module also critically assumes that the WebAssembly module //! being generated **must be standalone**. In this mode all sorts of features //! supported by `#[wasm_bindgen]` aren't actually supported, such as closures, //! imports of global js names, js getters/setters, exporting structs, etc. //! These features may all eventually come to the standard bindings proposal, //! but it will likely take some time. In the meantime this module simply focuses -//! on taking what's already a valid wasm module and letting it through with a +//! on taking what's already a valid Wasm module and letting it through with a //! standard WebIDL custom section. All other modules generate an error during //! this binding process. //! //! Note that when this function is called and used we're also not actually //! generating any JS glue. Any JS glue currently generated is also invalid if -//! the module contains the wasm bindings section and it's actually respected. +//! the module contains the Wasm bindings section and it's actually respected. -use crate::wit::{AdapterId, AdapterJsImportKind, AdapterType, Instruction}; +use crate::wit::AuxExport; +use crate::wit::{AdapterId, AdapterJsImportKind, AdapterType, AuxExportedMethodKind, Instruction}; use crate::wit::{AdapterKind, NonstandardWitSection, WasmBindgenAux}; -use crate::wit::{AuxExport, InstructionData}; use crate::wit::{AuxExportKind, AuxImport, AuxValue, JsImport, JsImportName}; use anyhow::{anyhow, bail, Context, Error}; use std::collections::HashMap; @@ -50,7 +50,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> { externref_drop: _, externref_drop_slice: _, exn_store: _, - shadow_stack_pointer: _, + stack_pointer: _, function_table: _, thread_destroy: _, } = *aux; @@ -145,7 +145,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> { bail!( "generating a bindings section is currently incompatible with \ local JS modules being specified as well, `{}` cannot be used \ - since a standalone wasm file is being generated", + since a standalone Wasm file is being generated", name, ); } @@ -154,7 +154,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> { bail!( "generating a bindings section is currently incompatible with \ local JS snippets being specified as well, `{}` cannot be used \ - since a standalone wasm file is being generated", + since a standalone Wasm file is being generated", name, ); } @@ -163,7 +163,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> { bail!( "generating a bindings section is currently incompatible with \ package.json being consumed as well, `{}` cannot be used \ - since a standalone wasm file is being generated", + since a standalone Wasm file is being generated", path.display(), ); } @@ -187,7 +187,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> { if let Some(enum_) = enums.iter().next() { bail!( "generating a bindings section is currently incompatible with \ - exporting an `enum` from the wasm file, cannot export `{}`", + exporting an `enum` from the Wasm file, cannot export `{}`", enum_.name, ); } @@ -195,7 +195,7 @@ pub fn add(module: &mut Module) -> Result<(), Error> { if let Some(struct_) = structs.iter().next() { bail!( "generating a bindings section is currently incompatible with \ - exporting a `struct` from the wasm file, cannot export `{}`", + exporting a `struct` from the Wasm file, cannot export `{}`", struct_.name, ); } @@ -204,94 +204,6 @@ pub fn add(module: &mut Module) -> Result<(), Error> { Ok(()) } -fn translate_instruction( - instr: &InstructionData, - us2walrus: &HashMap, - module: &Module, -) -> Result { - use Instruction::*; - - match &instr.instr { - Standard(s) => Ok(s.clone()), - CallAdapter(id) => { - let id = us2walrus[id]; - Ok(wit_walrus::Instruction::CallAdapter(id)) - } - CallExport(e) => match module.exports.get(*e).item { - walrus::ExportItem::Function(f) => Ok(wit_walrus::Instruction::CallCore(f)), - _ => bail!("can only call exported functions"), - }, - CallTableElement(e) => { - let entry = wasm_bindgen_wasm_conventions::get_function_table_entry(module, *e)?; - let id = entry - .func - .ok_or_else(|| anyhow!("function table wasn't filled in a {}", e))?; - Ok(wit_walrus::Instruction::CallCore(id)) - } - StringToMemory { - mem, - malloc, - realloc: _, - } => Ok(wit_walrus::Instruction::StringToMemory { - mem: *mem, - malloc: *malloc, - }), - StoreRetptr { .. } | LoadRetptr { .. } | Retptr { .. } => { - bail!("return pointers aren't supported in wasm interface types"); - } - I32FromBool | BoolFromI32 => { - bail!("booleans aren't supported in wasm interface types"); - } - I32FromStringFirstChar | StringFromChar => { - bail!("chars aren't supported in wasm interface types"); - } - I32FromExternrefOwned | I32FromExternrefBorrow | ExternrefLoadOwned | TableGet => { - bail!("externref pass failed to sink into wasm module"); - } - I32FromExternrefRustOwned { .. } - | I32FromExternrefRustBorrow { .. } - | RustFromI32 { .. } => { - bail!("rust types aren't supported in wasm interface types"); - } - I32Split64 { .. } | I64FromLoHi { .. } => { - bail!("64-bit integers aren't supported in wasm-bindgen"); - } - I32SplitOption64 { .. } - | I32FromOptionExternref { .. } - | I32FromOptionU32Sentinel - | I32FromOptionRust { .. } - | I32FromOptionBool - | I32FromOptionChar - | I32FromOptionEnum { .. } - | FromOptionNative { .. } - | OptionVector { .. } - | OptionString { .. } - | OptionRustFromI32 { .. } - | OptionVectorLoad { .. } - | OptionView { .. } - | OptionU32Sentinel - | ToOptionNative { .. } - | OptionBoolFromI32 - | OptionCharFromI32 - | OptionEnumFromI32 { .. } - | Option64FromI32 { .. } => { - bail!("optional types aren't supported in wasm bindgen"); - } - UnwrapResult { .. } | UnwrapResultString { .. } => { - bail!("self-unwrapping result types aren't supported in wasm bindgen"); - } - MutableSliceToMemory { .. } | VectorToMemory { .. } | VectorLoad { .. } | View { .. } => { - bail!("vector slices aren't supported in wasm interface types yet"); - } - CachedStringLoad { .. } => { - bail!("cached strings aren't supported in wasm interface types"); - } - StackClosure { .. } => { - bail!("closures aren't supported in wasm interface types"); - } - } -} - fn check_standard_import(import: &AuxImport) -> Result<(), Error> { let desc_js = |js: &JsImport| { let mut extra = String::new(); @@ -357,7 +269,13 @@ fn check_standard_import(import: &AuxImport) -> Result<(), Error> { AuxImport::Intrinsic(intrinsic) => { format!("wasm-bindgen specific intrinsic `{}`", intrinsic.name()) } + AuxImport::LinkTo(path, _) => { + format!("wasm-bindgen specific link function for `{}`", path) + } AuxImport::Closure { .. } => format!("creating a `Closure` wrapper"), + AuxImport::UnwrapExportedClass(name) => { + format!("unwrapping a pointer from a `{}` js class wrapper", name) + } }; bail!("import of {} requires JS glue", item); } @@ -374,38 +292,22 @@ fn check_standard_export(export: &AuxExport) -> Result<(), Error> { name, ); } - AuxExportKind::Getter { class, field, .. } => { - bail!( - "cannot export `{}::{}` getter function when generating \ - a standalone WebAssembly module with no JS glue", - class, - field, - ); - } - AuxExportKind::Setter { class, field, .. } => { - bail!( - "cannot export `{}::{}` setter function when generating \ - a standalone WebAssembly module with no JS glue", - class, - field, - ); - } - AuxExportKind::StaticFunction { class, name } => { - bail!( - "cannot export `{}::{}` static function when \ - generating a standalone WebAssembly module with no \ - JS glue", - class, - name - ); - } - AuxExportKind::Method { class, name, .. } => { + AuxExportKind::Method { + class, name, kind, .. + } => { + let kind_name = match kind { + AuxExportedMethodKind::Method => "method", + AuxExportedMethodKind::Getter => "getter", + AuxExportedMethodKind::Setter => "setter", + }; + bail!( - "cannot export `{}::{}` method when \ + "cannot export `{}::{}` {} when \ generating a standalone WebAssembly module with no \ JS glue", class, - name + name, + kind_name ); } } diff --git a/crates/cli-support/src/wit/standard.rs b/crates/cli-support/src/wit/standard.rs index 412f10aafc6..8b3780f37fb 100644 --- a/crates/cli-support/src/wit/standard.rs +++ b/crates/cli-support/src/wit/standard.rs @@ -1,15 +1,19 @@ use crate::descriptor::VectorKind; use crate::wit::{AuxImport, WasmBindgenAux}; use std::borrow::Cow; -use std::collections::{HashMap, HashSet}; -use walrus::{FunctionId, ImportId, TypedCustomSectionId}; +use std::collections::{BTreeMap, HashSet}; +use walrus::{FunctionId, ImportId, RefType, TypedCustomSectionId}; #[derive(Default, Debug)] pub struct NonstandardWitSection { /// A list of adapter functions, keyed by their id. - pub adapters: HashMap, + /// + /// This map is iterated over in multiple places, so we use an ordered map + /// to ensure that the order of iteration is deterministic. This map affects + /// all parts of the generated code, so it's important to get this right. + pub adapters: BTreeMap, - /// A list of pairs for adapter functions that implement core wasm imports. + /// A list of pairs for adapter functions that implement core Wasm imports. pub implements: Vec<(ImportId, FunctionId, AdapterId)>, /// A list of adapter functions and the names they're exported under. @@ -36,7 +40,6 @@ pub enum AdapterKind { instructions: Vec, }, Import { - module: String, name: String, kind: AdapterJsImportKind, }, @@ -65,16 +68,18 @@ pub enum AdapterJsImportKind { Normal, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum AdapterType { S8, S16, S32, S64, + S128, U8, U16, U32, U64, + U128, F32, F64, String, @@ -85,15 +90,22 @@ pub enum AdapterType { Vector(VectorKind), Option(Box), Struct(String), + Enum(String), + StringEnum(String), NamedExternref(String), Function, + NonNull, } #[derive(Debug, Clone)] pub enum Instruction { - /// A known instruction in the "standard" - Standard(wit_walrus::Instruction), - + /// Calls a function by its id. + CallCore(walrus::FunctionId), + /// Call the deallocation function. + DeferFree { + free: walrus::FunctionId, + align: usize, + }, /// A call to one of our own defined adapters, similar to the standard /// call-adapter instruction CallAdapter(AdapterId), @@ -102,6 +114,9 @@ pub enum Instruction { /// Call an element in the function table of the core module CallTableElement(u32), + /// Gets an argument by its index. + ArgGet(u32), + /// An instruction to store `ty` at the `offset` index in the return pointer StoreRetptr { ty: AdapterType, @@ -120,6 +135,54 @@ pub enum Instruction { size: u32, }, + /// Pops a 32/16/8-bit integer (`u8`, `s16`, etc.) and pushes a Wasm `i32`. + Int32ToWasm, + /// Pops a Wasm `i32` and pushes a 32-bit integer. + WasmToInt32 { + /// Whether the integer represents an unsigned 32-bit value. + unsigned_32: bool, + }, + + /// Pops a 64-bit integer and pushes a Wasm `i64`. + Int64ToWasm, + /// Pops a Wasm `i64` and pushes a 64-bit integer. + WasmToInt64 { + unsigned: bool, + }, + + /// Pops a 128-bit integer and pushes 2 Wasm 64-bit ints. + Int128ToWasm, + /// Pops 2 Wasm 64-bit ints and pushes a 128-bit integer. + WasmToInt128 { + signed: bool, + }, + + OptionInt128ToWasm, + OptionWasmToInt128 { + signed: bool, + }, + + /// Pops a Wasm `i32` and pushes the enum variant as a string + WasmToStringEnum { + name: String, + }, + + OptionWasmToStringEnum { + name: String, + }, + + /// pops a string and pushes the enum variant as an `i32` + StringEnumToWasm { + name: String, + invalid: u32, + }, + + OptionStringEnumToWasm { + name: String, + invalid: u32, + hole: u32, + }, + /// Pops a `bool` from the stack and pushes an `i32` equivalent I32FromBool, /// Pops a `string` from the stack and pushes the first character as `i32` @@ -127,7 +190,7 @@ pub enum Instruction { /// Pops an `externref` from the stack, allocates space in the externref table, /// returns the index it was stored at. I32FromExternrefOwned, - /// Pops an `externref` from the stack, pushes it onto the externref wasm table + /// Pops an `externref` from the stack, pushes it onto the externref Wasm table /// stack, and returns the index it was stored at. I32FromExternrefBorrow, /// Pops an `externref` from the stack, assumes it's a Rust class given, and @@ -146,18 +209,8 @@ pub enum Instruction { I32FromOptionRust { class: String, }, - /// Pops an `s64` or `u64` from the stack, pushing two `i32` values. - I32Split64 { - signed: bool, - }, - /// Pops an `s64` or `u64` from the stack, pushing three `i32` values. - /// First is the "some/none" bit, and the next is the low bits, and the - /// next is the high bits. - I32SplitOption64 { - signed: bool, - }, /// Pops an `externref` from the stack, pushes either 0 if it's "none" or and - /// index into the owned wasm table it was stored at if it's "some" + /// index into the owned Wasm table it was stored at if it's "some" I32FromOptionExternref { /// Set to `Some` by the externref pass of where to put it in the wasm /// module, otherwise it's shoved into the JS shim. @@ -177,6 +230,14 @@ pub enum Instruction { I32FromOptionEnum { hole: u32, }, + /// Pops an `externref` from the stack, pushes either a sentinel value if it's + /// "none" or the integer value of it if it's "some" + F64FromOptionSentinelInt { + signed: bool, + }, + /// Pops an `externref` from the stack, pushes either a sentinel value if it's + /// "none" or the f32 value of it if it's "some" + F64FromOptionSentinelF32, /// Pops any externref from the stack and then pushes two values. First is a /// 0/1 if it's none/some and second is `ty` value if it was there or 0 if /// it wasn't there. @@ -195,7 +256,6 @@ pub enum Instruction { MutableSliceToMemory { kind: VectorKind, malloc: walrus::FunctionId, - free: walrus::FunctionId, mem: walrus::MemoryId, }, @@ -211,6 +271,8 @@ pub enum Instruction { mem: walrus::MemoryId, realloc: Option, }, + /// Pops a pointer + length, pushes a string + MemoryToString(walrus::MemoryId), /// Pops an externref, pushes pointer/length or all zeros OptionVector { @@ -233,13 +295,13 @@ pub enum Instruction { /// pops a `i32`, pushes `bool` BoolFromI32, /// pops `i32`, loads externref at that slot, dealloates externref, pushes `externref` - ExternrefLoadOwned, + ExternrefLoadOwned { + /// This is needed solely for `Result`, since it can contain externrefs, + /// but has to pass them through a retptr. + table_and_drop: Option<(walrus::TableId, walrus::FunctionId)>, + }, /// pops `i32`, pushes string from that `char` StringFromChar, - /// pops two `i32`, pushes a 64-bit number - I64FromLoHi { - signed: bool, - }, /// pops `i32`, pushes an externref for the wrapped rust class RustFromI32 { class: String, @@ -250,9 +312,10 @@ pub enum Instruction { /// pops ptr/length i32, loads string from cache CachedStringLoad { owned: bool, - optional: bool, mem: walrus::MemoryId, free: walrus::FunctionId, + /// If we're in reference-types mode, the externref table ID to get the cached string from. + table: Option, }, /// pops ptr/length, pushes a vector, frees the original data VectorLoad { @@ -284,6 +347,8 @@ pub enum Instruction { kind: VectorKind, mem: walrus::MemoryId, }, + /// pops f64, pushes it viewed as an optional value with a known sentinel + OptionF64Sentinel, /// pops i32, pushes it viewed as an optional value with a known sentinel OptionU32Sentinel, /// pops an i32, then `ty`, then pushes externref @@ -296,39 +361,20 @@ pub enum Instruction { OptionEnumFromI32 { hole: u32, }, - Option64FromI32 { - signed: bool, - }, + I32FromOptionNonNull, + OptionNonNullFromI32, + I32FromNonNull, } impl AdapterType { - pub fn from_wit(wit: wit_walrus::ValType) -> AdapterType { - match wit { - wit_walrus::ValType::S8 => AdapterType::S8, - wit_walrus::ValType::S16 => AdapterType::S16, - wit_walrus::ValType::S32 => AdapterType::S32, - wit_walrus::ValType::S64 => AdapterType::S64, - wit_walrus::ValType::U8 => AdapterType::U8, - wit_walrus::ValType::U16 => AdapterType::U16, - wit_walrus::ValType::U32 => AdapterType::U32, - wit_walrus::ValType::U64 => AdapterType::U64, - wit_walrus::ValType::F32 => AdapterType::F32, - wit_walrus::ValType::F64 => AdapterType::F64, - wit_walrus::ValType::String => AdapterType::String, - wit_walrus::ValType::Externref => AdapterType::Externref, - wit_walrus::ValType::I32 => AdapterType::I32, - wit_walrus::ValType::I64 => AdapterType::I64, - } - } - pub fn from_wasm(wasm: walrus::ValType) -> Option { Some(match wasm { walrus::ValType::I32 => AdapterType::I32, walrus::ValType::I64 => AdapterType::I64, walrus::ValType::F32 => AdapterType::F32, walrus::ValType::F64 => AdapterType::F64, - walrus::ValType::Externref => AdapterType::Externref, - walrus::ValType::Funcref | walrus::ValType::V128 => return None, + walrus::ValType::Ref(RefType::Externref) => AdapterType::Externref, + walrus::ValType::Ref(_) | walrus::ValType::V128 => return None, }) } @@ -338,35 +384,11 @@ impl AdapterType { AdapterType::I64 => walrus::ValType::I64, AdapterType::F32 => walrus::ValType::F32, AdapterType::F64 => walrus::ValType::F64, - AdapterType::Externref | AdapterType::NamedExternref(_) => walrus::ValType::Externref, - _ => return None, - }) - } - - pub fn to_wit(&self) -> Option { - Some(match self { - AdapterType::S8 => wit_walrus::ValType::S8, - AdapterType::S16 => wit_walrus::ValType::S16, - AdapterType::S32 => wit_walrus::ValType::S32, - AdapterType::S64 => wit_walrus::ValType::S64, - AdapterType::U8 => wit_walrus::ValType::U8, - AdapterType::U16 => wit_walrus::ValType::U16, - AdapterType::U32 => wit_walrus::ValType::U32, - AdapterType::U64 => wit_walrus::ValType::U64, - AdapterType::F32 => wit_walrus::ValType::F32, - AdapterType::F64 => wit_walrus::ValType::F64, - AdapterType::String => wit_walrus::ValType::String, + AdapterType::Enum(_) => walrus::ValType::I32, AdapterType::Externref | AdapterType::NamedExternref(_) => { - wit_walrus::ValType::Externref + walrus::ValType::Ref(RefType::Externref) } - - AdapterType::I32 => wit_walrus::ValType::I32, - AdapterType::I64 => wit_walrus::ValType::I64, - AdapterType::Option(_) - | AdapterType::Function - | AdapterType::Struct(_) - | AdapterType::Bool - | AdapterType::Vector(_) => return None, + _ => return None, }) } @@ -394,7 +416,7 @@ impl NonstandardWitSection { kind, }, ); - return id; + id } /// Removes any dead entries in `adapters` that are no longer necessary @@ -463,29 +485,23 @@ impl walrus::CustomSection for NonstandardWitSection { }; for instr in instrs { match instr.instr { - Standard(wit_walrus::Instruction::DeferCallCore(f)) - | Standard(wit_walrus::Instruction::CallCore(f)) => { + DeferFree { free: f, .. } | CallCore(f) => { roots.push_func(f); } StoreRetptr { mem, .. } | LoadRetptr { mem, .. } | View { mem, .. } | OptionView { mem, .. } - | Standard(wit_walrus::Instruction::MemoryToString(mem)) => { + | MemoryToString(mem) => { roots.push_memory(mem); } - VectorToMemory { malloc, mem, .. } - | OptionVector { malloc, mem, .. } - | Standard(wit_walrus::Instruction::StringToMemory { mem, malloc }) => { + VectorToMemory { malloc, mem, .. } | OptionVector { malloc, mem, .. } => { roots.push_memory(mem); roots.push_func(malloc); } - MutableSliceToMemory { - free, malloc, mem, .. - } => { + MutableSliceToMemory { malloc, mem, .. } => { roots.push_memory(mem); roots.push_func(malloc); - roots.push_func(free); } VectorLoad { free, mem, .. } | OptionVectorLoad { free, mem, .. } @@ -509,11 +525,11 @@ impl walrus::CustomSection for NonstandardWitSection { roots.push_func(id); } } - I32FromOptionExternref { table_and_alloc } => { - if let Some((table, alloc)) = table_and_alloc { - roots.push_table(table); - roots.push_func(alloc); - } + I32FromOptionExternref { + table_and_alloc: Some((table, alloc)), + } => { + roots.push_table(table); + roots.push_func(alloc); } UnwrapResult { table_and_drop } | UnwrapResultString { table_and_drop } => { if let Some((table, drop)) = table_and_drop { diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 39b9ee93a2d..2e9b8a28019 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -1,53 +1,62 @@ [package] -name = "wasm-bindgen-cli" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://rustwasm.github.io/wasm-bindgen/" categories = ["wasm"] +default-run = 'wasm-bindgen' description = """ Command line interface of the `#[wasm_bindgen]` attribute and project. For more information see https://github.com/rustwasm/wasm-bindgen. """ -edition = '2018' -default-run = 'wasm-bindgen' +documentation = "https://rustwasm.github.io/wasm-bindgen/" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-cli" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli" +rust-version = "1.76" +version = "0.2.100" + +[package.metadata.binstall] +bin-dir = "wasm-bindgen-{ version }-{ target }/{ bin }{ binary-ext }" +pkg-url = "https://github.com/rustwasm/wasm-bindgen/releases/download/{ version }/wasm-bindgen-{ version }-{ target }{ archive-suffix }" [dependencies] -curl = "0.4.13" -docopt = "1.0" -env_logger = "0.8" anyhow = "1.0" +clap = { version = "4", features = ["derive"] } +env_logger = "0.11.5" log = "0.4" -openssl = { version = '0.10.11', optional = true } +native-tls = { version = "0.2", default-features = false, optional = true } rouille = { version = "3.0.0", default-features = false } serde = { version = "1.0", features = ['derive'] } serde_derive = "1.0" serde_json = "1.0" -walrus = { version = "0.19.0", features = ['parallel'] } -wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.80" } -wasm-bindgen-shared = { path = "../shared", version = "=0.2.80" } +tempfile = "3.0" +ureq = { version = "2.7", default-features = false, features = ["brotli", "gzip"] } +walrus = "0.23" +wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.100" } +wasm-bindgen-shared = { path = "../shared", version = "=0.2.100" } [dev-dependencies] -assert_cmd = "1.0" +assert_cmd = "2" diff = "0.1" -predicates = "1.0.0" +predicates = "3" rayon = "1.0" -tempfile = "3.0" -wasmprinter = "0.2, <=0.2.33" # pinned for wit-printer -wit-printer = "0.2" -wit-text = "0.8" -wit-validator = "0.2" -wit-walrus = "0.6" - -[[test]] -name = "reference" -harness = false +wasmparser = "0.214" +wasmprinter = "0.214" [[test]] -name = "interface-types" harness = false +name = "reference" [features] -vendored-openssl = ['openssl/vendored'] +default = ["rustls-tls"] + +native-tls = ["ureq/native-tls"] +rustls-tls = ["ureq/tls"] + +# Legacy support +openssl = ["dep:native-tls"] +vendored-openssl = ["openssl", "native-tls/vendored"] + +[lints] +workspace = true diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/deno.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/deno.rs index a0b05cdbd5b..2ed328d1fd4 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/deno.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/deno.rs @@ -1,44 +1,39 @@ -use std::ffi::OsString; -use std::fs; use std::path::Path; use std::process::Command; +use std::{fs, process}; use anyhow::{Context, Error}; -use crate::node::{exec, SHARED_SETUP}; +use crate::Tests; +use crate::{node::SHARED_SETUP, Cli}; -pub fn execute( - module: &str, - tmpdir: &Path, - args: &[OsString], - tests: &[String], -) -> Result<(), Error> { +pub fn execute(module: &str, tmpdir: &Path, cli: Cli, tests: Tests) -> Result<(), Error> { let mut js_to_execute = format!( - r#"import * as wasm from "./{0}.js"; + r#"import * as wasm from "./{module}.js"; + const nocapture = {nocapture}; {console_override} - // global.__wbg_test_invoke = f => f(); + window.__wbg_test_invoke = f => f(); - // Forward runtime arguments. These arguments are also arguments to the - // `wasm-bindgen-test-runner` which forwards them to deno which we - // forward to the test harness. this is basically only used for test - // filters for now. - cx.args(Deno.args.slice(1)); - - const ok = await cx.run(tests.map(n => wasm.__wasm[n])); - if (!ok) Deno.exit(1); + {args} const tests = []; "#, - module, + nocapture = cli.nocapture.clone(), console_override = SHARED_SETUP, + args = cli.into_args(&tests), ); - for test in tests { - js_to_execute.push_str(&format!("tests.push('{}')\n", test)); + for test in tests.tests { + js_to_execute.push_str(&format!("tests.push('{}')\n", test.name)); } + js_to_execute.push_str( + r#"const ok = await cx.run(tests.map(n => wasm.__wasm[n])); +if (!ok) Deno.exit(1);"#, + ); + let js_path = tmpdir.join("run.js"); fs::write(&js_path, js_to_execute).context("failed to write JS file")?; @@ -63,11 +58,15 @@ pub fn execute( .arg(&js_path) .args(args), )*/ - exec( - Command::new("deno") - .arg("run") - .arg("--allow-read") - .arg(&js_path) - .args(args), - ) + let status = Command::new("deno") + .arg("run") + .arg("--allow-read") + .arg(&js_path) + .status()?; + + if !status.success() { + process::exit(status.code().unwrap_or(1)) + } else { + Ok(()) + } } diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs index 89b5252c1c1..d39229312b2 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs @@ -1,18 +1,20 @@ use crate::shell::Shell; use anyhow::{bail, format_err, Context, Error}; -use curl::easy::{Easy, List}; use log::{debug, warn}; use rouille::url::Url; use serde::{Deserialize, Serialize}; -use serde_json::{self, json, Map, Value as Json}; +use serde_json::{json, Map, Value as Json}; use std::env; use std::fs::File; -use std::io::{self, Read}; +use std::io::{self, Cursor, ErrorKind, Read, Write}; use std::net::{SocketAddr, TcpListener, TcpStream}; use std::path::{Path, PathBuf}; use std::process::{Child, Command, Stdio}; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::Arc; use std::thread; use std::time::{Duration, Instant}; +use ureq::Agent; /// Options that can use to customize and configure a WebDriver session. type Capabilities = Map; @@ -55,40 +57,60 @@ pub struct LegacyNewSessionParameters { /// binary, controlling it, running tests, scraping output, displaying output, /// etc. It will return `Ok` if all tests finish successfully, and otherwise it /// will return an error if some tests failed. -pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error> { +pub fn run( + server: &SocketAddr, + shell: &Shell, + driver_timeout: u64, + test_timeout: u64, +) -> Result<(), Error> { let driver = Driver::find()?; let mut drop_log: Box = Box::new(|| ()); let driver_url = match driver.location() { Locate::Remote(url) => Ok(url.clone()), Locate::Local((path, args)) => { - // Allow tests to run in parallel (in theory) by finding any open port - // available for our driver. We can't bind the port for the driver, but - // hopefully the OS gives this invocation unique ports across processes - let driver_addr = TcpListener::bind("127.0.0.1:0")?.local_addr()?; - - // Spawn the driver binary, collecting its stdout/stderr in separate - // threads. We'll print this output later. - let mut cmd = Command::new(path); - cmd.args(args) - .arg(format!("--port={}", driver_addr.port().to_string())); - let mut child = BackgroundChild::spawn(&path, &mut cmd, shell)?; - drop_log = Box::new(move || child.print_stdio_on_drop = false); - // Wait for the driver to come online and bind its port before we try to // connect to it. let start = Instant::now(); - let max = Duration::new(5, 0); - let mut bound = false; - while start.elapsed() < max { - if TcpStream::connect(&driver_addr).is_ok() { - bound = true; - break; + let max = Duration::new(driver_timeout, 0); + + let (driver_addr, mut child) = 'outer: loop { + // Allow tests to run in parallel (in theory) by finding any open port + // available for our driver. We can't bind the port for the driver, but + // hopefully the OS gives this invocation unique ports across processes + let driver_addr = TcpListener::bind("127.0.0.1:0")?.local_addr()?; + // Spawn the driver binary, collecting its stdout/stderr in separate + // threads. We'll print this output later. + let mut cmd = Command::new(path); + cmd.args(args).arg(format!("--port={}", driver_addr.port())); + let mut child = BackgroundChild::spawn(path, &mut cmd, shell)?; + + // Wait for the driver to come online and bind its port before we try to + // connect to it. + loop { + if child.has_failed() { + if start.elapsed() >= max { + bail!("driver failed to start") + } + + println!("Failed to start driver, trying again ..."); + + thread::sleep(Duration::from_millis(100)); + break; + } else if TcpStream::connect(driver_addr).is_ok() { + break 'outer (driver_addr, child); + } else if start.elapsed() >= max { + bail!("driver failed to bind port during startup") + } else { + thread::sleep(Duration::from_millis(100)); + } } - thread::sleep(Duration::from_millis(100)); - } - if !bound { - bail!("driver failed to bind port during startup") - } + }; + + drop_log = Box::new(move || { + let _ = &child; + child.print_stdio_on_drop = false; + }); + Url::parse(&format!("http://{}", driver_addr)).map_err(Error::from) } }?; @@ -99,7 +121,7 @@ pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error ); let mut client = Client { - handle: Easy::new(), + agent: Agent::new(), driver_url, session: None, }; @@ -122,7 +144,20 @@ pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error // Visit our local server to open up the page that runs tests, and then get // some handles to objects on the page which we'll be scraping output from. - let url = format!("http://{}", server); + // + // If WASM_BINDGEN_TEST_ADDRESS is set, use it as the local server URL, + // trying to inherit the port from the server if it isn't specified. + let url = match std::env::var("WASM_BINDGEN_TEST_ADDRESS") { + Ok(u) => { + let mut url = Url::parse(&u)?; + if url.port().is_none() { + url.set_port(Some(server.port())).unwrap(); + } + url.to_string() + } + Err(_) => format!("http://{}", server), + }; + shell.status(&format!("Visiting {}...", url)); client.goto(&id, &url)?; shell.status("Loading page elements..."); @@ -145,7 +180,7 @@ pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error // information. shell.status("Waiting for test to finish..."); let start = Instant::now(); - let max = Duration::new(timeout, 0); + let max = Duration::new(test_timeout, 0); while start.elapsed() < max { if client.text(&id, &output)?.contains("test result: ") { break; @@ -171,18 +206,19 @@ pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error drop_log(); } else { println!("Failed to detect test as having been run. It might have timed out."); - if output.len() > 0 { + if !output.is_empty() { println!("output div contained:\n{}", tab(&output)); } } - if logs.len() > 0 { - println!("console.log div contained:\n{}", tab(&logs)); - } - if errors.len() > 0 { - println!("console.log div contained:\n{}", tab(&errors)); - } if !output.contains("test result: ok") { + if !logs.is_empty() { + println!("console.log div contained:\n{}", tab(&logs)); + } + if !errors.is_empty() { + println!("console.log div contained:\n{}", tab(&errors)); + } + bail!("some tests failed") } @@ -193,6 +229,7 @@ enum Driver { Gecko(Locate), Safari(Locate), Chrome(Locate), + Edge(Locate), } enum Locate { @@ -225,6 +262,7 @@ impl Driver { ("geckodriver", Driver::Gecko as fn(Locate) -> Driver), ("safaridriver", Driver::Safari as fn(Locate) -> Driver), ("chromedriver", Driver::Chrome as fn(Locate) -> Driver), + ("msedgedriver", Driver::Edge as fn(Locate) -> Driver), ]; // First up, if env vars like GECKODRIVER_REMOTE are present, use those @@ -232,10 +270,7 @@ impl Driver { for (driver, ctor) in drivers.iter() { let env = format!("{}_REMOTE", driver.to_uppercase()); let url = match env::var(&env) { - Ok(var) => match Url::parse(&var) { - Ok(url) => url, - Err(_) => continue, - }, + Ok(var) => Url::parse(&var).context(format!("failed to parse `{env}`"))?, Err(_) => continue, }; return Ok(ctor(Locate::Remote(url))); @@ -278,11 +313,12 @@ environment variables like `GECKODRIVER=/path/to/geckodriver` or make sure that the binary is in `PATH`; to configure the address of remote webdriver you can use environment variables like `GECKODRIVER_REMOTE=http://remote.host/` -This crate currently supports `geckodriver`, `chromedriver`, and `safaridriver`, -although more driver support may be added! You can download these at: +This crate currently supports `geckodriver`, `chromedriver`, `safaridriver`, and +`msedgedriver`, although more driver support may be added! You can download these at: * geckodriver - https://github.com/mozilla/geckodriver/releases - * chromedriver - http://chromedriver.chromium.org/downloads + * chromedriver - https://chromedriver.chromium.org/downloads + * msedgedriver - https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ * safaridriver - should be preinstalled on OSX If you would prefer to not use headless testing and would instead like to do @@ -301,6 +337,7 @@ an issue against rustwasm/wasm-bindgen! Driver::Gecko(_) => "Firefox", Driver::Safari(_) => "Safari", Driver::Chrome(_) => "Chrome", + Driver::Edge(_) => "Edge", } } @@ -309,12 +346,13 @@ an issue against rustwasm/wasm-bindgen! Driver::Gecko(locate) => locate, Driver::Safari(locate) => locate, Driver::Chrome(locate) => locate, + Driver::Edge(locate) => locate, } } } struct Client { - handle: Easy, + agent: Agent, driver_url: Url, session: Option, } @@ -326,7 +364,7 @@ enum Method<'a> { } // Below here is a bunch of details of the WebDriver protocol implementation. -// I'm not too too familiar with them myself, but these seem to work! I mostly +// I'm not too familiar with them myself, but these seem to work! I mostly // copied the `webdriver-client` crate when writing the below bindings. impl Client { @@ -421,14 +459,42 @@ impl Client { let x: Response = self.post("/session", &request)?; Ok(x.session_id) } + Driver::Edge(_) => { + #[derive(Deserialize)] + struct Response { + #[serde(rename = "sessionId")] + session_id: String, + } + cap.entry("ms:edgeOptions".to_string()) + .or_insert_with(|| Json::Object(serde_json::Map::new())) + .as_object_mut() + .expect("ms:edgeOptions wasn't a JSON object") + .entry("args".to_string()) + .or_insert_with(|| Json::Array(vec![])) + .as_array_mut() + .expect("args wasn't a JSON array") + .extend(vec![ + Json::String("headless".to_string()), + // See https://stackoverflow.com/questions/50642308/ + // for what this funky `disable-dev-shm-usage` + // option is + Json::String("disable-dev-shm-usage".to_string()), + Json::String("no-sandbox".to_string()), + ]); + let request = LegacyNewSessionParameters { + desired: cap, + required: Capabilities::new(), + }; + let x: Response = self.post("/session", &request)?; + Ok(x.session_id) + } } } fn close_window(&mut self, id: &str) -> Result<(), Error> { #[derive(Deserialize)] struct Response {} - let x: Response = self.delete(&format!("/session/{}/window", id))?; - drop(x); + let _: Response = self.delete(&format!("/session/{}/window", id))?; Ok(()) } @@ -443,8 +509,7 @@ impl Client { let request = Request { url: url.to_string(), }; - let x: Response = self.post(&format!("/session/{}/url", id), &request)?; - drop(x); + let _: Response = self.post(&format!("/session/{}/url", id), &request)?; Ok(()) } @@ -471,10 +536,10 @@ impl Client { value: selector.to_string(), }; let x: Response = self.post(&format!("/session/{}/element", id), &request)?; - Ok(x.value + x.value .gecko_reference .or(x.value.safari_reference) - .ok_or(format_err!("failed to find element reference in response"))?) + .ok_or(format_err!("failed to find element reference in response")) } fn text(&mut self, id: &str, element: &str) -> Result { @@ -517,37 +582,24 @@ impl Client { fn doit(&mut self, path: &str, method: Method) -> Result { let url = self.driver_url.join(path)?; - self.handle.reset(); - self.handle.url(url.as_str())?; - match method { - Method::Post(data) => { - self.handle.post(true)?; - self.handle - .http_headers(build_headers(&["Content-Type: application/json"]))?; - self.handle.post_fields_copy(data.as_bytes())?; - } - Method::Delete => self.handle.custom_request("DELETE")?, - Method::Get => self.handle.get(true)?, - } - let mut result = Vec::new(); - { - let mut t = self.handle.transfer(); - t.write_function(|buf| { - result.extend_from_slice(buf); - Ok(buf.len()) - })?; - t.perform()? - } - let result = String::from_utf8_lossy(&result); - if self.handle.response_code()? != 200 { - bail!( - "non-200 response code: {}\n{}", - self.handle.response_code()?, - result - ); + let response = match method { + Method::Post(data) => self + .agent + .post(url.as_str()) + .set("Content-Type", "application/json") + .send_bytes(data.as_bytes())?, + Method::Delete => self.agent.delete(url.as_str()).call()?, + Method::Get => self.agent.get(url.as_str()).call()?, + }; + + let response_code = response.status(); + let result = response.into_string()?; + + if response_code != 200 { + bail!("non-200 response code: {}\n{}", response_code, result); } debug!("got: {}", result); - Ok(result.into_owned()) + Ok(result) } } @@ -563,34 +615,21 @@ impl Drop for Client { } } -fn build_headers(headers: &[&str]) -> List { - let mut list = List::new(); - for header in headers { - list.append(header).unwrap(); - } - list -} - -fn read(r: &mut R) -> io::Result> { - let mut dst = Vec::new(); - r.read_to_end(&mut dst)?; - Ok(dst) -} - fn tab(s: &str) -> String { let mut result = String::new(); for line in s.lines() { result.push_str(" "); result.push_str(line); - result.push_str("\n"); + result.push('\n'); } - return result; + result } struct BackgroundChild<'a> { child: Child, stdout: Option>>>, stderr: Option>>>, + any_stderr: Arc, shell: &'a Shell, print_stdio_on_drop: bool, } @@ -610,19 +649,51 @@ impl<'a> BackgroundChild<'a> { .context(format!("failed to spawn {:?} binary", path))?; let mut stdout = child.stdout.take().unwrap(); let mut stderr = child.stderr.take().unwrap(); - let stdout = Some(thread::spawn(move || read(&mut stdout))); - let stderr = Some(thread::spawn(move || read(&mut stderr))); + let stdout = Some(thread::spawn(move || { + let mut dst = Vec::new(); + stdout.read_to_end(&mut dst)?; + Ok(dst) + })); + let any_stderr = Arc::new(AtomicBool::new(false)); + let any_stderr_clone = Arc::clone(&any_stderr); + let stderr = Some(thread::spawn(move || { + let mut dst = Cursor::new(Vec::new()); + let mut buffer = [0]; + + match stderr.read_exact(&mut buffer) { + Ok(()) => { + dst.write_all(&buffer).unwrap(); + any_stderr_clone.store(true, Ordering::Relaxed); + } + Err(error) if error.kind() == ErrorKind::UnexpectedEof => { + return Ok(dst.into_inner()) + } + Err(error) => return Err(error), + } + + io::copy(&mut stderr, &mut dst)?; + Ok(dst.into_inner()) + })); Ok(BackgroundChild { child, stdout, stderr, + any_stderr, shell, print_stdio_on_drop: true, }) } + + fn has_failed(&mut self) -> bool { + match self.child.try_wait() { + Ok(Some(status)) => !status.success(), + Ok(None) => self.any_stderr.load(Ordering::Relaxed), + Err(_) => true, + } + } } -impl<'a> Drop for BackgroundChild<'a> { +impl Drop for BackgroundChild<'_> { fn drop(&mut self) { self.child.kill().unwrap(); let status = self.child.wait().unwrap(); @@ -634,11 +705,11 @@ impl<'a> Drop for BackgroundChild<'a> { println!("driver status: {}", status); let stdout = self.stdout.take().unwrap().join().unwrap().unwrap(); - if stdout.len() > 0 { + if !stdout.is_empty() { println!("driver stdout:\n{}", tab(&String::from_utf8_lossy(&stdout))); } let stderr = self.stderr.take().unwrap().join().unwrap().unwrap(); - if stderr.len() > 0 { + if !stderr.is_empty() { println!("driver stderr:\n{}", tab(&String::from_utf8_lossy(&stderr))); } } diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/index-headless.html b/crates/cli/src/bin/wasm-bindgen-test-runner/index-headless.html index a65c242fd58..e5af4a0eb61 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/index-headless.html +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/index-headless.html @@ -1,3 +1,4 @@ + @@ -17,10 +18,14 @@ } }; + // {NOCAPTURE} const wrap = method => { const og = orig(`console_${method}`); const on_method = `on_console_${method}`; console[method] = function (...args) { + if (nocapture) { + orig("output").apply(this, args); + } if (window[on_method]) { window[on_method](args); } @@ -36,6 +41,6 @@ window.__wbg_test_invoke = f => f(); - + diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/index.html b/crates/cli/src/bin/wasm-bindgen-test-runner/index.html index 1fc86aafb95..aaf6afc7e0d 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/index.html +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/index.html @@ -1,3 +1,4 @@ + @@ -24,6 +25,6 @@ window.__wbg_test_invoke = f => f(); - + diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs index 95a82601702..a4b8c58de2b 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs @@ -1,7 +1,7 @@ -//! A "wrapper binary" used to execute wasm files as tests +//! A "wrapper binary" used to execute Wasm files as tests //! -//! This binary is intended to be used as a "test runner" for wasm binaries, -//! being compatible with `cargo test` for the wasm target. It will +//! This binary is intended to be used as a "test runner" for Wasm binaries, +//! being compatible with `cargo test` for the Wasm target. It will //! automatically execute `wasm-bindgen` (or the equivalent thereof) and then //! execute either Node.js over the tests or start a server which a browser can //! be used to run against to execute tests. In a browser mode if `CI` is in the @@ -11,76 +11,181 @@ //! For more documentation about this see the `wasm-bindgen-test` crate README //! and source code. -use anyhow::{anyhow, bail, Context}; +use anyhow::{bail, Context}; +use clap::Parser; +use clap::ValueEnum; use std::env; use std::fs; +use std::path::Path; use std::path::PathBuf; use std::thread; use wasm_bindgen_cli_support::Bindgen; -// no need for jemalloc bloat in this binary (and we don't need speed) -#[global_allocator] -static ALLOC: std::alloc::System = std::alloc::System; - mod deno; mod headless; mod node; mod server; mod shell; -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -enum TestMode { - Node, - Deno, - Browser, +#[derive(Parser)] +#[command(name = "wasm-bindgen-test-runner", version, about, long_about = None)] +struct Cli { + #[arg( + index = 1, + help = "The file to test. `cargo test` passes this argument for you." + )] + file: PathBuf, + #[arg(long, conflicts_with = "ignored", help = "Run ignored tests")] + include_ignored: bool, + #[arg(long, conflicts_with = "include_ignored", help = "Run ignored tests")] + ignored: bool, + #[arg(long, help = "Exactly match filters rather than by substring")] + exact: bool, + #[arg( + long, + value_name = "FILTER", + help = "Skip tests whose names contain FILTER (this flag can be used multiple times)" + )] + skip: Vec, + #[arg(long, help = "List all tests and benchmarks")] + list: bool, + #[arg( + long, + help = "don't capture `console.*()` of each task, allow printing directly" + )] + nocapture: bool, + #[arg( + long, + value_enum, + value_name = "terse", + help = "Configure formatting of output" + )] + format: Option, + #[arg( + index = 2, + value_name = "FILTER", + help = "The FILTER string is tested against the name of all tests, and only those tests \ + whose names contain the filter are run." + )] + filter: Option, +} + +impl Cli { + fn into_args(self, tests: &Tests) -> String { + let include_ignored = self.include_ignored; + let filtered = tests.filtered; + + format!( + r#" + // Forward runtime arguments. + cx.include_ignored({include_ignored:?}); + cx.filtered_count({filtered}); + "# + ) + } +} + +struct Tests { + tests: Vec, + filtered: usize, +} + +impl Tests { + fn new() -> Self { + Self { + tests: Vec::new(), + filtered: 0, + } + } +} + +struct Test { + name: String, + ignored: bool, } fn main() -> anyhow::Result<()> { env_logger::init(); - let mut args = env::args_os().skip(1); - let shell = shell::Shell::new(); - // Currently no flags are supported, and assume there's only one argument - // which is the wasm file to test. This'll want to improve over time! - let wasm_file_to_test = match args.next() { - Some(file) => PathBuf::from(file), - None => bail!("must have a file to test as first argument"), - }; + let cli = Cli::parse(); - // Assume a cargo-like directory layout and generate output at - // `target/wasm32-unknown-unknown/wbg-tmp/...` - let tmpdir = wasm_file_to_test - .parent() // chop off file name - .and_then(|p| p.parent()) // chop off `deps` - .and_then(|p| p.parent()) // chop off `debug` - .map(|p| p.join("wbg-tmp")) - .ok_or_else(|| anyhow!("file to test doesn't follow the expected Cargo conventions"))?; + let shell = shell::Shell::new(); - // Make sure there's no stale state from before - drop(fs::remove_dir_all(&tmpdir)); - fs::create_dir(&tmpdir).context("creating temporary directory")?; - - let module = "wasm-bindgen-test"; + let file_name = cli + .file + .file_name() + .map(Path::new) + .context("file to test is not a valid file, can't extract file name")?; // Collect all tests that the test harness is supposed to run. We assume // that any exported function with the prefix `__wbg_test` is a test we need // to execute. - let wasm = fs::read(&wasm_file_to_test).context("failed to read wasm file")?; + let wasm = fs::read(&cli.file).context("failed to read Wasm file")?; let mut wasm = - walrus::Module::from_buffer(&wasm).context("failed to deserialize wasm module")?; - let mut tests = Vec::new(); + walrus::Module::from_buffer(&wasm).context("failed to deserialize Wasm module")?; + let mut tests = Tests::new(); - for export in wasm.exports.iter() { - if !export.name.starts_with("__wbgt_") { + 'outer: for export in wasm.exports.iter() { + let Some(name) = export.name.strip_prefix("__wbgt_") else { continue; + }; + let modifiers = name.split_once('_').expect("found invalid identifier").0; + let test = Test { + name: export.name.clone(), + ignored: modifiers.contains('$'), + }; + + if let Some(filter) = &cli.filter { + let matches = if cli.exact { + name == *filter + } else { + name.contains(filter) + }; + + if !matches { + tests.filtered += 1; + continue; + } + } + + for skip in &cli.skip { + let matches = if cli.exact { + name == *skip + } else { + name.contains(skip) + }; + + if matches { + tests.filtered += 1; + continue 'outer; + } + } + + if !test.ignored && cli.ignored { + tests.filtered += 1; + } else { + tests.tests.push(test); } - tests.push(export.name.to_string()); } + if cli.list { + for test in tests.tests { + println!("{}: test", test.name.split_once("::").unwrap().1); + } + + // Returning cleanly has the strange effect of outputting + // an additional empty line with spaces in it. + std::process::exit(0); + } + + let tmpdir = tempfile::tempdir()?; + + let module = "wasm-bindgen-test"; + // Right now there's a bug where if no tests are present then the // `wasm-bindgen-test` runtime support isn't linked in, so just bail out // early saying everything is ok. - if tests.len() == 0 { + if tests.tests.is_empty() { println!("no tests to run!"); return Ok(()); } @@ -91,92 +196,147 @@ fn main() -> anyhow::Result<()> { // to read later on. let custom_section = wasm.customs.remove_raw("__wasm_bindgen_test_unstable"); + let no_modules = std::env::var("WASM_BINDGEN_USE_NO_MODULE").is_ok(); let test_mode = match custom_section { - Some(section) if section.data.contains(&0x01) => TestMode::Browser, + Some(section) if section.data.contains(&0x01) => TestMode::Browser { no_modules }, + Some(section) if section.data.contains(&0x02) => TestMode::DedicatedWorker { no_modules }, + Some(section) if section.data.contains(&0x03) => TestMode::SharedWorker { no_modules }, + Some(section) if section.data.contains(&0x04) => TestMode::ServiceWorker { no_modules }, + Some(section) if section.data.contains(&0x05) => TestMode::Node { no_modules }, Some(_) => bail!("invalid __wasm_bingen_test_unstable value"), - None if std::env::var("WASM_BINDGEN_USE_DENO").is_ok() => TestMode::Deno, - None => TestMode::Node, + None => { + let mut modes = Vec::new(); + let mut add_mode = + |mode: TestMode| std::env::var(mode.env()).is_ok().then(|| modes.push(mode)); + add_mode(TestMode::Deno); + add_mode(TestMode::Browser { no_modules }); + add_mode(TestMode::DedicatedWorker { no_modules }); + add_mode(TestMode::SharedWorker { no_modules }); + add_mode(TestMode::ServiceWorker { no_modules }); + add_mode(TestMode::Node { no_modules }); + + match modes.len() { + 0 => TestMode::Node { no_modules: true }, + 1 => modes[0], + _ => { + bail!( + "only one test mode must be set, found: `{}`", + modes + .into_iter() + .map(TestMode::env) + .collect::>() + .join("`, `") + ) + } + } + } }; let headless = env::var("NO_HEADLESS").is_err(); let debug = env::var("WASM_BINDGEN_NO_DEBUG").is_err(); // Gracefully handle requests to execute only node or only web tests. - let node = test_mode == TestMode::Node; - - if env::var_os("WASM_BINDGEN_TEST_ONLY_NODE").is_some() { - if !node { - println!( - "this test suite is only configured to run in a browser, \ - but we're only testing node.js tests so skipping" - ); - return Ok(()); - } + let node = matches!(test_mode, TestMode::Node { .. }); + + if env::var_os("WASM_BINDGEN_TEST_ONLY_NODE").is_some() && !node { + println!( + "this test suite is only configured to run in a browser, \ + but we're only testing node.js tests so skipping" + ); + return Ok(()); } - if env::var_os("WASM_BINDGEN_TEST_ONLY_WEB").is_some() { - if node { - println!( - "\ -This test suite is only configured to run in node.js, but we're only running -browser tests so skipping. If you'd like to run the tests in a browser -include this in your crate when testing: - - wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); - -You'll likely want to put that in a `#[cfg(test)]` module or at the top of an -integration test.\ -" - ); - return Ok(()); - } + if env::var_os("WASM_BINDGEN_TEST_ONLY_WEB").is_some() && node { + println!( + "\ + This test suite is only configured to run in node.js, but we're only running + browser tests so skipping. If you'd like to run the tests in a browser + include this in your crate when testing: + + wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); + + You'll likely want to put that in a `#[cfg(test)]` module or at the top of an + integration test.\ + " + ); + return Ok(()); } - let timeout = env::var("WASM_BINDGEN_TEST_TIMEOUT") + let driver_timeout = env::var("WASM_BINDGEN_TEST_DRIVER_TIMEOUT") .map(|timeout| { timeout .parse() - .expect("Could not parse 'WASM_BINDGEN_TEST_TIMEOUT'") + .expect("Could not parse 'WASM_BINDGEN_TEST_DRIVER_TIMEOUT'") }) - .unwrap_or(20); + .unwrap_or(5); - if debug { - println!("Set timeout to {} seconds...", timeout); - } + let browser_timeout = env::var("WASM_BINDGEN_TEST_TIMEOUT") + .map(|timeout| { + let timeout = timeout + .parse() + .expect("Could not parse 'WASM_BINDGEN_TEST_TIMEOUT'"); + println!("Set timeout to {} seconds...", timeout); + timeout + }) + .unwrap_or(20); // Make the generated bindings available for the tests to execute against. shell.status("Executing bindgen..."); let mut b = Bindgen::new(); match test_mode { - TestMode::Node => b.nodejs(true)?, + TestMode::Node { no_modules: true } => b.nodejs(true)?, + TestMode::Node { no_modules: false } => b.nodejs_module(true)?, TestMode::Deno => b.deno(true)?, - TestMode::Browser => b.web(true)?, + TestMode::Browser { .. } + | TestMode::DedicatedWorker { .. } + | TestMode::SharedWorker { .. } + | TestMode::ServiceWorker { .. } => { + if test_mode.no_modules() { + b.no_modules(true)? + } else { + b.web(true)? + } + } }; + if std::env::var("WASM_BINDGEN_SPLIT_LINKED_MODULES").is_ok() { + b.split_linked_modules(true); + } + + let coverage = coverage_args(file_name); + b.debug(debug) .input_module(module, wasm) .keep_debug(false) .emit_start(false) .generate(&tmpdir) - .context("executing `wasm-bindgen` over the wasm file")?; + .context("executing `wasm-bindgen` over the Wasm file")?; shell.clear(); - let args: Vec<_> = args.collect(); - match test_mode { - TestMode::Node => node::execute(&module, &tmpdir, &args, &tests)?, - TestMode::Deno => deno::execute(&module, &tmpdir, &args, &tests)?, - TestMode::Browser => { + TestMode::Node { no_modules } => { + node::execute(module, tmpdir.path(), cli, tests, !no_modules, coverage)? + } + TestMode::Deno => deno::execute(module, tmpdir.path(), cli, tests)?, + TestMode::Browser { .. } + | TestMode::DedicatedWorker { .. } + | TestMode::SharedWorker { .. } + | TestMode::ServiceWorker { .. } => { let srv = server::spawn( &if headless { "127.0.0.1:0".parse().unwrap() + } else if let Ok(address) = std::env::var("WASM_BINDGEN_TEST_ADDRESS") { + address.parse().unwrap() } else { "127.0.0.1:8000".parse().unwrap() }, headless, - &module, - &tmpdir, - &args, - &tests, + module, + tmpdir.path(), + cli, + tests, + test_mode, + std::env::var("WASM_BINDGEN_TEST_NO_ORIGIN_ISOLATION").is_err(), + coverage, ) .context("failed to spawn server")?; let addr = srv.server_addr(); @@ -188,17 +348,88 @@ integration test.\ "Interactive browsers tests are now available at http://{}", addr ); - println!(""); + println!(); println!("Note that interactive mode is enabled because `NO_HEADLESS`"); println!("is specified in the environment of this process. Once you're"); println!("done with testing you'll need to kill this server with"); println!("Ctrl-C."); - return Ok(srv.run()); + srv.run(); + return Ok(()); } thread::spawn(|| srv.run()); - headless::run(&addr, &shell, timeout)?; + headless::run(&addr, &shell, driver_timeout, browser_timeout)?; } } Ok(()) } + +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +enum TestMode { + Node { no_modules: bool }, + Deno, + Browser { no_modules: bool }, + DedicatedWorker { no_modules: bool }, + SharedWorker { no_modules: bool }, + ServiceWorker { no_modules: bool }, +} + +impl TestMode { + fn is_worker(self) -> bool { + matches!( + self, + Self::DedicatedWorker { .. } | Self::SharedWorker { .. } | Self::ServiceWorker { .. } + ) + } + + fn no_modules(self) -> bool { + match self { + Self::Deno => true, + Self::Browser { no_modules } + | Self::Node { no_modules } + | Self::DedicatedWorker { no_modules } + | Self::SharedWorker { no_modules } + | Self::ServiceWorker { no_modules } => no_modules, + } + } + + fn env(self) -> &'static str { + match self { + TestMode::Node { .. } => "WASM_BINDGEN_USE_NODE_EXPERIMENTAL", + TestMode::Deno => "WASM_BINDGEN_USE_DENO", + TestMode::Browser { .. } => "WASM_BINDGEN_USE_BROWSER", + TestMode::DedicatedWorker { .. } => "WASM_BINDGEN_USE_DEDICATED_WORKER", + TestMode::SharedWorker { .. } => "WASM_BINDGEN_USE_SHARED_WORKER", + TestMode::ServiceWorker { .. } => "WASM_BINDGEN_USE_SERVICE_WORKER", + } + } +} + +fn coverage_args(file_name: &Path) -> PathBuf { + fn generated(file_name: &Path, prefix: &str) -> String { + let res = format!("{prefix}{}.profraw", file_name.display()); + res + } + + let prefix = env::var_os("WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_PREFIX") + .map(|s| s.to_str().unwrap().to_string()) + .unwrap_or_default(); + + match env::var_os("WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_OUT") { + Some(s) => { + let mut buf = PathBuf::from(s); + if buf.is_dir() { + buf.push(generated(file_name, &prefix)); + } + buf + } + None => PathBuf::from(generated(file_name, &prefix)), + } +} + +/// Possible values for the `--format` option. +#[derive(Debug, Clone, Copy, ValueEnum)] +enum FormatSetting { + /// Display one character per test + Terse, +} diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs index 0b389682aa7..f7cef86faa7 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs @@ -1,11 +1,14 @@ use std::env; -use std::ffi::OsString; use std::fs; -use std::path::Path; +use std::path::{Path, PathBuf}; +use std::process; use std::process::Command; use anyhow::{Context, Error}; +use crate::Cli; +use crate::Tests; + // depends on the variable 'wasm' and initializes te WasmBindgenTestContext cx pub const SHARED_SETUP: &str = r#" const handlers = {}; @@ -14,13 +17,17 @@ const wrap = method => { const og = console[method]; const on_method = `on_console_${method}`; console[method] = function (...args) { - og.apply(this, args); + if (nocapture) { + og.apply(this, args); + } if (handlers[on_method]) { handlers[on_method](args); } }; }; +// save original `console.log` +global.__wbgtest_og_console_log = console.log; // override `console.log` and `console.error` etc... before we import tests to // ensure they're bound correctly in wasm. This'll allow us to intercept // all these calls and capture the output of tests @@ -30,7 +37,7 @@ wrap("info"); wrap("warn"); wrap("error"); -cx = new wasm.WasmBindgenTestContext(); +const 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; @@ -41,41 +48,63 @@ handlers.on_console_error = wasm.__wbgtest_console_error; pub fn execute( module: &str, tmpdir: &Path, - args: &[OsString], - tests: &[String], + cli: Cli, + tests: Tests, + module_format: bool, + coverage: PathBuf, ) -> Result<(), Error> { let mut js_to_execute = format!( r#" - const {{ exit }} = require('process'); - const wasm = require("./{0}"); + {exit}; + {fs}; + {wasm}; + const nocapture = {nocapture}; {console_override} global.__wbg_test_invoke = f => f(); async function main(tests) {{ - // Forward runtime arguments. These arguments are also arguments to the - // `wasm-bindgen-test-runner` which forwards them to node which we - // forward to the test harness. this is basically only used for test - // filters for now. - cx.args(process.argv.slice(2)); + {args} const ok = await cx.run(tests.map(n => wasm.__wasm[n])); + + const coverage = wasm.__wbgtest_cov_dump(); + if (coverage !== undefined) + await fs.writeFile('{coverage}', coverage); + if (!ok) exit(1); }} const tests = []; "#, - module, + wasm = if !module_format { + format!(r"const wasm = require('./{0}.js')", module) + } else { + format!(r"import * as wasm from './{0}.js'", module) + }, + exit = if !module_format { + r"const { exit } = require('node:process')".to_string() + } else { + r"import { exit } from 'node:process'".to_string() + }, + fs = if !module_format { + r"const fs = require('node:fs/promises')".to_string() + } else { + r"import fs from 'node:fs/promises'".to_string() + }, + coverage = coverage.display(), + nocapture = cli.nocapture.clone(), console_override = SHARED_SETUP, + args = cli.into_args(&tests), ); // Note that we're collecting *JS objects* that represent the functions to - // execute, and then those objects are passed into wasm for it to execute + // execute, and then those objects are passed into Wasm for it to execute // when it sees fit. - for test in tests { - js_to_execute.push_str(&format!("tests.push('{}')\n", test)); + for test in tests.tests { + js_to_execute.push_str(&format!("tests.push('{}')\n", test.name)); } // And as a final addendum, exit with a nonzero code if any tests fail. js_to_execute.push_str( @@ -88,7 +117,14 @@ pub fn execute( ", ); - let js_path = tmpdir.join("run.js"); + let js_path = if module_format { + // fixme: this is a hack to make node understand modules + let package_json = tmpdir.join("package.json"); + fs::write(&package_json, r#"{"type": "module"}"#).unwrap(); + tmpdir.join("run.mjs") + } else { + tmpdir.join("run.cjs") + }; fs::write(&js_path, js_to_execute).context("failed to write JS file")?; // Augment `NODE_PATH` so things like `require("tests/my-custom.js")` work @@ -100,30 +136,21 @@ pub fn execute( path.push(tmpdir.to_path_buf()); let extra_node_args = env::var("NODE_ARGS") .unwrap_or_default() - .split(",") + .split(',') .map(|s| s.to_string()) .filter(|s| !s.is_empty()) .collect::>(); - exec( - Command::new("node") - .env("NODE_PATH", env::join_paths(&path).unwrap()) - .args(&extra_node_args) - .arg(&js_path) - .args(args), - ) -} - -#[cfg(unix)] -pub fn exec(cmd: &mut Command) -> Result<(), Error> { - use std::os::unix::prelude::*; - Err(Error::from(cmd.exec()) - .context("failed to execute `node`") - .into()) -} -#[cfg(windows)] -pub fn exec(cmd: &mut Command) -> Result<(), Error> { - use std::process; - let status = cmd.status()?; - process::exit(status.code().unwrap_or(3)); + let status = Command::new("node") + .env("NODE_PATH", env::join_paths(&path).unwrap()) + .arg("--expose-gc") + .args(&extra_node_args) + .arg(&js_path) + .status()?; + + if !status.success() { + process::exit(status.code().unwrap_or(1)) + } else { + Ok(()) + } } diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs index 631d9ec2f8d..f5b088a17b6 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs @@ -1,66 +1,293 @@ -use std::ffi::OsString; +use std::borrow::Cow; use std::fs; +use std::io::{Read, Write}; use std::net::SocketAddr; -use std::path::Path; +use std::path::{Path, PathBuf}; use anyhow::{anyhow, Context, Error}; use rouille::{Request, Response, Server}; -pub fn spawn( +use crate::{Cli, TestMode, Tests}; + +pub(crate) fn spawn( addr: &SocketAddr, headless: bool, - module: &str, + module: &'static str, tmpdir: &Path, - args: &[OsString], - tests: &[String], + cli: Cli, + tests: Tests, + test_mode: TestMode, + isolate_origin: bool, + coverage: PathBuf, ) -> Result Response + Send + Sync>, Error> { - let mut js_to_execute = format!( - r#" - import {{ - WasmBindgenTestContext as Context, - __wbgtest_console_debug, - __wbgtest_console_log, - __wbgtest_console_info, - __wbgtest_console_warn, - __wbgtest_console_error, - default as init, - }} from './{0}'; - - // Now that we've gotten to the point where JS is executing, update our - // status text as at this point we should be asynchronously fetching the - // wasm module. - document.getElementById('output').textContent = "Loading wasm module..."; - - async function main(test) {{ - const wasm = await init('./{0}_bg.wasm'); - - const cx = new Context(); - window.on_console_debug = __wbgtest_console_debug; - window.on_console_log = __wbgtest_console_log; - window.on_console_info = __wbgtest_console_info; - window.on_console_warn = __wbgtest_console_warn; - window.on_console_error = __wbgtest_console_error; - - // Forward runtime arguments. These arguments are also arguments to the - // `wasm-bindgen-test-runner` which forwards them to node which we - // forward to the test harness. this is basically only used for test - // filters for now. - cx.args({1:?}); - - await cx.run(test.map(s => wasm[s])); - }} - - const tests = []; - "#, - module, args, - ); - for test in tests { - js_to_execute.push_str(&format!("tests.push('{}');\n", test)); + let mut js_to_execute = String::new(); + + let cov_import = if test_mode.no_modules() { + "let __wbgtest_cov_dump = wasm_bindgen.__wbgtest_cov_dump;" + } else { + "__wbgtest_cov_dump," + }; + let cov_dump = r#" + // Dump the coverage data collected during the tests + const coverage = __wbgtest_cov_dump(); + + if (coverage !== undefined) { + await fetch("/__wasm_bindgen/coverage", { + method: "POST", + body: coverage + }); + } + "#; + + let wbg_import_script = if test_mode.no_modules() { + String::from( + r#" + let Context = wasm_bindgen.WasmBindgenTestContext; + let __wbgtest_console_debug = wasm_bindgen.__wbgtest_console_debug; + let __wbgtest_console_log = wasm_bindgen.__wbgtest_console_log; + let __wbgtest_console_info = wasm_bindgen.__wbgtest_console_info; + let __wbgtest_console_warn = wasm_bindgen.__wbgtest_console_warn; + let __wbgtest_console_error = wasm_bindgen.__wbgtest_console_error; + {cov_import} + let init = wasm_bindgen; + "#, + ) + } else { + format!( + r#" + import {{ + WasmBindgenTestContext as Context, + __wbgtest_console_debug, + __wbgtest_console_log, + __wbgtest_console_info, + __wbgtest_console_warn, + __wbgtest_console_error, + {cov_import} + default as init, + }} from './{}'; + "#, + module, + ) + }; + + let nocapture = cli.nocapture; + let args = cli.into_args(&tests); + + if test_mode.is_worker() { + let mut worker_script = if test_mode.no_modules() { + format!(r#"importScripts("{0}.js");"#, module) + } else { + String::new() + }; + + worker_script.push_str(&wbg_import_script); + + match test_mode { + TestMode::DedicatedWorker { .. } => worker_script.push_str("const port = self\n"), + TestMode::SharedWorker { .. } => worker_script.push_str( + r#" + addEventListener('connect', (e) => { + const port = e.ports[0] + "#, + ), + TestMode::ServiceWorker { .. } => worker_script.push_str( + r#" + addEventListener('install', (e) => skipWaiting()); + addEventListener('activate', (e) => e.waitUntil(clients.claim())); + addEventListener('message', (e) => { + const port = e.ports[0] + "#, + ), + _ => unreachable!(), + } + + worker_script.push_str(&format!( + r#" + const nocapture = {nocapture}; + const wrap = method => {{ + const on_method = `on_console_${{method}}`; + self.console[method] = function (...args) {{ + if (nocapture) {{ + self.__wbg_test_output_writeln(args); + }} + if (self[on_method]) {{ + self[on_method](args); + }} + port.postMessage(["__wbgtest_" + method, args]); + }}; + }}; + + self.__wbg_test_invoke = f => f(); + self.__wbg_test_output = ""; + self.__wbg_test_output_writeln = function (line) {{ + self.__wbg_test_output += line + "\n"; + port.postMessage(["__wbgtest_output", self.__wbg_test_output]); + }} + + wrap("debug"); + wrap("log"); + wrap("info"); + wrap("warn"); + wrap("error"); + + async function run_in_worker(tests) {{ + const wasm = await init("./{module}_bg.wasm"); + const t = self; + const cx = new Context(); + + self.on_console_debug = __wbgtest_console_debug; + self.on_console_log = __wbgtest_console_log; + self.on_console_info = __wbgtest_console_info; + self.on_console_warn = __wbgtest_console_warn; + self.on_console_error = __wbgtest_console_error; + + {args} + + await cx.run(tests.map(s => wasm[s])); + {cov_dump} + }} + + port.onmessage = function(e) {{ + let tests = e.data; + run_in_worker(tests); + }} + "#, + )); + + if matches!( + test_mode, + TestMode::SharedWorker { .. } | TestMode::ServiceWorker { .. } + ) { + worker_script.push_str("})"); + } + + let name = if matches!(test_mode, TestMode::ServiceWorker { .. }) { + "service.js" + } else { + "worker.js" + }; + let worker_js_path = tmpdir.join(name); + fs::write(worker_js_path, worker_script).context("failed to write JS file")?; + + js_to_execute.push_str(&format!( + r#" + // Now that we've gotten to the point where JS is executing, update our + // status text as at this point we should be asynchronously fetching the + // Wasm module. + document.getElementById('output').textContent = "Loading Wasm module..."; + {} + + port.addEventListener("message", function(e) {{ + // Checking the whether the message is from wasm_bindgen_test + if( + e.data && + Array.isArray(e.data) && + e.data[0] && + typeof e.data[0] == "string" && + e.data[0].slice(0,10)=="__wbgtest_" + ) {{ + const method = e.data[0].slice(10); + const args = e.data.slice(1); + + if ( + method == "log" || method == "error" || + method == "warn" || method == "info" || + method == "debug" + ) {{ + console[method].apply(undefined, args[0]); + }} else if (method == "output") {{ + document.getElementById("output").textContent = args[0]; + }} + }} + }}); + + async function main(test) {{ + port.postMessage(test) + }} + + const tests = []; + "#, + { + let module = if test_mode.no_modules() { + "classic" + } else { + "module" + }; + + match test_mode { + TestMode::DedicatedWorker { .. } => { + format!("const port = new Worker('worker.js', {{type: '{module}'}});\n") + } + TestMode::SharedWorker { .. } => { + format!( + r#" + const worker = new SharedWorker("worker.js?random=" + crypto.randomUUID(), {{type: "{module}"}}); + const port = worker.port; + port.start(); + "# + ) + } + TestMode::ServiceWorker { .. } => { + format!( + r#" + const url = "service.js?random=" + crypto.randomUUID(); + await navigator.serviceWorker.register(url, {{type: "{module}"}}); + await new Promise((resolve) => {{ + navigator.serviceWorker.addEventListener('controllerchange', () => {{ + if (navigator.serviceWorker.controller.scriptURL != location.href + url) {{ + throw "`wasm-bindgen-test-runner` does not support running multiple service worker tests at the same time" + }} + resolve(); + }}); + }}); + const channel = new MessageChannel(); + navigator.serviceWorker.controller.postMessage(undefined, [channel.port2]); + const port = channel.port1; + port.start(); + "# + ) + } + _ => unreachable!(), + } + } + )); + } else { + js_to_execute.push_str(&wbg_import_script); + + js_to_execute.push_str(&format!( + r#" + // Now that we've gotten to the point where JS is executing, update our + // status text as at this point we should be asynchronously fetching the + // Wasm module. + document.getElementById('output').textContent = "Loading Wasm module..."; + + async function main(test) {{ + const wasm = await init('./{module}_bg.wasm'); + + const cx = new Context(); + window.on_console_debug = __wbgtest_console_debug; + window.on_console_log = __wbgtest_console_log; + window.on_console_info = __wbgtest_console_info; + window.on_console_warn = __wbgtest_console_warn; + window.on_console_error = __wbgtest_console_error; + + {args} + + await cx.run(test.map(s => wasm[s])); + {cov_dump} + }} + + const tests = []; + "#, + )); + } + for test in tests.tests { + js_to_execute.push_str(&format!("tests.push('{}');\n", test.name)); } js_to_execute.push_str("main(tests);\n"); let js_path = tmpdir.join("run.js"); - fs::write(&js_path, js_to_execute).context("failed to write JS file")?; + fs::write(js_path, js_to_execute).context("failed to write JS file")?; // For now, always run forever on this port. We may update this later! let tmpdir = tmpdir.to_path_buf(); @@ -75,20 +302,55 @@ pub fn spawn( } else { include_str!("index.html") }; - return Response::from_data("text/html", s); + let s = s.replace("// {NOCAPTURE}", &format!("const nocapture = {nocapture};")); + let s = if !test_mode.is_worker() && test_mode.no_modules() { + s.replace( + "", + &format!( + "\n", + module + ), + ) + } else { + s.replace( + "", + "", + ) + }; + + let mut response = Response::from_data("text/html", s); + + if isolate_origin { + set_isolate_origin_headers(&mut response) + } + + return response; + } else if request.url() == "/__wasm_bindgen/coverage" { + return if let Err(e) = handle_coverage_dump(&coverage, request) { + let s: &str = &format!("Failed to dump coverage: {e}"); + log::error!("{s}"); + let mut ret = Response::text(s); + ret.status_code = 500; + ret + } else { + Response::empty_204() + }; } // Otherwise we need to find the asset here. It may either be in our // temporary directory (generated files) or in the main directory // (relative import paths to JS). Try to find both locations. - let mut response = try_asset(&request, &tmpdir); + let mut response = try_asset(request, &tmpdir); if !response.is_success() { - response = try_asset(&request, ".".as_ref()); + response = try_asset(request, ".".as_ref()); } // Make sure browsers don't cache anything (Chrome appeared to with this // header?) response.headers.retain(|(k, _)| k != "Cache-Control"); - return response; + if isolate_origin { + set_isolate_origin_headers(&mut response) + } + response }) .map_err(|e| anyhow!("{}", e))?; return Ok(srv); @@ -104,7 +366,7 @@ pub fn spawn( // 'foo'` instead of `from 'foo.js'`. Fixup those paths here to see if a // `js` file exists. if let Some(part) = request.url().split('/').last() { - if !part.contains(".") { + if !part.contains('.') { let new_request = Request::fake_http( request.method(), format!("{}.js", request.url()), @@ -123,3 +385,35 @@ pub fn spawn( response } } + +fn handle_coverage_dump(profraw_path: &Path, request: &Request) -> anyhow::Result<()> { + // This is run after all tests are done and dumps the data received in the request + // into a single profraw file + let mut profraw = std::fs::File::create(profraw_path)?; + let mut data = Vec::new(); + if let Some(mut r_data) = request.data() { + r_data.read_to_end(&mut data)?; + } + // Warnings about empty data should have already been handled by + // the client + + profraw.write_all(&data)?; + Ok(()) +} + +/* + * Set the Cross-Origin-Opener-Policy and Cross-Origin_Embedder-Policy headers + * on the Server response to enable worker context sharing, as described in: + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy#certain_features_depend_on_cross-origin_isolation + * https://security.googleblog.com/2018/07/mitigating-spectre-with-site-isolation.html + */ +fn set_isolate_origin_headers(response: &mut Response) { + response.headers.push(( + Cow::Borrowed("Cross-Origin-Opener-Policy"), + Cow::Borrowed("same-origin"), + )); + response.headers.push(( + Cow::Borrowed("Cross-Origin-Embedder-Policy"), + Cow::Borrowed("require-corp"), + )); +} diff --git a/crates/cli/src/bin/wasm-bindgen.rs b/crates/cli/src/bin/wasm-bindgen.rs index 877b0c41a12..b705e8a09dd 100644 --- a/crates/cli/src/bin/wasm-bindgen.rs +++ b/crates/cli/src/bin/wasm-bindgen.rs @@ -1,86 +1,95 @@ use anyhow::{bail, Error}; -use docopt::Docopt; -use serde::Deserialize; +use clap::Parser; use std::path::PathBuf; use std::process; use wasm_bindgen_cli_support::{Bindgen, EncodeInto}; -// no need for jemalloc bloat in this binary (and we don't need speed) -#[global_allocator] -static ALLOC: std::alloc::System = std::alloc::System; - -const USAGE: &'static str = " -Generating JS bindings for a wasm file - -Usage: - wasm-bindgen [options] - wasm-bindgen -h | --help - wasm-bindgen -V | --version - -Options: - -h --help Show this screen. - --out-dir DIR Output directory - --out-name VAR Set a custom output filename (Without extension. Defaults to crate name) - --target TARGET What type of output to generate, valid - values are [web, bundler, nodejs, no-modules, deno], - and the default is [bundler] - --no-modules-global VAR Name of the global variable to initialize - --browser Hint that JS should only be compatible with a browser - --typescript Output a TypeScript definition file (on by default) - --no-typescript Don't emit a *.d.ts file - --omit-imports Don't emit imports in generated JavaScript - --debug Include otherwise-extraneous debug checks in output - --no-demangle Don't demangle Rust symbol names - --keep-debug Keep debug sections in wasm files - --remove-name-section Remove the debugging `name` section of the file - --remove-producers-section Remove the telemetry `producers` section - --omit-default-module-path Don't add WebAssembly fallback imports in generated JavaScript - --encode-into MODE Whether or not to use TextEncoder#encodeInto, - valid values are [test, always, never] - --nodejs Deprecated, use `--target nodejs` - --web Deprecated, use `--target web` - --no-modules Deprecated, use `--target no-modules` - --weak-refs Enable usage of the JS weak references proposal - --reference-types Enable usage of WebAssembly reference types - -V --version Print the version number of wasm-bindgen -"; - -#[derive(Debug, Deserialize)] +#[derive(Debug, Parser)] +#[command( + name = "wasm-bindgen", + version, + about, + long_about = None, + after_help = "Additional documentation: https://rustwasm.github.io/wasm-bindgen/reference/cli.html", +)] struct Args { - flag_nodejs: bool, - flag_browser: bool, - flag_web: bool, - flag_no_modules: bool, - flag_typescript: bool, - flag_no_typescript: bool, - flag_omit_imports: bool, - flag_out_dir: Option, - flag_out_name: Option, - flag_debug: bool, - flag_version: bool, - flag_no_demangle: bool, - flag_no_modules_global: Option, - flag_remove_name_section: bool, - flag_remove_producers_section: bool, - flag_weak_refs: Option, - flag_reference_types: Option, - flag_keep_debug: bool, - flag_encode_into: Option, - flag_target: Option, - flag_omit_default_module_path: bool, - arg_input: Option, + #[arg(long, help = "Deprecated, use `--target nodejs`")] + nodejs: bool, + #[arg(long, help = "Hint that JS should only be compatible with a browser")] + browser: bool, + #[arg(long, help = "Deprecated, use `--target web`")] + web: bool, + #[arg(long, help = "Deprecated, use `--target no-modules`")] + no_modules: bool, + #[arg(long, help = "Output a TypeScript definition file (on by default)")] + typescript: bool, + #[arg(long, help = "Don't emit a *.d.ts file")] + no_typescript: bool, + #[arg(long, help = "Don't emit imports in generated JavaScript")] + omit_imports: bool, + #[arg(long, value_name = "DIR", help = "Output directory")] + out_dir: Option, + #[arg( + long, + value_name = "VAR", + help = "Set a custom output filename (Without extension. Defaults to crate name)" + )] + out_name: Option, + #[arg(long, help = "Include otherwise-extraneous debug checks in output")] + debug: bool, + #[arg(long, help = "Don't demangle Rust symbol names")] + no_demangle: bool, + #[arg( + long, + value_name = "VAR", + help = "Name of the global variable to initialize" + )] + no_modules_global: Option, + #[arg(long, help = "Remove the debugging `name` section of the file")] + remove_name_section: bool, + #[arg(long, help = "Remove the telemetry `producers` section")] + remove_producers_section: bool, + #[arg(long, help = "Deprecated, is runtime-detected")] + #[allow(dead_code)] + weak_refs: bool, + #[arg(long, help = "Deprecated, use `-Ctarget-feature=+reference-types`")] + reference_types: bool, + #[arg(long, help = "Keep exports synthesized by LLD")] + keep_lld_exports: bool, + #[arg(long, help = "Keep debug sections in Wasm files")] + keep_debug: bool, + #[arg( + long, + value_name = "MODE", + help = "Whether or not to use TextEncoder#encodeInto, valid values are [test, always, never]" + )] + encode_into: Option, + #[arg( + long, + value_name = "TARGET", + help = "What type of output to generate, valid\n\ + values are [web, bundler, nodejs, no-modules, deno, experimental-nodejs-module],\n\ + and the default is [bundler]" + )] + target: Option, + #[arg( + long, + help = "Don't add WebAssembly fallback imports in generated JavaScript" + )] + omit_default_module_path: bool, + #[arg( + long, + help = "Split linked modules out into their own files. Recommended if possible.\n\ + If a bundler is used, it needs to be set up accordingly." + )] + split_linked_modules: bool, + input: PathBuf, } fn main() { env_logger::init(); - let args: Args = Docopt::new(USAGE) - .and_then(|d| d.deserialize()) - .unwrap_or_else(|e| e.exit()); + let args = Args::parse(); - if args.flag_version { - println!("wasm-bindgen {}", wasm_bindgen_shared::version()); - return; - } let err = match rmain(&args) { Ok(()) => return, Err(e) => e, @@ -90,50 +99,46 @@ fn main() { } fn rmain(args: &Args) -> Result<(), Error> { - let input = match args.arg_input { - Some(ref s) => s, - None => bail!("input file expected"), - }; - - let typescript = args.flag_typescript || !args.flag_no_typescript; + let typescript = args.typescript || !args.no_typescript; let mut b = Bindgen::new(); - if let Some(name) = &args.flag_target { + if let Some(name) = &args.target { match name.as_str() { "bundler" => b.bundler(true)?, "web" => b.web(true)?, "no-modules" => b.no_modules(true)?, "nodejs" => b.nodejs(true)?, "deno" => b.deno(true)?, + "experimental-nodejs-module" => b.nodejs_module(true)?, s => bail!("invalid encode-into mode: `{}`", s), }; } - b.input_path(input) - .nodejs(args.flag_nodejs)? - .web(args.flag_web)? - .browser(args.flag_browser)? - .no_modules(args.flag_no_modules)? - .debug(args.flag_debug) - .demangle(!args.flag_no_demangle) - .keep_debug(args.flag_keep_debug) - .remove_name_section(args.flag_remove_name_section) - .remove_producers_section(args.flag_remove_producers_section) + b.input_path(&args.input) + .nodejs(args.nodejs)? + .web(args.web)? + .browser(args.browser)? + .no_modules(args.no_modules)? + .debug(args.debug) + .demangle(!args.no_demangle) + .keep_lld_exports(args.keep_lld_exports) + .keep_debug(args.keep_debug) + .remove_name_section(args.remove_name_section) + .remove_producers_section(args.remove_producers_section) .typescript(typescript) - .omit_imports(args.flag_omit_imports) - .omit_default_module_path(args.flag_omit_default_module_path); - if let Some(true) = args.flag_weak_refs { - b.weak_refs(true); - } - if let Some(true) = args.flag_reference_types { + .omit_imports(args.omit_imports) + .omit_default_module_path(args.omit_default_module_path) + .split_linked_modules(args.split_linked_modules); + if args.reference_types { + #[allow(deprecated)] b.reference_types(true); } - if let Some(ref name) = args.flag_no_modules_global { + if let Some(ref name) = args.no_modules_global { b.no_modules_global(name)?; } - if let Some(ref name) = args.flag_out_name { + if let Some(ref name) = args.out_name { b.out_name(name); } - if let Some(mode) = &args.flag_encode_into { + if let Some(mode) = &args.encode_into { match mode.as_str() { "test" => b.encode_into(EncodeInto::Test), "always" => b.encode_into(EncodeInto::Always), @@ -142,7 +147,7 @@ fn rmain(args: &Args) -> Result<(), Error> { }; } - let out_dir = match args.flag_out_dir { + let out_dir = match args.out_dir { Some(ref p) => p, None => bail!("the `--out-dir` argument is now required"), }; diff --git a/crates/cli/src/bin/wasm2es6js.rs b/crates/cli/src/bin/wasm2es6js.rs index caa35cf122b..6a13a6ae550 100644 --- a/crates/cli/src/bin/wasm2es6js.rs +++ b/crates/cli/src/bin/wasm2es6js.rs @@ -1,56 +1,47 @@ use anyhow::{Context, Error}; -use docopt::Docopt; -use serde::Deserialize; +use clap::Parser; use std::fs; use std::path::PathBuf; -// no need for jemalloc bloat in this binary (and we don't need speed) -#[global_allocator] -static ALLOC: std::alloc::System = std::alloc::System; - -const USAGE: &'static str = " -Converts a wasm file to an ES6 JS module - -Usage: - wasm2es6js [options] - wasm2es6js -h | --help - -Options: - -h --help Show this screen. - -o --output FILE File to place output in - --out-dir DIR Directory to place ouptut in - --typescript Output a `*.d.ts` file next to the JS output - --base64 Inline the wasm module using base64 encoding - --fetch PATH Load module by passing the PATH argument to `fetch()` - -Note that this is not intended to produce a production-ready output module -but rather is intended purely as a temporary \"hack\" until it's standard in -bundlers for working with wasm. Use this program with care! -"; - -#[derive(Debug, Deserialize)] +#[derive(Parser, Debug)] +#[command( + name = "wasm2es6js", + version, + about, + long_about = None, + after_help = "Note that this is not intended to produce a production-ready output module but rather\n\ + is intended purely as a temporary \"hack\" until it's standard in\n\ + bundlers for working with wasm. Use this program with care!", +)] struct Args { - flag_output: Option, - flag_out_dir: Option, - flag_typescript: bool, - flag_base64: bool, - flag_fetch: Option, - arg_input: PathBuf, + #[arg(long, short, value_name = "FILE", help = "File to place output in")] + output: Option, + #[arg(long, value_name = "DIR", help = "Directory to place output in")] + out_dir: Option, + #[arg(long, help = "Output a `*.d.ts` file next to the JS output")] + typescript: bool, + #[arg(long, help = "Inline the Wasm module using base64 encoding")] + base64: bool, + #[arg( + long, + value_name = "PATH", + help = "Load module by passing the PATH argument to `fetch()`" + )] + fetch: Option, + input: PathBuf, } fn main() -> anyhow::Result<()> { - let args: Args = Docopt::new(USAGE) - .and_then(|d| d.deserialize()) - .unwrap_or_else(|e| e.exit()); - let wasm = fs::read(&args.arg_input) - .with_context(|| format!("failed to read `{}`", args.arg_input.display()))?; + let args = Args::parse(); + let wasm = fs::read(&args.input) + .with_context(|| format!("failed to read `{}`", args.input.display()))?; let object = wasm_bindgen_cli_support::wasm2es6js::Config::new() - .base64(args.flag_base64) - .fetch(args.flag_fetch.clone()) + .base64(args.base64) + .fetch(args.fetch.clone()) .generate(&wasm)?; - if args.flag_typescript { + if args.typescript { let ts = object.typescript()?; write(&args, "d.ts", ts.as_bytes(), false)?; } @@ -65,12 +56,12 @@ fn main() -> anyhow::Result<()> { } fn write(args: &Args, extension: &str, contents: &[u8], print_fallback: bool) -> Result<(), Error> { - if let Some(p) = &args.flag_output { + if let Some(p) = &args.output { let dst = p.with_extension(extension); fs::write(&dst, contents) .with_context(|| format!("failed to write `{}`", dst.display()))?; - } else if let Some(p) = &args.flag_out_dir { - let filename = args.arg_input.file_name().unwrap(); + } else if let Some(p) = &args.out_dir { + let filename = args.input.file_name().unwrap(); let dst = p.join(filename).with_extension(extension); fs::write(&dst, contents) .with_context(|| format!("failed to write `{}`", dst.display()))?; diff --git a/crates/cli/tests/interface-types.rs b/crates/cli/tests/interface-types.rs deleted file mode 100644 index fef04583a1a..00000000000 --- a/crates/cli/tests/interface-types.rs +++ /dev/null @@ -1,87 +0,0 @@ -use anyhow::{bail, Result}; -use assert_cmd::prelude::*; -use rayon::prelude::*; -use std::env; -use std::path::Path; -use std::process::Command; - -fn main() -> Result<()> { - let filter = env::args().nth(1); - - let mut tests = Vec::new(); - let dir = env::current_dir()?.join("tests/interface-types"); - for entry in dir.read_dir()? { - let path = entry?.path(); - if path.extension().and_then(|s| s.to_str()) != Some("wat") { - continue; - } - if let Some(filter) = &filter { - if !path.display().to_string().contains(filter) { - continue; - } - } - tests.push(path); - } - tests.sort(); - - let errs = tests - .par_iter() - .filter_map(|t| runtest(t).err().map(|e| (t, e))) - .collect::>(); - - if errs.len() == 0 { - println!("{} tests passed", tests.len()); - return Ok(()); - } - eprintln!("failed tests:\n"); - for (test, err) in errs { - eprintln!("{} failure\n{}", test.display(), tab(&format!("{:?}", err))); - } - bail!("tests failed"); -} - -fn runtest(test: &Path) -> Result<()> { - let js = test.with_extension("js"); - let td = tempfile::TempDir::new()?; - - let mut bindgen = Command::cargo_bin("wasm-bindgen")?; - bindgen - .arg("--out-dir") - .arg(td.path()) - .arg(test) - .arg("--out-name=wasm") - .arg("--nodejs") - .arg("--no-typescript"); - exec(&mut bindgen)?; - - exec( - Command::new("node") - .arg("--experimental-wasm-reftypes") - .arg(&js) - .env("NODE_PATH", td.path()), - )?; - - Ok(()) -} - -fn exec(cmd: &mut Command) -> Result<()> { - let output = cmd.output()?; - if output.status.success() { - return Ok(()); - } - let mut err = format!("command failed {:?}", cmd); - err.push_str(&format!("\nstatus: {}", output.status)); - err.push_str(&format!( - "\nstderr:\n{}", - tab(&String::from_utf8_lossy(&output.stderr)) - )); - err.push_str(&format!( - "\nstdout:\n{}", - tab(&String::from_utf8_lossy(&output.stdout)) - )); - bail!("{}", err); -} - -fn tab(s: &str) -> String { - format!(" {}", s.replace("\n", "\n ")) -} diff --git a/crates/cli/tests/interface-types/anyref.js b/crates/cli/tests/interface-types/anyref.js deleted file mode 100644 index 20caf0d46db..00000000000 --- a/crates/cli/tests/interface-types/anyref.js +++ /dev/null @@ -1,16 +0,0 @@ -const assert = require('assert'); -const wasm = require('wasm'); - -const obj = {}; -assert.strictEqual(wasm.foo(obj), obj); - -wasm.store('x'); -assert.strictEqual(wasm.load(), 'x'); - -const obj2 = {}; -wasm.store(obj2); -assert.strictEqual(wasm.load(), obj2); -assert.strictEqual(wasm.load(), obj2); - -wasm.store(undefined); -assert.strictEqual(wasm.load(), undefined); diff --git a/crates/cli/tests/interface-types/anyref.wat b/crates/cli/tests/interface-types/anyref.wat deleted file mode 100644 index 7a7a8ee3592..00000000000 --- a/crates/cli/tests/interface-types/anyref.wat +++ /dev/null @@ -1,26 +0,0 @@ -(module - (func $foo (param externref) (result externref) - local.get 0) - - (func $store (param externref) - i32.const 0 - local.get 0 - table.set 0) - - (func $load (result externref) - i32.const 0 - table.get 0) - - (table 1 externref) - - (@interface func (export "foo") (param externref) (result externref) - arg.get 0 - call-core $foo) - - (@interface func (export "store") (param externref) - arg.get 0 - call-core $store) - - (@interface func (export "load") (result externref) - call-core $load) -) diff --git a/crates/cli/tests/interface-types/defer-call.js b/crates/cli/tests/interface-types/defer-call.js deleted file mode 100644 index a8abdc319dc..00000000000 --- a/crates/cli/tests/interface-types/defer-call.js +++ /dev/null @@ -1,5 +0,0 @@ -const wasm = require('wasm'); -const assert = require('assert'); - -assert.strictEqual(wasm.foo(), 0); -assert.strictEqual(wasm.get(), 1); diff --git a/crates/cli/tests/interface-types/defer-call.wat b/crates/cli/tests/interface-types/defer-call.wat deleted file mode 100644 index 4b4b5955ce6..00000000000 --- a/crates/cli/tests/interface-types/defer-call.wat +++ /dev/null @@ -1,21 +0,0 @@ -(module - (global $ctr (mut i32) (i32.const 0)) - - (func $increment - global.get $ctr - i32.const 1 - i32.add - global.set $ctr) - - (func $get (result i32) - global.get $ctr) - - (@interface func (export "foo") (result s32) - defer-call-core $increment - call-core $get - i32-to-s32) - - (@interface func (export "get") (result s32) - call-core $get - i32-to-s32) -) diff --git a/crates/cli/tests/interface-types/empty.js b/crates/cli/tests/interface-types/empty.js deleted file mode 100644 index 050212fa60f..00000000000 --- a/crates/cli/tests/interface-types/empty.js +++ /dev/null @@ -1,2 +0,0 @@ -const m = require('wasm'); - diff --git a/crates/cli/tests/interface-types/empty.wat b/crates/cli/tests/interface-types/empty.wat deleted file mode 100644 index 3af8f254547..00000000000 --- a/crates/cli/tests/interface-types/empty.wat +++ /dev/null @@ -1 +0,0 @@ -(module) diff --git a/crates/cli/tests/interface-types/integers.js b/crates/cli/tests/interface-types/integers.js deleted file mode 100644 index 05cbabc5228..00000000000 --- a/crates/cli/tests/interface-types/integers.js +++ /dev/null @@ -1,9 +0,0 @@ -const assert = require('assert'); -const wasm = require('wasm'); - -assert.strictEqual(wasm.add_i8(0, 1), 1); -assert.strictEqual(wasm.add_u8(0, 1), 1); -assert.strictEqual(wasm.add_i16(0, 1), 1); -assert.strictEqual(wasm.add_u16(0, 1), 1); -assert.strictEqual(wasm.add_i32(0, 1), 1); -assert.strictEqual(wasm.add_u32(0, 1), 1); diff --git a/crates/cli/tests/interface-types/integers.wat b/crates/cli/tests/interface-types/integers.wat deleted file mode 100644 index b240b84516f..00000000000 --- a/crates/cli/tests/interface-types/integers.wat +++ /dev/null @@ -1,54 +0,0 @@ -(module - (func $add_i32 (param i32 i32) (result i32) - local.get 0 - local.get 1 - i32.add) - - (@interface func (export "add_i8") (param s8) (param s8) (result s8) - arg.get 0 - s8-to-i32 - arg.get 1 - s8-to-i32 - call-core $add_i32 - i32-to-s8) - - (@interface func (export "add_i16") (param s16) (param s16) (result s16) - arg.get 0 - s16-to-i32 - arg.get 1 - s16-to-i32 - call-core $add_i32 - i32-to-s16) - - (@interface func (export "add_i32") (param s32) (param s32) (result s32) - arg.get 0 - s32-to-i32 - arg.get 1 - s32-to-i32 - call-core $add_i32 - i32-to-s32) - - (@interface func (export "add_u8") (param s8) (param s8) (result s8) - arg.get 0 - s8-to-i32 - arg.get 1 - s8-to-i32 - call-core $add_i32 - i32-to-s8) - - (@interface func (export "add_u16") (param u16) (param u16) (result u16) - arg.get 0 - u16-to-i32 - arg.get 1 - u16-to-i32 - call-core $add_i32 - i32-to-u16) - - (@interface func (export "add_u32") (param u32) (param u32) (result u32) - arg.get 0 - u32-to-i32 - arg.get 1 - u32-to-i32 - call-core $add_i32 - i32-to-u32) -) diff --git a/crates/cli/tests/interface-types/memory-to-string.js b/crates/cli/tests/interface-types/memory-to-string.js deleted file mode 100644 index df3cc794572..00000000000 --- a/crates/cli/tests/interface-types/memory-to-string.js +++ /dev/null @@ -1,5 +0,0 @@ -const wasm = require('wasm'); -const assert = require('assert'); - -assert.strictEqual(wasm.foo(), 'foo'); -assert.strictEqual(wasm.hexa(), 'hexa'); diff --git a/crates/cli/tests/interface-types/memory-to-string.wat b/crates/cli/tests/interface-types/memory-to-string.wat deleted file mode 100644 index 95fd609799b..00000000000 --- a/crates/cli/tests/interface-types/memory-to-string.wat +++ /dev/null @@ -1,21 +0,0 @@ -(module - (memory 1) - - (func $foo (result i32 i32) - i32.const 0 - i32.const 3) - (func $hexa (result i32 i32) - i32.const 10 - i32.const 4) - - (data (i32.const 0) "foo") - (data (i32.const 10) "hexa") - - (@interface func (export "foo") (result string) - call-core $foo - memory-to-string) - - (@interface func (export "hexa") (result string) - call-core $hexa - memory-to-string) -) diff --git a/crates/cli/tests/interface-types/no-wasm.js b/crates/cli/tests/interface-types/no-wasm.js deleted file mode 100644 index 50b0b21a17e..00000000000 --- a/crates/cli/tests/interface-types/no-wasm.js +++ /dev/null @@ -1,5 +0,0 @@ -const assert = require('assert'); -const wasm = require('wasm'); - -wasm.nop(); -assert.strictEqual(wasm.roundtrip(1), 1); diff --git a/crates/cli/tests/interface-types/no-wasm.wat b/crates/cli/tests/interface-types/no-wasm.wat deleted file mode 100644 index 91c427f0311..00000000000 --- a/crates/cli/tests/interface-types/no-wasm.wat +++ /dev/null @@ -1,5 +0,0 @@ -(module - (@interface func (export "nop")) - (@interface func (export "roundtrip") (param s32) (result s32) - arg.get 0) -) diff --git a/crates/cli/tests/interface-types/string-to-memory.js b/crates/cli/tests/interface-types/string-to-memory.js deleted file mode 100644 index cc9051bf0e0..00000000000 --- a/crates/cli/tests/interface-types/string-to-memory.js +++ /dev/null @@ -1,11 +0,0 @@ -const wasm = require('wasm'); -const assert = require('assert'); - -const test = s => { - wasm.set(s); - assert.strictEqual(s, wasm.get()); -}; - -test(''); -test('x'); -test('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); diff --git a/crates/cli/tests/interface-types/string-to-memory.wat b/crates/cli/tests/interface-types/string-to-memory.wat deleted file mode 100644 index 25f9576b343..00000000000 --- a/crates/cli/tests/interface-types/string-to-memory.wat +++ /dev/null @@ -1,27 +0,0 @@ -(module - (memory 1) - - (global $glen (mut i32) (i32.const 0)) - (global $gptr (mut i32) (i32.const 0)) - - (func $malloc (param i32) (result i32) i32.const 23) - - (func $set (param $ptr i32) (param $len i32) - local.get $ptr - global.set $gptr - local.get $len - global.set $glen) - - (func $get (result i32 i32) - global.get $gptr - global.get $glen) - - (@interface func (export "set") (param string) - arg.get 0 - string-to-memory $malloc - call-core $set) - - (@interface func (export "get") (result string) - call-core $get - memory-to-string) -) diff --git a/crates/cli/tests/reference.rs b/crates/cli/tests/reference.rs index e09d0d8f0b9..190df67b541 100644 --- a/crates/cli/tests/reference.rs +++ b/crates/cli/tests/reference.rs @@ -1,27 +1,71 @@ -//! A test suite to check the reference JS and wasm output of the `wasm-bindgen` +//! A test suite to check the reference JS and Wasm output of the `wasm-bindgen` //! library. //! //! This is intended as an end-to-end integration test where we can track -//! changes to the JS and wasm output. +//! changes to the JS and Wasm output. //! //! Tests are located in `reference/*.rs` files and are accompanied with sibling //! `*.js` files and `*.wat` files with the expected output of the `*.rs` //! compilation. Use `BLESS=1` in the environment to automatically update all //! tests. +//! +//! Note: Tests are run sequentially. In CI, tests are run ordered by name and +//! all tests will be run to show all errors. Outside of CI, recently modified +//! tests are run first and the runner will stop on the first failure. This is +//! done to make it faster to iterate on tests. +//! +//! ## Dependencies +//! +//! By default, tests only have access to the `wasm-bindgen` and +//! `wasm-bindgen-futures` crates. Additional crates can be used by declaring +//! them as dependencies using a comment at the top of the test file. +//! For example: +//! +//! ```rust +//! // DEPENDENCY: web-sys = { path = '{root}/crates/web-sys', features = ['console', 'Url', 'MediaSourceReadyState'] } +//! ``` +//! +//! This will add the `web-sys` crate as a dependency to the test, allowing the +//! test to use the `console`, `Url`, and `MediaSourceReadyState` features, as +//! well as the `web-sys` crate itself. +//! +//! Note that the `{root}` placeholder will be replaced with the path to the +//! root of the `wasm-bindgen` repository. +//! +//! Multiple dependencies can be declared in a single test file using multiple +//! `DEPENDENCY:` comments. +//! +//! ## Custom CLI flags +//! +//! By default, tests will use the `bundler` target. Custom CLI flags can be +//! passed to the `wasm-bindgen` CLI by declaring them in a comment at the top +//! of the test file. For example: +//! +//! ```rust +//! // FLAGS: --target=web --reference-types +//! ``` +//! +//! Multiple comments can be used to run the test multiple times with different +//! flags. +//! +//! ```rust +//! // FLAGS: --target=web +//! // FLAGS: --target=nodejs +//! ``` use anyhow::{bail, Result}; use assert_cmd::prelude::*; -use rayon::prelude::*; use std::env; use std::fs; use std::path::{Path, PathBuf}; use std::process::Command; +use walrus::ModuleConfig; fn main() -> Result<()> { let filter = env::args().nth(1); let mut tests = Vec::new(); - let dir = env::current_dir()?.join("tests/reference"); + let dir = repo_root().join("crates/cli/tests/reference"); for entry in dir.read_dir()? { let path = entry?.path(); if path.extension().and_then(|s| s.to_str()) != Some("rs") { @@ -36,15 +80,32 @@ fn main() -> Result<()> { } tests.sort(); - let errs = tests - .par_iter() - .filter_map(|t| runtest(t).err().map(|e| (t, e))) - .collect::>(); + let is_ci = env::var("CI").is_ok(); + if !is_ci { + // sort test files by when they were last modified, so that we run the most + // recently modified tests first. This just makes iterating on tests a bit + // easier. + tests.sort_by_cached_key(|p| fs::metadata(p).unwrap().modified().unwrap()); + tests.reverse(); + } + + let mut errs_iter = tests.iter().filter_map(|t| { + println!(" {}", t.file_name().unwrap().to_string_lossy()); + runtest(t).err().map(|e| (t, e)) + }); - if errs.len() == 0 { + let Some(first_error) = errs_iter.next() else { println!("{} tests passed", tests.len()); return Ok(()); + }; + + let mut errs = vec![first_error]; + if is_ci { + // one error should be enough for local testing to ensure fast iteration + // only find all errors in CI + errs.extend(errs_iter); } + eprintln!("failed tests:\n"); for (test, err) in errs { eprintln!("{} failure\n{}", test.display(), tab(&format!("{:?}", err))); @@ -55,6 +116,25 @@ fn main() -> Result<()> { fn runtest(test: &Path) -> Result<()> { let contents = fs::read_to_string(test)?; let td = tempfile::TempDir::new()?; + let root = repo_root(); + let root = root.display(); + + // parse target declarations + let mut all_flags: Vec<_> = contents + .lines() + .filter_map(|l| l.strip_prefix("// FLAGS: ")) + .map(|l| l.trim()) + .collect(); + if all_flags.is_empty() { + all_flags.push(""); + } + + // parse additional dependency declarations + let dependencies = contents + .lines() + .filter_map(|l| l.strip_prefix("// DEPENDENCY: ")) + .map(|l| "\n ".to_string() + &l.trim().replace("{root}", &root.to_string())) + .fold(String::new(), |a, b| a + &b); let manifest = format!( " @@ -62,21 +142,19 @@ fn runtest(test: &Path) -> Result<()> { name = \"reference-test\" authors = [] version = \"1.0.0\" - edition = '2018' + edition = '2021' [dependencies] - wasm-bindgen = {{ path = '{}' }} - wasm-bindgen-futures = {{ path = '{}/crates/futures' }} + wasm-bindgen = {{ path = '{root}' }} + wasm-bindgen-futures = {{ path = '{root}/crates/futures' }} + {dependencies} [lib] crate-type = ['cdylib'] - path = '{}' + path = '{test}' ", - repo_root().display(), - repo_root().display(), - test.display(), + test = test.display(), ); - let interface_types = contents.contains("// interface-types"); fs::write(td.path().join("Cargo.toml"), manifest)?; let target_dir = target_dir(); @@ -94,29 +172,56 @@ fn runtest(test: &Path) -> Result<()> { .join("debug") .join("reference_test.wasm"); - let mut bindgen = Command::cargo_bin("wasm-bindgen")?; - bindgen.arg("--out-dir").arg(td.path()).arg(&wasm); - if contents.contains("// enable-externref") { - bindgen.env("WASM_BINDGEN_EXTERNREF", "1"); - } - if interface_types { - bindgen.env("WASM_INTERFACE_TYPES", "1"); - } - exec(&mut bindgen)?; + for (flags_index, &flags) in all_flags.iter().enumerate() { + // extract the target from the flags + let target = flags + .split_whitespace() + .find_map(|f| f.strip_prefix("--target=")) + .unwrap_or("bundler"); + + let out_dir = &td.path().join(target); + fs::create_dir(out_dir)?; + + let mut bindgen = Command::cargo_bin("wasm-bindgen")?; + bindgen + .arg("--out-dir") + .arg(out_dir) + .arg(&wasm) + .arg("--remove-producers-section"); + for flag in flags.split_whitespace() { + bindgen.arg(flag); + } + if contents.contains("// enable-externref") { + bindgen.env("WASM_BINDGEN_EXTERNREF", "1"); + } + exec(&mut bindgen)?; + + // suffix the file name with the target + let test = if all_flags.len() > 1 { + let base_file_name = format!( + "{}-{}.rs", + test.file_stem().unwrap().to_string_lossy(), + flags_index + ); + test.with_file_name(base_file_name) + } else { + test.to_owned() + }; + + // bundler uses a different main JS file, because its + // reference_test.js just imports the reference_test_bg.js + let main_js_file = match target { + "bundler" => "reference_test_bg.js", + _ => "reference_test.js", + }; - if interface_types { - let wasm = td.path().join("reference_test.wasm"); - wit_validator::validate(&fs::read(&wasm)?)?; - let wat = sanitize_wasm(&wasm)?; - assert_same(&wat, &test.with_extension("wat"))?; - } else { if !contents.contains("async") { - let js = fs::read_to_string(td.path().join("reference_test_bg.js"))?; + let js = fs::read_to_string(out_dir.join(main_js_file))?; assert_same(&js, &test.with_extension("js"))?; - let wat = sanitize_wasm(&td.path().join("reference_test_bg.wasm"))?; + let wat = sanitize_wasm(&out_dir.join("reference_test_bg.wasm"))?; assert_same(&wat, &test.with_extension("wat"))?; } - let d_ts = fs::read_to_string(td.path().join("reference_test.d.ts"))?; + let d_ts = fs::read_to_string(out_dir.join("reference_test.d.ts"))?; assert_same(&d_ts, &test.with_extension("d.ts"))?; } @@ -127,18 +232,18 @@ fn assert_same(output: &str, expected: &Path) -> Result<()> { if env::var("BLESS").is_ok() { fs::write(expected, output)?; } else { - let expected = fs::read_to_string(&expected)?; + let expected = fs::read_to_string(expected)?; diff(&expected, output)?; } Ok(()) } fn sanitize_wasm(wasm: &Path) -> Result { - // Clean up the wasm module by removing all function + // Clean up the Wasm module by removing all function // implementations/instructions, data sections, etc. This'll help us largely // only deal with exports/imports which is all we're really interested in. - let mut module = walrus::ModuleConfig::new() - .on_parse(wit_walrus::on_parse) + let mut module = ModuleConfig::new() + .generate_producers_section(false) .parse_file(wasm)?; for func in module.funcs.iter_mut() { let local = match &mut func.kind { @@ -164,18 +269,15 @@ fn sanitize_wasm(wasm: &Path) -> Result { let ids = module .exports .iter() - .filter(|e| match e.item { - walrus::ExportItem::Global(_) => true, - _ => false, - }) + .filter(|e| matches!(e.item, walrus::ExportItem::Global(_))) .map(|d| d.id()) .collect::>(); for id in ids { module.exports.delete(id); } walrus::passes::gc::run(&mut module); - let mut wat = wit_printer::print_bytes(&module.emit_wasm())?; - wat.push_str("\n"); + let mut wat = wasmprinter::print_bytes(module.emit_wasm())?; + wat.push('\n'); Ok(wat) } @@ -187,37 +289,33 @@ fn diff(a: &str, b: &str) -> Result<()> { for result in diff::lines(a, b) { match result { diff::Result::Both(l, _) => { - s.push_str(" "); + s.push(' '); s.push_str(l); } diff::Result::Left(l) => { - s.push_str("-"); + s.push('-'); s.push_str(l); } diff::Result::Right(l) => { - s.push_str("+"); + s.push('+'); s.push_str(l); } } - s.push_str("\n"); + s.push('\n'); } bail!("found a difference:\n\n{}", s); } fn target_dir() -> PathBuf { - let mut dir = PathBuf::from(env::current_exe().unwrap()); - dir.pop(); // current exe - if dir.ends_with("deps") { - dir.pop(); - } - dir.pop(); // debug and/or release - return dir; + repo_root().join("target/tests/reference") } fn repo_root() -> PathBuf { let mut repo_root = env::current_dir().unwrap(); - repo_root.pop(); // remove 'cli' - repo_root.pop(); // remove 'crates' + if repo_root.file_name() == Some("cli".as_ref()) { + repo_root.pop(); // remove 'cli' + repo_root.pop(); // remove 'crates' + } repo_root } @@ -240,5 +338,5 @@ fn exec(cmd: &mut Command) -> Result<()> { } fn tab(s: &str) -> String { - format!(" {}", s.replace("\n", "\n ")) + format!(" {}", s.replace('\n', "\n ")) } diff --git a/crates/cli/tests/reference/add.d.ts b/crates/cli/tests/reference/add.d.ts index a8ee5f2e475..f11140413c4 100644 --- a/crates/cli/tests/reference/add.d.ts +++ b/crates/cli/tests/reference/add.d.ts @@ -1,14 +1,4 @@ /* tslint:disable */ /* eslint-disable */ -/** -* @param {number} a -* @param {number} b -* @returns {number} -*/ export function add_u32(a: number, b: number): number; -/** -* @param {number} a -* @param {number} b -* @returns {number} -*/ export function add_i32(a: number, b: number): number; diff --git a/crates/cli/tests/reference/add.js b/crates/cli/tests/reference/add.js index 23c05cafe9f..f11b75ef83a 100644 --- a/crates/cli/tests/reference/add.js +++ b/crates/cli/tests/reference/add.js @@ -1,22 +1,36 @@ -import * as wasm from './reference_test_bg.wasm'; +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} /** -* @param {number} a -* @param {number} b -* @returns {number} -*/ + * @param {number} a + * @param {number} b + * @returns {number} + */ export function add_u32(a, b) { const ret = wasm.add_u32(a, b); return ret >>> 0; } /** -* @param {number} a -* @param {number} b -* @returns {number} -*/ + * @param {number} a + * @param {number} b + * @returns {number} + */ export function add_i32(a, b) { const ret = wasm.add_i32(a, b); return ret; } +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + diff --git a/crates/cli/tests/reference/add.wat b/crates/cli/tests/reference/add.wat index 990d0158736..bc5cbff68cd 100644 --- a/crates/cli/tests/reference/add.wat +++ b/crates/cli/tests/reference/add.wat @@ -1,8 +1,16 @@ -(module - (type (;0;) (func (param i32 i32) (result i32))) - (func $add_u32 (type 0) (param i32 i32) (result i32)) - (func $add_i32 (type 0) (param i32 i32) (result i32)) +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32 i32) (result i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $add_u32 (;1;) (type 1) (param i32 i32) (result i32)) + (func $add_i32 (;2;) (type 1) (param i32 i32) (result i32)) + (table (;0;) 128 externref) (memory (;0;) 17) (export "memory" (memory 0)) (export "add_u32" (func $add_u32)) - (export "add_i32" (func $add_i32))) + (export "add_i32" (func $add_i32)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/anyref-empty.js b/crates/cli/tests/reference/anyref-empty.js index 74cbbafc276..a25c33a1af9 100644 --- a/crates/cli/tests/reference/anyref-empty.js +++ b/crates/cli/tests/reference/anyref-empty.js @@ -1,4 +1,8 @@ -import * as wasm from './reference_test_bg.wasm'; +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + export function __wbindgen_init_externref_table() { const table = wasm.__wbindgen_export_0; diff --git a/crates/cli/tests/reference/anyref-empty.wat b/crates/cli/tests/reference/anyref-empty.wat index f5cc60b84a0..1044fd51d5e 100644 --- a/crates/cli/tests/reference/anyref-empty.wat +++ b/crates/cli/tests/reference/anyref-empty.wat @@ -1,8 +1,11 @@ -(module +(module $reference_test.wasm (type (;0;) (func)) (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) - (table (;0;) 32 externref) + (table (;0;) 128 externref) (memory (;0;) 16) (export "memory" (memory 0)) (export "__wbindgen_export_0" (table 0)) - (export "__wbindgen_start" (func 0))) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after export) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/anyref-import-catch.d.ts b/crates/cli/tests/reference/anyref-import-catch.d.ts index 3e2ffc07207..091dbcc51a6 100644 --- a/crates/cli/tests/reference/anyref-import-catch.d.ts +++ b/crates/cli/tests/reference/anyref-import-catch.d.ts @@ -1,5 +1,3 @@ /* tslint:disable */ /* eslint-disable */ -/** -*/ export function exported(): void; diff --git a/crates/cli/tests/reference/anyref-import-catch.js b/crates/cli/tests/reference/anyref-import-catch.js index 9e9399802f6..97101e26dba 100644 --- a/crates/cli/tests/reference/anyref-import-catch.js +++ b/crates/cli/tests/reference/anyref-import-catch.js @@ -1,26 +1,12 @@ -import * as wasm from './reference_test_bg.wasm'; - -const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; - -let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); - -cachedTextDecoder.decode(); - -let cachegetUint8Memory0 = null; -function getUint8Memory0() { - if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { - cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); - } - return cachegetUint8Memory0; +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; } -function getStringFromWasm0(ptr, len) { - return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); -} function addToExternrefTable0(obj) { const idx = wasm.__externref_table_alloc(); - wasm.__wbindgen_export_0.set(idx, obj); + wasm.__wbindgen_export_2.set(idx, obj); return idx; } @@ -33,45 +19,45 @@ function handleError(f, args) { } } -let cachegetInt32Memory0 = null; -function getInt32Memory0() { - if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { - cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); } - return cachegetInt32Memory0; + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } function takeFromExternrefTable0(idx) { - const value = wasm.__wbindgen_export_0.get(idx); + const value = wasm.__wbindgen_export_2.get(idx); wasm.__externref_table_dealloc(idx); return value; } -/** -*/ + export function exported() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.exported(retptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - if (r1) { - throw takeFromExternrefTable0(r0); - } - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); + const ret = wasm.exported(); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); } } -export function __wbg_foo_8d66ddef0ff279d6() { return handleError(function () { +export function __wbg_foo_4e8309b1aa95a4ac() { return handleError(function () { foo(); }, arguments) }; -export function __wbindgen_throw(arg0, arg1) { - throw new Error(getStringFromWasm0(arg0, arg1)); -}; - export function __wbindgen_init_externref_table() { - const table = wasm.__wbindgen_export_0; + const table = wasm.__wbindgen_export_2; const offset = table.grow(4); table.set(0, undefined); table.set(offset + 0, undefined); @@ -81,3 +67,7 @@ export function __wbindgen_init_externref_table() { ; }; +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/anyref-import-catch.wat b/crates/cli/tests/reference/anyref-import-catch.wat index 6b1b5b7e2cf..506e67cca2b 100644 --- a/crates/cli/tests/reference/anyref-import-catch.wat +++ b/crates/cli/tests/reference/anyref-import-catch.wat @@ -1,21 +1,22 @@ -(module +(module $reference_test.wasm (type (;0;) (func)) (type (;1;) (func (result i32))) - (type (;2;) (func (param i32))) - (type (;3;) (func (param i32) (result i32))) + (type (;2;) (func (result i32 i32))) + (type (;3;) (func (param i32))) (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) - (func $__wbindgen_exn_store (type 2) (param i32)) - (func $__externref_table_dealloc (type 2) (param i32)) - (func $exported (type 2) (param i32)) - (func $__externref_table_alloc (type 1) (result i32)) - (func $__wbindgen_add_to_stack_pointer (type 3) (param i32) (result i32)) - (table (;0;) 32 externref) + (func $__wbindgen_exn_store (;1;) (type 3) (param i32)) + (func $__externref_table_dealloc (;2;) (type 3) (param i32)) + (func $"exported multivalue shim" (;3;) (type 2) (result i32 i32)) + (func $__externref_table_alloc (;4;) (type 1) (result i32)) + (table (;0;) 128 externref) (memory (;0;) 17) (export "memory" (memory 0)) - (export "exported" (func $exported)) - (export "__wbindgen_export_0" (table 0)) + (export "exported" (func $"exported multivalue shim")) (export "__wbindgen_exn_store" (func $__wbindgen_exn_store)) (export "__externref_table_alloc" (func $__externref_table_alloc)) - (export "__wbindgen_add_to_stack_pointer" (func $__wbindgen_add_to_stack_pointer)) + (export "__wbindgen_export_2" (table 0)) (export "__externref_table_dealloc" (func $__externref_table_dealloc)) - (export "__wbindgen_start" (func 0))) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/anyref-nop.d.ts b/crates/cli/tests/reference/anyref-nop.d.ts index b9f9648536e..b7f28e8f7af 100644 --- a/crates/cli/tests/reference/anyref-nop.d.ts +++ b/crates/cli/tests/reference/anyref-nop.d.ts @@ -1,5 +1,3 @@ /* tslint:disable */ /* eslint-disable */ -/** -*/ export function foo(): void; diff --git a/crates/cli/tests/reference/anyref-nop.js b/crates/cli/tests/reference/anyref-nop.js index 116b85fcbfd..48574501fbc 100644 --- a/crates/cli/tests/reference/anyref-nop.js +++ b/crates/cli/tests/reference/anyref-nop.js @@ -1,7 +1,9 @@ -import * as wasm from './reference_test_bg.wasm'; +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + -/** -*/ export function foo() { wasm.foo(); } diff --git a/crates/cli/tests/reference/anyref-nop.wat b/crates/cli/tests/reference/anyref-nop.wat index 7c42a885375..cc829fa21e9 100644 --- a/crates/cli/tests/reference/anyref-nop.wat +++ b/crates/cli/tests/reference/anyref-nop.wat @@ -1,10 +1,13 @@ -(module +(module $reference_test.wasm (type (;0;) (func)) (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) - (func $foo (type 0)) - (table (;0;) 32 externref) + (func $foo (;1;) (type 0)) + (table (;0;) 128 externref) (memory (;0;) 17) (export "memory" (memory 0)) (export "foo" (func $foo)) (export "__wbindgen_export_0" (table 0)) - (export "__wbindgen_start" (func 0))) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/async-number.d.ts b/crates/cli/tests/reference/async-number.d.ts index d7204543623..e1bf9ff0bcc 100644 --- a/crates/cli/tests/reference/async-number.d.ts +++ b/crates/cli/tests/reference/async-number.d.ts @@ -1,6 +1,3 @@ /* tslint:disable */ /* eslint-disable */ -/** -* @returns {Promise} -*/ export function foo(): Promise; diff --git a/crates/cli/tests/reference/async-void.d.ts b/crates/cli/tests/reference/async-void.d.ts index 83335802b7e..e1866a433c0 100644 --- a/crates/cli/tests/reference/async-void.d.ts +++ b/crates/cli/tests/reference/async-void.d.ts @@ -1,6 +1,3 @@ /* tslint:disable */ /* eslint-disable */ -/** -* @returns {Promise} -*/ export function foo(): Promise; diff --git a/crates/cli/tests/reference/builder.d.ts b/crates/cli/tests/reference/builder.d.ts new file mode 100644 index 00000000000..5a2da02112d --- /dev/null +++ b/crates/cli/tests/reference/builder.d.ts @@ -0,0 +1,7 @@ +/* tslint:disable */ +/* eslint-disable */ +export class ClassBuilder { + private constructor(); + free(): void; + static builder(): ClassBuilder; +} diff --git a/crates/cli/tests/reference/builder.js b/crates/cli/tests/reference/builder.js new file mode 100644 index 00000000000..b63d64f2f5b --- /dev/null +++ b/crates/cli/tests/reference/builder.js @@ -0,0 +1,75 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +const ClassBuilderFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_classbuilder_free(ptr >>> 0, 1)); + +export class ClassBuilder { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(ClassBuilder.prototype); + obj.__wbg_ptr = ptr; + ClassBuilderFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + ClassBuilderFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_classbuilder_free(ptr, 0); + } + /** + * @returns {ClassBuilder} + */ + static builder() { + const ret = wasm.classbuilder_builder(); + return ClassBuilder.__wrap(ret); + } +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/builder.rs b/crates/cli/tests/reference/builder.rs new file mode 100644 index 00000000000..317f20cad92 --- /dev/null +++ b/crates/cli/tests/reference/builder.rs @@ -0,0 +1,11 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub struct ClassBuilder(()); + +#[wasm_bindgen] +impl ClassBuilder { + pub fn builder() -> ClassBuilder { + ClassBuilder(()) + } +} diff --git a/crates/cli/tests/reference/builder.wat b/crates/cli/tests/reference/builder.wat new file mode 100644 index 00000000000..fac41751113 --- /dev/null +++ b/crates/cli/tests/reference/builder.wat @@ -0,0 +1,17 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (type (;2;) (func (param i32 i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbg_classbuilder_free (;1;) (type 2) (param i32 i32)) + (func $classbuilder_builder (;2;) (type 1) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "__wbg_classbuilder_free" (func $__wbg_classbuilder_free)) + (export "classbuilder_builder" (func $classbuilder_builder)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/constructor.d.ts b/crates/cli/tests/reference/constructor.d.ts new file mode 100644 index 00000000000..f2ac36f4b25 --- /dev/null +++ b/crates/cli/tests/reference/constructor.d.ts @@ -0,0 +1,6 @@ +/* tslint:disable */ +/* eslint-disable */ +export class ClassConstructor { + free(): void; + constructor(); +} diff --git a/crates/cli/tests/reference/constructor.js b/crates/cli/tests/reference/constructor.js new file mode 100644 index 00000000000..c0a781c3c94 --- /dev/null +++ b/crates/cli/tests/reference/constructor.js @@ -0,0 +1,66 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +const ClassConstructorFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_classconstructor_free(ptr >>> 0, 1)); + +export class ClassConstructor { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + ClassConstructorFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_classconstructor_free(ptr, 0); + } + constructor() { + const ret = wasm.classconstructor_new(); + this.__wbg_ptr = ret >>> 0; + ClassConstructorFinalization.register(this, this.__wbg_ptr, this); + return this; + } +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/constructor.rs b/crates/cli/tests/reference/constructor.rs new file mode 100644 index 00000000000..ca4bac080b3 --- /dev/null +++ b/crates/cli/tests/reference/constructor.rs @@ -0,0 +1,13 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub struct ClassConstructor(()); + +#[wasm_bindgen] +impl ClassConstructor { + + #[wasm_bindgen(constructor)] + pub fn new() -> ClassConstructor { + ClassConstructor(()) + } +} diff --git a/crates/cli/tests/reference/constructor.wat b/crates/cli/tests/reference/constructor.wat new file mode 100644 index 00000000000..1e99415e7d6 --- /dev/null +++ b/crates/cli/tests/reference/constructor.wat @@ -0,0 +1,17 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (type (;2;) (func (param i32 i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbg_classconstructor_free (;1;) (type 2) (param i32 i32)) + (func $classconstructor_new (;2;) (type 1) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "__wbg_classconstructor_free" (func $__wbg_classconstructor_free)) + (export "classconstructor_new" (func $classconstructor_new)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/echo.d.ts b/crates/cli/tests/reference/echo.d.ts new file mode 100644 index 00000000000..5183992234d --- /dev/null +++ b/crates/cli/tests/reference/echo.d.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +export function echo_u8(a: number): number; +export function echo_i8(a: number): number; +export function echo_u16(a: number): number; +export function echo_i16(a: number): number; +export function echo_u32(a: number): number; +export function echo_i32(a: number): number; +export function echo_u64(a: bigint): bigint; +export function echo_i64(a: bigint): bigint; +export function echo_u128(a: bigint): bigint; +export function echo_i128(a: bigint): bigint; +export function echo_usize(a: number): number; +export function echo_isize(a: number): number; +export function echo_f32(a: number): number; +export function echo_f64(a: number): number; +export function echo_bool(a: boolean): boolean; +export function echo_char(a: string): string; +export function echo_string(a: string): string; +export function echo_vec_u8(a: Uint8Array): Uint8Array; +export function echo_vec_i8(a: Int8Array): Int8Array; +export function echo_vec_u16(a: Uint16Array): Uint16Array; +export function echo_vec_i16(a: Int16Array): Int16Array; +export function echo_vec_u32(a: Uint32Array): Uint32Array; +export function echo_vec_i32(a: Int32Array): Int32Array; +export function echo_vec_u64(a: BigUint64Array): BigUint64Array; +export function echo_vec_i64(a: BigInt64Array): BigInt64Array; +export function echo_vec_uninit_u8(a: Uint8Array): Uint8Array; +export function echo_vec_uninit_i8(a: Int8Array): Int8Array; +export function echo_vec_uninit_u16(a: Uint16Array): Uint16Array; +export function echo_vec_uninit_i16(a: Int16Array): Int16Array; +export function echo_vec_uninit_u32(a: Uint32Array): Uint32Array; +export function echo_vec_uninit_i32(a: Int32Array): Int32Array; +export function echo_vec_uninit_u64(a: BigUint64Array): BigUint64Array; +export function echo_vec_uninit_i64(a: BigInt64Array): BigInt64Array; +export function echo_vec_string(a: string[]): string[]; +export function echo_struct(a: Foo): Foo; +export function echo_vec_struct(a: Foo[]): Foo[]; +export function echo_option_u8(a?: number | null): number | undefined; +export function echo_option_i8(a?: number | null): number | undefined; +export function echo_option_u16(a?: number | null): number | undefined; +export function echo_option_i16(a?: number | null): number | undefined; +export function echo_option_u32(a?: number | null): number | undefined; +export function echo_option_i32(a?: number | null): number | undefined; +export function echo_option_u64(a?: bigint | null): bigint | undefined; +export function echo_option_i64(a?: bigint | null): bigint | undefined; +export function echo_option_u128(a?: bigint | null): bigint | undefined; +export function echo_option_i128(a?: bigint | null): bigint | undefined; +export function echo_option_usize(a?: number | null): number | undefined; +export function echo_option_isize(a?: number | null): number | undefined; +export function echo_option_f32(a?: number | null): number | undefined; +export function echo_option_f64(a?: number | null): number | undefined; +export function echo_option_bool(a?: boolean | null): boolean | undefined; +export function echo_option_char(a?: string | null): string | undefined; +export function echo_option_string(a?: string | null): string | undefined; +export function echo_option_vec_u8(a?: Uint8Array | null): Uint8Array | undefined; +export function echo_option_vec_i8(a?: Int8Array | null): Int8Array | undefined; +export function echo_option_vec_u16(a?: Uint16Array | null): Uint16Array | undefined; +export function echo_option_vec_i16(a?: Int16Array | null): Int16Array | undefined; +export function echo_option_vec_u32(a?: Uint32Array | null): Uint32Array | undefined; +export function echo_option_vec_i32(a?: Int32Array | null): Int32Array | undefined; +export function echo_option_vec_u64(a?: BigUint64Array | null): BigUint64Array | undefined; +export function echo_option_vec_i64(a?: BigInt64Array | null): BigInt64Array | undefined; +export function echo_option_vec_uninit_u8(a?: Uint8Array | null): Uint8Array | undefined; +export function echo_option_vec_uninit_i8(a?: Int8Array | null): Int8Array | undefined; +export function echo_option_vec_uninit_u16(a?: Uint16Array | null): Uint16Array | undefined; +export function echo_option_vec_uninit_i16(a?: Int16Array | null): Int16Array | undefined; +export function echo_option_vec_uninit_u32(a?: Uint32Array | null): Uint32Array | undefined; +export function echo_option_vec_uninit_i32(a?: Int32Array | null): Int32Array | undefined; +export function echo_option_vec_uninit_u64(a?: BigUint64Array | null): BigUint64Array | undefined; +export function echo_option_vec_uninit_i64(a?: BigInt64Array | null): BigInt64Array | undefined; +export function echo_option_vec_string(a?: string[] | null): string[] | undefined; +export function echo_option_struct(a?: Foo | null): Foo | undefined; +export function echo_option_vec_struct(a?: Foo[] | null): Foo[] | undefined; +export class Foo { + private constructor(); + free(): void; +} diff --git a/crates/cli/tests/reference/echo.js b/crates/cli/tests/reference/echo.js new file mode 100644 index 00000000000..c786581f554 --- /dev/null +++ b/crates/cli/tests/reference/echo.js @@ -0,0 +1,1273 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches && builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +let WASM_VECTOR_LEN = 0; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; + +let cachedTextEncoder = new lTextEncoder('utf-8'); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} +/** + * @param {number} a + * @returns {number} + */ +export function echo_u8(a) { + const ret = wasm.echo_u8(a); + return ret; +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_i8(a) { + const ret = wasm.echo_i8(a); + return ret; +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_u16(a) { + const ret = wasm.echo_u16(a); + return ret; +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_i16(a) { + const ret = wasm.echo_i16(a); + return ret; +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_u32(a) { + const ret = wasm.echo_u32(a); + return ret >>> 0; +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_i32(a) { + const ret = wasm.echo_i32(a); + return ret; +} + +/** + * @param {bigint} a + * @returns {bigint} + */ +export function echo_u64(a) { + const ret = wasm.echo_u64(a); + return BigInt.asUintN(64, ret); +} + +/** + * @param {bigint} a + * @returns {bigint} + */ +export function echo_i64(a) { + const ret = wasm.echo_i64(a); + return ret; +} + +/** + * @param {bigint} a + * @returns {bigint} + */ +export function echo_u128(a) { + const ret = wasm.echo_u128(a, a >> BigInt(64)); + return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64))); +} + +/** + * @param {bigint} a + * @returns {bigint} + */ +export function echo_i128(a) { + const ret = wasm.echo_i128(a, a >> BigInt(64)); + return (BigInt.asUintN(64, ret[0]) | (ret[1] << BigInt(64))); +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_usize(a) { + const ret = wasm.echo_usize(a); + return ret >>> 0; +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_isize(a) { + const ret = wasm.echo_isize(a); + return ret; +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_f32(a) { + const ret = wasm.echo_f32(a); + return ret; +} + +/** + * @param {number} a + * @returns {number} + */ +export function echo_f64(a) { + const ret = wasm.echo_f64(a); + return ret; +} + +/** + * @param {boolean} a + * @returns {boolean} + */ +export function echo_bool(a) { + const ret = wasm.echo_bool(a); + return ret !== 0; +} + +function _assertChar(c) { + if (typeof(c) === 'number' && (c >= 0x110000 || (c >= 0xD800 && c < 0xE000))) throw new Error(`expected a valid Unicode scalar value, found ${c}`); +} +/** + * @param {string} a + * @returns {string} + */ +export function echo_char(a) { + const char0 = a.codePointAt(0); + _assertChar(char0); + const ret = wasm.echo_char(char0); + return String.fromCodePoint(ret); +} + +/** + * @param {string} a + * @returns {string} + */ +export function echo_string(a) { + let deferred2_0; + let deferred2_1; + try { + const ptr0 = passStringToWasm0(a, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_string(ptr0, len0); + deferred2_0 = ret[0]; + deferred2_1 = ret[1]; + return getStringFromWasm0(ret[0], ret[1]); + } finally { + wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); + } +} + +function passArray8ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 1, 1) >>> 0; + getUint8ArrayMemory0().set(arg, ptr / 1); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function getArrayU8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); +} +/** + * @param {Uint8Array} a + * @returns {Uint8Array} + */ +export function echo_vec_u8(a) { + const ptr0 = passArray8ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_u8(ptr0, len0); + var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + return v2; +} + +let cachedInt8ArrayMemory0 = null; + +function getInt8ArrayMemory0() { + if (cachedInt8ArrayMemory0 === null || cachedInt8ArrayMemory0.byteLength === 0) { + cachedInt8ArrayMemory0 = new Int8Array(wasm.memory.buffer); + } + return cachedInt8ArrayMemory0; +} + +function getArrayI8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); +} +/** + * @param {Int8Array} a + * @returns {Int8Array} + */ +export function echo_vec_i8(a) { + const ptr0 = passArray8ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_i8(ptr0, len0); + var v2 = getArrayI8FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + return v2; +} + +let cachedUint16ArrayMemory0 = null; + +function getUint16ArrayMemory0() { + if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) { + cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer); + } + return cachedUint16ArrayMemory0; +} + +function passArray16ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 2, 2) >>> 0; + getUint16ArrayMemory0().set(arg, ptr / 2); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function getArrayU16FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len); +} +/** + * @param {Uint16Array} a + * @returns {Uint16Array} + */ +export function echo_vec_u16(a) { + const ptr0 = passArray16ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_u16(ptr0, len0); + var v2 = getArrayU16FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 2, 2); + return v2; +} + +let cachedInt16ArrayMemory0 = null; + +function getInt16ArrayMemory0() { + if (cachedInt16ArrayMemory0 === null || cachedInt16ArrayMemory0.byteLength === 0) { + cachedInt16ArrayMemory0 = new Int16Array(wasm.memory.buffer); + } + return cachedInt16ArrayMemory0; +} + +function getArrayI16FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len); +} +/** + * @param {Int16Array} a + * @returns {Int16Array} + */ +export function echo_vec_i16(a) { + const ptr0 = passArray16ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_i16(ptr0, len0); + var v2 = getArrayI16FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 2, 2); + return v2; +} + +let cachedUint32ArrayMemory0 = null; + +function getUint32ArrayMemory0() { + if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) { + cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer); + } + return cachedUint32ArrayMemory0; +} + +function passArray32ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 4, 4) >>> 0; + getUint32ArrayMemory0().set(arg, ptr / 4); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function getArrayU32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} +/** + * @param {Uint32Array} a + * @returns {Uint32Array} + */ +export function echo_vec_u32(a) { + const ptr0 = passArray32ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_u32(ptr0, len0); + var v2 = getArrayU32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + return v2; +} + +let cachedInt32ArrayMemory0 = null; + +function getInt32ArrayMemory0() { + if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) { + cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer); + } + return cachedInt32ArrayMemory0; +} + +function getArrayI32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); +} +/** + * @param {Int32Array} a + * @returns {Int32Array} + */ +export function echo_vec_i32(a) { + const ptr0 = passArray32ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_i32(ptr0, len0); + var v2 = getArrayI32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + return v2; +} + +let cachedBigUint64ArrayMemory0 = null; + +function getBigUint64ArrayMemory0() { + if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) { + cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer); + } + return cachedBigUint64ArrayMemory0; +} + +function passArray64ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 8, 8) >>> 0; + getBigUint64ArrayMemory0().set(arg, ptr / 8); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function getArrayU64FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getBigUint64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len); +} +/** + * @param {BigUint64Array} a + * @returns {BigUint64Array} + */ +export function echo_vec_u64(a) { + const ptr0 = passArray64ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_u64(ptr0, len0); + var v2 = getArrayU64FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 8, 8); + return v2; +} + +let cachedBigInt64ArrayMemory0 = null; + +function getBigInt64ArrayMemory0() { + if (cachedBigInt64ArrayMemory0 === null || cachedBigInt64ArrayMemory0.byteLength === 0) { + cachedBigInt64ArrayMemory0 = new BigInt64Array(wasm.memory.buffer); + } + return cachedBigInt64ArrayMemory0; +} + +function getArrayI64FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getBigInt64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len); +} +/** + * @param {BigInt64Array} a + * @returns {BigInt64Array} + */ +export function echo_vec_i64(a) { + const ptr0 = passArray64ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_i64(ptr0, len0); + var v2 = getArrayI64FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 8, 8); + return v2; +} + +/** + * @param {Uint8Array} a + * @returns {Uint8Array} + */ +export function echo_vec_uninit_u8(a) { + const ptr0 = passArray8ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_uninit_u8(ptr0, len0); + var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + return v2; +} + +/** + * @param {Int8Array} a + * @returns {Int8Array} + */ +export function echo_vec_uninit_i8(a) { + const ptr0 = passArray8ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_uninit_i8(ptr0, len0); + var v2 = getArrayI8FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + return v2; +} + +/** + * @param {Uint16Array} a + * @returns {Uint16Array} + */ +export function echo_vec_uninit_u16(a) { + const ptr0 = passArray16ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_uninit_u16(ptr0, len0); + var v2 = getArrayU16FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 2, 2); + return v2; +} + +/** + * @param {Int16Array} a + * @returns {Int16Array} + */ +export function echo_vec_uninit_i16(a) { + const ptr0 = passArray16ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_uninit_i16(ptr0, len0); + var v2 = getArrayI16FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 2, 2); + return v2; +} + +/** + * @param {Uint32Array} a + * @returns {Uint32Array} + */ +export function echo_vec_uninit_u32(a) { + const ptr0 = passArray32ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_uninit_u32(ptr0, len0); + var v2 = getArrayU32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + return v2; +} + +/** + * @param {Int32Array} a + * @returns {Int32Array} + */ +export function echo_vec_uninit_i32(a) { + const ptr0 = passArray32ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_uninit_i32(ptr0, len0); + var v2 = getArrayI32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + return v2; +} + +/** + * @param {BigUint64Array} a + * @returns {BigUint64Array} + */ +export function echo_vec_uninit_u64(a) { + const ptr0 = passArray64ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_uninit_u64(ptr0, len0); + var v2 = getArrayU64FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 8, 8); + return v2; +} + +/** + * @param {BigInt64Array} a + * @returns {BigInt64Array} + */ +export function echo_vec_uninit_i64(a) { + const ptr0 = passArray64ToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_uninit_i64(ptr0, len0); + var v2 = getArrayI64FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 8, 8); + return v2; +} + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_2.set(idx, obj); + return idx; +} + +function passArrayJsValueToWasm0(array, malloc) { + const ptr = malloc(array.length * 4, 4) >>> 0; + for (let i = 0; i < array.length; i++) { + const add = addToExternrefTable0(array[i]); + getDataViewMemory0().setUint32(ptr + 4 * i, add, true); + } + WASM_VECTOR_LEN = array.length; + return ptr; +} + +function getArrayJsValueFromWasm0(ptr, len) { + ptr = ptr >>> 0; + const mem = getDataViewMemory0(); + const result = []; + for (let i = ptr; i < ptr + 4 * len; i += 4) { + result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true))); + } + wasm.__externref_drop_slice(ptr, len); + return result; +} +/** + * @param {string[]} a + * @returns {string[]} + */ +export function echo_vec_string(a) { + const ptr0 = passArrayJsValueToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_string(ptr0, len0); + var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + return v2; +} + +function _assertClass(instance, klass) { + if (!(instance instanceof klass)) { + throw new Error(`expected instance of ${klass.name}`); + } +} +/** + * @param {Foo} a + * @returns {Foo} + */ +export function echo_struct(a) { + _assertClass(a, Foo); + var ptr0 = a.__destroy_into_raw(); + const ret = wasm.echo_struct(ptr0); + return Foo.__wrap(ret); +} + +/** + * @param {Foo[]} a + * @returns {Foo[]} + */ +export function echo_vec_struct(a) { + const ptr0 = passArrayJsValueToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_vec_struct(ptr0, len0); + var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + return v2; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_u8(a) { + const ret = wasm.echo_option_u8(isLikeNone(a) ? 0xFFFFFF : a); + return ret === 0xFFFFFF ? undefined : ret; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_i8(a) { + const ret = wasm.echo_option_i8(isLikeNone(a) ? 0xFFFFFF : a); + return ret === 0xFFFFFF ? undefined : ret; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_u16(a) { + const ret = wasm.echo_option_u16(isLikeNone(a) ? 0xFFFFFF : a); + return ret === 0xFFFFFF ? undefined : ret; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_i16(a) { + const ret = wasm.echo_option_i16(isLikeNone(a) ? 0xFFFFFF : a); + return ret === 0xFFFFFF ? undefined : ret; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_u32(a) { + const ret = wasm.echo_option_u32(isLikeNone(a) ? 0x100000001 : (a) >>> 0); + return ret === 0x100000001 ? undefined : ret; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_i32(a) { + const ret = wasm.echo_option_i32(isLikeNone(a) ? 0x100000001 : (a) >> 0); + return ret === 0x100000001 ? undefined : ret; +} + +/** + * @param {bigint | null} [a] + * @returns {bigint | undefined} + */ +export function echo_option_u64(a) { + const ret = wasm.echo_option_u64(!isLikeNone(a), isLikeNone(a) ? BigInt(0) : a); + return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]); +} + +/** + * @param {bigint | null} [a] + * @returns {bigint | undefined} + */ +export function echo_option_i64(a) { + const ret = wasm.echo_option_i64(!isLikeNone(a), isLikeNone(a) ? BigInt(0) : a); + return ret[0] === 0 ? undefined : ret[1]; +} + +/** + * @param {bigint | null} [a] + * @returns {bigint | undefined} + */ +export function echo_option_u128(a) { + const ret = wasm.echo_option_u128(!isLikeNone(a), isLikeNone(a) ? BigInt(0) : a, isLikeNone(a) ? BigInt(0) : a >> BigInt(64)); + return ret[0] === 0 ? undefined : (BigInt.asUintN(64, ret[1]) | (BigInt.asUintN(64, ret[2]) << BigInt(64))); +} + +/** + * @param {bigint | null} [a] + * @returns {bigint | undefined} + */ +export function echo_option_i128(a) { + const ret = wasm.echo_option_i128(!isLikeNone(a), isLikeNone(a) ? BigInt(0) : a, isLikeNone(a) ? BigInt(0) : a >> BigInt(64)); + return ret[0] === 0 ? undefined : (BigInt.asUintN(64, ret[1]) | (ret[2] << BigInt(64))); +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_usize(a) { + const ret = wasm.echo_option_usize(isLikeNone(a) ? 0x100000001 : (a) >>> 0); + return ret === 0x100000001 ? undefined : ret; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_isize(a) { + const ret = wasm.echo_option_isize(isLikeNone(a) ? 0x100000001 : (a) >> 0); + return ret === 0x100000001 ? undefined : ret; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_f32(a) { + const ret = wasm.echo_option_f32(isLikeNone(a) ? 0x100000001 : Math.fround(a)); + return ret === 0x100000001 ? undefined : ret; +} + +/** + * @param {number | null} [a] + * @returns {number | undefined} + */ +export function echo_option_f64(a) { + const ret = wasm.echo_option_f64(!isLikeNone(a), isLikeNone(a) ? 0 : a); + return ret[0] === 0 ? undefined : ret[1]; +} + +/** + * @param {boolean | null} [a] + * @returns {boolean | undefined} + */ +export function echo_option_bool(a) { + const ret = wasm.echo_option_bool(isLikeNone(a) ? 0xFFFFFF : a ? 1 : 0); + return ret === 0xFFFFFF ? undefined : ret !== 0; +} + +/** + * @param {string | null} [a] + * @returns {string | undefined} + */ +export function echo_option_char(a) { + const char0 = isLikeNone(a) ? 0xFFFFFF : a.codePointAt(0); + if (char0 !== 0xFFFFFF) { _assertChar(char0); } + const ret = wasm.echo_option_char(char0); + return ret === 0xFFFFFF ? undefined : String.fromCodePoint(ret); +} + +/** + * @param {string | null} [a] + * @returns {string | undefined} + */ +export function echo_option_string(a) { + var ptr0 = isLikeNone(a) ? 0 : passStringToWasm0(a, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_string(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getStringFromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + } + return v2; +} + +/** + * @param {Uint8Array | null} [a] + * @returns {Uint8Array | undefined} + */ +export function echo_option_vec_u8(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray8ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_u8(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + } + return v2; +} + +/** + * @param {Int8Array | null} [a] + * @returns {Int8Array | undefined} + */ +export function echo_option_vec_i8(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray8ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_i8(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayI8FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + } + return v2; +} + +/** + * @param {Uint16Array | null} [a] + * @returns {Uint16Array | undefined} + */ +export function echo_option_vec_u16(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray16ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_u16(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayU16FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 2, 2); + } + return v2; +} + +/** + * @param {Int16Array | null} [a] + * @returns {Int16Array | undefined} + */ +export function echo_option_vec_i16(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray16ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_i16(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayI16FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 2, 2); + } + return v2; +} + +/** + * @param {Uint32Array | null} [a] + * @returns {Uint32Array | undefined} + */ +export function echo_option_vec_u32(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray32ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_u32(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayU32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + } + return v2; +} + +/** + * @param {Int32Array | null} [a] + * @returns {Int32Array | undefined} + */ +export function echo_option_vec_i32(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray32ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_i32(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayI32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + } + return v2; +} + +/** + * @param {BigUint64Array | null} [a] + * @returns {BigUint64Array | undefined} + */ +export function echo_option_vec_u64(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray64ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_u64(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayU64FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 8, 8); + } + return v2; +} + +/** + * @param {BigInt64Array | null} [a] + * @returns {BigInt64Array | undefined} + */ +export function echo_option_vec_i64(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray64ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_i64(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayI64FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 8, 8); + } + return v2; +} + +/** + * @param {Uint8Array | null} [a] + * @returns {Uint8Array | undefined} + */ +export function echo_option_vec_uninit_u8(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray8ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_uninit_u8(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + } + return v2; +} + +/** + * @param {Int8Array | null} [a] + * @returns {Int8Array | undefined} + */ +export function echo_option_vec_uninit_i8(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray8ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_uninit_i8(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayI8FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); + } + return v2; +} + +/** + * @param {Uint16Array | null} [a] + * @returns {Uint16Array | undefined} + */ +export function echo_option_vec_uninit_u16(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray16ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_uninit_u16(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayU16FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 2, 2); + } + return v2; +} + +/** + * @param {Int16Array | null} [a] + * @returns {Int16Array | undefined} + */ +export function echo_option_vec_uninit_i16(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray16ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_uninit_i16(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayI16FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 2, 2); + } + return v2; +} + +/** + * @param {Uint32Array | null} [a] + * @returns {Uint32Array | undefined} + */ +export function echo_option_vec_uninit_u32(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray32ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_uninit_u32(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayU32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + } + return v2; +} + +/** + * @param {Int32Array | null} [a] + * @returns {Int32Array | undefined} + */ +export function echo_option_vec_uninit_i32(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray32ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_uninit_i32(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayI32FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + } + return v2; +} + +/** + * @param {BigUint64Array | null} [a] + * @returns {BigUint64Array | undefined} + */ +export function echo_option_vec_uninit_u64(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray64ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_uninit_u64(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayU64FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 8, 8); + } + return v2; +} + +/** + * @param {BigInt64Array | null} [a] + * @returns {BigInt64Array | undefined} + */ +export function echo_option_vec_uninit_i64(a) { + var ptr0 = isLikeNone(a) ? 0 : passArray64ToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_uninit_i64(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayI64FromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 8, 8); + } + return v2; +} + +/** + * @param {string[] | null} [a] + * @returns {string[] | undefined} + */ +export function echo_option_vec_string(a) { + var ptr0 = isLikeNone(a) ? 0 : passArrayJsValueToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_string(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + } + return v2; +} + +/** + * @param {Foo | null} [a] + * @returns {Foo | undefined} + */ +export function echo_option_struct(a) { + let ptr0 = 0; + if (!isLikeNone(a)) { + _assertClass(a, Foo); + ptr0 = a.__destroy_into_raw(); + } + const ret = wasm.echo_option_struct(ptr0); + return ret === 0 ? undefined : Foo.__wrap(ret); +} + +/** + * @param {Foo[] | null} [a] + * @returns {Foo[] | undefined} + */ +export function echo_option_vec_struct(a) { + var ptr0 = isLikeNone(a) ? 0 : passArrayJsValueToWasm0(a, wasm.__wbindgen_malloc); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.echo_option_vec_struct(ptr0, len0); + let v2; + if (ret[0] !== 0) { + v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice(); + wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); + } + return v2; +} + +const FooFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_foo_free(ptr >>> 0, 1)); + +export class Foo { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(Foo.prototype); + obj.__wbg_ptr = ptr; + FooFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + static __unwrap(jsValue) { + if (!(jsValue instanceof Foo)) { + return 0; + } + return jsValue.__destroy_into_raw(); + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + FooFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_foo_free(ptr, 0); + } +} + +export function __wbg_foo_new(arg0) { + const ret = Foo.__wrap(arg0); + return ret; +}; + +export function __wbg_foo_unwrap(arg0) { + const ret = Foo.__unwrap(arg0); + return ret; +}; + +export function __wbindgen_debug_string(arg0, arg1) { + const ret = debugString(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_2; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_string_get(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); +}; + +export function __wbindgen_string_new(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return ret; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/echo.rs b/crates/cli/tests/reference/echo.rs new file mode 100644 index 00000000000..815db98c363 --- /dev/null +++ b/crates/cli/tests/reference/echo.rs @@ -0,0 +1,93 @@ +use std::mem::MaybeUninit; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub struct Foo { + x: u32, +} + +macro_rules! echo { + ($(($n:ident, $t:ty)),*) => { + $( + #[wasm_bindgen] + pub fn $n(a: $t) -> $t { + a + } + )* + } +} + +echo!( + (echo_u8, u8), + (echo_i8, i8), + (echo_u16, u16), + (echo_i16, i16), + (echo_u32, u32), + (echo_i32, i32), + (echo_u64, u64), + (echo_i64, i64), + (echo_u128, u128), + (echo_i128, i128), + (echo_usize, usize), + (echo_isize, isize), + (echo_f32, f32), + (echo_f64, f64), + (echo_bool, bool), + (echo_char, char), + (echo_string, String), + (echo_vec_u8, Vec), + (echo_vec_i8, Vec), + (echo_vec_u16, Vec), + (echo_vec_i16, Vec), + (echo_vec_u32, Vec), + (echo_vec_i32, Vec), + (echo_vec_u64, Vec), + (echo_vec_i64, Vec), + (echo_vec_uninit_u8, Vec>), + (echo_vec_uninit_i8, Vec>), + (echo_vec_uninit_u16, Vec>), + (echo_vec_uninit_i16, Vec>), + (echo_vec_uninit_u32, Vec>), + (echo_vec_uninit_i32, Vec>), + (echo_vec_uninit_u64, Vec>), + (echo_vec_uninit_i64, Vec>), + (echo_vec_string, Vec), + (echo_struct, Foo), + (echo_vec_struct, Vec), + (echo_option_u8, Option), + (echo_option_i8, Option), + (echo_option_u16, Option), + (echo_option_i16, Option), + (echo_option_u32, Option), + (echo_option_i32, Option), + (echo_option_u64, Option), + (echo_option_i64, Option), + (echo_option_u128, Option), + (echo_option_i128, Option), + (echo_option_usize, Option), + (echo_option_isize, Option), + (echo_option_f32, Option), + (echo_option_f64, Option), + (echo_option_bool, Option), + (echo_option_char, Option), + (echo_option_string, Option), + (echo_option_vec_u8, Option>), + (echo_option_vec_i8, Option>), + (echo_option_vec_u16, Option>), + (echo_option_vec_i16, Option>), + (echo_option_vec_u32, Option>), + (echo_option_vec_i32, Option>), + (echo_option_vec_u64, Option>), + (echo_option_vec_i64, Option>), + (echo_option_vec_uninit_u8, Option>>), + (echo_option_vec_uninit_i8, Option>>), + (echo_option_vec_uninit_u16, Option>>), + (echo_option_vec_uninit_i16, Option>>), + (echo_option_vec_uninit_u32, Option>>), + (echo_option_vec_uninit_i32, Option>>), + (echo_option_vec_uninit_u64, Option>>), + (echo_option_vec_uninit_i64, Option>>), + (echo_option_vec_string, Option>), + (echo_option_struct, Option), + (echo_option_vec_struct, Option>) +); diff --git a/crates/cli/tests/reference/echo.wat b/crates/cli/tests/reference/echo.wat new file mode 100644 index 00000000000..4504528bcc9 --- /dev/null +++ b/crates/cli/tests/reference/echo.wat @@ -0,0 +1,181 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (type (;2;) (func (param i32) (result i32))) + (type (;3;) (func (param i32 i32))) + (type (;4;) (func (param i32 i32) (result i32))) + (type (;5;) (func (param i32 i32) (result i32 i32))) + (type (;6;) (func (param i32 i32 i32))) + (type (;7;) (func (param i32 i32 i32 i32) (result i32))) + (type (;8;) (func (param i32 i64) (result i32 i64))) + (type (;9;) (func (param i32 i64 i64) (result i32 i64 i64))) + (type (;10;) (func (param i32 f64) (result i32 f64))) + (type (;11;) (func (param i64) (result i64))) + (type (;12;) (func (param i64 i64) (result i64 i64))) + (type (;13;) (func (param f32) (result f32))) + (type (;14;) (func (param f64) (result f64))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbindgen_realloc (;1;) (type 7) (param i32 i32 i32 i32) (result i32)) + (func $__wbindgen_malloc (;2;) (type 4) (param i32 i32) (result i32)) + (func $__externref_drop_slice (;3;) (type 3) (param i32 i32)) + (func $echo_option_u8 (;4;) (type 2) (param i32) (result i32)) + (func $echo_option_i8 (;5;) (type 2) (param i32) (result i32)) + (func $echo_option_u16 (;6;) (type 2) (param i32) (result i32)) + (func $echo_option_i16 (;7;) (type 2) (param i32) (result i32)) + (func $echo_option_struct (;8;) (type 2) (param i32) (result i32)) + (func $echo_option_u32 (;9;) (type 14) (param f64) (result f64)) + (func $echo_option_i32 (;10;) (type 14) (param f64) (result f64)) + (func $echo_option_usize (;11;) (type 14) (param f64) (result f64)) + (func $echo_option_isize (;12;) (type 14) (param f64) (result f64)) + (func $echo_option_f32 (;13;) (type 14) (param f64) (result f64)) + (func $echo_u8 (;14;) (type 2) (param i32) (result i32)) + (func $echo_i8 (;15;) (type 2) (param i32) (result i32)) + (func $echo_u16 (;16;) (type 2) (param i32) (result i32)) + (func $echo_i16 (;17;) (type 2) (param i32) (result i32)) + (func $echo_u32 (;18;) (type 2) (param i32) (result i32)) + (func $echo_i32 (;19;) (type 2) (param i32) (result i32)) + (func $echo_usize (;20;) (type 2) (param i32) (result i32)) + (func $echo_isize (;21;) (type 2) (param i32) (result i32)) + (func $echo_f32 (;22;) (type 13) (param f32) (result f32)) + (func $echo_bool (;23;) (type 2) (param i32) (result i32)) + (func $echo_char (;24;) (type 2) (param i32) (result i32)) + (func $echo_struct (;25;) (type 2) (param i32) (result i32)) + (func $echo_option_bool (;26;) (type 2) (param i32) (result i32)) + (func $echo_option_char (;27;) (type 2) (param i32) (result i32)) + (func $echo_u64 (;28;) (type 11) (param i64) (result i64)) + (func $echo_i64 (;29;) (type 11) (param i64) (result i64)) + (func $echo_f64 (;30;) (type 14) (param f64) (result f64)) + (func $__wbindgen_free (;31;) (type 6) (param i32 i32 i32)) + (func $__wbg_foo_free (;32;) (type 3) (param i32 i32)) + (func $"echo_option_u128 multivalue shim" (;33;) (type 9) (param i32 i64 i64) (result i32 i64 i64)) + (func $"echo_option_i128 multivalue shim" (;34;) (type 9) (param i32 i64 i64) (result i32 i64 i64)) + (func $"echo_u128 multivalue shim" (;35;) (type 12) (param i64 i64) (result i64 i64)) + (func $"echo_i128 multivalue shim" (;36;) (type 12) (param i64 i64) (result i64 i64)) + (func $"echo_string multivalue shim" (;37;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_u8 multivalue shim" (;38;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_i8 multivalue shim" (;39;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_u16 multivalue shim" (;40;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_i16 multivalue shim" (;41;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_u32 multivalue shim" (;42;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_i32 multivalue shim" (;43;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_u64 multivalue shim" (;44;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_i64 multivalue shim" (;45;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_uninit_u8 multivalue shim" (;46;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_uninit_i8 multivalue shim" (;47;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_uninit_u16 multivalue shim" (;48;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_uninit_i16 multivalue shim" (;49;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_uninit_u32 multivalue shim" (;50;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_uninit_i32 multivalue shim" (;51;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_uninit_u64 multivalue shim" (;52;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_uninit_i64 multivalue shim" (;53;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_string multivalue shim" (;54;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_vec_struct multivalue shim" (;55;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_u64 multivalue shim" (;56;) (type 8) (param i32 i64) (result i32 i64)) + (func $"echo_option_i64 multivalue shim" (;57;) (type 8) (param i32 i64) (result i32 i64)) + (func $"echo_option_f64 multivalue shim" (;58;) (type 10) (param i32 f64) (result i32 f64)) + (func $"echo_option_string multivalue shim" (;59;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_u8 multivalue shim" (;60;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_i8 multivalue shim" (;61;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_u16 multivalue shim" (;62;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_i16 multivalue shim" (;63;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_u32 multivalue shim" (;64;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_i32 multivalue shim" (;65;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_u64 multivalue shim" (;66;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_i64 multivalue shim" (;67;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_uninit_u8 multivalue shim" (;68;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_uninit_i8 multivalue shim" (;69;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_uninit_u16 multivalue shim" (;70;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_uninit_i16 multivalue shim" (;71;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_uninit_u32 multivalue shim" (;72;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_uninit_i32 multivalue shim" (;73;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_uninit_u64 multivalue shim" (;74;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_uninit_i64 multivalue shim" (;75;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_string multivalue shim" (;76;) (type 5) (param i32 i32) (result i32 i32)) + (func $"echo_option_vec_struct multivalue shim" (;77;) (type 5) (param i32 i32) (result i32 i32)) + (func $__externref_table_alloc (;78;) (type 1) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "__wbg_foo_free" (func $__wbg_foo_free)) + (export "echo_u8" (func $echo_u8)) + (export "echo_i8" (func $echo_i8)) + (export "echo_u16" (func $echo_u16)) + (export "echo_i16" (func $echo_i16)) + (export "echo_u32" (func $echo_u32)) + (export "echo_i32" (func $echo_i32)) + (export "echo_u64" (func $echo_u64)) + (export "echo_i64" (func $echo_i64)) + (export "echo_u128" (func $"echo_u128 multivalue shim")) + (export "echo_i128" (func $"echo_i128 multivalue shim")) + (export "echo_usize" (func $echo_usize)) + (export "echo_isize" (func $echo_isize)) + (export "echo_f32" (func $echo_f32)) + (export "echo_f64" (func $echo_f64)) + (export "echo_bool" (func $echo_bool)) + (export "echo_char" (func $echo_char)) + (export "echo_string" (func $"echo_string multivalue shim")) + (export "echo_vec_u8" (func $"echo_vec_u8 multivalue shim")) + (export "echo_vec_i8" (func $"echo_vec_i8 multivalue shim")) + (export "echo_vec_u16" (func $"echo_vec_u16 multivalue shim")) + (export "echo_vec_i16" (func $"echo_vec_i16 multivalue shim")) + (export "echo_vec_u32" (func $"echo_vec_u32 multivalue shim")) + (export "echo_vec_i32" (func $"echo_vec_i32 multivalue shim")) + (export "echo_vec_u64" (func $"echo_vec_u64 multivalue shim")) + (export "echo_vec_i64" (func $"echo_vec_i64 multivalue shim")) + (export "echo_vec_uninit_u8" (func $"echo_vec_uninit_u8 multivalue shim")) + (export "echo_vec_uninit_i8" (func $"echo_vec_uninit_i8 multivalue shim")) + (export "echo_vec_uninit_u16" (func $"echo_vec_uninit_u16 multivalue shim")) + (export "echo_vec_uninit_i16" (func $"echo_vec_uninit_i16 multivalue shim")) + (export "echo_vec_uninit_u32" (func $"echo_vec_uninit_u32 multivalue shim")) + (export "echo_vec_uninit_i32" (func $"echo_vec_uninit_i32 multivalue shim")) + (export "echo_vec_uninit_u64" (func $"echo_vec_uninit_u64 multivalue shim")) + (export "echo_vec_uninit_i64" (func $"echo_vec_uninit_i64 multivalue shim")) + (export "echo_vec_string" (func $"echo_vec_string multivalue shim")) + (export "echo_struct" (func $echo_struct)) + (export "echo_vec_struct" (func $"echo_vec_struct multivalue shim")) + (export "echo_option_u8" (func $echo_option_u8)) + (export "echo_option_i8" (func $echo_option_i8)) + (export "echo_option_u16" (func $echo_option_u16)) + (export "echo_option_i16" (func $echo_option_i16)) + (export "echo_option_u32" (func $echo_option_u32)) + (export "echo_option_i32" (func $echo_option_i32)) + (export "echo_option_u64" (func $"echo_option_u64 multivalue shim")) + (export "echo_option_i64" (func $"echo_option_i64 multivalue shim")) + (export "echo_option_u128" (func $"echo_option_u128 multivalue shim")) + (export "echo_option_i128" (func $"echo_option_i128 multivalue shim")) + (export "echo_option_usize" (func $echo_option_usize)) + (export "echo_option_isize" (func $echo_option_isize)) + (export "echo_option_f32" (func $echo_option_f32)) + (export "echo_option_f64" (func $"echo_option_f64 multivalue shim")) + (export "echo_option_bool" (func $echo_option_bool)) + (export "echo_option_char" (func $echo_option_char)) + (export "echo_option_string" (func $"echo_option_string multivalue shim")) + (export "echo_option_vec_u8" (func $"echo_option_vec_u8 multivalue shim")) + (export "echo_option_vec_i8" (func $"echo_option_vec_i8 multivalue shim")) + (export "echo_option_vec_u16" (func $"echo_option_vec_u16 multivalue shim")) + (export "echo_option_vec_i16" (func $"echo_option_vec_i16 multivalue shim")) + (export "echo_option_vec_u32" (func $"echo_option_vec_u32 multivalue shim")) + (export "echo_option_vec_i32" (func $"echo_option_vec_i32 multivalue shim")) + (export "echo_option_vec_u64" (func $"echo_option_vec_u64 multivalue shim")) + (export "echo_option_vec_i64" (func $"echo_option_vec_i64 multivalue shim")) + (export "echo_option_vec_uninit_u8" (func $"echo_option_vec_uninit_u8 multivalue shim")) + (export "echo_option_vec_uninit_i8" (func $"echo_option_vec_uninit_i8 multivalue shim")) + (export "echo_option_vec_uninit_u16" (func $"echo_option_vec_uninit_u16 multivalue shim")) + (export "echo_option_vec_uninit_i16" (func $"echo_option_vec_uninit_i16 multivalue shim")) + (export "echo_option_vec_uninit_u32" (func $"echo_option_vec_uninit_u32 multivalue shim")) + (export "echo_option_vec_uninit_i32" (func $"echo_option_vec_uninit_i32 multivalue shim")) + (export "echo_option_vec_uninit_u64" (func $"echo_option_vec_uninit_u64 multivalue shim")) + (export "echo_option_vec_uninit_i64" (func $"echo_option_vec_uninit_i64 multivalue shim")) + (export "echo_option_vec_string" (func $"echo_option_vec_string multivalue shim")) + (export "echo_option_struct" (func $echo_option_struct)) + (export "echo_option_vec_struct" (func $"echo_option_vec_struct multivalue shim")) + (export "__wbindgen_malloc" (func $__wbindgen_malloc)) + (export "__wbindgen_realloc" (func $__wbindgen_realloc)) + (export "__wbindgen_export_2" (table 0)) + (export "__wbindgen_free" (func $__wbindgen_free)) + (export "__externref_table_alloc" (func $__externref_table_alloc)) + (export "__externref_drop_slice" (func $__externref_drop_slice)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/empty.js b/crates/cli/tests/reference/empty.js index 275ace8aee5..a25c33a1af9 100644 --- a/crates/cli/tests/reference/empty.js +++ b/crates/cli/tests/reference/empty.js @@ -1,2 +1,17 @@ -import * as wasm from './reference_test_bg.wasm'; +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; diff --git a/crates/cli/tests/reference/empty.wat b/crates/cli/tests/reference/empty.wat index d54fa33542f..1044fd51d5e 100644 --- a/crates/cli/tests/reference/empty.wat +++ b/crates/cli/tests/reference/empty.wat @@ -1,3 +1,11 @@ -(module +(module $reference_test.wasm + (type (;0;) (func)) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (table (;0;) 128 externref) (memory (;0;) 16) - (export "memory" (memory 0))) + (export "memory" (memory 0)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after export) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/enums.d.ts b/crates/cli/tests/reference/enums.d.ts new file mode 100644 index 00000000000..8d1b955c1f9 --- /dev/null +++ b/crates/cli/tests/reference/enums.d.ts @@ -0,0 +1,42 @@ +/* tslint:disable */ +/* eslint-disable */ +export function enum_echo(color: Color): Color; +export function option_enum_echo(color?: Color | null): Color | undefined; +export function get_name(color: Color): ColorName; +export function option_string_enum_echo(color?: ColorName | null): ColorName | undefined; +export function option_order(order?: Ordering | null): Ordering | undefined; +/** + * A color. + */ +export enum Color { + /** + * Green as a leaf. + */ + Green = 0, + /** + * Yellow as the sun. + */ + Yellow = 1, + /** + * Red as a rose. + */ + Red = 2, +} +export enum ImplicitDiscriminant { + A = 0, + B = 1, + C = 42, + D = 43, +} +/** + * A C-style enum with negative discriminants. + */ +export enum Ordering { + Less = -1, + Equal = 0, + Greater = 1, +} +/** + * The name of a color. + */ +type ColorName = "green" | "yellow" | "red"; diff --git a/crates/cli/tests/reference/enums.js b/crates/cli/tests/reference/enums.js new file mode 100644 index 00000000000..10d698dc7e5 --- /dev/null +++ b/crates/cli/tests/reference/enums.js @@ -0,0 +1,127 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} +/** + * @param {Color} color + * @returns {Color} + */ +export function enum_echo(color) { + const ret = wasm.enum_echo(color); + return ret; +} + +function isLikeNone(x) { + return x === undefined || x === null; +} +/** + * @param {Color | null} [color] + * @returns {Color | undefined} + */ +export function option_enum_echo(color) { + const ret = wasm.option_enum_echo(isLikeNone(color) ? 3 : color); + return ret === 3 ? undefined : ret; +} + +/** + * @param {Color} color + * @returns {ColorName} + */ +export function get_name(color) { + const ret = wasm.get_name(color); + return __wbindgen_enum_ColorName[ret]; +} + +/** + * @param {ColorName | null} [color] + * @returns {ColorName | undefined} + */ +export function option_string_enum_echo(color) { + const ret = wasm.option_string_enum_echo(isLikeNone(color) ? 4 : ((__wbindgen_enum_ColorName.indexOf(color) + 1 || 4) - 1)); + return __wbindgen_enum_ColorName[ret]; +} + +/** + * @param {Ordering | null} [order] + * @returns {Ordering | undefined} + */ +export function option_order(order) { + const ret = wasm.option_order(isLikeNone(order) ? 2 : order); + return ret === 2 ? undefined : ret; +} + +/** + * A color. + * @enum {0 | 1 | 2} + */ +export const Color = Object.freeze({ + /** + * Green as a leaf. + */ + Green: 0, "0": "Green", + /** + * Yellow as the sun. + */ + Yellow: 1, "1": "Yellow", + /** + * Red as a rose. + */ + Red: 2, "2": "Red", +}); +/** + * @enum {0 | 1 | 42 | 43} + */ +export const ImplicitDiscriminant = Object.freeze({ + A: 0, "0": "A", + B: 1, "1": "B", + C: 42, "42": "C", + D: 43, "43": "D", +}); +/** + * A C-style enum with negative discriminants. + * @enum {-1 | 0 | 1} + */ +export const Ordering = Object.freeze({ + Less: -1, "-1": "Less", + Equal: 0, "0": "Equal", + Greater: 1, "1": "Greater", +}); + +const __wbindgen_enum_ColorName = ["green", "yellow", "red"]; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/enums.rs b/crates/cli/tests/reference/enums.rs new file mode 100644 index 00000000000..553d63d9a4d --- /dev/null +++ b/crates/cli/tests/reference/enums.rs @@ -0,0 +1,80 @@ +use wasm_bindgen::prelude::*; + +/// A color. +#[wasm_bindgen] +#[derive(PartialEq, Debug)] +pub enum Color { + /// Green as a leaf. + Green, + /// Yellow as the sun. + Yellow, + /// Red as a rose. + Red, +} + +#[wasm_bindgen] +pub fn enum_echo(color: Color) -> Color { + color +} + +#[wasm_bindgen] +pub fn option_enum_echo(color: Option) -> Option { + color +} + +/// The name of a color. +#[wasm_bindgen] +#[derive(PartialEq, Debug)] +pub enum ColorName { + Green = "green", + Yellow = "yellow", + Red = "red", +} + +#[wasm_bindgen] +pub fn get_name(color: Color) -> ColorName { + match color { + Color::Red => ColorName::Red, + Color::Green => ColorName::Green, + Color::Yellow => ColorName::Yellow, + } +} + +#[wasm_bindgen] +pub fn option_string_enum_echo(color: Option) -> Option { + color +} + +/// An unused string enum. +#[wasm_bindgen(js_name = "FooBar")] +pub enum UnusedStringEnum { + Foo = "foo", + Bar = "bar", +} + +#[wasm_bindgen] +enum PrivateStringEnum { + Foo = "foo", + Bar = "bar", +} + +#[wasm_bindgen] +pub enum ImplicitDiscriminant { + A, + B, + C = 42, + D, +} + +/// A C-style enum with negative discriminants. +#[wasm_bindgen] +pub enum Ordering { + Less = -1, + Equal = 0, + Greater = 1, +} + +#[wasm_bindgen] +pub fn option_order(order: Option) -> Option { + order +} diff --git a/crates/cli/tests/reference/enums.wat b/crates/cli/tests/reference/enums.wat new file mode 100644 index 00000000000..3688c671785 --- /dev/null +++ b/crates/cli/tests/reference/enums.wat @@ -0,0 +1,22 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32) (result i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $enum_echo (;1;) (type 1) (param i32) (result i32)) + (func $option_enum_echo (;2;) (type 1) (param i32) (result i32)) + (func $get_name (;3;) (type 1) (param i32) (result i32)) + (func $option_string_enum_echo (;4;) (type 1) (param i32) (result i32)) + (func $option_order (;5;) (type 1) (param i32) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "enum_echo" (func $enum_echo)) + (export "option_enum_echo" (func $option_enum_echo)) + (export "get_name" (func $get_name)) + (export "option_string_enum_echo" (func $option_string_enum_echo)) + (export "option_order" (func $option_order)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/function-attrs.d.ts b/crates/cli/tests/reference/function-attrs.d.ts new file mode 100644 index 00000000000..7ae18c6a5c9 --- /dev/null +++ b/crates/cli/tests/reference/function-attrs.d.ts @@ -0,0 +1,34 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Description for fn_with_attr + * @param firstArg - some number + * @param secondArg + * @returns returns 1 if arg2 is true, or arg1 if arg2 is undefined or false + */ +export function fn_with_attr(firstArg: number, secondArg: boolean | undefined): Promise; +/** + * Description for HoldsNumber + */ +export class HoldsNumber { + private constructor(); + free(): void; + /** + * Description for static_fn_with_attr + * @param firstArg - some number + * @param secondArg + * @returns returns an instance of HoldsNumber, holding arg1 if arg2 is undefined and holding arg2 if not + */ + static static_fn_with_attr(firstArg: number, secondArg: number | undefined): HoldsNumber; + /** + * Description for method_with_attr + * @param firstArg - some number + * @param secondArg + * @returns returns arg1 if arg2 is true, or holding value of self if arg2 is undefined or false + */ + method_with_attr(firstArg: number, secondArg: boolean | undefined): number; + /** + * Inner value + */ + readonly inner: number; +} diff --git a/crates/cli/tests/reference/function-attrs.rs b/crates/cli/tests/reference/function-attrs.rs new file mode 100644 index 00000000000..2621a4cc37d --- /dev/null +++ b/crates/cli/tests/reference/function-attrs.rs @@ -0,0 +1,69 @@ +use wasm_bindgen::prelude::*; + +/// Description for fn_with_attr +#[wasm_bindgen( + unchecked_return_type = "number", + return_description = "returns 1 if arg2 is true, or arg1 if arg2 is undefined or false" +)] +pub async fn fn_with_attr( + #[wasm_bindgen(js_name = "firstArg", param_description = "some number")] arg1: u32, + #[wasm_bindgen(js_name = "secondArg", unchecked_param_type = "boolean | undefined")] arg2: JsValue, +) -> Result { + if arg2.is_undefined() { + Ok(arg1.into()) + } else if arg2.is_truthy() { + Ok(1u32.into()) + } else { + Ok(arg1.into()) + } +} + +/// Description for HoldsNumber +#[wasm_bindgen] +pub struct HoldsNumber { + inner: JsValue, +} + +#[wasm_bindgen] +impl HoldsNumber { + /// Inner value + #[wasm_bindgen(getter = "inner", unchecked_return_type = "number")] + pub fn get_inner(&self) -> JsValue { + self.inner.clone() + } + + /// Description for static_fn_with_attr + #[wasm_bindgen( + return_description = "returns an instance of HoldsNumber, holding arg1 if arg2 is undefined and holding arg2 if not" + )] + pub fn static_fn_with_attr( + #[wasm_bindgen(js_name = "firstArg", param_description = "some number")] arg1: u32, + #[wasm_bindgen(js_name = "secondArg", unchecked_param_type = "number | undefined")] + arg2: JsValue, + ) -> HoldsNumber { + if arg2.is_undefined() { + HoldsNumber { inner: arg1.into() } + } else { + HoldsNumber { inner: arg2 } + } + } + + /// Description for method_with_attr + #[wasm_bindgen( + unchecked_return_type = "number", + return_description = "returns arg1 if arg2 is true, or holding value of self if arg2 is undefined or false" + )] + pub fn method_with_attr( + &self, + #[wasm_bindgen(js_name = "firstArg", param_description = "some number")] arg1: u32, + #[wasm_bindgen(js_name = "secondArg", unchecked_param_type = "boolean | undefined")] arg2: JsValue, + ) -> JsValue { + if arg2.is_undefined() { + self.inner.clone() + } else if arg2.is_truthy() { + arg1.into() + } else { + self.inner.clone() + } + } +} diff --git a/crates/cli/tests/reference/getter-setter.d.ts b/crates/cli/tests/reference/getter-setter.d.ts new file mode 100644 index 00000000000..789fb0f279f --- /dev/null +++ b/crates/cli/tests/reference/getter-setter.d.ts @@ -0,0 +1,29 @@ +/* tslint:disable */ +/* eslint-disable */ +export class Foo { + private constructor(); + free(): void; + x: number; + get y(): number | undefined; + set y(value: number | null | undefined); + get z(): number | undefined; + set z(value: number | null | undefined); + readonly lone_getter: number | undefined; + set lone_setter(value: number | null | undefined); + /** + * You will only read numbers. + */ + get weird(): number; + /** + * But you must write strings. + * + * Yes, this is totally fine in JS. + */ + set weird(value: string | null | undefined); + /** + * There can be static getters and setters too, and they can even have the + * same name as instance getters and setters. + */ + static get x(): boolean | undefined; + static set x(value: boolean | null | undefined); +} diff --git a/crates/cli/tests/reference/getter-setter.js b/crates/cli/tests/reference/getter-setter.js new file mode 100644 index 00000000000..a9df5536a5b --- /dev/null +++ b/crates/cli/tests/reference/getter-setter.js @@ -0,0 +1,208 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +let WASM_VECTOR_LEN = 0; + +const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; + +let cachedTextEncoder = new lTextEncoder('utf-8'); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +const FooFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_foo_free(ptr >>> 0, 1)); + +export class Foo { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + FooFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_foo_free(ptr, 0); + } + /** + * @returns {number} + */ + get x() { + const ret = wasm.__wbg_get_foo_x(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} arg0 + */ + set x(arg0) { + wasm.__wbg_set_foo_x(this.__wbg_ptr, arg0); + } + /** + * @returns {number | undefined} + */ + get y() { + const ret = wasm.__wbg_get_foo_y(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @param {number | null} [arg0] + */ + set y(arg0) { + wasm.__wbg_set_foo_y(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : (arg0) >>> 0); + } + /** + * @returns {number | undefined} + */ + get z() { + const ret = wasm.foo_z(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @param {number | null} [z] + */ + set z(z) { + wasm.foo_set_z(this.__wbg_ptr, isLikeNone(z) ? 0x100000001 : (z) >>> 0); + } + /** + * @returns {number | undefined} + */ + get lone_getter() { + const ret = wasm.foo_lone_getter(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; + } + /** + * @param {number | null} [value] + */ + set lone_setter(value) { + wasm.foo_set_lone_setter(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0); + } + /** + * You will only read numbers. + * @returns {number} + */ + get weird() { + const ret = wasm.foo_weird(this.__wbg_ptr); + return ret >>> 0; + } + /** + * But you must write strings. + * + * Yes, this is totally fine in JS. + * @param {string | null} [value] + */ + set weird(value) { + var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + wasm.foo_set_weird(this.__wbg_ptr, ptr0, len0); + } + /** + * There can be static getters and setters too, and they can even have the + * same name as instance getters and setters. + * @returns {boolean | undefined} + */ + static get x() { + const ret = wasm.foo_x_static(); + return ret === 0xFFFFFF ? undefined : ret !== 0; + } + /** + * @param {boolean | null} [value] + */ + static set x(value) { + wasm.foo_set_x_static(isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); + } +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/getter-setter.rs b/crates/cli/tests/reference/getter-setter.rs new file mode 100644 index 00000000000..184d34b0790 --- /dev/null +++ b/crates/cli/tests/reference/getter-setter.rs @@ -0,0 +1,48 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +struct Foo { + pub x: u32, + pub y: Option, + z: Option, +} + +#[wasm_bindgen] +impl Foo { + #[wasm_bindgen(getter)] + pub fn z(&self) -> Option { + self.z + } + #[wasm_bindgen(setter)] + pub fn set_z(&mut self, z: Option) { + self.z = z; + } + + #[wasm_bindgen(getter)] + pub fn lone_getter(&self) -> Option { + self.z + } + + #[wasm_bindgen(setter)] + pub fn set_lone_setter(&mut self, value: Option) {} + + /// You will only read numbers. + #[wasm_bindgen(getter)] + pub fn weird(&self) -> u32 { + 42 + } + /// But you must write strings. + /// + /// Yes, this is totally fine in JS. + #[wasm_bindgen(setter)] + pub fn set_weird(&mut self, value: Option) {} + + /// There can be static getters and setters too, and they can even have the + /// same name as instance getters and setters. + #[wasm_bindgen(getter = x)] + pub fn x_static() -> Option { + None + } + #[wasm_bindgen(setter = x)] + pub fn set_x_static(value: Option) {} +} diff --git a/crates/cli/tests/reference/getter-setter.wat b/crates/cli/tests/reference/getter-setter.wat new file mode 100644 index 00000000000..7834c0fccf8 --- /dev/null +++ b/crates/cli/tests/reference/getter-setter.wat @@ -0,0 +1,50 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (type (;2;) (func (param i32))) + (type (;3;) (func (param i32) (result i32))) + (type (;4;) (func (param i32) (result f64))) + (type (;5;) (func (param i32 i32))) + (type (;6;) (func (param i32 i32) (result i32))) + (type (;7;) (func (param i32 i32 i32))) + (type (;8;) (func (param i32 i32 i32 i32) (result i32))) + (type (;9;) (func (param i32 f64))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbindgen_realloc (;1;) (type 8) (param i32 i32 i32 i32) (result i32)) + (func $__wbindgen_malloc (;2;) (type 6) (param i32 i32) (result i32)) + (func $foo_set_weird (;3;) (type 7) (param i32 i32 i32)) + (func $__wbg_set_foo_y (;4;) (type 9) (param i32 f64)) + (func $__wbg_get_foo_y (;5;) (type 4) (param i32) (result f64)) + (func $__wbg_get_foo_x (;6;) (type 3) (param i32) (result i32)) + (func $foo_set_z (;7;) (type 9) (param i32 f64)) + (func $foo_set_lone_setter (;8;) (type 9) (param i32 f64)) + (func $foo_z (;9;) (type 4) (param i32) (result f64)) + (func $foo_lone_getter (;10;) (type 4) (param i32) (result f64)) + (func $__wbg_set_foo_x (;11;) (type 5) (param i32 i32)) + (func $foo_weird (;12;) (type 3) (param i32) (result i32)) + (func $foo_x_static (;13;) (type 1) (result i32)) + (func $__wbg_foo_free (;14;) (type 5) (param i32 i32)) + (func $foo_set_x_static (;15;) (type 2) (param i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "__wbg_foo_free" (func $__wbg_foo_free)) + (export "__wbg_get_foo_x" (func $__wbg_get_foo_x)) + (export "__wbg_set_foo_x" (func $__wbg_set_foo_x)) + (export "__wbg_get_foo_y" (func $__wbg_get_foo_y)) + (export "__wbg_set_foo_y" (func $__wbg_set_foo_y)) + (export "foo_z" (func $foo_z)) + (export "foo_set_z" (func $foo_set_z)) + (export "foo_lone_getter" (func $foo_lone_getter)) + (export "foo_set_lone_setter" (func $foo_set_lone_setter)) + (export "foo_weird" (func $foo_weird)) + (export "foo_set_weird" (func $foo_set_weird)) + (export "foo_x_static" (func $foo_x_static)) + (export "foo_set_x_static" (func $foo_set_x_static)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_malloc" (func $__wbindgen_malloc)) + (export "__wbindgen_realloc" (func $__wbindgen_realloc)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/import-catch.js b/crates/cli/tests/reference/import-catch.js deleted file mode 100644 index adaf3c2ae34..00000000000 --- a/crates/cli/tests/reference/import-catch.js +++ /dev/null @@ -1,66 +0,0 @@ -import * as wasm from './reference_test_bg.wasm'; - -const heap = new Array(32).fill(undefined); - -heap.push(undefined, null, true, false); - -let heap_next = heap.length; - -function addHeapObject(obj) { - if (heap_next === heap.length) heap.push(heap.length + 1); - const idx = heap_next; - heap_next = heap[idx]; - - heap[idx] = obj; - return idx; -} - -function handleError(f, args) { - try { - return f.apply(this, args); - } catch (e) { - wasm.__wbindgen_exn_store(addHeapObject(e)); - } -} - -let cachegetInt32Memory0 = null; -function getInt32Memory0() { - if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { - cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); - } - return cachegetInt32Memory0; -} - -function getObject(idx) { return heap[idx]; } - -function dropObject(idx) { - if (idx < 36) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} -/** -*/ -export function exported() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.exported(retptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - if (r1) { - throw takeObject(r0); - } - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } -} - -export function __wbg_foo_8d66ddef0ff279d6() { return handleError(function () { - foo(); -}, arguments) }; - diff --git a/crates/cli/tests/reference/import-catch.rs b/crates/cli/tests/reference/import-catch.rs deleted file mode 100644 index b6a6e58fbf9..00000000000 --- a/crates/cli/tests/reference/import-catch.rs +++ /dev/null @@ -1,12 +0,0 @@ -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(catch)] - fn foo() -> Result<(), JsValue>; -} - -#[wasm_bindgen] -pub fn exported() -> Result<(), JsValue> { - foo() -} diff --git a/crates/cli/tests/reference/import-catch.wat b/crates/cli/tests/reference/import-catch.wat deleted file mode 100644 index 1298798b7a7..00000000000 --- a/crates/cli/tests/reference/import-catch.wat +++ /dev/null @@ -1,11 +0,0 @@ -(module - (type (;0;) (func (param i32))) - (type (;1;) (func (param i32) (result i32))) - (func $__wbindgen_exn_store (type 0) (param i32)) - (func $exported (type 0) (param i32)) - (func $__wbindgen_add_to_stack_pointer (type 1) (param i32) (result i32)) - (memory (;0;) 17) - (export "memory" (memory 0)) - (export "exported" (func $exported)) - (export "__wbindgen_exn_store" (func $__wbindgen_exn_store)) - (export "__wbindgen_add_to_stack_pointer" (func $__wbindgen_add_to_stack_pointer))) diff --git a/crates/cli/tests/reference/import-catch.d.ts b/crates/cli/tests/reference/import-getter-setter.d.ts similarity index 91% rename from crates/cli/tests/reference/import-catch.d.ts rename to crates/cli/tests/reference/import-getter-setter.d.ts index 3e2ffc07207..091dbcc51a6 100644 --- a/crates/cli/tests/reference/import-catch.d.ts +++ b/crates/cli/tests/reference/import-getter-setter.d.ts @@ -1,5 +1,3 @@ /* tslint:disable */ /* eslint-disable */ -/** -*/ export function exported(): void; diff --git a/crates/cli/tests/reference/import-getter-setter.js b/crates/cli/tests/reference/import-getter-setter.js new file mode 100644 index 00000000000..adaca3bab4d --- /dev/null +++ b/crates/cli/tests/reference/import-getter-setter.js @@ -0,0 +1,104 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +export function exported() { + wasm.exported(); +} + +export function __wbg_another_79dcbfe47962d7a7(arg0) { + const ret = arg0.prop2; + return ret; +}; + +export function __wbg_b_266c81b129cbc216(arg0) { + const ret = arg0.a; + return ret; +}; + +export function __wbg_bar2_38c86771c0e03476() { + const ret = Bar.bar2(); + return ret; +}; + +export function __wbg_getfoo_690459206923b526() { + const ret = Bar.get_foo(); + return ret; +}; + +export function __wbg_new_98ff9abc2a3e2736() { + const ret = new SomeClass(); + return ret; +}; + +export function __wbg_setanother_51e596d4d035bc4d(arg0, arg1) { + arg0.prop2 = arg1 >>> 0; +}; + +export function __wbg_setb_eda0c18669c4ad53(arg0, arg1) { + arg0.a = arg1 >>> 0; +}; + +export function __wbg_setbar2_d99cb80edd0e1959(arg0) { + Bar.set_bar2(arg0 >>> 0); +}; + +export function __wbg_setfoo_029452b4d4645d79(arg0) { + Bar.set_foo(arg0 >>> 0); +}; + +export function __wbg_setsignal_bd536e517c35da41(arg0, arg1) { + arg0.signal = arg1 >>> 0; +}; + +export function __wbg_setsomeprop_965004b0138eb32c(arg0, arg1) { + arg0.some_prop = arg1 >>> 0; +}; + +export function __wbg_signal_89fe6c5b19fec3df(arg0) { + const ret = arg0.signal; + return ret; +}; + +export function __wbg_someprop_fd4fc05f44bf5de2(arg0) { + const ret = arg0.some_prop; + return ret; +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/import-getter-setter.rs b/crates/cli/tests/reference/import-getter-setter.rs new file mode 100644 index 00000000000..413616b7600 --- /dev/null +++ b/crates/cli/tests/reference/import-getter-setter.rs @@ -0,0 +1,59 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(js_namespace = Bar, getter = bar)] + fn get_foo() -> u32; + #[wasm_bindgen(js_namespace = Bar, setter = bar)] + fn set_foo(value: u32); + #[wasm_bindgen(js_namespace = Bar, getter, js_name = bar2)] + fn get_foo2() -> u32; + #[wasm_bindgen(js_namespace = Bar, setter, js_name = bar2)] + fn set_foo2(value: u32); + + #[wasm_bindgen] + #[derive(Debug, Clone, PartialEq)] + pub type SomeClass; + + #[wasm_bindgen(method, getter, js_class = "SomeClass", js_name = signal)] + pub fn signal(this: &SomeClass) -> u32; + #[wasm_bindgen(method, setter, js_class = "SomeClass", js_name = signal)] + pub fn set_signal(this: &SomeClass, value: u32); + + #[wasm_bindgen(method, getter, js_class = "SomeClass")] + pub fn some_prop(this: &SomeClass) -> u32; + #[wasm_bindgen(method, setter, js_class = "SomeClass")] + pub fn set_some_prop(this: &SomeClass, value: u32); + + #[wasm_bindgen(method, getter = prop2, js_class = "SomeClass")] + pub fn another(this: &SomeClass) -> u32; + #[wasm_bindgen(method, setter = prop2, js_class = "SomeClass")] + pub fn set_another(this: &SomeClass, value: u32); + + // #[wasm_bindgen(getter, js_class = "SomeClass")] + // pub fn static_controller() -> SomeClass; + // #[wasm_bindgen(getter, js_class = "SomeClass")] + // pub fn set_static_controller(value: &SomeClass); + + #[wasm_bindgen(constructor, js_class = "SomeClass")] + pub fn new() -> SomeClass; + + // js_name conflicts with the getter/setter name + #[wasm_bindgen(method, getter = a, js_class = "SomeClass", js_name = b)] + pub fn c(this: &SomeClass) -> u32; + #[wasm_bindgen(method, setter = a, js_class = "SomeClass", js_name = b)] + pub fn set_c(this: &SomeClass, value: u32); +} + +#[wasm_bindgen] +pub fn exported() { + set_foo(get_foo()); + set_foo2(get_foo2()); + + let a = SomeClass::new(); + a.set_signal(a.signal()); + a.set_some_prop(a.some_prop()); + a.set_another(a.another()); + a.set_c(a.c()); + // let _ = static_signal(); +} diff --git a/crates/cli/tests/reference/import-getter-setter.wat b/crates/cli/tests/reference/import-getter-setter.wat new file mode 100644 index 00000000000..7bcb1cbffc6 --- /dev/null +++ b/crates/cli/tests/reference/import-getter-setter.wat @@ -0,0 +1,13 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $exported (;1;) (type 0)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "exported" (func $exported)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/import.d.ts b/crates/cli/tests/reference/import.d.ts new file mode 100644 index 00000000000..091dbcc51a6 --- /dev/null +++ b/crates/cli/tests/reference/import.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export function exported(): void; diff --git a/crates/cli/tests/reference/import.js b/crates/cli/tests/reference/import.js new file mode 100644 index 00000000000..5fd514c7295 --- /dev/null +++ b/crates/cli/tests/reference/import.js @@ -0,0 +1,115 @@ +import { default as default1 } from 'tests/wasm/import_class.js'; + +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_2.set(idx, obj); + return idx; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_2.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} + +export function exported() { + const ret = wasm.exported(); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} + +export function __wbg_add_7fbfb2c172506d12(arg0, arg1) { + const ret = add(arg0, arg1); + return ret; +}; + +export function __wbg_barfromfoo_29614885590bfb6f() { + bar_from_foo(); +}; + +export function __wbg_catchme_f7d87ea824a61e87() { return handleError(function () { + catch_me(); +}, arguments) }; + +export function __wbg_get_56ba567010fb9959(arg0) { + const ret = arg0.get(); + return ret; +}; + +export function __wbg_myfunction_8c7b624429f78550() { + b.my_function(); +}; + +export function __wbg_new_d21827b66c7fd25d(arg0) { + const ret = new default1(arg0); + return ret; +}; + +export function __wbg_nocatch_be850a8dddd9599d() { + no_catch(); +}; + +export function __wbg_reload_84c12f152ad689f0() { + window.location.reload(); +}; + +export function __wbg_static_accessor_CONST_9e9d5ae758197645() { + const ret = a.CONST; + return ret; +}; + +export function __wbg_write_c2ce0ce33a6087d5(arg0, arg1) { + window.document.write(getStringFromWasm0(arg0, arg1)); +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_2; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/import.rs b/crates/cli/tests/reference/import.rs new file mode 100644 index 00000000000..1299f5eaf83 --- /dev/null +++ b/crates/cli/tests/reference/import.rs @@ -0,0 +1,58 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + // Both `catch_me` and `no_catch` should be defined in the JS and invoke + // their respective JS function inside a JS shim function. This is + // important, because these 2 function may not be defined when the WASM + // module is instantiated. + #[wasm_bindgen(catch)] + fn catch_me() -> Result<(), JsValue>; + fn no_catch(); + + // Reload needs to be passed the right `this` parameter in JS. + #[wasm_bindgen(js_namespace = ["window", "location"])] + fn reload(); + #[wasm_bindgen(js_namespace = ["window", "document"])] + fn write(s: &str); + + // module import + #[wasm_bindgen(module = "./foo.js")] + fn bar_from_foo(); + #[wasm_bindgen(inline_js = "export function add(a,b) { return a + b; }")] + fn add(a: f64, b: f64) -> f64; +} + +#[wasm_bindgen(js_namespace = ["a"])] +extern "C" { + // test that namespaces are overwritten and not inherited/concatenated + #[wasm_bindgen(js_namespace = ["b"])] + fn my_function(); + #[wasm_bindgen(thread_local_v2)] + static CONST: f64; +} + +#[wasm_bindgen(module = "tests/wasm/import_class.js")] +extern "C" { + #[wasm_bindgen(js_name = default)] + type RenamedTypes; + #[wasm_bindgen(constructor, js_class = default)] + fn new(arg: i32) -> RenamedTypes; + #[wasm_bindgen(method, js_class = default)] + fn get(this: &RenamedTypes) -> i32; +} + +#[wasm_bindgen] +pub fn exported() -> Result<(), JsValue> { + bar_from_foo(); + let _ = add(CONST.with(Clone::clone), 2.0); + reload(); + write(""); + no_catch(); + my_function(); + + let f = RenamedTypes::new(1); + assert_eq!(f.get(), 2); + + catch_me() +} diff --git a/crates/cli/tests/reference/import.wat b/crates/cli/tests/reference/import.wat new file mode 100644 index 00000000000..506e67cca2b --- /dev/null +++ b/crates/cli/tests/reference/import.wat @@ -0,0 +1,22 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (type (;2;) (func (result i32 i32))) + (type (;3;) (func (param i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbindgen_exn_store (;1;) (type 3) (param i32)) + (func $__externref_table_dealloc (;2;) (type 3) (param i32)) + (func $"exported multivalue shim" (;3;) (type 2) (result i32 i32)) + (func $__externref_table_alloc (;4;) (type 1) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "exported" (func $"exported multivalue shim")) + (export "__wbindgen_exn_store" (func $__wbindgen_exn_store)) + (export "__externref_table_alloc" (func $__externref_table_alloc)) + (export "__wbindgen_export_2" (table 0)) + (export "__externref_table_dealloc" (func $__externref_table_dealloc)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/int128.d.ts b/crates/cli/tests/reference/int128.d.ts new file mode 100644 index 00000000000..ff5bfb22910 --- /dev/null +++ b/crates/cli/tests/reference/int128.d.ts @@ -0,0 +1,7 @@ +/* tslint:disable */ +/* eslint-disable */ +export function echo_i128(a: bigint): bigint; +export function echo_u128(a: bigint): bigint; +export function echo_option_i128(a?: bigint | null): bigint | undefined; +export function echo_option_u128(a?: bigint | null): bigint | undefined; +export function throw_i128(): bigint; diff --git a/crates/cli/tests/reference/int128.js b/crates/cli/tests/reference/int128.js new file mode 100644 index 00000000000..32de778621c --- /dev/null +++ b/crates/cli/tests/reference/int128.js @@ -0,0 +1,95 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} +/** + * @param {bigint} a + * @returns {bigint} + */ +export function echo_i128(a) { + const ret = wasm.echo_i128(a, a >> BigInt(64)); + return (BigInt.asUintN(64, ret[0]) | (ret[1] << BigInt(64))); +} + +/** + * @param {bigint} a + * @returns {bigint} + */ +export function echo_u128(a) { + const ret = wasm.echo_u128(a, a >> BigInt(64)); + return (BigInt.asUintN(64, ret[0]) | (BigInt.asUintN(64, ret[1]) << BigInt(64))); +} + +function isLikeNone(x) { + return x === undefined || x === null; +} +/** + * @param {bigint | null} [a] + * @returns {bigint | undefined} + */ +export function echo_option_i128(a) { + const ret = wasm.echo_option_i128(!isLikeNone(a), isLikeNone(a) ? BigInt(0) : a, isLikeNone(a) ? BigInt(0) : a >> BigInt(64)); + return ret[0] === 0 ? undefined : (BigInt.asUintN(64, ret[1]) | (ret[2] << BigInt(64))); +} + +/** + * @param {bigint | null} [a] + * @returns {bigint | undefined} + */ +export function echo_option_u128(a) { + const ret = wasm.echo_option_u128(!isLikeNone(a), isLikeNone(a) ? BigInt(0) : a, isLikeNone(a) ? BigInt(0) : a >> BigInt(64)); + return ret[0] === 0 ? undefined : (BigInt.asUintN(64, ret[1]) | (BigInt.asUintN(64, ret[2]) << BigInt(64))); +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_0.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +/** + * @returns {bigint} + */ +export function throw_i128() { + const ret = wasm.throw_i128(); + if (ret[3]) { + throw takeFromExternrefTable0(ret[2]); + } + return (BigInt.asUintN(64, ret[0]) | (ret[1] << BigInt(64))); +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/int128.rs b/crates/cli/tests/reference/int128.rs new file mode 100644 index 00000000000..350faa34a43 --- /dev/null +++ b/crates/cli/tests/reference/int128.rs @@ -0,0 +1,28 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn echo_i128(a: i128) -> i128 { + a +} +#[wasm_bindgen] +pub fn echo_u128(a: u128) -> u128 { + a +} + +#[wasm_bindgen] +pub fn echo_option_i128(a: Option) -> Option { + a +} +#[wasm_bindgen] +pub fn echo_option_u128(a: Option) -> Option { + a +} + +#[wasm_bindgen] +pub fn throw_i128() -> Result { + Ok(0_i128) +} +// #[wasm_bindgen] +// pub fn throw_option_i128() -> Result, JsError> { +// Ok(None) +// } diff --git a/crates/cli/tests/reference/int128.wat b/crates/cli/tests/reference/int128.wat new file mode 100644 index 00000000000..5aa13f6f694 --- /dev/null +++ b/crates/cli/tests/reference/int128.wat @@ -0,0 +1,27 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i64 i64 i32 i32))) + (type (;2;) (func (param i32))) + (type (;3;) (func (param i32 i64 i64) (result i32 i64 i64))) + (type (;4;) (func (param i64 i64) (result i64 i64))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__externref_table_dealloc (;1;) (type 2) (param i32)) + (func $"echo_option_i128 multivalue shim" (;2;) (type 3) (param i32 i64 i64) (result i32 i64 i64)) + (func $"echo_option_u128 multivalue shim" (;3;) (type 3) (param i32 i64 i64) (result i32 i64 i64)) + (func $"throw_i128 multivalue shim" (;4;) (type 1) (result i64 i64 i32 i32)) + (func $"echo_i128 multivalue shim" (;5;) (type 4) (param i64 i64) (result i64 i64)) + (func $"echo_u128 multivalue shim" (;6;) (type 4) (param i64 i64) (result i64 i64)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "echo_i128" (func $"echo_i128 multivalue shim")) + (export "echo_u128" (func $"echo_u128 multivalue shim")) + (export "echo_option_i128" (func $"echo_option_i128 multivalue shim")) + (export "echo_option_u128" (func $"echo_option_u128 multivalue shim")) + (export "throw_i128" (func $"throw_i128 multivalue shim")) + (export "__wbindgen_export_0" (table 0)) + (export "__externref_table_dealloc" (func $__externref_table_dealloc)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/interface-types-anyref.rs b/crates/cli/tests/reference/interface-types-anyref.rs deleted file mode 100644 index 86fb2b93dec..00000000000 --- a/crates/cli/tests/reference/interface-types-anyref.rs +++ /dev/null @@ -1,8 +0,0 @@ -// interface-types - -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -pub fn externref_in_out(a: &JsValue, b: JsValue) -> JsValue { - b -} diff --git a/crates/cli/tests/reference/interface-types-anyref.wat b/crates/cli/tests/reference/interface-types-anyref.wat deleted file mode 100644 index 09f1584537c..00000000000 --- a/crates/cli/tests/reference/interface-types-anyref.wat +++ /dev/null @@ -1,12 +0,0 @@ -(module - (type (;0;) (func (param externref externref) (result externref))) - (func $#func0 (@name "externref_in_out externref shim") (type 0) (param externref externref) (result externref)) - (memory (;0;) 17) - (export "memory" (memory 0)) - (export "externref_in_out" (func $#func0)) - (@interface type (;0;) (func (param externref) (param externref) (result externref))) - (@interface func (;0;) (type 0) - arg.get 0 - arg.get 1 - call-core $#func0) - (@interface export "externref_in_out" (func 0))) diff --git a/crates/cli/tests/reference/interface-types-empty.wat b/crates/cli/tests/reference/interface-types-empty.wat deleted file mode 100644 index 256b406f947..00000000000 --- a/crates/cli/tests/reference/interface-types-empty.wat +++ /dev/null @@ -1,10 +0,0 @@ -(module - (type (;0;) (func)) - (func $empty (type 0)) - (memory (;0;) 17) - (export "memory" (memory 0)) - (export "empty" (func $empty)) - (@interface type (;0;) (func)) - (@interface func (;0;) (type 0) - call-core $empty) - (@interface export "empty" (func 0))) diff --git a/crates/cli/tests/reference/interface-types-integers.rs b/crates/cli/tests/reference/interface-types-integers.rs deleted file mode 100644 index f5016b31bec..00000000000 --- a/crates/cli/tests/reference/interface-types-integers.rs +++ /dev/null @@ -1,46 +0,0 @@ -// interface-types - -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -pub fn integers(_a1: u8, _a2: i8, _a3: u16, _a4: i16, _a5: u32, _a6: i32, _a7: f32, _a8: f64) {} - -#[wasm_bindgen] -pub fn ret_i8() -> i8 { - 0 -} - -#[wasm_bindgen] -pub fn ret_u8() -> u8 { - 1 -} - -#[wasm_bindgen] -pub fn ret_i16() -> i16 { - 2 -} - -#[wasm_bindgen] -pub fn ret_u16() -> u16 { - 3 -} - -#[wasm_bindgen] -pub fn ret_i32() -> i32 { - 4 -} - -#[wasm_bindgen] -pub fn ret_u32() -> u32 { - 5 -} - -#[wasm_bindgen] -pub fn ret_f32() -> f32 { - 6.0 -} - -#[wasm_bindgen] -pub fn ret_f64() -> f64 { - 7.0 -} diff --git a/crates/cli/tests/reference/interface-types-integers.wat b/crates/cli/tests/reference/interface-types-integers.wat deleted file mode 100644 index e00118c037f..00000000000 --- a/crates/cli/tests/reference/interface-types-integers.wat +++ /dev/null @@ -1,81 +0,0 @@ -(module - (type (;0;) (func (result i32))) - (type (;1;) (func (result f32))) - (type (;2;) (func (result f64))) - (type (;3;) (func (param i32 i32 i32 i32 i32 i32 f32 f64))) - (func $integers (type 3) (param i32 i32 i32 i32 i32 i32 f32 f64)) - (func $ret_i8 (type 0) (result i32)) - (func $ret_u8 (type 0) (result i32)) - (func $ret_i16 (type 0) (result i32)) - (func $ret_u16 (type 0) (result i32)) - (func $ret_i32 (type 0) (result i32)) - (func $ret_u32 (type 0) (result i32)) - (func $ret_f32 (type 1) (result f32)) - (func $ret_f64 (type 2) (result f64)) - (memory (;0;) 17) - (export "memory" (memory 0)) - (export "integers" (func $integers)) - (export "ret_i8" (func $ret_i8)) - (export "ret_u8" (func $ret_u8)) - (export "ret_i16" (func $ret_i16)) - (export "ret_u16" (func $ret_u16)) - (export "ret_i32" (func $ret_i32)) - (export "ret_u32" (func $ret_u32)) - (export "ret_f32" (func $ret_f32)) - (export "ret_f64" (func $ret_f64)) - (@interface type (;0;) (func (param u8) (param s8) (param u16) (param s16) (param u32) (param s32) (param f32) (param f64))) - (@interface type (;1;) (func (result s8))) - (@interface type (;2;) (func (result u8))) - (@interface type (;3;) (func (result s16))) - (@interface type (;4;) (func (result u16))) - (@interface type (;5;) (func (result s32))) - (@interface type (;6;) (func (result u32))) - (@interface type (;7;) (func (result f32))) - (@interface type (;8;) (func (result f64))) - (@interface func (;0;) (type 0) - arg.get 0 - u8-to-i32 - arg.get 1 - s8-to-i32 - arg.get 2 - u16-to-i32 - arg.get 3 - s16-to-i32 - arg.get 4 - u32-to-i32 - arg.get 5 - s32-to-i32 - arg.get 6 - arg.get 7 - call-core $integers) - (@interface func (;1;) (type 1) - call-core $ret_i8 - i32-to-s8) - (@interface func (;2;) (type 2) - call-core $ret_u8 - i32-to-u8) - (@interface func (;3;) (type 3) - call-core $ret_i16 - i32-to-s16) - (@interface func (;4;) (type 4) - call-core $ret_u16 - i32-to-u16) - (@interface func (;5;) (type 5) - call-core $ret_i32 - i32-to-s32) - (@interface func (;6;) (type 6) - call-core $ret_u32 - i32-to-u32) - (@interface func (;7;) (type 7) - call-core $ret_f32) - (@interface func (;8;) (type 8) - call-core $ret_f64) - (@interface export "integers" (func 0)) - (@interface export "ret_i8" (func 1)) - (@interface export "ret_u8" (func 2)) - (@interface export "ret_i16" (func 3)) - (@interface export "ret_u16" (func 4)) - (@interface export "ret_i32" (func 5)) - (@interface export "ret_u32" (func 6)) - (@interface export "ret_f32" (func 7)) - (@interface export "ret_f64" (func 8))) diff --git a/crates/cli/tests/reference/interface-types-interop.rs b/crates/cli/tests/reference/interface-types-interop.rs deleted file mode 100644 index 191426d54a6..00000000000 --- a/crates/cli/tests/reference/interface-types-interop.rs +++ /dev/null @@ -1,8 +0,0 @@ -// interface-types - -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -pub fn take_and_return(a: u8) -> u16 { - a.into() -} diff --git a/crates/cli/tests/reference/interface-types-interop.wat b/crates/cli/tests/reference/interface-types-interop.wat deleted file mode 100644 index 193b8f18e23..00000000000 --- a/crates/cli/tests/reference/interface-types-interop.wat +++ /dev/null @@ -1,13 +0,0 @@ -(module - (type (;0;) (func (param i32) (result i32))) - (func $take_and_return (type 0) (param i32) (result i32)) - (memory (;0;) 17) - (export "memory" (memory 0)) - (export "take_and_return" (func $take_and_return)) - (@interface type (;0;) (func (param u8) (result u16))) - (@interface func (;0;) (type 0) - arg.get 0 - u8-to-i32 - call-core $take_and_return - i32-to-u16) - (@interface export "take_and_return" (func 0))) diff --git a/crates/cli/tests/reference/interface-types-strings.rs b/crates/cli/tests/reference/interface-types-strings.rs deleted file mode 100644 index d7a67f0f20e..00000000000 --- a/crates/cli/tests/reference/interface-types-strings.rs +++ /dev/null @@ -1,11 +0,0 @@ -// interface-types - -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -pub fn strings(a: &str) -> String { - String::new() -} - -#[wasm_bindgen] -pub fn many_strings(a: &str, b: String) {} diff --git a/crates/cli/tests/reference/interface-types-strings.wat b/crates/cli/tests/reference/interface-types-strings.wat deleted file mode 100644 index ddb2ce3d951..00000000000 --- a/crates/cli/tests/reference/interface-types-strings.wat +++ /dev/null @@ -1,29 +0,0 @@ -(module - (type (;0;) (func (param i32) (result i32))) - (type (;1;) (func (param i32 i32))) - (type (;2;) (func (param i32 i32) (result i32 i32))) - (type (;3;) (func (param i32 i32 i32 i32))) - (func $__wbindgen_malloc (type 0) (param i32) (result i32)) - (func $many_strings (type 3) (param i32 i32 i32 i32)) - (func $__wbindgen_free (type 1) (param i32 i32)) - (func $#func3 (@name "strings multivalue shim") (type 2) (param i32 i32) (result i32 i32)) - (memory (;0;) 17) - (export "memory" (memory 0)) - (export "strings" (func $#func3)) - (export "many_strings" (func $many_strings)) - (@interface type (;0;) (func (param string) (result string))) - (@interface type (;1;) (func (param string) (param string))) - (@interface func (;0;) (type 0) - arg.get 0 - string-to-memory $__wbindgen_malloc - call-core $#func3 - defer-call-core $__wbindgen_free - memory-to-string) - (@interface func (;1;) (type 1) - arg.get 0 - string-to-memory $__wbindgen_malloc - arg.get 1 - string-to-memory $__wbindgen_malloc - call-core $many_strings) - (@interface export "strings" (func 0)) - (@interface export "many_strings" (func 1))) diff --git a/crates/cli/tests/reference/intrinsic-only.d.ts b/crates/cli/tests/reference/intrinsic-only.d.ts new file mode 100644 index 00000000000..bb95c9509da --- /dev/null +++ b/crates/cli/tests/reference/intrinsic-only.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export function causes_error(): number; diff --git a/crates/cli/tests/reference/intrinsic-only.js b/crates/cli/tests/reference/intrinsic-only.js new file mode 100644 index 00000000000..26525348f80 --- /dev/null +++ b/crates/cli/tests/reference/intrinsic-only.js @@ -0,0 +1,57 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_0.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +/** + * @returns {number} + */ +export function causes_error() { + const ret = wasm.causes_error(); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return ret[0]; +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/intrinsic-only.rs b/crates/cli/tests/reference/intrinsic-only.rs new file mode 100644 index 00000000000..2dc264ef2b4 --- /dev/null +++ b/crates/cli/tests/reference/intrinsic-only.rs @@ -0,0 +1,6 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn causes_error() -> Result { + Ok(1.0) +} diff --git a/crates/cli/tests/reference/intrinsic-only.wat b/crates/cli/tests/reference/intrinsic-only.wat new file mode 100644 index 00000000000..8f0b95f09dc --- /dev/null +++ b/crates/cli/tests/reference/intrinsic-only.wat @@ -0,0 +1,17 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result f64 i32 i32))) + (type (;2;) (func (param i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__externref_table_dealloc (;1;) (type 2) (param i32)) + (func $"causes_error multivalue shim" (;2;) (type 1) (result f64 i32 i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "causes_error" (func $"causes_error multivalue shim")) + (export "__wbindgen_export_0" (table 0)) + (export "__externref_table_dealloc" (func $__externref_table_dealloc)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/keyword.d.ts b/crates/cli/tests/reference/keyword.d.ts new file mode 100644 index 00000000000..4bc758e17b7 --- /dev/null +++ b/crates/cli/tests/reference/keyword.d.ts @@ -0,0 +1,6 @@ +/* tslint:disable */ +/* eslint-disable */ +export function exported(): void; +export function _function(): void; +export function _var(): void; +export function weird_arguments(_new: number, _var: number, _switch: number, _default: number, _arguments: number): void; diff --git a/crates/cli/tests/reference/keyword.js b/crates/cli/tests/reference/keyword.js new file mode 100644 index 00000000000..bfda76214e4 --- /dev/null +++ b/crates/cli/tests/reference/keyword.js @@ -0,0 +1,91 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +export function exported() { + wasm.exported(); +} + +export function _function() { + wasm._function(); +} + +export function _var() { + wasm._var(); +} + +/** + * @param {number} _new + * @param {number} _var + * @param {number} _switch + * @param {number} _default + * @param {number} _arguments + */ +export function weird_arguments(_new, _var, _switch, _default, _arguments) { + wasm.weird_arguments(_new, _var, _switch, _default, _arguments); +} + +export function __wbg_await_e0a0e75be8b6fef6() { + await(); +}; + +export function __wbg_let_8d461e9e0592bd8c(arg0) { + arg0.let(); +}; + +export function __wbg_new_4b026aaf1c1e4438() { + const ret = A.new(); + return ret; +}; + +export function __wbg_new_d4bfd9add722b492() { + const ret = window.__TAURI__.menu.Menu.new(); + return ret; +}; + +export function __wbg_new_e17dd7c5a1cd57d8() { + B.new(); +}; + +export function __wbg_static_accessor_TRUE_c6b68bf8545d99a3() { + const ret = true; + return ret; +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/keyword.rs b/crates/cli/tests/reference/keyword.rs new file mode 100644 index 00000000000..ee1393b6ff2 --- /dev/null +++ b/crates/cli/tests/reference/keyword.rs @@ -0,0 +1,57 @@ +use wasm_bindgen::prelude::*; + +// Imports with keywords + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen] + pub type A; + + #[wasm_bindgen(static_method_of = A, js_name = "new")] + pub fn static_new() -> A; + #[wasm_bindgen(js_namespace = ["B"], js_name = "new")] + pub fn namespace_new(); + + #[wasm_bindgen(method, js_name = "let")] + pub fn keyword_let(ptr: &A); + + // await is not a reserved keyword in JS + pub fn r#await(); + + // true & false are reserved keywords in JS, but we allow them anyway + #[wasm_bindgen(thread_local_v2, js_name = "true")] + static TRUE: JsValue; +} + +// https://github.com/rustwasm/wasm-bindgen/issues/4317 +#[wasm_bindgen(js_namespace = ["window", "__TAURI__", "menu"])] +extern "C" { + #[wasm_bindgen] + pub type Menu; + + #[wasm_bindgen(static_method_of = Menu)] + pub fn new() -> Menu; +} + +// This function ensures the imported stuff isn't optimized out +#[wasm_bindgen] +pub fn exported() { + let a = A::static_new(); + let _ = a.keyword_let(); + let _ = namespace_new(); + let _ = r#await(); + std::hint::black_box(&TRUE); + + let _ = Menu::new(); +} + +// Exports with keywords that we allow and are renamed automatically. + +#[wasm_bindgen] +pub fn function() {} + +#[wasm_bindgen(js_name = "var")] +pub fn sane_name() {} + +#[wasm_bindgen] +pub fn weird_arguments(new: u32, var: u32, r#switch: u32, default: u32, arguments: u32) {} diff --git a/crates/cli/tests/reference/keyword.wat b/crates/cli/tests/reference/keyword.wat new file mode 100644 index 00000000000..41921ddfb93 --- /dev/null +++ b/crates/cli/tests/reference/keyword.wat @@ -0,0 +1,20 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32 i32 i32 i32 i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $weird_arguments (;1;) (type 1) (param i32 i32 i32 i32 i32)) + (func $exported (;2;) (type 0)) + (func $_function (;3;) (type 0)) + (func $_var (;4;) (type 0)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "exported" (func $exported)) + (export "_function" (func $_function)) + (export "_var" (func $_var)) + (export "weird_arguments" (func $weird_arguments)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/modules.d.ts b/crates/cli/tests/reference/modules.d.ts new file mode 100644 index 00000000000..091dbcc51a6 --- /dev/null +++ b/crates/cli/tests/reference/modules.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export function exported(): void; diff --git a/crates/cli/tests/reference/modules.js b/crates/cli/tests/reference/modules.js new file mode 100644 index 00000000000..ed323e4f0a9 --- /dev/null +++ b/crates/cli/tests/reference/modules.js @@ -0,0 +1,60 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +export function exported() { + wasm.exported(); +} + +export function __wbg_parseFloat_2be7f01c31025438(arg0, arg1) { + const ret = parseFloat(getStringFromWasm0(arg0, arg1)); + return ret; +}; + +export function __wbg_parseFloat_7bc8aecd47f33642(arg0) { + const ret = parseFloat(arg0); + return ret; +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_string_new(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return ret; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/modules.rs b/crates/cli/tests/reference/modules.rs new file mode 100644 index 00000000000..79a9384dfc5 --- /dev/null +++ b/crates/cli/tests/reference/modules.rs @@ -0,0 +1,38 @@ +use wasm_bindgen::prelude::*; + +mod a { + use wasm_bindgen::prelude::*; + + #[wasm_bindgen] + extern "C" { + #[wasm_bindgen(js_name = parseFloat)] + pub fn parse_float(text: &JsValue) -> f64; + } +} + +mod b { + use wasm_bindgen::prelude::*; + + #[wasm_bindgen] + extern "C" { + #[wasm_bindgen(js_name = parseFloat)] + pub fn parse_float(text: &str) -> f64; + } +} + +mod a_again { + use wasm_bindgen::prelude::*; + + #[wasm_bindgen] + extern "C" { + #[wasm_bindgen(js_name = parseFloat)] + pub fn parse_float(text: &JsValue) -> f64; + } +} + +#[wasm_bindgen] +pub fn exported() { + let _ = a::parse_float(&JsValue::from_str("3.14")); + let _ = b::parse_float("3.14"); + let _ = a_again::parse_float(&JsValue::from_str("3.14")); +} diff --git a/crates/cli/tests/reference/modules.wat b/crates/cli/tests/reference/modules.wat new file mode 100644 index 00000000000..7bcb1cbffc6 --- /dev/null +++ b/crates/cli/tests/reference/modules.wat @@ -0,0 +1,13 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $exported (;1;) (type 0)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "exported" (func $exported)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/nop.d.ts b/crates/cli/tests/reference/nop.d.ts index c285bc0f2f6..be1200f247d 100644 --- a/crates/cli/tests/reference/nop.d.ts +++ b/crates/cli/tests/reference/nop.d.ts @@ -1,5 +1,3 @@ /* tslint:disable */ /* eslint-disable */ -/** -*/ export function nop(): void; diff --git a/crates/cli/tests/reference/nop.js b/crates/cli/tests/reference/nop.js index edac6e410e5..39f2a0fb3b1 100644 --- a/crates/cli/tests/reference/nop.js +++ b/crates/cli/tests/reference/nop.js @@ -1,8 +1,21 @@ -import * as wasm from './reference_test_bg.wasm'; +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + -/** -*/ export function nop() { wasm.nop(); } +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + diff --git a/crates/cli/tests/reference/nop.wat b/crates/cli/tests/reference/nop.wat index 4ec164815de..8c1452177ae 100644 --- a/crates/cli/tests/reference/nop.wat +++ b/crates/cli/tests/reference/nop.wat @@ -1,6 +1,13 @@ -(module +(module $reference_test.wasm (type (;0;) (func)) - (func $nop (type 0)) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $nop (;1;) (type 0)) + (table (;0;) 128 externref) (memory (;0;) 17) (export "memory" (memory 0)) - (export "nop" (func $nop))) + (export "nop" (func $nop)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/optional-args.d.ts b/crates/cli/tests/reference/optional-args.d.ts new file mode 100644 index 00000000000..4f156949356 --- /dev/null +++ b/crates/cli/tests/reference/optional-args.d.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +/* eslint-disable */ +export function all_optional(a?: number | null, b?: number | null, c?: number | null): void; +export function some_optional(a: number | null | undefined, b: number, c?: number | null): void; diff --git a/crates/cli/tests/reference/optional-args.js b/crates/cli/tests/reference/optional-args.js new file mode 100644 index 00000000000..43ead5d86c1 --- /dev/null +++ b/crates/cli/tests/reference/optional-args.js @@ -0,0 +1,38 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +function isLikeNone(x) { + return x === undefined || x === null; +} +/** + * @param {number | null} [a] + * @param {number | null} [b] + * @param {number | null} [c] + */ +export function all_optional(a, b, c) { + wasm.all_optional(isLikeNone(a) ? 0x100000001 : (a) >>> 0, isLikeNone(b) ? 0x100000001 : (b) >>> 0, isLikeNone(c) ? 0x100000001 : (c) >>> 0); +} + +/** + * @param {number | null | undefined} a + * @param {number} b + * @param {number | null} [c] + */ +export function some_optional(a, b, c) { + wasm.some_optional(isLikeNone(a) ? 0x100000001 : (a) >>> 0, b, isLikeNone(c) ? 0x100000001 : (c) >>> 0); +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + diff --git a/crates/cli/tests/reference/optional-args.rs b/crates/cli/tests/reference/optional-args.rs new file mode 100644 index 00000000000..bbc0fa81e39 --- /dev/null +++ b/crates/cli/tests/reference/optional-args.rs @@ -0,0 +1,7 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn all_optional(a: Option, b: Option, c: Option) {} + +#[wasm_bindgen] +pub fn some_optional(a: Option, b: u32, c: Option) {} diff --git a/crates/cli/tests/reference/optional-args.wat b/crates/cli/tests/reference/optional-args.wat new file mode 100644 index 00000000000..a0f6061efbe --- /dev/null +++ b/crates/cli/tests/reference/optional-args.wat @@ -0,0 +1,17 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param f64 i32 f64))) + (type (;2;) (func (param f64 f64 f64))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $all_optional (;1;) (type 2) (param f64 f64 f64)) + (func $some_optional (;2;) (type 1) (param f64 i32 f64)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "all_optional" (func $all_optional)) + (export "some_optional" (func $some_optional)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/pointers.d.ts b/crates/cli/tests/reference/pointers.d.ts new file mode 100644 index 00000000000..314eae5938b --- /dev/null +++ b/crates/cli/tests/reference/pointers.d.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +/* eslint-disable */ +export function const_pointer(input: number): number; +export function mut_pointer(input: number): number; diff --git a/crates/cli/tests/reference/pointers.js b/crates/cli/tests/reference/pointers.js new file mode 100644 index 00000000000..3b971fd408e --- /dev/null +++ b/crates/cli/tests/reference/pointers.js @@ -0,0 +1,34 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + +/** + * @param {number} input + * @returns {number} + */ +export function const_pointer(input) { + const ret = wasm.const_pointer(input); + return ret >>> 0; +} + +/** + * @param {number} input + * @returns {number} + */ +export function mut_pointer(input) { + const ret = wasm.mut_pointer(input); + return ret >>> 0; +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + diff --git a/crates/cli/tests/reference/pointers.rs b/crates/cli/tests/reference/pointers.rs new file mode 100644 index 00000000000..ecee8167070 --- /dev/null +++ b/crates/cli/tests/reference/pointers.rs @@ -0,0 +1,11 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn const_pointer(input: *const u8) -> *const u8 { + u32::MAX as *const _ +} + +#[wasm_bindgen] +pub fn mut_pointer(input: *mut u8) -> *mut u8 { + u32::MAX as *mut _ +} diff --git a/crates/cli/tests/reference/pointers.wat b/crates/cli/tests/reference/pointers.wat new file mode 100644 index 00000000000..811cd77533f --- /dev/null +++ b/crates/cli/tests/reference/pointers.wat @@ -0,0 +1,16 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32) (result i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $const_pointer (;1;) (type 1) (param i32) (result i32)) + (func $mut_pointer (;2;) (type 1) (param i32) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "const_pointer" (func $const_pointer)) + (export "mut_pointer" (func $mut_pointer)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/raw.d.ts b/crates/cli/tests/reference/raw.d.ts new file mode 100644 index 00000000000..b28681c178f --- /dev/null +++ b/crates/cli/tests/reference/raw.d.ts @@ -0,0 +1,9 @@ +/* tslint:disable */ +/* eslint-disable */ +export function test1(test: number): number; +export class Test { + private constructor(); + free(): void; + static test1(test: number): Test; + test2(test: number): void; +} diff --git a/crates/cli/tests/reference/raw.js b/crates/cli/tests/reference/raw.js new file mode 100644 index 00000000000..4e9035bbf26 --- /dev/null +++ b/crates/cli/tests/reference/raw.js @@ -0,0 +1,90 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} +/** + * @param {number} test + * @returns {number} + */ +export function test1(test) { + const ret = wasm.test1(test); + return ret >>> 0; +} + +const TestFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_test_free(ptr >>> 0, 1)); + +export class Test { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(Test.prototype); + obj.__wbg_ptr = ptr; + TestFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + TestFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_test_free(ptr, 0); + } + /** + * @param {number} test + * @returns {Test} + */ + static test1(test) { + const ret = wasm.test_test1(test); + return Test.__wrap(ret); + } + /** + * @param {number} test + */ + test2(test) { + wasm.test_test2(this.__wbg_ptr, test); + } +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/raw.rs b/crates/cli/tests/reference/raw.rs new file mode 100644 index 00000000000..7c49eba5b04 --- /dev/null +++ b/crates/cli/tests/reference/raw.rs @@ -0,0 +1,24 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn r#test1(r#test: u32) -> u32 { + r#test2(); + r#test +} + +#[wasm_bindgen] +pub struct r#Test; + +#[wasm_bindgen] +impl r#Test { + pub fn r#test1(r#test: u32) -> Self { + Self + } + + pub fn r#test2(&self, r#test: u32) {} +} + +#[wasm_bindgen(module = "test")] +extern "C" { + fn r#test2() -> JsValue; +} diff --git a/crates/cli/tests/reference/raw.wat b/crates/cli/tests/reference/raw.wat new file mode 100644 index 00000000000..4c784dcfcbc --- /dev/null +++ b/crates/cli/tests/reference/raw.wat @@ -0,0 +1,21 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32) (result i32))) + (type (;2;) (func (param i32 i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $test_test2 (;1;) (type 2) (param i32 i32)) + (func $test1 (;2;) (type 1) (param i32) (result i32)) + (func $test_test1 (;3;) (type 1) (param i32) (result i32)) + (func $__wbg_test_free (;4;) (type 2) (param i32 i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "test1" (func $test1)) + (export "__wbg_test_free" (func $__wbg_test_free)) + (export "test_test1" (func $test_test1)) + (export "test_test2" (func $test_test2)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/result-string.d.ts b/crates/cli/tests/reference/result-string.d.ts deleted file mode 100644 index 50967eed5cf..00000000000 --- a/crates/cli/tests/reference/result-string.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** -* @returns {string} -*/ -export function exported(): string; diff --git a/crates/cli/tests/reference/result-string.js b/crates/cli/tests/reference/result-string.js deleted file mode 100644 index 02f56599e24..00000000000 --- a/crates/cli/tests/reference/result-string.js +++ /dev/null @@ -1,85 +0,0 @@ -import * as wasm from './reference_test_bg.wasm'; - -const heap = new Array(32).fill(undefined); - -heap.push(undefined, null, true, false); - -let heap_next = heap.length; - -function addHeapObject(obj) { - if (heap_next === heap.length) heap.push(heap.length + 1); - const idx = heap_next; - heap_next = heap[idx]; - - heap[idx] = obj; - return idx; -} - -let cachegetInt32Memory0 = null; -function getInt32Memory0() { - if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { - cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); - } - return cachegetInt32Memory0; -} - -function getObject(idx) { return heap[idx]; } - -function dropObject(idx) { - if (idx < 36) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} - -const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; - -let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); - -cachedTextDecoder.decode(); - -let cachegetUint8Memory0 = null; -function getUint8Memory0() { - if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { - cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); - } - return cachegetUint8Memory0; -} - -function getStringFromWasm0(ptr, len) { - return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); -} -/** -* @returns {string} -*/ -export function exported() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.exported(retptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var r2 = getInt32Memory0()[retptr / 4 + 2]; - var r3 = getInt32Memory0()[retptr / 4 + 3]; - var ptr0 = r0; - var len0 = r1; - if (r3) { - ptr0 = 0; len0 = 0; - throw takeObject(r2); - } - return getStringFromWasm0(ptr0, len0); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(ptr0, len0); - } -} - -export function __wbindgen_number_new(arg0) { - const ret = arg0; - return addHeapObject(ret); -}; - diff --git a/crates/cli/tests/reference/result-string.rs b/crates/cli/tests/reference/result-string.rs deleted file mode 100644 index eb965cbde2b..00000000000 --- a/crates/cli/tests/reference/result-string.rs +++ /dev/null @@ -1,6 +0,0 @@ -use wasm_bindgen::prelude::*; - -#[wasm_bindgen] -pub fn exported() -> Result { - Err(JsValue::from(5i32)) -} diff --git a/crates/cli/tests/reference/result-string.wat b/crates/cli/tests/reference/result-string.wat deleted file mode 100644 index efe5e65189c..00000000000 --- a/crates/cli/tests/reference/result-string.wat +++ /dev/null @@ -1,12 +0,0 @@ -(module - (type (;0;) (func (param i32))) - (type (;1;) (func (param i32) (result i32))) - (type (;2;) (func (param i32 i32))) - (func $exported (type 0) (param i32)) - (func $__wbindgen_free (type 2) (param i32 i32)) - (func $__wbindgen_add_to_stack_pointer (type 1) (param i32) (result i32)) - (memory (;0;) 17) - (export "memory" (memory 0)) - (export "exported" (func $exported)) - (export "__wbindgen_add_to_stack_pointer" (func $__wbindgen_add_to_stack_pointer)) - (export "__wbindgen_free" (func $__wbindgen_free))) diff --git a/crates/cli/tests/reference/result.d.ts b/crates/cli/tests/reference/result.d.ts new file mode 100644 index 00000000000..b2cb99de65e --- /dev/null +++ b/crates/cli/tests/reference/result.d.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export function result_string(): string; +export function result_void(): void; +export function result_i32(): number; diff --git a/crates/cli/tests/reference/result.js b/crates/cli/tests/reference/result.js new file mode 100644 index 00000000000..ddc18ed8148 --- /dev/null +++ b/crates/cli/tests/reference/result.js @@ -0,0 +1,96 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_0.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +/** + * @returns {string} + */ +export function result_string() { + let deferred2_0; + let deferred2_1; + try { + const ret = wasm.result_string(); + var ptr1 = ret[0]; + var len1 = ret[1]; + if (ret[3]) { + ptr1 = 0; len1 = 0; + throw takeFromExternrefTable0(ret[2]); + } + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); + } finally { + wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); + } +} + +export function result_void() { + const ret = wasm.result_void(); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} + +/** + * @returns {number} + */ +export function result_i32() { + const ret = wasm.result_i32(); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return ret[0]; +} + +export function __wbindgen_error_new(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return ret; +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_number_new(arg0) { + const ret = arg0; + return ret; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/result.rs b/crates/cli/tests/reference/result.rs new file mode 100644 index 00000000000..2ac0ba0d977 --- /dev/null +++ b/crates/cli/tests/reference/result.rs @@ -0,0 +1,16 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn result_string() -> Result { + Err(JsValue::from(5i32)) +} + +#[wasm_bindgen] +pub fn result_void() -> Result<(), JsError> { + Err(JsError::new("message")) +} + +#[wasm_bindgen] +pub fn result_i32() -> Result { + Ok(1) +} diff --git a/crates/cli/tests/reference/result.wat b/crates/cli/tests/reference/result.wat new file mode 100644 index 00000000000..58a6e0deb13 --- /dev/null +++ b/crates/cli/tests/reference/result.wat @@ -0,0 +1,26 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32 i32))) + (type (;2;) (func (result i32 i32 i32))) + (type (;3;) (func (result i32 i32 i32 i32))) + (type (;4;) (func (param i32))) + (type (;5;) (func (param i32 i32 i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__externref_table_dealloc (;1;) (type 4) (param i32)) + (func $__wbindgen_free (;2;) (type 5) (param i32 i32 i32)) + (func $"result_string multivalue shim" (;3;) (type 3) (result i32 i32 i32 i32)) + (func $"result_i32 multivalue shim" (;4;) (type 2) (result i32 i32 i32)) + (func $"result_void multivalue shim" (;5;) (type 1) (result i32 i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "result_string" (func $"result_string multivalue shim")) + (export "result_void" (func $"result_void multivalue shim")) + (export "result_i32" (func $"result_i32 multivalue shim")) + (export "__wbindgen_export_0" (table 0)) + (export "__externref_table_dealloc" (func $__externref_table_dealloc)) + (export "__wbindgen_free" (func $__wbindgen_free)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/self-type.d.ts b/crates/cli/tests/reference/self-type.d.ts new file mode 100644 index 00000000000..b2e2f6e7f85 --- /dev/null +++ b/crates/cli/tests/reference/self-type.d.ts @@ -0,0 +1,12 @@ +/* tslint:disable */ +/* eslint-disable */ +export class Test { + free(): void; + constructor(); + consume_self(): void; + ref_self(): void; + ref_mut_self(): void; + self_Self(): void; + self_ref_Self(): void; + self_ref_mut_Self(): void; +} diff --git a/crates/cli/tests/reference/self-type.js b/crates/cli/tests/reference/self-type.js new file mode 100644 index 00000000000..57075362366 --- /dev/null +++ b/crates/cli/tests/reference/self-type.js @@ -0,0 +1,86 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +const TestFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_test_free(ptr >>> 0, 1)); + +export class Test { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + TestFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_test_free(ptr, 0); + } + constructor() { + const ret = wasm.test_new(); + this.__wbg_ptr = ret >>> 0; + TestFinalization.register(this, this.__wbg_ptr, this); + return this; + } + consume_self() { + const ptr = this.__destroy_into_raw(); + wasm.test_consume_self(ptr); + } + ref_self() { + wasm.test_ref_self(this.__wbg_ptr); + } + ref_mut_self() { + wasm.test_ref_mut_self(this.__wbg_ptr); + } + self_Self() { + const ptr = this.__destroy_into_raw(); + wasm.test_self_Self(ptr); + } + self_ref_Self() { + wasm.test_self_ref_Self(this.__wbg_ptr); + } + self_ref_mut_Self() { + wasm.test_self_ref_mut_Self(this.__wbg_ptr); + } +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/self-type.rs b/crates/cli/tests/reference/self-type.rs new file mode 100644 index 00000000000..4ed15e88270 --- /dev/null +++ b/crates/cli/tests/reference/self-type.rs @@ -0,0 +1,20 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub struct Test; + +#[wasm_bindgen] +impl Test { + #[wasm_bindgen(constructor)] + pub fn new() -> Test { + Test + } + + pub fn consume_self(self) {} + pub fn ref_self(&self) {} + pub fn ref_mut_self(&mut self) {} + + pub fn self_Self(self: Self) {} + pub fn self_ref_Self(self: &Self) {} + pub fn self_ref_mut_Self(self: &mut Self) {} +} diff --git a/crates/cli/tests/reference/self-type.wat b/crates/cli/tests/reference/self-type.wat new file mode 100644 index 00000000000..ec0e2fdec46 --- /dev/null +++ b/crates/cli/tests/reference/self-type.wat @@ -0,0 +1,30 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (type (;2;) (func (param i32))) + (type (;3;) (func (param i32 i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $test_ref_self (;1;) (type 2) (param i32)) + (func $test_ref_mut_self (;2;) (type 2) (param i32)) + (func $test_self_ref_Self (;3;) (type 2) (param i32)) + (func $test_self_ref_mut_Self (;4;) (type 2) (param i32)) + (func $__wbg_test_free (;5;) (type 3) (param i32 i32)) + (func $test_new (;6;) (type 1) (result i32)) + (func $test_consume_self (;7;) (type 2) (param i32)) + (func $test_self_Self (;8;) (type 2) (param i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "__wbg_test_free" (func $__wbg_test_free)) + (export "test_new" (func $test_new)) + (export "test_consume_self" (func $test_consume_self)) + (export "test_ref_self" (func $test_ref_self)) + (export "test_ref_mut_self" (func $test_ref_mut_self)) + (export "test_self_Self" (func $test_self_Self)) + (export "test_self_ref_Self" (func $test_self_ref_Self)) + (export "test_self_ref_mut_Self" (func $test_self_ref_mut_Self)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/skip-jsdoc.d.ts b/crates/cli/tests/reference/skip-jsdoc.d.ts new file mode 100644 index 00000000000..0d908f65acc --- /dev/null +++ b/crates/cli/tests/reference/skip-jsdoc.d.ts @@ -0,0 +1,13 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Manually documented function + * + * @param {number} arg - This is my arg. It is mine. + * @returns to whence I came + */ +export function docme(arg: number): number; +/** + * Regular documentation. + */ +export function i_has_docs(arg: number): number; diff --git a/crates/cli/tests/reference/skip-jsdoc.js b/crates/cli/tests/reference/skip-jsdoc.js new file mode 100644 index 00000000000..1ba307bae00 --- /dev/null +++ b/crates/cli/tests/reference/skip-jsdoc.js @@ -0,0 +1,37 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + +/** + * Manually documented function + * + * @param {number} arg - This is my arg. It is mine. + * @returns to whence I came + */ +export function docme(arg) { + const ret = wasm.docme(arg); + return ret >>> 0; +} + +/** + * Regular documentation. + * @param {number} arg + * @returns {number} + */ +export function i_has_docs(arg) { + const ret = wasm.i_has_docs(arg); + return ret >>> 0; +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + diff --git a/crates/cli/tests/reference/skip-jsdoc.rs b/crates/cli/tests/reference/skip-jsdoc.rs new file mode 100644 index 00000000000..2aa14eb1359 --- /dev/null +++ b/crates/cli/tests/reference/skip-jsdoc.rs @@ -0,0 +1,16 @@ +use wasm_bindgen::prelude::*; + +/// Manually documented function +/// +/// @param {number} arg - This is my arg. It is mine. +/// @returns to whence I came +#[wasm_bindgen(skip_jsdoc)] +pub fn docme(arg: u32) -> u32 { + arg + 1 +} + +/// Regular documentation. +#[wasm_bindgen] +pub fn i_has_docs(arg: u32) -> u32 { + arg + 1 +} diff --git a/crates/cli/tests/reference/skip-jsdoc.wat b/crates/cli/tests/reference/skip-jsdoc.wat new file mode 100644 index 00000000000..99c1443aca1 --- /dev/null +++ b/crates/cli/tests/reference/skip-jsdoc.wat @@ -0,0 +1,16 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32) (result i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $docme (;1;) (type 1) (param i32) (result i32)) + (func $i_has_docs (;2;) (type 1) (param i32) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "docme" (func $docme)) + (export "i_has_docs" (func $i_has_docs)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/static.d.ts b/crates/cli/tests/reference/static.d.ts new file mode 100644 index 00000000000..091dbcc51a6 --- /dev/null +++ b/crates/cli/tests/reference/static.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export function exported(): void; diff --git a/crates/cli/tests/reference/static.js b/crates/cli/tests/reference/static.js new file mode 100644 index 00000000000..34aa7975e7a --- /dev/null +++ b/crates/cli/tests/reference/static.js @@ -0,0 +1,85 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +function isLikeNone(x) { + return x === undefined || x === null; +} + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_1.set(idx, obj); + return idx; +} + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +export function exported() { + wasm.exported(); +} + +export function __wbg_static_accessor_NAMESPACE_OPTIONAL_c9a4344c544120f4() { + const ret = typeof test === 'undefined' ? null : test?.NAMESPACE_OPTIONAL; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); +}; + +export function __wbg_static_accessor_NAMESPACE_PLAIN_784c8d7f5bbac62a() { + const ret = test.NAMESPACE_PLAIN; + return ret; +}; + +export function __wbg_static_accessor_NESTED_NAMESPACE_OPTIONAL_a414abbeb018a35a() { + const ret = typeof test1 === 'undefined' ? null : test1?.test2?.NESTED_NAMESPACE_OPTIONAL; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); +}; + +export function __wbg_static_accessor_NESTED_NAMESPACE_PLAIN_1121b285cb8479df() { + const ret = test1.test2.NESTED_NAMESPACE_PLAIN; + return ret; +}; + +export function __wbg_static_accessor_OPTIONAL_ade71b6402851d0c() { + const ret = typeof OPTIONAL === 'undefined' ? null : OPTIONAL; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); +}; + +export function __wbg_static_accessor_PLAIN_c0f08eb2f0db194c() { + const ret = PLAIN; + return ret; +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_1; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/static.rs b/crates/cli/tests/reference/static.rs new file mode 100644 index 00000000000..4437f550e7d --- /dev/null +++ b/crates/cli/tests/reference/static.rs @@ -0,0 +1,30 @@ +// DEPENDENCY: js-sys = { path = '{root}/crates/js-sys' } + +use wasm_bindgen::prelude::*; +use js_sys::Number; + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(thread_local_v2)] + static PLAIN: JsValue; + #[wasm_bindgen(thread_local_v2)] + static OPTIONAL: Option; + #[wasm_bindgen(thread_local_v2, js_namespace = test)] + static NAMESPACE_PLAIN: JsValue; + #[wasm_bindgen(thread_local_v2, js_namespace = test)] + static NAMESPACE_OPTIONAL: Option; + #[wasm_bindgen(thread_local_v2, js_namespace = ["test1", "test2"])] + static NESTED_NAMESPACE_PLAIN: JsValue; + #[wasm_bindgen(thread_local_v2, js_namespace = ["test1", "test2"])] + static NESTED_NAMESPACE_OPTIONAL: Option; +} + +#[wasm_bindgen] +pub fn exported() { + let _ = PLAIN.with(JsValue::clone); + let _ = OPTIONAL.with(Option::clone); + let _ = NAMESPACE_PLAIN.with(JsValue::clone); + let _ = NAMESPACE_OPTIONAL.with(Option::clone); + let _ = NESTED_NAMESPACE_PLAIN.with(JsValue::clone); + let _ = NESTED_NAMESPACE_OPTIONAL.with(Option::clone); +} diff --git a/crates/cli/tests/reference/static.wat b/crates/cli/tests/reference/static.wat new file mode 100644 index 00000000000..35b905ffffe --- /dev/null +++ b/crates/cli/tests/reference/static.wat @@ -0,0 +1,16 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $exported (;1;) (type 0)) + (func $__externref_table_alloc (;2;) (type 1) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "exported" (func $exported)) + (export "__externref_table_alloc" (func $__externref_table_alloc)) + (export "__wbindgen_export_1" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/string-arg.d.ts b/crates/cli/tests/reference/string-arg.d.ts index 701afc6b2d4..a03bca0b63b 100644 --- a/crates/cli/tests/reference/string-arg.d.ts +++ b/crates/cli/tests/reference/string-arg.d.ts @@ -1,6 +1,3 @@ /* tslint:disable */ /* eslint-disable */ -/** -* @param {string} a -*/ export function foo(a: string): void; diff --git a/crates/cli/tests/reference/string-arg.js b/crates/cli/tests/reference/string-arg.js index e4b98fad136..9d52328a50f 100644 --- a/crates/cli/tests/reference/string-arg.js +++ b/crates/cli/tests/reference/string-arg.js @@ -1,4 +1,8 @@ -import * as wasm from './reference_test_bg.wasm'; +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; @@ -6,16 +10,18 @@ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true cachedTextDecoder.decode(); -let cachegetUint8Memory0 = null; -function getUint8Memory0() { - if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { - cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); } - return cachegetUint8Memory0; + return cachedUint8ArrayMemory0; } function getStringFromWasm0(ptr, len) { - return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } let WASM_VECTOR_LEN = 0; @@ -41,16 +47,16 @@ function passStringToWasm0(arg, malloc, realloc) { if (realloc === undefined) { const buf = cachedTextEncoder.encode(arg); - const ptr = malloc(buf.length); - getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); WASM_VECTOR_LEN = buf.length; return ptr; } let len = arg.length; - let ptr = malloc(len); + let ptr = malloc(len, 1) >>> 0; - const mem = getUint8Memory0(); + const mem = getUint8ArrayMemory0(); let offset = 0; @@ -64,25 +70,37 @@ function passStringToWasm0(arg, malloc, realloc) { if (offset !== 0) { arg = arg.slice(offset); } - ptr = realloc(ptr, len, len = offset + arg.length * 3); - const view = getUint8Memory0().subarray(ptr + offset, ptr + len); + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); const ret = encodeString(arg, view); offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; } WASM_VECTOR_LEN = offset; return ptr; } /** -* @param {string} a -*/ + * @param {string} a + */ export function foo(a) { const ptr0 = passStringToWasm0(a, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; wasm.foo(ptr0, len0); } +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + export function __wbindgen_throw(arg0, arg1) { throw new Error(getStringFromWasm0(arg0, arg1)); }; diff --git a/crates/cli/tests/reference/string-arg.wat b/crates/cli/tests/reference/string-arg.wat index bf24ad9158c..fa9738c1214 100644 --- a/crates/cli/tests/reference/string-arg.wat +++ b/crates/cli/tests/reference/string-arg.wat @@ -1,12 +1,20 @@ -(module - (type (;0;) (func (param i32) (result i32))) +(module $reference_test.wasm + (type (;0;) (func)) (type (;1;) (func (param i32 i32))) - (type (;2;) (func (param i32 i32 i32) (result i32))) - (func $__wbindgen_realloc (type 2) (param i32 i32 i32) (result i32)) - (func $__wbindgen_malloc (type 0) (param i32) (result i32)) - (func $foo (type 1) (param i32 i32)) + (type (;2;) (func (param i32 i32) (result i32))) + (type (;3;) (func (param i32 i32 i32 i32) (result i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbindgen_realloc (;1;) (type 3) (param i32 i32 i32 i32) (result i32)) + (func $__wbindgen_malloc (;2;) (type 2) (param i32 i32) (result i32)) + (func $foo (;3;) (type 1) (param i32 i32)) + (table (;0;) 128 externref) (memory (;0;) 17) (export "memory" (memory 0)) (export "foo" (func $foo)) + (export "__wbindgen_export_0" (table 0)) (export "__wbindgen_malloc" (func $__wbindgen_malloc)) - (export "__wbindgen_realloc" (func $__wbindgen_realloc))) + (export "__wbindgen_realloc" (func $__wbindgen_realloc)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/targets-0.d.ts b/crates/cli/tests/reference/targets-0.d.ts new file mode 100644 index 00000000000..a01199843fc --- /dev/null +++ b/crates/cli/tests/reference/targets-0.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export function add_that_might_fail(a: number, b: number): number; diff --git a/crates/cli/tests/reference/targets-0.js b/crates/cli/tests/reference/targets-0.js new file mode 100644 index 00000000000..a153ca7932d --- /dev/null +++ b/crates/cli/tests/reference/targets-0.js @@ -0,0 +1,31 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + +/** + * @param {number} a + * @param {number} b + * @returns {number} + */ +export function add_that_might_fail(a, b) { + const ret = wasm.add_that_might_fail(a, b); + return ret >>> 0; +} + +export function __wbg_random_8be0a899673d8681() { + const ret = Math.random(); + return ret; +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + diff --git a/crates/cli/tests/reference/targets-0.wat b/crates/cli/tests/reference/targets-0.wat new file mode 100644 index 00000000000..551c3e6d9f9 --- /dev/null +++ b/crates/cli/tests/reference/targets-0.wat @@ -0,0 +1,14 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32 i32) (result i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $add_that_might_fail (;1;) (type 1) (param i32 i32) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "add_that_might_fail" (func $add_that_might_fail)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/targets-1.d.ts b/crates/cli/tests/reference/targets-1.d.ts new file mode 100644 index 00000000000..67e807819b3 --- /dev/null +++ b/crates/cli/tests/reference/targets-1.d.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +export function add_that_might_fail(a: number, b: number): number; + +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; + +export interface InitOutput { + readonly memory: WebAssembly.Memory; + readonly add_that_might_fail: (a: number, b: number) => number; + readonly __wbindgen_export_0: WebAssembly.Table; + readonly __wbindgen_start: () => void; +} + +export type SyncInitInput = BufferSource | WebAssembly.Module; +/** +* Instantiates the given `module`, which can either be bytes or +* a precompiled `WebAssembly.Module`. +* +* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. +* +* @returns {InitOutput} +*/ +export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; + +/** +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and +* for everything else, calls `WebAssembly.instantiate` directly. +* +* @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. +* +* @returns {Promise} +*/ +export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise; diff --git a/crates/cli/tests/reference/targets-1.js b/crates/cli/tests/reference/targets-1.js new file mode 100644 index 00000000000..50322fbdbb5 --- /dev/null +++ b/crates/cli/tests/reference/targets-1.js @@ -0,0 +1,132 @@ +let wasm; + +/** + * @param {number} a + * @param {number} b + * @returns {number} + */ +export function add_that_might_fail(a, b) { + const ret = wasm.add_that_might_fail(a, b); + return ret >>> 0; +} + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_random_8be0a899673d8681 = function() { + const ret = Math.random(); + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; + }; + + return imports; +} + +function __wbg_init_memory(imports, memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('reference_test_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/crates/cli/tests/reference/targets-1.wat b/crates/cli/tests/reference/targets-1.wat new file mode 100644 index 00000000000..db2cb5a6b2e --- /dev/null +++ b/crates/cli/tests/reference/targets-1.wat @@ -0,0 +1,14 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32 i32) (result i32))) + (import "wbg" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $add_that_might_fail (;1;) (type 1) (param i32 i32) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "add_that_might_fail" (func $add_that_might_fail)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/targets-2.d.ts b/crates/cli/tests/reference/targets-2.d.ts new file mode 100644 index 00000000000..9e1c41bd645 --- /dev/null +++ b/crates/cli/tests/reference/targets-2.d.ts @@ -0,0 +1,25 @@ +declare namespace wasm_bindgen { + /* tslint:disable */ + /* eslint-disable */ + export function add_that_might_fail(a: number, b: number): number; + +} + +declare type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; + +declare interface InitOutput { + readonly memory: WebAssembly.Memory; + readonly add_that_might_fail: (a: number, b: number) => number; + readonly __wbindgen_export_0: WebAssembly.Table; + readonly __wbindgen_start: () => void; +} + +/** +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and +* for everything else, calls `WebAssembly.instantiate` directly. +* +* @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. +* +* @returns {Promise} +*/ +declare function wasm_bindgen (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise; diff --git a/crates/cli/tests/reference/targets-2.js b/crates/cli/tests/reference/targets-2.js new file mode 100644 index 00000000000..2ba5298fa52 --- /dev/null +++ b/crates/cli/tests/reference/targets-2.js @@ -0,0 +1,139 @@ +let wasm_bindgen; +(function() { + const __exports = {}; + let script_src; + if (typeof document !== 'undefined' && document.currentScript !== null) { + script_src = new URL(document.currentScript.src, location.href).toString(); + } + let wasm = undefined; + /** + * @param {number} a + * @param {number} b + * @returns {number} + */ + __exports.add_that_might_fail = function(a, b) { + const ret = wasm.add_that_might_fail(a, b); + return ret >>> 0; + }; + + async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } + } + + function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_random_8be0a899673d8681 = function() { + const ret = Math.random(); + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; + }; + + return imports; + } + + function __wbg_init_memory(imports, memory) { + + } + + function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + + + wasm.__wbindgen_start(); + return wasm; + } + + function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); + } + + async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined' && typeof script_src !== 'undefined') { + module_or_path = script_src.replace(/\.js$/, '_bg.wasm'); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); + } + + wasm_bindgen = Object.assign(__wbg_init, { initSync }, __exports); + +})(); diff --git a/crates/cli/tests/reference/targets-2.wat b/crates/cli/tests/reference/targets-2.wat new file mode 100644 index 00000000000..db2cb5a6b2e --- /dev/null +++ b/crates/cli/tests/reference/targets-2.wat @@ -0,0 +1,14 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32 i32) (result i32))) + (import "wbg" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $add_that_might_fail (;1;) (type 1) (param i32 i32) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "add_that_might_fail" (func $add_that_might_fail)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/targets-3.d.ts b/crates/cli/tests/reference/targets-3.d.ts new file mode 100644 index 00000000000..a01199843fc --- /dev/null +++ b/crates/cli/tests/reference/targets-3.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export function add_that_might_fail(a: number, b: number): number; diff --git a/crates/cli/tests/reference/targets-3.js b/crates/cli/tests/reference/targets-3.js new file mode 100644 index 00000000000..9f6ad77ef51 --- /dev/null +++ b/crates/cli/tests/reference/targets-3.js @@ -0,0 +1,40 @@ + +let imports = {}; +imports['__wbindgen_placeholder__'] = module.exports; +let wasm; +/** + * @param {number} a + * @param {number} b + * @returns {number} + */ +module.exports.add_that_might_fail = function(a, b) { + const ret = wasm.add_that_might_fail(a, b); + return ret >>> 0; +}; + +module.exports.__wbg_random_8be0a899673d8681 = function() { + const ret = Math.random(); + return ret; +}; + +module.exports.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +const path = require('path').join(__dirname, 'reference_test_bg.wasm'); +const bytes = require('fs').readFileSync(path); + +const wasmModule = new WebAssembly.Module(bytes); +const wasmInstance = new WebAssembly.Instance(wasmModule, imports); +wasm = wasmInstance.exports; +module.exports.__wasm = wasm; + +wasm.__wbindgen_start(); + diff --git a/crates/cli/tests/reference/targets-3.wat b/crates/cli/tests/reference/targets-3.wat new file mode 100644 index 00000000000..ec8996a0fd3 --- /dev/null +++ b/crates/cli/tests/reference/targets-3.wat @@ -0,0 +1,14 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32 i32) (result i32))) + (import "__wbindgen_placeholder__" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $add_that_might_fail (;1;) (type 1) (param i32 i32) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "add_that_might_fail" (func $add_that_might_fail)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/targets-4.d.ts b/crates/cli/tests/reference/targets-4.d.ts new file mode 100644 index 00000000000..a01199843fc --- /dev/null +++ b/crates/cli/tests/reference/targets-4.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export function add_that_might_fail(a: number, b: number): number; diff --git a/crates/cli/tests/reference/targets-4.js b/crates/cli/tests/reference/targets-4.js new file mode 100644 index 00000000000..ca25cd83ff4 --- /dev/null +++ b/crates/cli/tests/reference/targets-4.js @@ -0,0 +1,50 @@ +/** + * @param {number} a + * @param {number} b + * @returns {number} + */ +export function add_that_might_fail(a, b) { + const ret = wasm.add_that_might_fail(a, b); + return ret >>> 0; +} + +const imports = { + __wbindgen_placeholder__: { + __wbg_random_8be0a899673d8681: function() { + const ret = Math.random(); + return ret; + }, + __wbindgen_init_externref_table: function() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; + }, + }, + +}; + +const wasm_url = new URL('reference_test_bg.wasm', import.meta.url); +let wasmCode = ''; +switch (wasm_url.protocol) { + case 'file:': + wasmCode = await Deno.readFile(wasm_url); + break + case 'https:': + case 'http:': + wasmCode = await (await fetch(wasm_url)).arrayBuffer(); + break + default: + throw new Error(`Unsupported protocol: ${wasm_url.protocol}`); +} + +const wasmInstance = (await WebAssembly.instantiate(wasmCode, imports)).instance; +const wasm = wasmInstance.exports; +export const __wasm = wasm; + +wasm.__wbindgen_start(); + diff --git a/crates/cli/tests/reference/targets-4.wat b/crates/cli/tests/reference/targets-4.wat new file mode 100644 index 00000000000..ec8996a0fd3 --- /dev/null +++ b/crates/cli/tests/reference/targets-4.wat @@ -0,0 +1,14 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32 i32) (result i32))) + (import "__wbindgen_placeholder__" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $add_that_might_fail (;1;) (type 1) (param i32 i32) (result i32)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "add_that_might_fail" (func $add_that_might_fail)) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/targets.rs b/crates/cli/tests/reference/targets.rs new file mode 100644 index 00000000000..86e22ada3b7 --- /dev/null +++ b/crates/cli/tests/reference/targets.rs @@ -0,0 +1,19 @@ +// FLAGS: --target=bundler +// FLAGS: --target=web +// FLAGS: --target=no-modules +// FLAGS: --target=nodejs +// FLAGS: --target=deno + +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(js_namespace = Math)] + fn random() -> f64; +} + +#[wasm_bindgen] +pub fn add_that_might_fail(a: u32, b: u32) -> u32 { + assert!(random() > 0.5); + a + b +} diff --git a/crates/cli/tests/reference/typescript-type.d.ts b/crates/cli/tests/reference/typescript-type.d.ts new file mode 100644 index 00000000000..fa398def952 --- /dev/null +++ b/crates/cli/tests/reference/typescript-type.d.ts @@ -0,0 +1,4 @@ +/* tslint:disable */ +/* eslint-disable */ +export function single(a: number | string): void; +export function slice(a: (number | string)[]): void; diff --git a/crates/cli/tests/reference/typescript-type.js b/crates/cli/tests/reference/typescript-type.js new file mode 100644 index 00000000000..0f861886fcf --- /dev/null +++ b/crates/cli/tests/reference/typescript-type.js @@ -0,0 +1,82 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} +/** + * @param {number | string} a + */ +export function single(a) { + wasm.single(a); +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +let WASM_VECTOR_LEN = 0; + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_0.set(idx, obj); + return idx; +} + +function passArrayJsValueToWasm0(array, malloc) { + const ptr = malloc(array.length * 4, 4) >>> 0; + for (let i = 0; i < array.length; i++) { + const add = addToExternrefTable0(array[i]); + getDataViewMemory0().setUint32(ptr + 4 * i, add, true); + } + WASM_VECTOR_LEN = array.length; + return ptr; +} +/** + * @param {(number | string)[]} a + */ +export function slice(a) { + const ptr0 = passArrayJsValueToWasm0(a, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + wasm.slice(ptr0, len0); +} + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/typescript-type.rs b/crates/cli/tests/reference/typescript-type.rs new file mode 100644 index 00000000000..2f8b4810947 --- /dev/null +++ b/crates/cli/tests/reference/typescript-type.rs @@ -0,0 +1,13 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(typescript_type = "number | string")] + type CustomType; +} + +#[wasm_bindgen] +pub fn single(a: CustomType) {} + +#[wasm_bindgen] +pub fn slice(a: Vec) {} diff --git a/crates/cli/tests/reference/typescript-type.wat b/crates/cli/tests/reference/typescript-type.wat new file mode 100644 index 00000000000..9327a22ef7b --- /dev/null +++ b/crates/cli/tests/reference/typescript-type.wat @@ -0,0 +1,23 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (type (;2;) (func (param i32 i32))) + (type (;3;) (func (param i32 i32) (result i32))) + (type (;4;) (func (param externref))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbindgen_malloc (;1;) (type 3) (param i32 i32) (result i32)) + (func $slice (;2;) (type 2) (param i32 i32)) + (func $__externref_table_alloc (;3;) (type 1) (result i32)) + (func $"single externref shim" (;4;) (type 4) (param externref)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "single" (func $"single externref shim")) + (export "slice" (func $slice)) + (export "__wbindgen_export_0" (table 0)) + (export "__externref_table_alloc" (func $__externref_table_alloc)) + (export "__wbindgen_malloc" (func $__wbindgen_malloc)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/wasm-export-types.d.ts b/crates/cli/tests/reference/wasm-export-types.d.ts new file mode 100644 index 00000000000..a5f399db59d --- /dev/null +++ b/crates/cli/tests/reference/wasm-export-types.d.ts @@ -0,0 +1,38 @@ +/* tslint:disable */ +/* eslint-disable */ +export function example(a: number, b: bigint, c: any, d: string): string; +export function example_128(a: bigint): bigint | undefined; + +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; + +export interface InitOutput { + readonly memory: WebAssembly.Memory; + readonly example: (a: number, b: bigint, c: any, d: number, e: number) => [number, number]; + readonly example_128: (a: bigint, b: bigint) => [number, bigint, bigint]; + readonly __wbindgen_export_0: WebAssembly.Table; + readonly __wbindgen_malloc: (a: number, b: number) => number; + readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; + readonly __wbindgen_free: (a: number, b: number, c: number) => void; + readonly __wbindgen_start: () => void; +} + +export type SyncInitInput = BufferSource | WebAssembly.Module; +/** +* Instantiates the given `module`, which can either be bytes or +* a precompiled `WebAssembly.Module`. +* +* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. +* +* @returns {InitOutput} +*/ +export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; + +/** +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and +* for everything else, calls `WebAssembly.instantiate` directly. +* +* @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. +* +* @returns {Promise} +*/ +export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise; diff --git a/crates/cli/tests/reference/wasm-export-types.js b/crates/cli/tests/reference/wasm-export-types.js new file mode 100644 index 00000000000..de290e90502 --- /dev/null +++ b/crates/cli/tests/reference/wasm-export-types.js @@ -0,0 +1,226 @@ +let wasm; + +const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + +if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +let WASM_VECTOR_LEN = 0; + +const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} +/** + * @param {number} a + * @param {bigint} b + * @param {any} c + * @param {string} d + * @returns {string} + */ +export function example(a, b, c, d) { + let deferred2_0; + let deferred2_1; + try { + const ptr0 = passStringToWasm0(d, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.example(a, b, c, ptr0, len0); + deferred2_0 = ret[0]; + deferred2_1 = ret[1]; + return getStringFromWasm0(ret[0], ret[1]); + } finally { + wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); + } +} + +/** + * @param {bigint} a + * @returns {bigint | undefined} + */ +export function example_128(a) { + const ret = wasm.example_128(a, a >> BigInt(64)); + return ret[0] === 0 ? undefined : (BigInt.asUintN(64, ret[1]) | (BigInt.asUintN(64, ret[2]) << BigInt(64))); +} + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_export_0; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + + return imports; +} + +function __wbg_init_memory(imports, memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedUint8ArrayMemory0 = null; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('reference_test_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/crates/cli/tests/reference/wasm-export-types.rs b/crates/cli/tests/reference/wasm-export-types.rs new file mode 100644 index 00000000000..06f89d912e0 --- /dev/null +++ b/crates/cli/tests/reference/wasm-export-types.rs @@ -0,0 +1,17 @@ +// FLAGS: --target=web + +use wasm_bindgen::prelude::*; + +// This is for testing the type generation of the wasm-exported functions. +// Here, example should be exported as `(arg0: number, arg1: bigint, arg2: any, arg3: number, arg4: number) => [number, number]`. +// Notes: `arg2: any` is an external reference to a JS value, and the ABI of strings is `number, number` (pointer, length). + +#[wasm_bindgen] +pub fn example(a: u32, b: u64, c: JsValue, d: &str) -> String { + todo!() +} + +#[wasm_bindgen] +pub fn example_128(a: u128) -> Option { + None +} diff --git a/crates/cli/tests/reference/wasm-export-types.wat b/crates/cli/tests/reference/wasm-export-types.wat new file mode 100644 index 00000000000..195c25a5723 --- /dev/null +++ b/crates/cli/tests/reference/wasm-export-types.wat @@ -0,0 +1,26 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (param i32 i32) (result i32))) + (type (;2;) (func (param i32 i32 i32))) + (type (;3;) (func (param i32 i32 i32 i32) (result i32))) + (type (;4;) (func (param i32 i64 externref i32 i32) (result i32 i32))) + (type (;5;) (func (param i64 i64) (result i32 i64 i64))) + (import "wbg" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbindgen_realloc (;1;) (type 3) (param i32 i32 i32 i32) (result i32)) + (func $__wbindgen_malloc (;2;) (type 1) (param i32 i32) (result i32)) + (func $__wbindgen_free (;3;) (type 2) (param i32 i32 i32)) + (func $"example externref shim multivalue shim" (;4;) (type 4) (param i32 i64 externref i32 i32) (result i32 i32)) + (func $"example_128 multivalue shim" (;5;) (type 5) (param i64 i64) (result i32 i64 i64)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "example" (func $"example externref shim multivalue shim")) + (export "example_128" (func $"example_128 multivalue shim")) + (export "__wbindgen_export_0" (table 0)) + (export "__wbindgen_malloc" (func $__wbindgen_malloc)) + (export "__wbindgen_realloc" (func $__wbindgen_realloc)) + (export "__wbindgen_free" (func $__wbindgen_free)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/reference/web-sys.d.ts b/crates/cli/tests/reference/web-sys.d.ts new file mode 100644 index 00000000000..4ba47beb695 --- /dev/null +++ b/crates/cli/tests/reference/web-sys.d.ts @@ -0,0 +1,10 @@ +/* tslint:disable */ +/* eslint-disable */ +export function get_url(): URL; +export function get_media_source(): MediaSourceEnum; +/** + * The `MediaSourceEnum` enum. + * + * *This API requires the following crate features to be activated: `MediaSourceEnum`* + */ +type MediaSourceEnum = "camera" | "screen" | "application" | "window" | "browser" | "microphone" | "audioCapture" | "other"; diff --git a/crates/cli/tests/reference/web-sys.js b/crates/cli/tests/reference/web-sys.js new file mode 100644 index 00000000000..37300cfdcaa --- /dev/null +++ b/crates/cli/tests/reference/web-sys.js @@ -0,0 +1,218 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_2.set(idx, obj); + return idx; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches && builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +let WASM_VECTOR_LEN = 0; + +const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; + +let cachedTextEncoder = new lTextEncoder('utf-8'); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} +/** + * @returns {URL} + */ +export function get_url() { + const ret = wasm.get_url(); + return ret; +} + +/** + * @returns {MediaSourceEnum} + */ +export function get_media_source() { + const ret = wasm.get_media_source(); + return __wbindgen_enum_MediaSourceEnum[ret]; +} + +const __wbindgen_enum_MediaSourceEnum = ["camera", "screen", "application", "window", "browser", "microphone", "audioCapture", "other"]; + +export function __wbg_new_9ffbe0a71eff35e3() { return handleError(function (arg0, arg1) { + const ret = new URL(getStringFromWasm0(arg0, arg1)); + return ret; +}, arguments) }; + +export function __wbindgen_debug_string(arg0, arg1) { + const ret = debugString(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_2; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/crates/cli/tests/reference/web-sys.rs b/crates/cli/tests/reference/web-sys.rs new file mode 100644 index 00000000000..6ad4315c2ed --- /dev/null +++ b/crates/cli/tests/reference/web-sys.rs @@ -0,0 +1,15 @@ +// DEPENDENCY: web-sys = { path = '{root}/crates/web-sys', features = ['console', 'Url', 'MediaSourceEnum', 'MediaSourceReadyState'] } + +use wasm_bindgen::prelude::wasm_bindgen; +use web_sys::{Url, MediaSourceEnum, MediaSourceReadyState}; + +#[wasm_bindgen] +pub fn get_url() -> Url { + assert_eq!(MediaSourceReadyState::Closed, MediaSourceReadyState::Closed); + Url::new("https://example.com").unwrap() +} + +#[wasm_bindgen] +pub fn get_media_source() -> MediaSourceEnum { + MediaSourceEnum::Camera +} diff --git a/crates/cli/tests/reference/web-sys.wat b/crates/cli/tests/reference/web-sys.wat new file mode 100644 index 00000000000..723728e65a8 --- /dev/null +++ b/crates/cli/tests/reference/web-sys.wat @@ -0,0 +1,28 @@ +(module $reference_test.wasm + (type (;0;) (func)) + (type (;1;) (func (result i32))) + (type (;2;) (func (result externref))) + (type (;3;) (func (param i32))) + (type (;4;) (func (param i32 i32) (result i32))) + (type (;5;) (func (param i32 i32 i32 i32) (result i32))) + (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) + (func $__wbindgen_realloc (;1;) (type 5) (param i32 i32 i32 i32) (result i32)) + (func $__wbindgen_malloc (;2;) (type 4) (param i32 i32) (result i32)) + (func $__wbindgen_exn_store (;3;) (type 3) (param i32)) + (func $get_media_source (;4;) (type 1) (result i32)) + (func $__externref_table_alloc (;5;) (type 1) (result i32)) + (func $"get_url externref shim" (;6;) (type 2) (result externref)) + (table (;0;) 128 externref) + (memory (;0;) 17) + (export "memory" (memory 0)) + (export "get_url" (func $"get_url externref shim")) + (export "get_media_source" (func $get_media_source)) + (export "__wbindgen_exn_store" (func $__wbindgen_exn_store)) + (export "__externref_table_alloc" (func $__externref_table_alloc)) + (export "__wbindgen_export_2" (table 0)) + (export "__wbindgen_malloc" (func $__wbindgen_malloc)) + (export "__wbindgen_realloc" (func $__wbindgen_realloc)) + (export "__wbindgen_start" (func 0)) + (@custom "target_features" (after code) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") +) + diff --git a/crates/cli/tests/wasm-bindgen/main.rs b/crates/cli/tests/wasm-bindgen/main.rs index d534b5a9724..8961a7a4a70 100644 --- a/crates/cli/tests/wasm-bindgen/main.rs +++ b/crates/cli/tests/wasm-bindgen/main.rs @@ -17,15 +17,16 @@ use std::env; use std::fs; use std::path::PathBuf; use std::process::Command; +use wasmparser::Payload; fn target_dir() -> PathBuf { - let mut dir = PathBuf::from(env::current_exe().unwrap()); + let mut dir = env::current_exe().unwrap(); dir.pop(); // current exe if dir.ends_with("deps") { dir.pop(); } dir.pop(); // debug and/or release - return dir; + dir } fn repo_root() -> PathBuf { @@ -78,7 +79,7 @@ impl Project { name = \"{}\" authors = [] version = \"1.0.0\" - edition = '2018' + edition = '2021' [dependencies] wasm-bindgen = {{ path = '{}' }} @@ -206,7 +207,7 @@ fn bin_crate_works() { name = \"bin_crate_works\" authors = [] version = \"1.0.0\" - edition = '2018' + edition = '2021' [dependencies] wasm-bindgen = {{ path = '{}' }} @@ -226,6 +227,98 @@ fn bin_crate_works() { .stdout("hello, world\n"); } +#[test] +fn bin_crate_works_without_name_section() { + let mut project = Project::new("bin_crate_works_without_name_section"); + project + .file( + "src/main.rs", + r#" + use wasm_bindgen::prelude::*; + #[wasm_bindgen] + extern "C" { + #[wasm_bindgen(js_namespace = console)] + fn log(data: &str); + } + + fn main() { + log("hello, world"); + } + "#, + ) + .file( + "Cargo.toml", + &format!( + " + [package] + name = \"bin_crate_works_without_name_section\" + authors = [] + version = \"1.0.0\" + edition = '2021' + + [dependencies] + wasm-bindgen = {{ path = '{}' }} + + [workspace] + ", + repo_root().display(), + ), + ); + let wasm = project.build(); + + // Remove the name section from the module. + // This simulates a situation like #3362 where it fails to parse because one of + // the names is too long. + // Unfortunately, we can't use `walrus` to do this because it gives the name + // section special treatment, so instead we use `wasmparser` directly. + let mut contents = fs::read(&wasm).unwrap(); + for payload in wasmparser::Parser::new(0).parse_all(&contents.clone()) { + match payload.unwrap() { + Payload::CustomSection(reader) if reader.name() == "name" => { + /// Figures out how many bytes `x` will take up when encoded in + /// unsigned LEB128. + fn leb128_len(x: u32) -> usize { + match x { + 0..=0x07f => 1, + 0x80..=0x3fff => 2, + 0x4000..=0x1fffff => 3, + 0x200000..=0xfffffff => 4, + 0x10000000..=0xffffffff => 5, + } + } + + // Figure out the length of the section header. + let header_len = 1 + leb128_len(reader.data().len() as u32); + + // Remove the section. + contents.drain(reader.range().start - header_len..reader.range().end); + } + // Ignore everything else. + _ => {} + } + } + + fs::write(&wasm, contents).unwrap(); + + // Then run wasm-bindgen on the result. + let out_dir = project.root.join("pkg"); + fs::create_dir_all(&out_dir).unwrap(); + let mut cmd = Command::cargo_bin("wasm-bindgen").unwrap(); + cmd.arg("--out-dir") + .arg(&out_dir) + .arg(&wasm) + .arg("--target") + .arg("nodejs"); + cmd.assert().success(); + + Command::new("node") + .arg("bin_crate_works_without_name_section.js") + .current_dir(out_dir) + .assert() + .success() + .stdout("hello, world\n"); +} + #[test] fn default_module_path_target_web() { let (mut cmd, out_dir) = Project::new("default_module_path_target_web") @@ -239,9 +332,20 @@ fn default_module_path_target_web() { let contents = fs::read_to_string(out_dir.join("default_module_path_target_web.js")).unwrap(); assert!(contents.contains( "\ -async function init(input) { - if (typeof input === 'undefined') { - input = new URL('default_module_path_target_web_bg.wasm', import.meta.url); +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('default_module_path_target_web_bg.wasm', import.meta.url); }", )); } @@ -260,15 +364,26 @@ fn default_module_path_target_no_modules() { fs::read_to_string(out_dir.join("default_module_path_target_no_modules.js")).unwrap(); assert!(contents.contains( "\ - async function init(input) { - if (typeof input === 'undefined') { - let src; - if (typeof document === 'undefined') { - src = location.href; + if (typeof document !== 'undefined' && document.currentScript !== null) { + script_src = new URL(document.currentScript.src, location.href).toString(); + }", + )); + assert!(contents.contains( + "\ + async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) } else { - src = document.currentScript.src; + console.warn('using deprecated parameters for the initialization function; pass a single object instead') } - input = src.replace(/\\.js$/, '_bg.wasm'); + } + + if (typeof module_or_path === 'undefined' && typeof script_src !== 'undefined') { + module_or_path = script_src.replace(/\\.js$/, '_bg.wasm'); }", )); } @@ -287,9 +402,20 @@ fn omit_default_module_path_target_web() { fs::read_to_string(out_dir.join("omit_default_module_path_target_web.js")).unwrap(); assert!(contents.contains( "\ -async function init(input) { +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + - const imports = {};", + const imports = __wbg_get_imports();", )); } @@ -307,163 +433,61 @@ fn omit_default_module_path_target_no_modules() { fs::read_to_string(out_dir.join("omit_default_module_path_target_no_modules.js")).unwrap(); assert!(contents.contains( "\ - async function init(input) { - - const imports = {};", - )); -} - -#[test] -fn empty_interface_types() { - let (mut cmd, _out_dir) = Project::new("empty_interface_types") - .file( - "src/lib.rs", - r#" - #[no_mangle] - pub extern fn foo() {} - "#, - ) - .file( - "Cargo.toml", - &format!( - " - [package] - name = \"empty_interface_types\" - authors = [] - version = \"1.0.0\" - edition = '2018' - - [dependencies] - wasm-bindgen = {{ path = '{}' }} - - [lib] - crate-type = ['cdylib'] + async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; - [workspace] - ", - repo_root().display(), - ), - ) - .wasm_bindgen(""); - cmd.env("WASM_INTERFACE_TYPES", "1"); - cmd.assert().success(); -} - -#[test] -fn bad_interface_types_export() -> anyhow::Result<()> { - let (mut cmd, _out_dir) = Project::new("bad_interface_types_export") - .file( - "src/lib.rs", - r#" - use wasm_bindgen::prelude::*; - - #[wasm_bindgen] - pub fn foo(a: Vec) {} - "#, - ) - .file( - "Cargo.toml", - &format!( - " - [package] - name = \"bad_interface_types_export\" - authors = [] - version = \"1.0.0\" - edition = '2018' - [lib] - crate-type = [\"cdylib\"] + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } - [dependencies] - wasm-bindgen = {{ path = '{}' }} - [workspace] - ", - repo_root().display(), - ), - ) - .wasm_bindgen(""); - cmd.env("WASM_INTERFACE_TYPES", "1"); - cmd.assert().failure().code(1).stderr(str::is_match( - "\ -error: failed to generate a standard interface types section - -Caused by: - 0: in function export `foo` - 1: type Vector\\(U8\\) isn't supported in standard interface types -$", - )?); - Ok(()) + const imports = __wbg_get_imports();", + )); } #[test] -fn bad_interface_types_import() -> anyhow::Result<()> { - let (mut cmd, _out_dir) = Project::new("bad_interface_types_import") +fn function_table_preserved() { + let (mut cmd, _out_dir) = Project::new("function_table_preserved") .file( "src/lib.rs", r#" use wasm_bindgen::prelude::*; - #[wasm_bindgen] - extern "C" { - pub fn foo() -> Vec; - } - #[wasm_bindgen] pub fn bar() { - foo(); + Closure::wrap(Box::new(|| {}) as Box); } "#, ) - .file( - "Cargo.toml", - &format!( - " - [package] - name = \"bad_interface_types_import\" - authors = [] - version = \"1.0.0\" - edition = '2018' - - [lib] - crate-type = [\"cdylib\"] - - [dependencies] - wasm-bindgen = {{ path = '{}' }} - - [workspace] - ", - repo_root().display(), - ), - ) .wasm_bindgen(""); - cmd.env("WASM_INTERFACE_TYPES", "1"); - cmd.assert().failure().code(1).stderr(str::is_match( - "\ -error: failed to generate a standard interface types section - -Caused by: - 0: in adapter function - 1: import of global `foo` requires JS glue -$", - )?); - Ok(()) + cmd.assert().success(); } #[test] -fn function_table_preserved() { - let (mut cmd, _out_dir) = Project::new("function_table_preserved") +fn constructor_cannot_return_option_struct() { + let (mut cmd, _out_dir) = Project::new("constructor_cannot_return_option_struct") .file( "src/lib.rs", r#" use wasm_bindgen::prelude::*; #[wasm_bindgen] - pub fn bar() { - Closure::wrap(Box::new(|| {}) as Box); + pub struct Foo(()); + + #[wasm_bindgen] + impl Foo { + #[wasm_bindgen(constructor)] + pub fn new() -> Option { + Some(Foo(())) + } } "#, ) - .wasm_bindgen(""); - cmd.assert().success(); + .wasm_bindgen("--target web"); + cmd.assert().failure(); } diff --git a/crates/cli/tests/wasm-bindgen/npm.rs b/crates/cli/tests/wasm-bindgen/npm.rs index a727345bfef..a1e76cd2dca 100644 --- a/crates/cli/tests/wasm-bindgen/npm.rs +++ b/crates/cli/tests/wasm-bindgen/npm.rs @@ -14,7 +14,7 @@ fn no_modules_rejects_npm() { } #[wasm_bindgen(start)] - pub fn main() { + fn main() { foo(); } "#, @@ -48,7 +48,7 @@ fn more_package_json_fields_ignored() { } #[wasm_bindgen(start)] - pub fn main() { + fn main() { foo(); } "#, @@ -77,7 +77,7 @@ fn npm_conflict_rejected() { name = "npm_conflict_rejected" authors = [] version = "1.0.0" - edition = '2018' + edition = '2021' [dependencies] wasm-bindgen = {{ path = '{}' }} @@ -102,7 +102,7 @@ fn npm_conflict_rejected() { } #[wasm_bindgen(start)] - pub fn main() { + fn main() { foo(); bar::foo(); } @@ -124,7 +124,7 @@ fn npm_conflict_rejected() { name = "bar" authors = [] version = "1.0.0" - edition = '2018' + edition = '2021' [dependencies] wasm-bindgen = {{ path = '{}' }} diff --git a/crates/example-tests/Cargo.toml b/crates/example-tests/Cargo.toml new file mode 100644 index 00000000000..c023ea1b6b8 --- /dev/null +++ b/crates/example-tests/Cargo.toml @@ -0,0 +1,26 @@ +[package] +authors = ["The wasm-bindgen Developers"] +edition = "2021" +name = "example-tests" +publish = false +version = "0.0.0" + +[features] +default = ["stable"] +nightly = [] +stable = [] + +[dependencies] +anyhow = "1.0.75" +futures-util = { version = "0.3.28", features = ["sink"] } +http = "1" +hyper = "1" +hyper-util = { version = "0.1.6", features = ["http1", "service", "server", "tokio"] } +mozprofile = "0.9" +mozrunner = "0.15" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +tokio = { version = "1.29.1", features = ["macros", "net", "time"] } +tokio-tungstenite = "0.26" +tower = { version = "0.5", features = ["make", "util"] } +tower-http = { version = "0.6", features = ["fs", "util", "set-header"] } diff --git a/crates/example-tests/LICENSE-APACHE b/crates/example-tests/LICENSE-APACHE new file mode 120000 index 00000000000..1cd601d0a3a --- /dev/null +++ b/crates/example-tests/LICENSE-APACHE @@ -0,0 +1 @@ +../../LICENSE-APACHE \ No newline at end of file diff --git a/crates/example-tests/LICENSE-MIT b/crates/example-tests/LICENSE-MIT new file mode 120000 index 00000000000..b2cfbdc7b0b --- /dev/null +++ b/crates/example-tests/LICENSE-MIT @@ -0,0 +1 @@ +../../LICENSE-MIT \ No newline at end of file diff --git a/crates/example-tests/README.md b/crates/example-tests/README.md new file mode 100644 index 00000000000..812ead04a48 --- /dev/null +++ b/crates/example-tests/README.md @@ -0,0 +1,6 @@ +# example-tests + +Tests that none of our examples are broken, by opening them in a browser +and checking that no errors get logged to the console. + +This currently only supports Firefox. diff --git a/crates/example-tests/src/lib.rs b/crates/example-tests/src/lib.rs new file mode 100644 index 00000000000..e209e791819 --- /dev/null +++ b/crates/example-tests/src/lib.rs @@ -0,0 +1,508 @@ +use std::collections::VecDeque; +use std::fmt::{self, Display, Formatter, Write}; +use std::net::TcpListener; +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; +use std::time::{Duration, Instant}; +use std::{env, str}; + +use anyhow::{bail, Context}; +use futures_util::{future, SinkExt, StreamExt}; +use http::{HeaderName, HeaderValue, Response}; +use hyper_util::rt::{TokioExecutor, TokioIo}; +use hyper_util::server::conn::auto::Builder; +use hyper_util::service::TowerToHyperService; +use mozprofile::profile::Profile; +use mozrunner::firefox_default_path; +use mozrunner::runner::{FirefoxProcess, FirefoxRunner, Runner, RunnerProcess}; +use serde::de::DeserializeOwned; +use serde::{Deserialize, Serialize}; +use serde_json::{json, Value}; +use tokio::net::TcpStream; +use tokio::sync::oneshot; +use tokio::time::timeout; +use tokio_tungstenite::tungstenite::{self, Message}; +use tokio_tungstenite::{MaybeTlsStream, WebSocketStream}; +use tower::ServiceBuilder; +use tower_http::services::fs::ServeFileSystemResponseBody; +use tower_http::services::ServeDir; + +/// A command sent from the client to the server. +#[derive(Serialize)] +struct BidiCommand<'a, T> { + id: u64, + method: &'a str, + params: T, +} + +/// A message sent from the server to the client. +#[derive(Deserialize)] +#[serde(untagged)] +enum BidiMessage { + CommandResponse { + id: u64, + #[serde(flatten)] + payload: CommandResult, + }, + Event(Event), +} + +#[derive(Deserialize)] +#[serde(untagged)] +enum CommandResult { + Ok { result: R }, + Err(CommandError), +} + +impl From> for Result { + fn from(res: CommandResult) -> Self { + match res { + CommandResult::Ok { result } => Ok(result), + CommandResult::Err(e) => Err(e), + } + } +} + +/// An error that occurred while running a command. +#[derive(Serialize, Deserialize, Debug, Clone)] +struct CommandError { + /// The kind of error that occurred. + error: BidiErrorKind, + /// The message associated with the error. + message: String, + /// The stack trace associated with the error, if any. + stacktrace: Option, +} + +impl Display for CommandError { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + write!(f, "{}: {}", self.error, self.message)?; + if f.alternate() { + // Show the stack trace. + if let Some(stacktrace) = &self.stacktrace { + write!(f, "\n\nStack trace:\n{stacktrace}")?; + } + } + Ok(()) + } +} + +impl std::error::Error for CommandError {} + +/// A kind of error that can occur while running a command. +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)] +enum BidiErrorKind { + #[serde(rename = "unknown command")] + /// An unknown command was issued. + UnknownCommand, + /// An invalid argument was passed for a command. + #[serde(rename = "invalid argument")] + InvalidArgument, + /// Some other kind of error occurred. + #[serde(rename = "unknown error")] + UnknownError, +} + +impl Display for BidiErrorKind { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + match self { + BidiErrorKind::UnknownCommand => f.pad("unknown command"), + BidiErrorKind::InvalidArgument => f.pad("invalid argument"), + BidiErrorKind::UnknownError => f.pad("unknown error"), + } + } +} + +/// An event sent from the server to the client. +#[derive(Deserialize)] +pub struct Event { + /// The name of the event. + method: String, + /// The payload of the event. + params: Value, +} + +/// A connection to a WebDriver BiDi session. +struct WebDriver { + /// The WebSocket we're connected to the WebDriver implementation with. + ws: WebSocketStream>, + /// The WebDriver process. + process: FirefoxProcess, + /// The ID that will be used for the next command. + next_id: u64, + /// Unyielded events. + events: VecDeque, +} + +impl Drop for WebDriver { + fn drop(&mut self) { + self.process.kill().unwrap(); + } +} + +impl WebDriver { + async fn new() -> anyhow::Result { + // Make the OS assign us a random port by asking for port 0. + let driver_addr = TcpListener::bind("127.0.0.1:0")?.local_addr()?; + + // For the moment, we're only supporting Firefox here. + let mut builder = FirefoxRunner::new( + &firefox_default_path().context("failed to find Firefox installation")?, + Some(Profile::new(None)?), + ); + builder + .arg("--remote-debugging-port") + .arg(driver_addr.port().to_string()) + .arg("--headless") + .stdout(Stdio::null()) + .stderr(Stdio::null()); + let process = builder + .start() + // `mozprofile` doesn't guarantee that its errors are `Send + Sync`, + // which means that they can't be converted to `anyhow::Error`. + // So, convert them to strings as a workaround. + .map_err(|e| anyhow::Error::msg(e.to_string()))?; + + // Connect to the Firefox instance. + let start = Instant::now(); + let ws = loop { + match tokio_tungstenite::connect_async(format!("ws://{driver_addr}/session")).await { + Ok((ws, _)) => break ws, + Err(e) => { + if start.elapsed() > Duration::from_secs(20) { + return Err(e).context("failed to connect to Firefox (after 20s)"); + } + } + } + }; + + let mut this = WebDriver { + ws, + process, + next_id: 0, + events: VecDeque::new(), + }; + + // Start the session. + let _: Value = this + .issue_cmd( + "session.new", + json!({ "capabilities": { "unhandledPromptBehavior": "dismiss" } }), + ) + .await?; + + Ok(this) + } + + async fn issue_cmd( + &mut self, + method: &str, + params: T, + ) -> anyhow::Result { + let id = self.next_id; + self.next_id += 1; + let json = serde_json::to_string(&BidiCommand { id, method, params }) + .context("failed to serialize message")?; + self.ws.send(Message::Text(json.into())).await?; + loop { + let msg = self + .ws + .next() + .await + .unwrap_or(Err(tungstenite::Error::AlreadyClosed))?; + + let message: BidiMessage = serde_json::from_str(msg.to_text()?)?; + match message { + BidiMessage::CommandResponse { + id: response_id, + payload, + } => { + if response_id != id { + bail!("unexpected response to command {response_id} after sending command {id}") + } + return Result::from(payload).map_err(anyhow::Error::from); + } + BidiMessage::Event(event) => self.events.push_back(event), + } + } + } + + async fn next_event(&mut self) -> anyhow::Result { + if let Some(event) = self.events.pop_front() { + Ok(event) + } else { + let msg = self + .ws + .next() + .await + .unwrap_or(Err(tungstenite::Error::AlreadyClosed))?; + + let message: BidiMessage = serde_json::from_str(msg.to_text()?)?; + match message { + BidiMessage::CommandResponse { .. } => bail!("unexpected command response"), + BidiMessage::Event(event) => Ok(event), + } + } + } +} + +/// Handles a `log.entryAdded` event with the given parameters, and returns an +/// error if the log entry is an error (or something else goes wrong). +fn handle_log_event(params: Value) -> anyhow::Result<()> { + #[derive(Deserialize)] + #[serde(rename_all = "camelCase")] + struct LogEntry { + level: LogLevel, + text: Option, + stack_trace: Option, + } + + #[derive(Deserialize, Debug, PartialEq, Eq, Clone, Copy)] + #[serde(rename_all = "lowercase")] + enum LogLevel { + Debug, + Info, + Warn, + Error, + } + + #[derive(Deserialize)] + #[serde(rename_all = "camelCase")] + struct StackTrace { + call_frames: Vec, + } + + #[derive(Deserialize)] + #[serde(rename_all = "camelCase")] + struct StackFrame { + column_number: i64, + function_name: String, + line_number: i64, + url: String, + } + + impl Display for StackFrame { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + write!( + f, + "{} (at {}:{}:{})", + self.function_name, self.url, self.line_number, self.column_number + ) + } + } + + let entry: LogEntry = serde_json::from_value(params).context("invalid log entry received")?; + + if entry.level == LogLevel::Error { + if let Some(text) = entry.text { + let mut msg = format!("An error occurred: {text}"); + + if let Some(stack_trace) = entry.stack_trace { + write!(msg, "\n\nStack trace:").unwrap(); + for frame in stack_trace.call_frames { + write!(msg, "\n{frame}").unwrap(); + } + } + + bail!("{msg}") + } else { + bail!("An error occurred") + } + } + + Ok(()) +} + +/// Run a single example with the passed name, using the passed closure to +/// build it if prebuilt examples weren't provided. +pub async fn test_example( + name: &str, + build: impl FnOnce() -> anyhow::Result, +) -> anyhow::Result<()> { + let path = if let Some(value) = env::var_os("EXBUILD") { + Path::new(&value).join(name) + } else { + build()? + }; + + let mut driver = WebDriver::new().await?; + + // Serve the path. + let service = TowerToHyperService::new( + ServiceBuilder::new() + .map_response(|mut response: Response| { + response.headers_mut().insert( + HeaderName::from_static("cross-origin-opener-policy"), + HeaderValue::from_static("same-origin"), + ); + response.headers_mut().insert( + HeaderName::from_static("cross-origin-embedder-policy"), + HeaderValue::from_static("require-corp"), + ); + response + }) + .service(ServeDir::new(path)), + ); + + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await?; + let addr = listener.local_addr()?; + let builder = Builder::new(TokioExecutor::new()).http1_only(); + + let (tx, rx) = oneshot::channel(); + + let (server_result, result) = future::join( + async move { + let (stream, _) = listener.accept().await?; + + let conn = builder.serve_connection(TokioIo::new(stream), &service); + tokio::pin!(conn); + + let ret = tokio::select! { + res = conn.as_mut() => { + res.map_err(|e| anyhow::Error::msg(e.to_string())) + } + _ = rx => { + Ok(()) + } + }; + + conn.graceful_shutdown(); + ret + }, + async { + #[derive(Deserialize)] + struct BrowsingContextCreateResult { + context: String, + } + + let BrowsingContextCreateResult { context } = driver + .issue_cmd("browsingContext.create", json!({ "type": "tab" })) + .await?; + + let _: Value = driver + .issue_cmd( + "session.subscribe", + json!({ + "events": ["log.entryAdded", "network.responseCompleted"], + "contexts": [&context], + }), + ) + .await?; + + #[derive(Deserialize)] + struct BrowsingContextNavigateResult { + navigation: Option, + } + + let BrowsingContextNavigateResult { navigation } = driver + .issue_cmd( + "browsingContext.navigate", + json!({ + "context": &context, + "url": format!("http://{addr}"), + }), + ) + .await?; + // Apparently this being null means that 'the navigation [was] canceled before + // making progress'. + // source: https://w3c.github.io/webdriver-bidi/#module-browsingContext + let navigation = navigation.context("navigation canceled")?; + + // Wait for the page to be fetched, so that we can check whether it succeeds. + // Note: I'm pretty sure that `browsingContext.navigate` is supposed to report + // an error anyway if this fails, but Firefox seems to be behind the spec here. + loop { + let event = driver + .next_event() + .await + .context("websocket unexpectedly closed")?; + match event.method.as_str() { + "log.entryAdded" => handle_log_event(event.params)?, + "network.responseCompleted" => { + #[derive(Deserialize)] + struct NetworkResponseCompletedParameters { + navigation: Option, + response: NetworkResponseData, + } + + #[derive(Deserialize)] + #[serde(rename_all = "camelCase")] + struct NetworkResponseData { + status: u64, + status_text: String, + } + + let params: NetworkResponseCompletedParameters = + serde_json::from_value(event.params)?; + if params.navigation.as_ref() == Some(&navigation) { + if !(200..300).contains(¶ms.response.status) { + bail!( + "fetching page failed ({} {})", + params.response.status, + params.response.status_text + ) + } + break; + } + } + _ => {} + } + } + + let start = Instant::now(); + // Wait 5 seconds for any errors to occur. + const WAIT_DURATION: Duration = Duration::from_secs(5); + while start.elapsed() < WAIT_DURATION { + match timeout(WAIT_DURATION - start.elapsed(), driver.next_event()).await { + Ok(event) => { + let event = event?; + if event.method == "log.entryAdded" { + handle_log_event(event.params)?; + } + } + Err(_) => break, + } + } + + tx.send(()).unwrap(); + + Ok(()) + }, + ) + .await; + + server_result.context("error running file server")?; + + result +} + +pub fn run(command: &mut Command) -> anyhow::Result<()> { + // Format the command to use in errors. + let mut cmdline = command.get_program().to_string_lossy().to_string(); + for arg in command.get_args().map(|arg| arg.to_string_lossy()) { + cmdline += " "; + cmdline += &arg; + } + + let status = command.status()?; + if !status.success() { + bail!("`{cmdline}` failed with {status}"); + } + Ok(()) +} + +/// Returns the path of root `wasm-bindgen` folder. +pub fn manifest_dir() -> &'static Path { + Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .unwrap() + .parent() + .unwrap() +} + +/// Returns the path of the example with the passed name. +pub fn example_dir(name: &str) -> PathBuf { + [manifest_dir(), "examples".as_ref(), name.as_ref()] + .iter() + .collect() +} diff --git a/crates/example-tests/tests/shell.rs b/crates/example-tests/tests/shell.rs new file mode 100644 index 00000000000..569fe1334fb --- /dev/null +++ b/crates/example-tests/tests/shell.rs @@ -0,0 +1,53 @@ +// Since these run on shell scripts, they won't work outside Unix-based OSes. +#![cfg(unix)] + +use std::process::Command; +use std::str; + +use example_tests::{example_dir, run, test_example}; + +async fn test_shell_example(name: &str, envs: &[(&str, &str)]) -> anyhow::Result<()> { + test_example(name, || { + let path = example_dir(name); + run(Command::new(path.join("build.sh")) + .current_dir(&path) + .envs(envs.iter().copied()))?; + Ok(path) + }) + .await +} + +macro_rules! shell_tests { + ($( + $(#[$attr:meta])* + $(#[$var:literal = $val:literal])* + $test:ident = $name:literal, + )*) => { + $( + $(#[$attr])* + #[tokio::test] + async fn $test() -> anyhow::Result<()> { + test_shell_example($name, &[$(($var, $val)),*]).await + } + )* + }; +} + +shell_tests! { + #[cfg(feature = "nightly")] + #["RUSTUP_TOOLCHAIN" = "nightly"] + raytrace_parallel = "raytrace-parallel", + #[cfg(feature = "stable")] + synchronous_instantiation = "synchronous-instantiation", + #[cfg(feature = "nightly")] + #["RUSTUP_TOOLCHAIN" = "nightly"] + wasm_audio_worklet = "wasm-audio-worklet", + #[cfg(feature = "stable")] + wasm_in_web_worker = "wasm-in-web-worker", + #[cfg(feature = "stable")] + websockets = "websockets", + #[cfg(feature = "stable")] + without_a_bundler = "without-a-bundler", + #[cfg(feature = "stable")] + without_a_bundler_no_modules = "without-a-bundler-no-modules", +} diff --git a/crates/example-tests/tests/webpack.rs b/crates/example-tests/tests/webpack.rs new file mode 100644 index 00000000000..8cc233283b3 --- /dev/null +++ b/crates/example-tests/tests/webpack.rs @@ -0,0 +1,94 @@ +use std::fs; +use std::io::ErrorKind; +use std::process::Command; +use std::sync::Once; +use std::{io, str}; + +use example_tests::{example_dir, manifest_dir, run, test_example}; + +async fn test_webpack_example(name: &str) -> anyhow::Result<()> { + test_example(name, || { + let manifest_dir = manifest_dir(); + let path = example_dir(name); + + fn allow_already_exists(e: io::Error) -> io::Result<()> { + if e.kind() == ErrorKind::AlreadyExists { + Ok(()) + } else { + Err(e) + } + } + + // All of the examples have the same dependencies, so we can just install + // to the root `node_modules` once, since Node resolves packages from any + // outer directories as well as the one containing the `package.json`. + static INSTALL: Once = Once::new(); + INSTALL.call_once(|| { + fs::copy( + manifest_dir.join("_package.json"), + manifest_dir.join("package.json"), + ) + .map(|_| ()) + .or_else(allow_already_exists) + .unwrap(); + + run(Command::new("npm").arg("install").current_dir(manifest_dir)).unwrap(); + + fs::remove_file(manifest_dir.join("package.json")).unwrap(); + }); + + // Build the example. + run(Command::new("npm") + .arg("run") + .arg("build") + .current_dir(&path))?; + + Ok(path.join("dist")) + }) + .await +} + +#[allow(unused_macros)] +macro_rules! webpack_tests { + ($( + $(#[$attr:meta])* + $test:ident = $name:literal, + )*) => { + $( + $(#[$attr])* + #[tokio::test] + async fn $test() -> anyhow::Result<()> { + test_webpack_example($name).await + } + )* + }; +} + +#[cfg(feature = "stable")] +webpack_tests! { + add = "add", + canvas = "canvas", + char = "char", + closures = "closures", + console_log = "console_log", + dom = "dom", + duck_typed_interfaces = "duck-typed-interfaces", + fetch = "fetch", + guide_supported_types_examples = "guide-supported-types-examples", + hello_world = "hello_world", + import_js = "import_js", + julia_set = "julia_set", + paint = "paint", + performance = "performance", + request_animation_frame = "request-animation-frame", + todomvc = "todomvc", + wasm_in_wasm_imports = "wasm-in-wasm-imports", + wasm_in_wasm = "wasm-in-wasm", + weather_report = "weather_report", + webaudio = "webaudio", + #[ignore = "The CI virtual machines don't have GPUs, so this doesn't work there."] + webgl = "webgl", + webrtc_datachannel = "webrtc_datachannel", + #[ignore = "WebXR isn't supported in Firefox yet"] + webxr = "webxr", +} diff --git a/crates/externref-xform/Cargo.toml b/crates/externref-xform/Cargo.toml index ddb7f621b6b..22ba0977336 100644 --- a/crates/externref-xform/Cargo.toml +++ b/crates/externref-xform/Cargo.toml @@ -1,26 +1,32 @@ [package] -name = "wasm-bindgen-externref-xform" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/externref-xform" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen-externref-xform" description = """ Internal externref transformations for wasm-bindgen """ -edition = '2018' +documentation = "https://docs.rs/wasm-bindgen-externref-xform" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-externref-xform" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/externref-xform" +rust-version = "1.76" +version = "0.2.100" [dependencies] anyhow = "1.0" -walrus = "0.19.0" +walrus = "0.23" +wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.100" } [dev-dependencies] rayon = "1.0" -wasmprinter = "0.2" -wast = "21.0" -wat = "1.0" +wasmprinter = "0.214" +wast = "214" +wat = "~1.214" + +[lints] +workspace = true [[test]] -name = "all" harness = false +name = "all" diff --git a/crates/externref-xform/src/lib.rs b/crates/externref-xform/src/lib.rs index 168c108fe8e..6d4688bf2b8 100644 --- a/crates/externref-xform/src/lib.rs +++ b/crates/externref-xform/src/lib.rs @@ -2,7 +2,7 @@ //! module. //! //! This crate is in charge of enabling code using `wasm-bindgen` to use the -//! `externref` type inside of the wasm module. This transformation pass primarily +//! `externref` type inside of the Wasm module. This transformation pass primarily //! wraps exports and imports in shims which use `externref`, but quickly turn them //! into `i32` value types. This is all largely a stopgap until Rust has //! first-class support for the `externref` type, but that's thought to be in the @@ -11,20 +11,21 @@ //! //! The pass here works by collecting information during binding generation //! about imports and exports. Afterwards this pass runs in one go against a -//! wasm module, updating exports, imports, calls to these functions, etc. The -//! goal at least is to have valid wasm modules coming in that don't use -//! `externref` and valid wasm modules going out which use `externref` at the fringes. +//! Wasm module, updating exports, imports, calls to these functions, etc. The +//! goal at least is to have valid Wasm modules coming in that don't use +//! `externref` and valid Wasm modules going out which use `externref` at the fringes. -use anyhow::{anyhow, bail, Error}; +use anyhow::{anyhow, bail, Context as _, Error}; use std::cmp; use std::collections::{BTreeMap, HashMap, HashSet}; use std::mem; -use walrus::ir::*; + +use walrus::{ir::*, ElementItems, RefType}; +use walrus::{ConstExpr, FunctionId, GlobalId, Module, TableId, ValType}; use walrus::{ElementId, ExportId, ImportId, InstrLocId, TypeId}; -use walrus::{FunctionId, GlobalId, InitExpr, Module, TableId, ValType}; // must be kept in sync with src/lib.rs and EXTERNREF_HEAP_START -const DEFAULT_MIN: u32 = 32; +const DEFAULT_MIN: u64 = 128; /// State of the externref pass, used to collect information while bindings are /// generated and used eventually to actually execute the entire pass. @@ -51,6 +52,9 @@ pub struct Context { // The externref table we'll be using, injected after construction table: Option, + + // If the bulk memory proposal is enabled. + bulk_memory: bool, } pub struct Meta { @@ -96,10 +100,19 @@ enum Intrinsic { } impl Context { - /// Executed first very early over a wasm module, used to learn about how + /// Executed first very early over a Wasm module, used to learn about how /// large the function table is so we know what indexes to hand out when /// we're appending entries. pub fn prepare(&mut self, module: &mut Module) -> Result<(), Error> { + // Insert reference types to the target features section. + wasm_bindgen_wasm_conventions::insert_target_feature(module, "reference-types") + .context("failed to parse `target_features` custom section")?; + + self.bulk_memory = matches!( + wasm_bindgen_wasm_conventions::target_feature(module, "bulk-memory"), + Ok(true) + ); + // Figure out what the maximum index of functions pointers are. We'll // be adding new entries to the function table later (maybe) so // precalculate this ahead of time. @@ -112,10 +125,14 @@ impl Context { _ => continue, }; let offset = match offset { - walrus::InitExpr::Value(Value::I32(n)) => *n as u32, + walrus::ConstExpr::Value(Value::I32(n)) => *n as u32, other => bail!("invalid offset for segment of function table {:?}", other), }; - let max = offset + elem.members.len() as u32; + let len = match &elem.items { + ElementItems::Functions(items) => items.len(), + ElementItems::Expressions(_, items) => items.len(), + }; + let max = offset + len as u32; self.new_element_offset = cmp::max(self.new_element_offset, max); self.elements.insert(offset, *id); } @@ -126,7 +143,7 @@ impl Context { self.table = Some( module .tables - .add_local(DEFAULT_MIN, None, ValType::Externref), + .add_local(false, DEFAULT_MIN, None, RefType::Externref), ); Ok(()) @@ -176,7 +193,7 @@ impl Context { } fn function(&self, externref: &[(usize, bool)], ret_externref: bool) -> Option { - if !ret_externref && externref.len() == 0 { + if !ret_externref && externref.is_empty() { return None; } Some(Function { @@ -190,8 +207,8 @@ impl Context { // Inject a stack pointer global which will be used for managing the // stack on the externref table. - let init = InitExpr::Value(Value::I32(DEFAULT_MIN as i32)); - let stack_pointer = module.globals.add_local(ValType::I32, true, init); + let init = ConstExpr::Value(Value::I32(DEFAULT_MIN as i32)); + let stack_pointer = module.globals.add_local(ValType::I32, true, false, init); let mut heap_alloc = None; let mut heap_dealloc = None; @@ -285,12 +302,6 @@ impl Transform<'_> { self.process_elements(module)?; assert!(self.cx.new_elements.is_empty()); - // If we didn't actually transform anything, no need to inject or - // rewrite anything from below. - if self.shims.is_empty() { - return Ok(()); - } - // Perform all instruction transformations to rewrite calls between // functions and make sure everything is still hooked up right. self.rewrite_calls(module)?; @@ -418,16 +429,25 @@ impl Transform<'_> { // Create shims for all our functions and append them all to the segment // which places elements at the end. let mut new_segment = Vec::new(); - for (idx, function) in mem::replace(&mut self.cx.new_elements, Vec::new()) { + for (idx, function) in mem::take(&mut self.cx.new_elements) { let (&offset, &orig_element) = self .cx .elements .range(..=idx) .next_back() .ok_or(anyhow!("failed to find segment defining index {}", idx))?; - let target = module.elements.get(orig_element).members[(idx - offset) as usize].ok_or( - anyhow!("function index {} not present in element segment", idx), - )?; + + let target = match &module.elements.get(orig_element).items { + ElementItems::Functions(items) => items[(idx - offset) as usize], + ElementItems::Expressions(_, items) => { + if let ConstExpr::RefFunc(target) = items[(idx - offset) as usize] { + target + } else { + bail!("function index {} not present in element segment", idx) + } + } + }; + let (shim, _externref_ty) = self.append_shim( target, &format!("closure{}", idx), @@ -436,20 +456,23 @@ impl Transform<'_> { &mut module.funcs, &mut module.locals, )?; - new_segment.push(Some(shim)); + new_segment.push(ConstExpr::RefFunc(shim)); } // ... and next update the limits of the table in case any are listed. let new_max = self.cx.new_element_offset + new_segment.len() as u32; - table.initial = cmp::max(table.initial, new_max); + table.initial = cmp::max(table.initial, u64::from(new_max)); if let Some(max) = table.maximum { - table.maximum = Some(cmp::max(max, new_max)); + table.maximum = Some(cmp::max(max, u64::from(new_max))); } let kind = walrus::ElementKind::Active { table: table.id(), - offset: InitExpr::Value(Value::I32(self.cx.new_element_offset as i32)), + offset: ConstExpr::Value(Value::I32(self.cx.new_element_offset as i32)), }; - let segment = module.elements.add(kind, ValType::Funcref, new_segment); + let segment = module.elements.add( + kind, + ElementItems::Expressions(RefType::Funcref, new_segment), + ); table.elem_segments.insert(segment); Ok(()) @@ -490,9 +513,9 @@ impl Transform<'_> { for (i, old_ty) in target_ty.params().iter().enumerate() { let is_owned = func.args.remove(&i); let new_ty = is_owned - .map(|_which| ValType::Externref) - .unwrap_or(old_ty.clone()); - param_tys.push(new_ty.clone()); + .map(|_which| ValType::Ref(RefType::Externref)) + .unwrap_or(*old_ty); + param_tys.push(new_ty); if new_ty == *old_ty { param_convert.push(Convert::None); } else if is_export { @@ -515,7 +538,7 @@ impl Transform<'_> { let new_ret = if func.ret_externref { assert_eq!(target_ty.results(), &[ValType::I32]); - vec![ValType::Externref] + vec![ValType::Ref(RefType::Externref)] } else { target_ty.results().to_vec() }; @@ -555,7 +578,7 @@ impl Transform<'_> { // gc passes if we don't actually end up using them. let fp = locals.add(ValType::I32); let scratch_i32 = locals.add(ValType::I32); - let scratch_externref = locals.add(ValType::Externref); + let scratch_externref = locals.add(ValType::Ref(RefType::Externref)); // Update our stack pointer if there's any borrowed externref objects. if externref_stack > 0 { @@ -648,17 +671,22 @@ impl Transform<'_> { // // Note that we pave over all our stack slots with `ref.null` to ensure // that the table doesn't accidentally hold a strong reference to items - // no longer in use by our wasm instance. - // - // TODO: use `table.fill` once that's spec'd + // no longer in use by our Wasm instance. if externref_stack > 0 { - for i in 0..externref_stack { - body.local_get(fp); - if i > 0 { - body.i32_const(i).binop(BinaryOp::I32Add); + if self.cx.bulk_memory { + body.local_get(fp) + .ref_null(RefType::Externref) + .i32_const(externref_stack) + .table_fill(self.table); + } else { + for i in 0..externref_stack { + body.local_get(fp); + if i > 0 { + body.i32_const(i).binop(BinaryOp::I32Add); + } + body.ref_null(RefType::Externref); + body.table_set(self.table); } - body.ref_null(ValType::Externref); - body.table_set(self.table); } body.local_get(fp) @@ -708,24 +736,25 @@ impl Transform<'_> { impl VisitorMut for Rewrite<'_, '_> { fn start_instr_seq_mut(&mut self, seq: &mut InstrSeq) { for i in (0..seq.instrs.len()).rev() { - let call = match &mut seq.instrs[i].0 { - Instr::Call(call) => call, + let func = match &mut seq.instrs[i].0 { + Instr::Call(Call { func }) => func, + Instr::ReturnCall(ReturnCall { func }) => func, _ => continue, }; - let intrinsic = match self.xform.intrinsic_map.get(&call.func) { + let intrinsic = match self.xform.intrinsic_map.get(func) { Some(f) => f, None => { // If this wasn't a call of an intrinsic, but it was a // call of one of our old import functions then we // switch the functions we're calling here. - if let Some(f) = self.xform.import_map.get(&call.func) { - call.func = *f; + if let Some(f) = self.xform.import_map.get(func) { + *func = *f; } continue; } }; - let ty = ValType::Externref; + let ty = RefType::Externref; match intrinsic { Intrinsic::TableGrow => { // Change something that looks like: @@ -762,8 +791,8 @@ impl Transform<'_> { seq.instrs .insert(i, (RefNull { ty }.into(), InstrLocId::default())); } - Intrinsic::DropRef => call.func = self.heap_dealloc, - Intrinsic::CloneRef => call.func = self.clone_ref, + Intrinsic::DropRef => *func = self.heap_dealloc, + Intrinsic::CloneRef => *func = self.clone_ref, } } } diff --git a/crates/externref-xform/tests/all.rs b/crates/externref-xform/tests/all.rs index d913524ebea..063c6ec6c18 100644 --- a/crates/externref-xform/tests/all.rs +++ b/crates/externref-xform/tests/all.rs @@ -11,6 +11,7 @@ use rayon::prelude::*; use std::env; use std::fs; use std::path::{Path, PathBuf}; +use walrus::ModuleConfig; use wast::parser::{Parse, Parser}; fn main() { @@ -19,7 +20,9 @@ fn main() { fn runtest(test: &Test) -> Result { let wasm = wat::parse_file(&test.file)?; - let mut walrus = walrus::Module::from_buffer(&wasm)?; + let mut walrus = ModuleConfig::new() + .generate_producers_section(false) + .parse(&wasm)?; let mut cx = wasm_bindgen_externref_xform::Context::default(); cx.prepare(&mut walrus)?; for directive in test.directives.iter() { @@ -47,7 +50,7 @@ fn runtest(test: &Test) -> Result { } cx.run(&mut walrus)?; walrus::passes::gc::run(&mut walrus); - let printed = wasmprinter::print_bytes(&walrus.emit_wasm())?; + let printed = wasmprinter::print_bytes(walrus.emit_wasm())?; Ok(printed) } @@ -142,15 +145,12 @@ impl Test { while let Some(line) = iter.next() { if line.starts_with("(; CHECK-ALL:") { let mut pattern = String::new(); - while let Some(line) = iter.next() { + for line in iter.by_ref() { if line == ";)" { break; } pattern.push_str(line); - pattern.push_str("\n"); - } - while pattern.ends_with("\n") { - pattern.pop(); + pattern.push('\n'); } if iter.next().is_some() { bail!("CHECK-ALL must be at the end of the file"); @@ -182,8 +182,8 @@ impl Test { } bail!( "expected\n {}\n\nactual\n {}", - pattern.replace("\n", "\n "), - output.replace("\n", "\n ") + pattern.replace('\n', "\n "), + output.replace('\n', "\n ") ); } else { bail!( @@ -202,7 +202,7 @@ fn update_output(path: &Path, output: &str) -> Result<()> { let mut new_output = String::new(); for line in output.lines() { new_output.push_str(line); - new_output.push_str("\n"); + new_output.push('\n'); } let new = format!( "{}\n\n(; CHECK-ALL:\n{}\n;)\n", @@ -220,10 +220,10 @@ impl<'a> Parse<'a> for Directive { wast::custom_keyword!(externref_borrowed); wast::custom_keyword!(other); - let kind = if parser.peek::() { + let kind = if parser.peek::()? { parser.parse::()?; DirectiveKind::Import(parser.parse()?, parser.parse()?) - } else if parser.peek::() { + } else if parser.peek::()? { parser.parse::()?; DirectiveKind::Export(parser.parse()?) } else { @@ -234,10 +234,10 @@ impl<'a> Parse<'a> for Directive { parser.parens(|p| { let mut i = 0; while !p.is_empty() { - if parser.peek::() { + if parser.peek::()? { parser.parse::()?; args.push((i, true)); - } else if parser.peek::() { + } else if parser.peek::()? { parser.parse::()?; args.push((i, false)); } else { diff --git a/crates/externref-xform/tests/anyref-param-owned.wat b/crates/externref-xform/tests/anyref-param-owned.wat index 84171fc1bb8..a0063d05c8e 100644 --- a/crates/externref-xform/tests/anyref-param-owned.wat +++ b/crates/externref-xform/tests/anyref-param-owned.wat @@ -12,17 +12,21 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $#func0 (@name "foo externref shim") (type 2) (param externref) + (func $"foo externref shim" (;0;) (type 2) (param externref) (local i32) call $alloc local.tee 1 local.get 0 table.set 0 local.get 1 - call $foo) - (func $alloc (type 0) (result i32) - i32.const 0) - (func $foo (type 1) (param i32)) - (table (;0;) 32 externref) - (export "foo" (func $#func0))) + call $foo + ) + (func $alloc (;1;) (type 0) (result i32) + i32.const 0 + ) + (func $foo (;2;) (type 1) (param i32)) + (table (;0;) 128 externref) + (export "foo" (func $"foo externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/anyref-param.wat b/crates/externref-xform/tests/anyref-param.wat index e1dd54c2098..27310bd8024 100644 --- a/crates/externref-xform/tests/anyref-param.wat +++ b/crates/externref-xform/tests/anyref-param.wat @@ -11,7 +11,7 @@ (module (type (;0;) (func (param i32))) (type (;1;) (func (param externref))) - (func $#func0 (@name "foo externref shim") (type 1) (param externref) + (func $"foo externref shim" (;0;) (type 1) (param externref) (local i32) global.get 0 i32.const 1 @@ -29,9 +29,12 @@ local.get 1 i32.const 1 i32.add - global.set 0) - (func $foo (type 0) (param i32)) - (table (;0;) 32 externref) - (global (;0;) (mut i32) i32.const 32) - (export "foo" (func $#func0))) + global.set 0 + ) + (func $foo (;1;) (type 0) (param i32)) + (table (;0;) 128 externref) + (global (;0;) (mut i32) i32.const 128) + (export "foo" (func $"foo externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/clone-ref-intrinsic.wat b/crates/externref-xform/tests/clone-ref-intrinsic.wat index e618dc458ea..4fdf99a186c 100644 --- a/crates/externref-xform/tests/clone-ref-intrinsic.wat +++ b/crates/externref-xform/tests/clone-ref-intrinsic.wat @@ -17,7 +17,7 @@ (type (;1;) (func (param i32))) (type (;2;) (func (param i32) (result i32))) (type (;3;) (func (param externref) (result externref))) - (func $#func0 (@name "foo externref shim") (type 3) (param externref) (result externref) + (func $"foo externref shim" (;0;) (type 3) (param externref) (result externref) (local i32) call $alloc local.tee 1 @@ -28,21 +28,27 @@ local.tee 1 table.get 0 local.get 1 - call $dealloc) - (func $__wbindgen_object_clone_ref (type 2) (param i32) (result i32) + call $dealloc + ) + (func $__wbindgen_object_clone_ref (;1;) (type 2) (param i32) (result i32) (local i32) call $alloc local.tee 1 local.get 0 table.get 0 table.set 0 - local.get 1) - (func $foo (type 2) (param i32) (result i32) + local.get 1 + ) + (func $foo (;2;) (type 2) (param i32) (result i32) local.get 0 - call $__wbindgen_object_clone_ref) - (func $alloc (type 0) (result i32) - i32.const 0) - (func $dealloc (type 1) (param i32)) - (table (;0;) 32 externref) - (export "foo" (func $#func0))) + call $__wbindgen_object_clone_ref + ) + (func $alloc (;3;) (type 0) (result i32) + i32.const 0 + ) + (func $dealloc (;4;) (type 1) (param i32)) + (table (;0;) 128 externref) + (export "foo" (func $"foo externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/drop-ref-intrinsic.wat b/crates/externref-xform/tests/drop-ref-intrinsic.wat index 14dba696009..9f17f64748d 100644 --- a/crates/externref-xform/tests/drop-ref-intrinsic.wat +++ b/crates/externref-xform/tests/drop-ref-intrinsic.wat @@ -16,20 +16,25 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $#func0 (@name "foo externref shim") (type 2) (param externref) + (func $"foo externref shim" (;0;) (type 2) (param externref) (local i32) call $alloc local.tee 1 local.get 0 table.set 0 local.get 1 - call $foo) - (func $foo (type 1) (param i32) + call $foo + ) + (func $foo (;1;) (type 1) (param i32) local.get 0 - call $dealloc) - (func $alloc (type 0) (result i32) - i32.const 0) - (func $dealloc (type 1) (param i32)) - (table (;0;) 32 externref) - (export "foo" (func $#func0))) + call $dealloc + ) + (func $alloc (;2;) (type 0) (result i32) + i32.const 0 + ) + (func $dealloc (;3;) (type 1) (param i32)) + (table (;0;) 128 externref) + (export "foo" (func $"foo externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/import-anyref-owned.wat b/crates/externref-xform/tests/import-anyref-owned.wat index 2e999901c0d..35563bc10ca 100644 --- a/crates/externref-xform/tests/import-anyref-owned.wat +++ b/crates/externref-xform/tests/import-anyref-owned.wat @@ -15,17 +15,21 @@ (type (;0;) (func)) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (import "" "a" (func $a (type 2))) - (func $#func1 (@name "a externref shim") (type 1) (param i32) + (import "" "a" (func $a (;0;) (type 2))) + (func $"a externref shim" (;1;) (type 1) (param i32) local.get 0 table.get 0 local.get 0 call $dealloc - call $a) + call $a + ) (func (;2;) (type 0) i32.const 0 - call $#func1) - (func $dealloc (type 1) (param i32)) - (table (;0;) 32 externref) - (export "foo" (func 2))) + call $"a externref shim" + ) + (func $dealloc (;3;) (type 1) (param i32)) + (table (;0;) 128 externref) + (export "foo" (func 2)) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/import-anyref-ret.wat b/crates/externref-xform/tests/import-anyref-ret.wat index 0de6f44ae42..52c0719877c 100644 --- a/crates/externref-xform/tests/import-anyref-ret.wat +++ b/crates/externref-xform/tests/import-anyref-ret.wat @@ -13,8 +13,8 @@ (module (type (;0;) (func (result i32))) (type (;1;) (func (result externref))) - (import "" "a" (func $a (type 1))) - (func $#func1 (@name "a externref shim") (type 0) (result i32) + (import "" "a" (func $a (;0;) (type 1))) + (func $"a externref shim" (;1;) (type 0) (result i32) (local i32 externref) call $a local.set 1 @@ -22,11 +22,16 @@ local.tee 0 local.get 1 table.set 0 - local.get 0) + local.get 0 + ) (func (;2;) (type 0) (result i32) - call $#func1) - (func $alloc (type 0) (result i32) - i32.const 0) - (table (;0;) 32 externref) - (export "foo" (func 2))) + call $"a externref shim" + ) + (func $alloc (;3;) (type 0) (result i32) + i32.const 0 + ) + (table (;0;) 128 externref) + (export "foo" (func 2)) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/import-anyref.wat b/crates/externref-xform/tests/import-anyref.wat index 698e293a3f3..2ed417c0bbe 100644 --- a/crates/externref-xform/tests/import-anyref.wat +++ b/crates/externref-xform/tests/import-anyref.wat @@ -15,14 +15,18 @@ (type (;0;) (func)) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (import "" "a" (func $a (type 2))) - (func $#func1 (@name "a externref shim") (type 1) (param i32) + (import "" "a" (func $a (;0;) (type 2))) + (func $"a externref shim" (;1;) (type 1) (param i32) local.get 0 table.get 0 - call $a) + call $a + ) (func (;2;) (type 0) i32.const 0 - call $#func1) - (table (;0;) 32 externref) - (export "foo" (func 2))) + call $"a externref shim" + ) + (table (;0;) 128 externref) + (export "foo" (func 2)) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/mixed-export.wat b/crates/externref-xform/tests/mixed-export.wat index 2f103708db1..f67601c03e2 100644 --- a/crates/externref-xform/tests/mixed-export.wat +++ b/crates/externref-xform/tests/mixed-export.wat @@ -12,7 +12,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param f32 i32 i64 i32 i32))) (type (;2;) (func (param f32 externref i64 externref i32))) - (func $#func0 (@name "a externref shim") (type 2) (param f32 externref i64 externref i32) + (func $"a externref shim" (;0;) (type 2) (param f32 externref i64 externref i32) (local i32 i32) global.get 0 i32.const 1 @@ -38,11 +38,15 @@ local.get 5 i32.const 1 i32.add - global.set 0) - (func $alloc (type 0) (result i32) - i32.const 0) - (func $a (type 1) (param f32 i32 i64 i32 i32)) - (table (;0;) 32 externref) - (global (;0;) (mut i32) i32.const 32) - (export "a" (func $#func0))) + global.set 0 + ) + (func $alloc (;1;) (type 0) (result i32) + i32.const 0 + ) + (func $a (;2;) (type 1) (param f32 i32 i64 i32 i32)) + (table (;0;) 128 externref) + (global (;0;) (mut i32) i32.const 128) + (export "a" (func $"a externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/mixed.wat b/crates/externref-xform/tests/mixed.wat index 9582cf053a3..edeb646f00d 100644 --- a/crates/externref-xform/tests/mixed.wat +++ b/crates/externref-xform/tests/mixed.wat @@ -20,8 +20,8 @@ (type (;1;) (func (param i32))) (type (;2;) (func (param f32 i32 i64 i32 i32))) (type (;3;) (func (param f32 externref i64 externref i32))) - (import "" "a" (func $a (type 3))) - (func $#func1 (@name "a externref shim") (type 2) (param f32 i32 i64 i32 i32) + (import "" "a" (func $a (;0;) (type 3))) + (func $"a externref shim" (;1;) (type 2) (param f32 i32 i64 i32 i32) local.get 0 local.get 1 table.get 0 @@ -31,15 +31,19 @@ local.get 3 call $dealloc local.get 4 - call $a) + call $a + ) (func (;2;) (type 0) f32.const 0x1p+0 (;=1;) i32.const 2 i64.const 3 i32.const 4 i32.const 5 - call $#func1) - (func $dealloc (type 1) (param i32)) - (table (;0;) 32 externref) - (export "foo" (func 2))) + call $"a externref shim" + ) + (func $dealloc (;3;) (type 1) (param i32)) + (table (;0;) 128 externref) + (export "foo" (func 2)) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/ret-anyref.wat b/crates/externref-xform/tests/ret-anyref.wat index be0610abd0c..936d5d0c811 100644 --- a/crates/externref-xform/tests/ret-anyref.wat +++ b/crates/externref-xform/tests/ret-anyref.wat @@ -14,16 +14,20 @@ (type (;0;) (func (result i32))) (type (;1;) (func (result externref))) (type (;2;) (func (param i32))) - (func $#func0 (@name "foo externref shim") (type 1) (result externref) + (func $"foo externref shim" (;0;) (type 1) (result externref) (local i32) call $foo local.tee 0 table.get 0 local.get 0 - call $dealloc) - (func $foo (type 0) (result i32) - i32.const 0) - (func $dealloc (type 2) (param i32)) - (table (;0;) 32 externref) - (export "foo" (func $#func0))) + call $dealloc + ) + (func $foo (;1;) (type 0) (result i32) + i32.const 0 + ) + (func $dealloc (;2;) (type 2) (param i32)) + (table (;0;) 128 externref) + (export "foo" (func $"foo externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/table-grow-intrinsic.wat b/crates/externref-xform/tests/table-grow-intrinsic.wat index 20265152e47..9fc963923d9 100644 --- a/crates/externref-xform/tests/table-grow-intrinsic.wat +++ b/crates/externref-xform/tests/table-grow-intrinsic.wat @@ -17,24 +17,29 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $foo (type 1) (param i32) + (func $foo (;0;) (type 1) (param i32) (local i32) i32.const 0 local.set 1 ref.null extern local.get 1 table.grow 0 - drop) - (func $#func1 (@name "foo externref shim") (type 2) (param externref) + drop + ) + (func $"foo externref shim" (;1;) (type 2) (param externref) (local i32) call $alloc local.tee 1 local.get 0 table.set 0 local.get 1 - call $foo) - (func $alloc (type 0) (result i32) - i32.const 0) - (table (;0;) 32 externref) - (export "foo" (func $#func1))) + call $foo + ) + (func $alloc (;2;) (type 0) (result i32) + i32.const 0 + ) + (table (;0;) 128 externref) + (export "foo" (func $"foo externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/table-set-null-intrinsic.wat b/crates/externref-xform/tests/table-set-null-intrinsic.wat index 39f043db865..4a84bb88935 100644 --- a/crates/externref-xform/tests/table-set-null-intrinsic.wat +++ b/crates/externref-xform/tests/table-set-null-intrinsic.wat @@ -16,20 +16,25 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $#func0 (@name "foo externref shim") (type 2) (param externref) + (func $"foo externref shim" (;0;) (type 2) (param externref) (local i32) call $alloc local.tee 1 local.get 0 table.set 0 local.get 1 - call $foo) - (func $foo (type 1) (param i32) + call $foo + ) + (func $foo (;1;) (type 1) (param i32) local.get 0 ref.null extern - table.set 0) - (func $alloc (type 0) (result i32) - i32.const 0) - (table (;0;) 32 externref) - (export "foo" (func $#func0))) + table.set 0 + ) + (func $alloc (;2;) (type 0) (result i32) + i32.const 0 + ) + (table (;0;) 128 externref) + (export "foo" (func $"foo externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/table.wat b/crates/externref-xform/tests/table.wat index 98e24308402..3f651ddb879 100644 --- a/crates/externref-xform/tests/table.wat +++ b/crates/externref-xform/tests/table.wat @@ -14,20 +14,24 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $#func0 (@name "closure0 externref shim") (type 2) (param externref) + (func $"closure0 externref shim" (;0;) (type 2) (param externref) (local i32) call $alloc local.tee 1 local.get 0 table.set 1 local.get 1 - call $foo) - (func $alloc (type 0) (result i32) - i32.const 0) - (func $foo (type 1) (param i32)) + call $foo + ) + (func $alloc (;1;) (type 0) (result i32) + i32.const 0 + ) + (func $foo (;2;) (type 1) (param i32)) (table (;0;) 2 funcref) - (table (;1;) 32 externref) + (table (;1;) 128 externref) (export "func" (table 0)) (elem (;0;) (i32.const 0) func $foo) - (elem (;1;) (i32.const 1) func $#func0)) + (elem (;1;) (i32.const 1) funcref (ref.func $"closure0 externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/externref-xform/tests/tee-before-grow.wat b/crates/externref-xform/tests/tee-before-grow.wat index a168abac04e..2b206343d16 100644 --- a/crates/externref-xform/tests/tee-before-grow.wat +++ b/crates/externref-xform/tests/tee-before-grow.wat @@ -19,7 +19,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $foo (type 1) (param i32) + (func $foo (;0;) (type 1) (param i32) (local i32) i32.const 0 local.tee 0 @@ -27,17 +27,22 @@ ref.null extern local.get 1 table.grow 0 - drop) - (func $#func1 (@name "foo externref shim") (type 2) (param externref) + drop + ) + (func $"foo externref shim" (;1;) (type 2) (param externref) (local i32) call $alloc local.tee 1 local.get 0 table.set 0 local.get 1 - call $foo) - (func $alloc (type 0) (result i32) - i32.const 0) - (table (;0;) 32 externref) - (export "foo" (func $#func1))) + call $foo + ) + (func $alloc (;2;) (type 0) (result i32) + i32.const 0 + ) + (table (;0;) 128 externref) + (export "foo" (func $"foo externref shim")) + (@custom "target_features" (after code) "\01+\0freference-types") +) ;) diff --git a/crates/futures/Cargo.toml b/crates/futures/Cargo.toml index 4c29dfc4e44..caf381c899b 100644 --- a/crates/futures/Cargo.toml +++ b/crates/futures/Cargo.toml @@ -2,32 +2,42 @@ authors = ["The wasm-bindgen Developers"] description = "Bridging the gap between Rust Futures and JavaScript Promises" documentation = "https://docs.rs/wasm-bindgen-futures" +edition = "2021" homepage = "https://rustwasm.github.io/wasm-bindgen/" -license = "MIT/Apache-2.0" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" name = "wasm-bindgen-futures" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/futures" readme = "./README.md" -version = "0.4.30" -edition = "2018" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/futures" +rust-version = "1.57" +version = "0.4.50" + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] [dependencies] cfg-if = "1.0.0" -js-sys = { path = "../js-sys", version = '0.3.57' } -wasm-bindgen = { path = "../..", version = '0.2.80' } -futures-core = { version = '0.3.8', default-features = false, optional = true } +futures-core = { version = '0.3.8', default-features = false, optional = true } +js-sys = { path = "../js-sys", version = '=0.3.77', default-features = false } +once_cell = { version = "1.12", default-features = false } +wasm-bindgen = { path = "../..", version = '=0.2.100', default-features = false } [features] +default = ["std"] futures-core-03-stream = ['futures-core'] +std = ["wasm-bindgen/std", "js-sys/std", "web-sys/std"] -[target.'cfg(target_feature = "atomics")'.dependencies.web-sys] -path = "../web-sys" -version = "0.3.24" -features = [ - "MessageEvent", - "Worker", -] +[target.'cfg(target_feature = "atomics")'.dependencies] +web-sys = { path = "../web-sys", version = "=0.3.77", default-features = false, features = [ + "MessageEvent", + "Worker", +] } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test = { path = '../test', version = '0.3.30' } -futures-channel-preview = { version = "0.3.0-alpha.18" } -futures-lite = { version = "1.11.3", default-features = false } +futures-channel = "0.3" +futures-lite = { version = "2", default-features = false } +wasm-bindgen-test = { path = '../test' } + +[lints] +workspace = true diff --git a/crates/futures/README.md b/crates/futures/README.md index eb0a067f3ca..f458c0448e1 100644 --- a/crates/futures/README.md +++ b/crates/futures/README.md @@ -1,6 +1,6 @@ # `wasm-bindgen-futures` -[API Documention][docs] +[API Documentation][docs] This crate bridges the gap between a Rust `Future` and a JavaScript `Promise`. It provides two conversions: diff --git a/crates/futures/src/lib.rs b/crates/futures/src/lib.rs index c2a59d76286..633e023867b 100644 --- a/crates/futures/src/lib.rs +++ b/crates/futures/src/lib.rs @@ -30,22 +30,34 @@ //! systems and make sure that Rust/JavaScript can work together with //! asynchronous and I/O work. -#![cfg_attr(target_feature = "atomics", feature(stdsimd))] +#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr( + target_feature = "atomics", + feature(thread_local, stdarch_wasm_atomic_wait) +)] #![deny(missing_docs)] +#![cfg_attr(docsrs, feature(doc_cfg))] +extern crate alloc; + +use alloc::boxed::Box; +use alloc::rc::Rc; +use core::cell::RefCell; +use core::fmt; +use core::future::Future; +use core::pin::Pin; +use core::task::{Context, Poll, Waker}; use js_sys::Promise; -use std::cell::RefCell; -use std::fmt; -use std::future::Future; -use std::pin::Pin; -use std::rc::Rc; -use std::task::{Context, Poll, Waker}; use wasm_bindgen::prelude::*; mod queue; +#[cfg_attr(docsrs, doc(cfg(feature = "futures-core-03-stream")))] #[cfg(feature = "futures-core-03-stream")] pub mod stream; +pub use js_sys; +pub use wasm_bindgen; + mod task { use cfg_if::cfg_if; @@ -199,13 +211,13 @@ impl Future for JsFuture { /// /// # Panics /// -/// Note that in wasm panics are currently translated to aborts, but "abort" in -/// this case means that a JavaScript exception is thrown. The wasm module is +/// Note that in Wasm panics are currently translated to aborts, but "abort" in +/// this case means that a JavaScript exception is thrown. The Wasm module is /// still usable (likely erroneously) after Rust panics. /// /// If the `future` provided panics then the returned `Promise` **will not /// resolve**. Instead it will be a leaked promise. This is an unfortunate -/// limitation of wasm currently that's hoped to be fixed one day! +/// limitation of Wasm currently that's hoped to be fixed one day! pub fn future_to_promise(future: F) -> Promise where F: Future> + 'static, diff --git a/crates/futures/src/queue.rs b/crates/futures/src/queue.rs index 5822934b727..b7d9c89fb4a 100644 --- a/crates/futures/src/queue.rs +++ b/crates/futures/src/queue.rs @@ -1,9 +1,20 @@ +use alloc::collections::VecDeque; +use alloc::rc::Rc; +use core::cell::{Cell, RefCell}; use js_sys::Promise; -use std::cell::{Cell, RefCell}; -use std::collections::VecDeque; -use std::rc::Rc; use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen] + fn queueMicrotask(closure: &Closure); + + type Global; + + #[wasm_bindgen(method, getter, js_name = queueMicrotask)] + fn hasQueueMicrotask(this: &Global) -> JsValue; +} + struct QueueState { // The queue of Tasks which are to be run in order. In practice this is all the // synchronous work of futures, and each `Task` represents calling `poll` on @@ -42,20 +53,25 @@ pub(crate) struct Queue { state: Rc, promise: Promise, closure: Closure, + has_queue_microtask: bool, } impl Queue { // Schedule a task to run on the next tick pub(crate) fn schedule_task(&self, task: Rc) { self.state.tasks.borrow_mut().push_back(task); - // Note that we currently use a promise and a closure to do this, but - // eventually we should probably use something like `queueMicrotask`: - // https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask + // Use queueMicrotask to execute as soon as possible. If it does not exist + // fall back to the promise resolution if !self.state.is_scheduled.replace(true) { - let _ = self.promise.then(&self.closure); + if self.has_queue_microtask { + queueMicrotask(&self.closure); + } else { + let _ = self.promise.then(&self.closure); + } } } // Append a task to the currently running queue, or schedule it + #[cfg(not(target_feature = "atomics"))] pub(crate) fn push_task(&self, task: Rc) { // It would make sense to run this task on the same tick. For now, we // make the simplifying choice of always scheduling tasks for a future tick. @@ -70,6 +86,11 @@ impl Queue { tasks: RefCell::new(VecDeque::new()), }); + let has_queue_microtask = js_sys::global() + .unchecked_into::() + .hasQueueMicrotask() + .is_function(); + Self { promise: Promise::resolve(&JsValue::undefined()), @@ -78,14 +99,28 @@ impl Queue { // This closure will only be called on the next microtask event // tick - Closure::wrap(Box::new(move |_| state.run_all())) + Closure::new(move |_| state.run_all()) }, state, + has_queue_microtask, } } -} -thread_local! { - pub(crate) static QUEUE: Queue = Queue::new(); + pub(crate) fn with(f: impl FnOnce(&Self) -> R) -> R { + use once_cell::unsync::Lazy; + + struct Wrapper(Lazy); + + #[cfg(not(target_feature = "atomics"))] + unsafe impl Sync for Wrapper {} + + #[cfg(not(target_feature = "atomics"))] + unsafe impl Send for Wrapper {} + + #[cfg_attr(target_feature = "atomics", thread_local)] + static QUEUE: Wrapper = Wrapper(Lazy::new(Queue::new)); + + f(&QUEUE.0) + } } diff --git a/crates/futures/src/stream.rs b/crates/futures/src/stream.rs index 208120c3106..fe35d81c735 100644 --- a/crates/futures/src/stream.rs +++ b/crates/futures/src/stream.rs @@ -1,7 +1,7 @@ //! Converting JavaScript `AsyncIterator`s to Rust `Stream`s. //! -//! Analogous to the promise to future convertion, this module allows the -//! turing objects implementing the async iterator protocol into `Stream`s +//! Analogous to the promise to future conversion, this module allows +//! turning objects implementing the async iterator protocol into `Stream`s //! that produce values that can be awaited from. //! @@ -11,7 +11,7 @@ use core::pin::Pin; use core::task::{Context, Poll}; use futures_core::stream::Stream; use js_sys::{AsyncIterator, IteratorNext}; -use wasm_bindgen::{prelude::*, JsCast}; +use wasm_bindgen::prelude::*; /// A `Stream` that yields values from an underlying `AsyncIterator`. pub struct JsStream { diff --git a/crates/futures/src/task/multithread.rs b/crates/futures/src/task/multithread.rs index 8d51144846b..e66de91fd3c 100644 --- a/crates/futures/src/task/multithread.rs +++ b/crates/futures/src/task/multithread.rs @@ -1,14 +1,16 @@ -use std::cell::RefCell; -use std::future::Future; -use std::mem::ManuallyDrop; -use std::pin::Pin; -use std::rc::Rc; -use std::sync::atomic::AtomicI32; -use std::sync::atomic::Ordering::SeqCst; -use std::sync::Arc; -use std::task::{Context, Poll, RawWaker, RawWakerVTable, Waker}; +#![allow(clippy::incompatible_msrv)] + +use alloc::boxed::Box; +use alloc::rc::Rc; +use alloc::sync::Arc; +use core::cell::RefCell; +use core::future::Future; +use core::mem::ManuallyDrop; +use core::pin::Pin; +use core::sync::atomic::AtomicI32; +use core::sync::atomic::Ordering::SeqCst; +use core::task::{Context, Poll, RawWaker, RawWakerVTable, Waker}; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; const SLEEPING: i32 = 0; const AWAKE: i32 = 1; @@ -37,7 +39,7 @@ impl AtomicWaker { // from SLEEPING to AWAKE. unsafe { core::arch::wasm32::memory_atomic_notify( - &self.state as *const AtomicI32 as *mut i32, + self.state.as_ptr(), 1, // Number of threads to notify ); } @@ -97,12 +99,12 @@ impl Task { let closure = { let this = Rc::clone(&this); - Closure::wrap(Box::new(move |_| this.run()) as Box) + Closure::new(move |_| this.run()) }; *this.inner.borrow_mut() = Some(Inner { future, closure }); // Queue up the Future's work to happen on the next microtask tick. - crate::queue::QUEUE.with(move |queue| queue.schedule_task(this)); + crate::queue::Queue::with(move |queue| queue.schedule_task(this)); } pub(crate) fn run(&self) { @@ -174,7 +176,7 @@ fn wait_async(ptr: &AtomicI32, current_value: i32) -> Option { } else { let mem = wasm_bindgen::memory().unchecked_into::(); let array = js_sys::Int32Array::new(&mem.buffer()); - let result = Atomics::wait_async(&array, ptr as *const AtomicI32 as i32 / 4, current_value); + let result = Atomics::wait_async(&array, ptr.as_ptr() as u32 / 4, current_value); if result.async_() { Some(result.value()) } else { @@ -188,7 +190,7 @@ fn wait_async(ptr: &AtomicI32, current_value: i32) -> Option { type WaitAsyncResult; #[wasm_bindgen(static_method_of = Atomics, js_name = waitAsync)] - fn wait_async(buf: &js_sys::Int32Array, index: i32, value: i32) -> WaitAsyncResult; + fn wait_async(buf: &js_sys::Int32Array, index: u32, value: i32) -> WaitAsyncResult; #[wasm_bindgen(static_method_of = Atomics, js_name = waitAsync, getter)] fn get_wait_async() -> JsValue; diff --git a/crates/futures/src/task/singlethread.rs b/crates/futures/src/task/singlethread.rs index 570cd6fcf7e..733a0407510 100644 --- a/crates/futures/src/task/singlethread.rs +++ b/crates/futures/src/task/singlethread.rs @@ -1,9 +1,10 @@ -use std::cell::{Cell, RefCell}; -use std::future::Future; -use std::mem::ManuallyDrop; -use std::pin::Pin; -use std::rc::Rc; -use std::task::{Context, Poll, RawWaker, RawWakerVTable, Waker}; +use alloc::boxed::Box; +use alloc::rc::Rc; +use core::cell::{Cell, RefCell}; +use core::future::Future; +use core::mem::ManuallyDrop; +use core::pin::Pin; +use core::task::{Context, RawWaker, RawWakerVTable, Waker}; struct Inner { future: Pin + 'static>>, @@ -32,7 +33,24 @@ impl Task { *this.inner.borrow_mut() = Some(Inner { future, waker }); - crate::queue::QUEUE.with(|queue| queue.schedule_task(this)); + crate::queue::Queue::with(|queue| queue.schedule_task(this)); + } + + fn force_wake(this: Rc) { + crate::queue::Queue::with(|queue| { + queue.push_task(this); + }); + } + + fn wake(this: Rc) { + // If we've already been placed on the run queue then there's no need to + // requeue ourselves since we're going to run at some point in the + // future anyway. + if this.is_queued.replace(true) { + return; + } + + Self::force_wake(this); } fn wake_by_ref(this: &Rc) { @@ -43,9 +61,7 @@ impl Task { return; } - crate::queue::QUEUE.with(|queue| { - queue.push_task(Rc::clone(this)); - }); + Self::force_wake(Rc::clone(this)); } /// Creates a standard library `RawWaker` from an `Rc` of ourselves. @@ -55,15 +71,17 @@ impl Task { /// however, everything is guaranteed to be singlethreaded (since we're /// compiled without the `atomics` feature) so we "safely lie" and say our /// `Rc` pointer is good enough. + /// + /// The implementation is based off of futures::task::ArcWake unsafe fn into_raw_waker(this: Rc) -> RawWaker { unsafe fn raw_clone(ptr: *const ()) -> RawWaker { let ptr = ManuallyDrop::new(Rc::from_raw(ptr as *const Task)); - Task::into_raw_waker((*ptr).clone()) + Task::into_raw_waker(Rc::clone(&ptr)) } unsafe fn raw_wake(ptr: *const ()) { let ptr = Rc::from_raw(ptr as *const Task); - Task::wake_by_ref(&ptr); + Task::wake(ptr); } unsafe fn raw_wake_by_ref(ptr: *const ()) { @@ -75,7 +93,7 @@ impl Task { drop(Rc::from_raw(ptr as *const Task)); } - const VTABLE: RawWakerVTable = + static VTABLE: RawWakerVTable = RawWakerVTable::new(raw_clone, raw_wake, raw_wake_by_ref, raw_drop); RawWaker::new(Rc::into_raw(this) as *const (), &VTABLE) @@ -106,7 +124,7 @@ impl Task { // actually go away until all wakers referencing us go away, which may // take quite some time, so ensure that the heaviest of resources are // released early. - if let Poll::Ready(_) = poll { + if poll.is_ready() { *borrow = None; } } diff --git a/crates/futures/src/task/wait_async_polyfill.rs b/crates/futures/src/task/wait_async_polyfill.rs index 14b8f0eadf5..eed90c7ba6d 100644 --- a/crates/futures/src/task/wait_async_polyfill.rs +++ b/crates/futures/src/task/wait_async_polyfill.rs @@ -3,6 +3,8 @@ //! and ported to Rust //! +#![allow(clippy::incompatible_msrv)] + /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -36,46 +38,30 @@ * when possible. The worker communicates with its parent using postMessage. */ -use js_sys::{encode_uri_component, Array, Promise}; -use std::cell::RefCell; -use std::sync::atomic::AtomicI32; +use alloc::vec; +use alloc::vec::Vec; +use core::cell::RefCell; +use core::sync::atomic::AtomicI32; +use js_sys::{Array, Promise}; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use web_sys::{MessageEvent, Worker}; -const HELPER_CODE: &'static str = " -onmessage = function (ev) { - let [ia, index, value] = ev.data; - ia = new Int32Array(ia.buffer); - let result = Atomics.wait(ia, index, value); - postMessage(result); -}; -"; - -thread_local! { - static HELPERS: RefCell> = RefCell::new(vec![]); -} +#[thread_local] +static HELPERS: RefCell> = RefCell::new(vec![]); fn alloc_helper() -> Worker { - HELPERS.with(|helpers| { - if let Some(helper) = helpers.borrow_mut().pop() { - return helper; - } + if let Some(helper) = HELPERS.borrow_mut().pop() { + return helper; + } - let mut initialization_string = "data:application/javascript,".to_owned(); - let encoded: String = encode_uri_component(HELPER_CODE).into(); - initialization_string.push_str(&encoded); - - Worker::new(&initialization_string).unwrap_or_else(|js| wasm_bindgen::throw_val(js)) - }) + let worker_url = wasm_bindgen::link_to!(module = "/src/task/worker.js"); + Worker::new(&worker_url).unwrap_or_else(|js| wasm_bindgen::throw_val(js)) } fn free_helper(helper: Worker) { - HELPERS.with(move |helpers| { - let mut helpers = helpers.borrow_mut(); - helpers.push(helper.clone()); - helpers.truncate(10); // random arbitrary limit chosen here - }); + let mut helpers = HELPERS.borrow_mut(); + helpers.push(helper.clone()); + helpers.truncate(10); // random arbitrary limit chosen here } pub fn wait_async(ptr: &AtomicI32, value: i32) -> Promise { @@ -93,7 +79,7 @@ pub fn wait_async(ptr: &AtomicI32, value: i32) -> Promise { let data = Array::of3( &wasm_bindgen::memory(), - &JsValue::from(ptr as *const AtomicI32 as i32 / 4), + &JsValue::from(ptr.as_ptr() as u32 / 4), &JsValue::from(value), ); diff --git a/crates/futures/src/task/worker.js b/crates/futures/src/task/worker.js new file mode 100644 index 00000000000..d25dab6606d --- /dev/null +++ b/crates/futures/src/task/worker.js @@ -0,0 +1,6 @@ +onmessage = function (ev) { + let [ia, index, value] = ev.data; + ia = new Int32Array(ia.buffer); + let result = Atomics.wait(ia, index, value); + postMessage(result); +}; diff --git a/crates/futures/tests/tests.rs b/crates/futures/tests/tests.rs index ab7c147c941..ba5e44d5170 100644 --- a/crates/futures/tests/tests.rs +++ b/crates/futures/tests/tests.rs @@ -5,7 +5,7 @@ wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); use futures_channel::oneshot; use js_sys::Promise; use std::ops::FnMut; -use wasm_bindgen::{prelude::*, JsValue}; +use wasm_bindgen::prelude::*; use wasm_bindgen_futures::{future_to_promise, spawn_local, JsFuture}; use wasm_bindgen_test::*; @@ -138,7 +138,6 @@ async fn can_create_multiple_futures_from_same_promise() { #[wasm_bindgen_test] async fn can_use_an_async_iterable_as_stream() { use futures_lite::stream::StreamExt; - use wasm_bindgen::JsCast; use wasm_bindgen_futures::stream::JsStream; let async_iter = js_sys::Function::new_no_args( @@ -156,3 +155,33 @@ async fn can_use_an_async_iterable_as_stream() { assert_eq!(stream.next().await, Some(Ok(JsValue::from(24)))); assert_eq!(stream.next().await, None); } + +#[wasm_bindgen_test] +#[should_panic] +async fn should_panic() { + panic!() +} + +#[wasm_bindgen_test] +#[should_panic = "error message"] +async fn should_panic_string() { + panic!("error message") +} + +#[wasm_bindgen_test] +#[should_panic(expected = "error message")] +async fn should_panic_expected() { + panic!("error message") +} + +#[wasm_bindgen_test] +#[ignore] +async fn ignore() { + panic!("this test should have been ignored") +} + +#[wasm_bindgen_test] +#[ignore = "reason"] +async fn ignore_reason() { + panic!("this test should have been ignored") +} diff --git a/crates/js-sys/CHANGELOG.md b/crates/js-sys/CHANGELOG.md index f822008aab8..5a4de395eeb 100644 --- a/crates/js-sys/CHANGELOG.md +++ b/crates/js-sys/CHANGELOG.md @@ -2,36 +2,6 @@ -------------------------------------------------------------------------------- -## Unreleased - -Released YYYY-MM-DD. - -### Added - -* TODO (or remove section if none) - -### Changed - -* TODO (or remove section if none) - -### Deprecated - -* TODO (or remove section if none) - -### Removed - -* TODO (or remove section if none) - -### Fixed - -* TODO (or remove section if none) - -### Security - -* TODO (or remove section if none) - --------------------------------------------------------------------------------- - ## 0.2.1 Released 2018-08-13. diff --git a/crates/js-sys/Cargo.toml b/crates/js-sys/Cargo.toml index e5165da6853..57471e4e3b1 100644 --- a/crates/js-sys/Cargo.toml +++ b/crates/js-sys/Cargo.toml @@ -1,26 +1,44 @@ [package] -name = "js-sys" -version = "0.3.57" authors = ["The wasm-bindgen Developers"] -readme = "./README.md" categories = ["wasm"] -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/js-sys" description = """ Bindings for all JS global objects and functions in all JS environments like Node.js and browsers, built on `#[wasm_bindgen]` using the `wasm-bindgen` crate. """ -license = "MIT/Apache-2.0" -edition = "2018" +documentation = "https://docs.rs/js-sys" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "js-sys" +readme = "./README.md" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys" +rust-version = "1.57" +version = "0.3.77" [lib] -test = false doctest = false +test = false + +[features] +default = ["std"] +std = ["wasm-bindgen/std"] [dependencies] -wasm-bindgen = { path = "../..", version = "0.2.80" } +once_cell = { version = "1.12", default-features = false } +wasm-bindgen = { path = "../..", version = "=0.2.100", default-features = false } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test = { path = '../test', version = '=0.3.30' } -wasm-bindgen-futures = { path = '../futures', version = '0.4.30' } +wasm-bindgen-futures = { path = '../futures' } +wasm-bindgen-test = { path = '../test' } +web-sys = { path = "../web-sys", features = ["Headers", "Response", "ResponseInit"] } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(js_sys_unstable_apis)'] } + +[lints.clippy] +large_enum_variant = "allow" +new_without_default = "allow" +overly_complex_bool_expr = "allow" +too_many_arguments = "allow" +type_complexity = "allow" diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index 2972376bd22..ac1d51bfadd 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -17,19 +17,25 @@ //! bindings. #![doc(html_root_url = "https://docs.rs/js-sys/0.2")] - +#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(target_feature = "atomics", feature(thread_local))] + +extern crate alloc; + +use alloc::string::String; +use alloc::vec::Vec; +use core::cmp::Ordering; +use core::convert::{self, Infallible, TryFrom}; +use core::f64; +use core::fmt; +use core::iter::{self, Product, Sum}; +use core::mem::{self, MaybeUninit}; use core::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Neg, Not, Rem, Shl, Shr, Sub}; -use std::cmp::Ordering; -use std::convert::{self, Infallible}; -use std::f64; -use std::fmt; -use std::iter::{self, Product, Sum}; -use std::mem; -use std::str; -use std::str::FromStr; +use core::str; +use core::str::FromStr; +pub use wasm_bindgen; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; // When adding new imports: // @@ -381,6 +387,28 @@ extern "C" { #[wasm_bindgen(method, js_name = findIndex)] pub fn find_index(this: &Array, predicate: &mut dyn FnMut(JsValue, u32, Array) -> bool) -> i32; + /// The `findLast()` method of Array instances iterates the array in reverse order + /// and returns the value of the first element that satisfies the provided testing function. + /// If no elements satisfy the testing function, undefined is returned. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) + #[wasm_bindgen(method, js_name = findLast)] + pub fn find_last( + this: &Array, + predicate: &mut dyn FnMut(JsValue, u32, Array) -> bool, + ) -> JsValue; + + /// The `findLastIndex()` method of Array instances iterates the array in reverse order + /// and returns the index of the first element that satisfies the provided testing function. + /// If no elements satisfy the testing function, -1 is returned. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) + #[wasm_bindgen(method, js_name = findLastIndex)] + pub fn find_last_index( + this: &Array, + predicate: &mut dyn FnMut(JsValue, u32, Array) -> bool, + ) -> i32; + /// The `flat()` method creates a new array with all sub-array elements concatenated into it /// recursively up to the specified depth. /// @@ -448,6 +476,19 @@ extern "C" { #[wasm_bindgen(method, getter, structural)] pub fn length(this: &Array) -> u32; + /// Sets the length of the array. + /// + /// If it is set to less than the current length of the array, it will + /// shrink the array. + /// + /// If it is set to more than the current length of the array, it will + /// increase the length of the array, filling the new space with empty + /// slots. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) + #[wasm_bindgen(method, setter)] + pub fn set_length(this: &Array, value: u32); + /// `map()` calls a provided callback function once for each element in an array, /// in order, and constructs a new array from the results. callback is invoked /// only for indexes of the array which have assigned values, including undefined. @@ -598,14 +639,72 @@ extern "C" { pub fn unshift(this: &Array, value: &JsValue) -> u32; } +/// Iterator returned by `Array::into_iter` +#[derive(Debug, Clone)] +pub struct ArrayIntoIter { + range: core::ops::Range, + array: Array, +} + +impl core::iter::Iterator for ArrayIntoIter { + type Item = JsValue; + + fn next(&mut self) -> Option { + let index = self.range.next()?; + Some(self.array.get(index)) + } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + self.range.size_hint() + } + + #[inline] + fn count(self) -> usize + where + Self: Sized, + { + self.range.count() + } + + #[inline] + fn last(self) -> Option + where + Self: Sized, + { + let Self { range, array } = self; + range.last().map(|index| array.get(index)) + } + + #[inline] + fn nth(&mut self, n: usize) -> Option { + self.range.nth(n).map(|index| self.array.get(index)) + } +} + +impl core::iter::DoubleEndedIterator for ArrayIntoIter { + fn next_back(&mut self) -> Option { + let index = self.range.next_back()?; + Some(self.array.get(index)) + } + + fn nth_back(&mut self, n: usize) -> Option { + self.range.nth_back(n).map(|index| self.array.get(index)) + } +} + +impl core::iter::FusedIterator for ArrayIntoIter {} + +impl core::iter::ExactSizeIterator for ArrayIntoIter {} + /// Iterator returned by `Array::iter` #[derive(Debug, Clone)] pub struct ArrayIter<'a> { - range: std::ops::Range, + range: core::ops::Range, array: &'a Array, } -impl<'a> std::iter::Iterator for ArrayIter<'a> { +impl core::iter::Iterator for ArrayIter<'_> { type Item = JsValue; fn next(&mut self) -> Option { @@ -617,18 +716,44 @@ impl<'a> std::iter::Iterator for ArrayIter<'a> { fn size_hint(&self) -> (usize, Option) { self.range.size_hint() } + + #[inline] + fn count(self) -> usize + where + Self: Sized, + { + self.range.count() + } + + #[inline] + fn last(self) -> Option + where + Self: Sized, + { + let Self { range, array } = self; + range.last().map(|index| array.get(index)) + } + + #[inline] + fn nth(&mut self, n: usize) -> Option { + self.range.nth(n).map(|index| self.array.get(index)) + } } -impl<'a> std::iter::DoubleEndedIterator for ArrayIter<'a> { +impl core::iter::DoubleEndedIterator for ArrayIter<'_> { fn next_back(&mut self) -> Option { let index = self.range.next_back()?; Some(self.array.get(index)) } + + fn nth_back(&mut self, n: usize) -> Option { + self.range.nth_back(n).map(|index| self.array.get(index)) + } } -impl<'a> std::iter::FusedIterator for ArrayIter<'a> {} +impl core::iter::FusedIterator for ArrayIter<'_> {} -impl<'a> std::iter::ExactSizeIterator for ArrayIter<'a> {} +impl core::iter::ExactSizeIterator for ArrayIter<'_> {} impl Array { /// Returns an iterator over the values of the JS array. @@ -653,8 +778,20 @@ impl Array { } } +impl core::iter::IntoIterator for Array { + type Item = JsValue; + type IntoIter = ArrayIntoIter; + + fn into_iter(self) -> Self::IntoIter { + ArrayIntoIter { + range: 0..self.length(), + array: self, + } + } +} + // TODO pre-initialize the Array with the correct length using TrustedLen -impl std::iter::FromIterator for Array +impl core::iter::FromIterator for Array where A: AsRef, { @@ -668,7 +805,7 @@ where } } -impl std::iter::Extend for Array +impl core::iter::Extend for Array where A: AsRef, { @@ -823,20 +960,47 @@ pub mod Atomics { /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `add_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/add) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn add(typed_array: &JsValue, index: u32, value: i32) -> Result; + /// The static `Atomics.add()` method adds a given value at a given + /// position in the array and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/add) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = add)] + pub fn add_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result; + /// The static `Atomics.and()` method computes a bitwise AND with a given /// value at a given position in the array, and returns the old value /// at that position. /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `and_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/and) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn and(typed_array: &JsValue, index: u32, value: i32) -> Result; + /// The static `Atomics.and()` method computes a bitwise AND with a given + /// value at a given position in the array, and returns the old value + /// at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/and) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = and)] + pub fn and_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result; + /// The static `Atomics.compareExchange()` method exchanges a given /// replacement value at a given position in the array, if a given expected /// value equals the old value. It returns the old value at that position @@ -844,6 +1008,8 @@ pub mod Atomics { /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `compare_exchange_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/compareExchange) #[wasm_bindgen(js_namespace = Atomics, catch, js_name = compareExchange)] pub fn compare_exchange( @@ -853,15 +1019,50 @@ pub mod Atomics { replacement_value: i32, ) -> Result; + /// The static `Atomics.compareExchange()` method exchanges a given + /// replacement value at a given position in the array, if a given expected + /// value equals the old value. It returns the old value at that position + /// whether it was equal to the expected value or not. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/compareExchange) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = compareExchange)] + pub fn compare_exchange_bigint( + typed_array: &JsValue, + index: u32, + expected_value: i64, + replacement_value: i64, + ) -> Result; + /// The static `Atomics.exchange()` method stores a given value at a given /// position in the array and returns the old value at that position. /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `exchange_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/exchange) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn exchange(typed_array: &JsValue, index: u32, value: i32) -> Result; + /// The static `Atomics.exchange()` method stores a given value at a given + /// position in the array and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/exchange) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = exchange)] + pub fn exchange_bigint( + typed_array: &JsValue, + index: u32, + value: i64, + ) -> Result; + /// The static `Atomics.isLockFree()` method is used to determine /// whether to use locks or atomic operations. It returns true, /// if the given size is one of the `BYTES_PER_ELEMENT` property @@ -874,10 +1075,21 @@ pub mod Atomics { /// The static `Atomics.load()` method returns a value at a given /// position in the array. /// + /// You should use `load_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/load) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn load(typed_array: &JsValue, index: u32) -> Result; + /// The static `Atomics.load()` method returns a value at a given + /// position in the array. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/load) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = load)] + pub fn load_bigint(typed_array: &JsValue, index: i64) -> Result; + /// The static `Atomics.notify()` method notifies up some agents that /// are sleeping in the wait queue. /// Note: This operation works with a shared `Int32Array` only. @@ -900,26 +1112,63 @@ pub mod Atomics { /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `or_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/or) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn or(typed_array: &JsValue, index: u32, value: i32) -> Result; + /// The static `Atomics.or()` method computes a bitwise OR with a given value + /// at a given position in the array, and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/or) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = or)] + pub fn or_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result; + /// The static `Atomics.store()` method stores a given value at the given /// position in the array and returns that value. /// + /// You should use `store_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/store) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn store(typed_array: &JsValue, index: u32, value: i32) -> Result; - /// The static `Atomics.sub()` method substracts a given value at a + /// The static `Atomics.store()` method stores a given value at the given + /// position in the array and returns that value. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/store) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = store)] + pub fn store_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result; + + /// The static `Atomics.sub()` method subtracts a given value at a /// given position in the array and returns the old value at that position. /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `sub_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/sub) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn sub(typed_array: &JsValue, index: u32, value: i32) -> Result; + /// The static `Atomics.sub()` method subtracts a given value at a + /// given position in the array and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/sub) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = sub)] + pub fn sub_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result; + /// The static `Atomics.wait()` method verifies that a given /// position in an `Int32Array` still contains a given value /// and if so sleeps, awaiting a wakeup or a timeout. @@ -927,12 +1176,33 @@ pub mod Atomics { /// Note: This operation only works with a shared `Int32Array` /// and may not be allowed on the main thread. /// + /// You should use `wait_bigint` to operate on a `BigInt64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn wait(typed_array: &Int32Array, index: u32, value: i32) -> Result; + /// The static `Atomics.wait()` method verifies that a given + /// position in an `BigInt64Array` still contains a given value + /// and if so sleeps, awaiting a wakeup or a timeout. + /// It returns a string which is either "ok", "not-equal", or "timed-out". + /// Note: This operation only works with a shared `BigInt64Array` + /// and may not be allowed on the main thread. + /// + /// You should use `wait` to operate on a `Int32Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)] + pub fn wait_bigint( + typed_array: &BigInt64Array, + index: u32, + value: i64, + ) -> Result; + /// Like `wait()`, but with timeout /// + /// You should use `wait_with_timeout_bigint` to operate on a `BigInt64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait) #[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)] pub fn wait_with_timeout( @@ -942,15 +1212,106 @@ pub mod Atomics { timeout: f64, ) -> Result; + /// Like `wait()`, but with timeout + /// + /// You should use `wait_with_timeout` to operate on a `Int32Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = wait)] + pub fn wait_with_timeout_bigint( + typed_array: &BigInt64Array, + index: u32, + value: i64, + timeout: f64, + ) -> Result; + + /// The static `Atomics.waitAsync()` method verifies that a given position in an + /// `Int32Array` still contains a given value and if so sleeps, awaiting a + /// wakeup or a timeout. It returns an object with two properties. The first + /// property `async` is a boolean which if true indicates that the second + /// property `value` is a promise. If `async` is false then value is a string + /// whether equal to either "not-equal" or "timed-out". + /// Note: This operation only works with a shared `Int32Array` and may be used + /// on the main thread. + /// + /// You should use `wait_async_bigint` to operate on a `BigInt64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/waitAsync) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = waitAsync)] + pub fn wait_async( + typed_array: &Int32Array, + index: u32, + value: i32, + ) -> Result; + + /// The static `Atomics.waitAsync()` method verifies that a given position in an + /// `Int32Array` still contains a given value and if so sleeps, awaiting a + /// wakeup or a timeout. It returns an object with two properties. The first + /// property `async` is a boolean which if true indicates that the second + /// property `value` is a promise. If `async` is false then value is a string + /// whether equal to either "not-equal" or "timed-out". + /// Note: This operation only works with a shared `BigInt64Array` and may be used + /// on the main thread. + /// + /// You should use `wait_async` to operate on a `Int32Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/waitAsync) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = waitAsync)] + pub fn wait_async_bigint( + typed_array: &BigInt64Array, + index: u32, + value: i64, + ) -> Result; + + /// Like `waitAsync()`, but with timeout + /// + /// You should use `wait_async_with_timeout_bigint` to operate on a `BigInt64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/waitAsync) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = waitAsync)] + pub fn wait_async_with_timeout( + typed_array: &Int32Array, + index: u32, + value: i32, + timeout: f64, + ) -> Result; + + /// Like `waitAsync()`, but with timeout + /// + /// You should use `wait_async_with_timeout` to operate on a `Int32Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/waitAsync) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = waitAsync)] + pub fn wait_async_with_timeout_bigint( + typed_array: &BigInt64Array, + index: u32, + value: i64, + timeout: f64, + ) -> Result; + /// The static `Atomics.xor()` method computes a bitwise XOR /// with a given value at a given position in the array, /// and returns the old value at that position. /// This atomic operation guarantees that no other write happens /// until the modified value is written back. /// + /// You should use `xor_bigint` to operate on a `BigInt64Array` or a `BigUint64Array`. + /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/xor) #[wasm_bindgen(js_namespace = Atomics, catch)] pub fn xor(typed_array: &JsValue, index: u32, value: i32) -> Result; + + /// The static `Atomics.xor()` method computes a bitwise XOR + /// with a given value at a given position in the array, + /// and returns the old value at that position. + /// This atomic operation guarantees that no other write happens + /// until the modified value is written back. + /// + /// This method is used to operate on a `BigInt64Array` or a `BigUint64Array`. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/xor) + #[wasm_bindgen(js_namespace = Atomics, catch, js_name = xor)] + pub fn xor_bigint(typed_array: &JsValue, index: u32, value: i64) -> Result; } } @@ -1032,6 +1393,16 @@ impl BigInt { .pow(JsValue::as_ref(rhs)) .unchecked_into() } + + /// Returns a tuple of this [`BigInt`]'s absolute value along with a + /// [`bool`] indicating whether the [`BigInt`] was negative. + fn abs(&self) -> (Self, bool) { + if self < &BigInt::from(0) { + (-self, true) + } else { + (self.clone(), false) + } + } } macro_rules! bigint_from { @@ -1046,12 +1417,12 @@ macro_rules! bigint_from { impl PartialEq<$x> for BigInt { #[inline] fn eq(&self, other: &$x) -> bool { - JsValue::from(self) == BigInt::from(*other).unchecked_into::() + JsValue::from(self) == JsValue::from(BigInt::from(*other)) } } )*) } -bigint_from!(i8 u8 i16 u16 i32 u32); +bigint_from!(i8 u8 i16 u16 i32 u32 isize usize); macro_rules! bigint_from_big { ($($x:ident)*) => ($( @@ -1068,9 +1439,18 @@ macro_rules! bigint_from_big { self == &BigInt::from(*other) } } + + impl TryFrom for $x { + type Error = BigInt; + + #[inline] + fn try_from(x: BigInt) -> Result { + Self::try_from(JsValue::from(x)).map_err(JsCast::unchecked_into) + } + } )*) } -bigint_from_big!(i64 u64 i128 u128 isize usize); +bigint_from_big!(i64 u64 i128 u128); impl PartialEq for BigInt { #[inline] @@ -1129,41 +1509,42 @@ impl fmt::Debug for BigInt { impl fmt::Display for BigInt { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.pad_integral(self >= &BigInt::from(0), "", &self.to_string_unchecked(10)) + let (abs, is_neg) = self.abs(); + f.pad_integral(!is_neg, "", &abs.to_string_unchecked(10)) } } impl fmt::Binary for BigInt { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.pad_integral(self >= &BigInt::from(0), "0b", &self.to_string_unchecked(2)) + let (abs, is_neg) = self.abs(); + f.pad_integral(!is_neg, "0b", &abs.to_string_unchecked(2)) } } impl fmt::Octal for BigInt { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.pad_integral(self >= &BigInt::from(0), "0o", &self.to_string_unchecked(8)) + let (abs, is_neg) = self.abs(); + f.pad_integral(!is_neg, "0o", &abs.to_string_unchecked(8)) } } impl fmt::LowerHex for BigInt { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.pad_integral( - self >= &BigInt::from(0), - "0x", - &self.to_string_unchecked(16), - ) + let (abs, is_neg) = self.abs(); + f.pad_integral(!is_neg, "0x", &abs.to_string_unchecked(16)) } } impl fmt::UpperHex for BigInt { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let mut s: String = self.to_string_unchecked(16); + let (abs, is_neg) = self.abs(); + let mut s: String = abs.to_string_unchecked(16); s.make_ascii_uppercase(); - f.pad_integral(self >= &BigInt::from(0), "0x", &s) + f.pad_integral(!is_neg, "0x", &s) } } @@ -1256,6 +1637,18 @@ extern "C" { #[wasm_bindgen(constructor)] pub fn new(buffer: &ArrayBuffer, byteOffset: usize, byteLength: usize) -> DataView; + /// The `DataView` view provides a low-level interface for reading and + /// writing multiple number types in an `ArrayBuffer` irrespective of the + /// platform's endianness. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) + #[wasm_bindgen(constructor)] + pub fn new_with_shared_array_buffer( + buffer: &SharedArrayBuffer, + byteOffset: usize, + byteLength: usize, + ) -> DataView; + /// The ArrayBuffer referenced by this view. Fixed at construction time and thus read only. /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer) @@ -1915,7 +2308,7 @@ impl<'a> IntoIterator for &'a Iterator { } } -impl<'a> std::iter::Iterator for Iter<'a> { +impl core::iter::Iterator for Iter<'_> { type Item = Result; fn next(&mut self) -> Option { @@ -1935,7 +2328,7 @@ impl IntoIterator for Iterator { } } -impl std::iter::Iterator for IntoIter { +impl core::iter::Iterator for IntoIter { type Item = Result; fn next(&mut self) -> Option { @@ -2386,7 +2779,7 @@ impl Number { /// (without actually being zero). /// /// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) - // Cannot use f64::MIN_POSITIVE since that is the smallest **normal** postitive number. + // Cannot use f64::MIN_POSITIVE since that is the smallest **normal** positive number. pub const MIN_VALUE: f64 = 5E-324; /// Special "Not a Number" value. /// @@ -2439,6 +2832,38 @@ macro_rules! number_from { } number_from!(i8 u8 i16 u16 i32 u32 f32 f64); +/// The error type returned when a checked integral type conversion fails. +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub struct TryFromIntError(()); + +impl fmt::Display for TryFromIntError { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt.write_str("out of range integral type conversion attempted") + } +} + +#[cfg(feature = "std")] +impl std::error::Error for TryFromIntError {} + +macro_rules! number_try_from { + ($($x:ident)*) => ($( + impl TryFrom<$x> for Number { + type Error = TryFromIntError; + + #[inline] + fn try_from(x: $x) -> Result { + let x_f64 = x as f64; + if (Number::MIN_SAFE_INTEGER..=Number::MAX_SAFE_INTEGER).contains(&x_f64) { + Ok(Number::from(x_f64)) + } else { + Err(TryFromIntError(())) + } + } + } + )*) +} +number_try_from!(i64 u64 i128 u128); + // TODO: add this on the next major version, when blanket impl is removed /* impl convert::TryFrom for Number { @@ -2967,6 +3392,13 @@ extern "C" { #[wasm_bindgen(method, js_name = toLocaleTimeString)] pub fn to_locale_time_string(this: &Date, locale: &str) -> JsString; + #[wasm_bindgen(method, js_name = toLocaleTimeString)] + pub fn to_locale_time_string_with_options( + this: &Date, + locale: &str, + options: &JsValue, + ) -> JsString; + /// The `toString()` method returns a string representing /// the specified Date object. /// @@ -3961,6 +4393,16 @@ pub mod WebAssembly { #[wasm_bindgen(js_namespace = WebAssembly)] pub fn compile(buffer_source: &JsValue) -> Promise; + /// The `WebAssembly.compileStreaming()` function compiles a + /// `WebAssembly.Module` module directly from a streamed underlying + /// source. This function is useful if it is necessary to a compile a + /// module before it can be instantiated (otherwise, the + /// `WebAssembly.instantiateStreaming()` function should be used). + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming) + #[wasm_bindgen(js_namespace = WebAssembly, js_name = compileStreaming)] + pub fn compile_streaming(response: &Promise) -> Promise; + /// The `WebAssembly.instantiate()` function allows you to compile and /// instantiate WebAssembly code. /// @@ -3978,7 +4420,7 @@ pub mod WebAssembly { /// The `WebAssembly.instantiateStreaming()` function compiles and /// instantiates a WebAssembly module directly from a streamed /// underlying source. This is the most efficient, optimized way to load - /// wasm code. + /// Wasm code. /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming) #[wasm_bindgen(js_namespace = WebAssembly, js_name = instantiateStreaming)] @@ -3986,7 +4428,7 @@ pub mod WebAssembly { /// The `WebAssembly.validate()` function validates a given typed /// array of WebAssembly binary code, returning whether the bytes - /// form a valid wasm module (`true`) or not (`false`). + /// form a valid Wasm module (`true`) or not (`false`). /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate) #[wasm_bindgen(js_namespace = WebAssembly, catch)] @@ -4180,6 +4622,64 @@ pub mod WebAssembly { pub fn set(this: &Table, index: u32, function: &Function) -> Result<(), JsValue>; } + // WebAssembly.Tag + #[wasm_bindgen] + extern "C" { + /// The `WebAssembly.Tag()` constructor creates a new `Tag` object + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Tag) + #[wasm_bindgen(js_namespace = WebAssembly, extends = Object, typescript_type = "WebAssembly.Tag")] + #[derive(Clone, Debug, PartialEq, Eq)] + pub type Tag; + + /// The `WebAssembly.Tag()` constructor creates a new `Tag` object + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Tag) + #[wasm_bindgen(constructor, js_namespace = WebAssembly, catch)] + pub fn new(tag_descriptor: &Object) -> Result; + } + + // WebAssembly.Exception + #[wasm_bindgen] + extern "C" { + /// The `WebAssembly.Exception()` constructor creates a new `Exception` object + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Exception) + #[wasm_bindgen(js_namespace = WebAssembly, extends = Object, typescript_type = "WebAssembly.Exception")] + #[derive(Clone, Debug, PartialEq, Eq)] + pub type Exception; + + /// The `WebAssembly.Exception()` constructor creates a new `Exception` object + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Exception) + #[wasm_bindgen(constructor, js_namespace = WebAssembly, catch)] + pub fn new(tag: &Tag, payload: &Array) -> Result; + + /// The `WebAssembly.Exception()` constructor creates a new `Exception` object + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Exception) + #[wasm_bindgen(constructor, js_namespace = WebAssembly, catch)] + pub fn new_with_options( + tag: &Tag, + payload: &Array, + options: &Object, + ) -> Result; + + /// The `is()` prototype method of the `WebAssembly.Exception` can be used to + /// test if the Exception matches a given tag. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Exception/is) + #[wasm_bindgen(method, js_namespace = WebAssembly)] + pub fn is(this: &Exception, tag: &Tag) -> bool; + + /// The `getArg()` prototype method of the `WebAssembly.Exception` can be used + /// to get the value of a specified item in the exception's data arguments + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Exception/getArg) + #[wasm_bindgen(method, js_namespace = WebAssembly, js_name = getArg, catch)] + pub fn get_arg(this: &Exception, tag: &Tag, index: u32) -> Result; + } + // WebAssembly.Global #[wasm_bindgen] extern "C" { @@ -4234,7 +4734,7 @@ pub mod WebAssembly { #[wasm_bindgen(method, getter, js_namespace = WebAssembly)] pub fn buffer(this: &Memory) -> JsValue; - /// The `grow()` protoype method of the `Memory` object increases the + /// The `grow()` prototype method of the `Memory` object increases the /// size of the memory instance by a specified number of WebAssembly /// pages. /// @@ -4854,7 +5354,7 @@ impl JsString { /// /// [docs]: https://rustwasm.github.io/docs/wasm-bindgen/reference/types/str.html pub fn is_valid_utf16(&self) -> bool { - std::char::decode_utf16(self.iter()).all(|i| i.is_ok()) + core::char::decode_utf16(self.iter()).all(|i| i.is_ok()) } /// Returns an iterator over the `u16` character codes that make up this JS @@ -4862,9 +5362,9 @@ impl JsString { /// /// This method will call `char_code_at` for each code in this JS string, /// returning an iterator of the codes in sequence. - pub fn iter<'a>( - &'a self, - ) -> impl ExactSizeIterator + DoubleEndedIterator + 'a { + pub fn iter( + &self, + ) -> impl ExactSizeIterator + DoubleEndedIterator + '_ { (0..self.length()).map(move |i| self.char_code_at(i) as u16) } @@ -4889,7 +5389,7 @@ impl JsString { // https://github.com/rustwasm/wasm-bindgen/issues/1362 let cp = self.code_point_at(0).as_f64().unwrap_throw() as u32; - let c = std::char::from_u32(cp)?; + let c = core::char::from_u32(cp)?; if c.len_utf16() as u32 == len { Some(c) @@ -4900,6 +5400,7 @@ impl JsString { } impl PartialEq for JsString { + #[allow(clippy::cmp_owned)] // prevent infinite recursion fn eq(&self, other: &str) -> bool { String::from(self) == other } @@ -5349,6 +5850,64 @@ pub mod Intl { ) } } + + // Intl.RelativeTimeFormat + #[wasm_bindgen] + extern "C" { + /// The `Intl.RelativeTimeFormat` object is a constructor for objects + /// that enable language-sensitive relative time formatting. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) + #[wasm_bindgen(extends = Object, js_namespace = Intl, typescript_type = "Intl.RelativeTimeFormat")] + #[derive(Clone, Debug)] + pub type RelativeTimeFormat; + + /// The `Intl.RelativeTimeFormat` object is a constructor for objects + /// that enable language-sensitive relative time formatting. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) + #[wasm_bindgen(constructor, js_namespace = Intl)] + pub fn new(locales: &Array, options: &Object) -> RelativeTimeFormat; + + /// The `Intl.RelativeTimeFormat.prototype.format` method formats a `value` and `unit` + /// according to the locale and formatting options of this Intl.RelativeTimeFormat object. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format) + #[wasm_bindgen(method, js_class = "Intl.RelativeTimeFormat")] + pub fn format(this: &RelativeTimeFormat, value: f64, unit: &str) -> JsString; + + /// The `Intl.RelativeTimeFormat.prototype.formatToParts()` method returns an array of + /// objects representing the relative time format in parts that can be used for custom locale-aware formatting. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts) + #[wasm_bindgen(method, js_class = "Intl.RelativeTimeFormat", js_name = formatToParts)] + pub fn format_to_parts(this: &RelativeTimeFormat, value: f64, unit: &str) -> Array; + + /// The `Intl.RelativeTimeFormat.prototype.resolvedOptions()` method returns a new + /// object with properties reflecting the locale and relative time formatting + /// options computed during initialization of this RelativeTimeFormat object. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions) + #[wasm_bindgen(method, js_namespace = Intl, js_name = resolvedOptions)] + pub fn resolved_options(this: &RelativeTimeFormat) -> Object; + + /// The `Intl.RelativeTimeFormat.supportedLocalesOf()` method returns an array + /// containing those of the provided locales that are supported in date and time + /// formatting without having to fall back to the runtime's default locale. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat/supportedLocalesOf) + #[wasm_bindgen(static_method_of = RelativeTimeFormat, js_namespace = Intl, js_name = supportedLocalesOf)] + pub fn supported_locales_of(locales: &Array, options: &Object) -> Array; + } + + impl Default for RelativeTimeFormat { + fn default() -> Self { + Self::new( + &JsValue::UNDEFINED.unchecked_into(), + &JsValue::UNDEFINED.unchecked_into(), + ) + } + } } // Promise @@ -5476,19 +6035,22 @@ extern "C" { /// This allows access to the global properties and global names by accessing /// the `Object` returned. pub fn global() -> Object { - thread_local!(static GLOBAL: Object = get_global_object()); + use once_cell::unsync::Lazy; + + struct Wrapper(Lazy); - return GLOBAL.with(|g| g.clone()); + #[cfg(not(target_feature = "atomics"))] + unsafe impl Sync for Wrapper {} + + #[cfg(not(target_feature = "atomics"))] + unsafe impl Send for Wrapper {} + + #[cfg_attr(target_feature = "atomics", thread_local)] + static GLOBAL: Wrapper = Wrapper(Lazy::new(get_global_object)); + + return GLOBAL.0.clone(); fn get_global_object() -> Object { - // This is a bit wonky, but we're basically using `#[wasm_bindgen]` - // attributes to synthesize imports so we can access properties of the - // form: - // - // * `globalThis.globalThis` - // * `self.self` - // * ... (etc) - // // Accessing the global object is not an easy thing to do, and what we // basically want is `globalThis` but we can't rely on that existing // everywhere. In the meantime we've got the fallbacks mentioned in: @@ -5502,26 +6064,27 @@ pub fn global() -> Object { extern "C" { type Global; - #[wasm_bindgen(getter, catch, static_method_of = Global, js_class = globalThis, js_name = globalThis)] - fn get_global_this() -> Result; + #[wasm_bindgen(thread_local_v2, js_name = globalThis)] + static GLOBAL_THIS: Option; - #[wasm_bindgen(getter, catch, static_method_of = Global, js_class = self, js_name = self)] - fn get_self() -> Result; + #[wasm_bindgen(thread_local_v2, js_name = self)] + static SELF: Option; - #[wasm_bindgen(getter, catch, static_method_of = Global, js_class = window, js_name = window)] - fn get_window() -> Result; + #[wasm_bindgen(thread_local_v2, js_name = window)] + static WINDOW: Option; - #[wasm_bindgen(getter, catch, static_method_of = Global, js_class = global, js_name = global)] - fn get_global() -> Result; + #[wasm_bindgen(thread_local_v2, js_name = global)] + static GLOBAL: Option; } // The order is important: in Firefox Extension Content Scripts `globalThis` // is a Sandbox (not Window), so `globalThis` must be checked after `window`. - let static_object = Global::get_self() - .or_else(|_| Global::get_window()) - .or_else(|_| Global::get_global_this()) - .or_else(|_| Global::get_global()); - if let Ok(obj) = static_object { + let static_object = SELF + .with(Option::clone) + .or_else(|| WINDOW.with(Option::clone)) + .or_else(|| GLOBAL_THIS.with(Option::clone)) + .or_else(|| GLOBAL.with(Option::clone)); + if let Some(obj) = static_object { if !obj.is_undefined() { return obj; } @@ -5662,6 +6225,13 @@ macro_rules! arrays { #[wasm_bindgen(method)] pub fn at(this: &$name, idx: i32) -> Option<$ty>; + /// The `copyWithin()` method shallow copies part of a typed array to another + /// location in the same typed array and returns it, without modifying its size. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) + #[wasm_bindgen(method, js_name = copyWithin)] + pub fn copy_within(this: &$name, target: i32, start: i32, end: i32) -> $name; + /// Gets the value at `idx`, equivalent to the javascript `my_var = arr[idx]`. #[wasm_bindgen(method, structural, indexing_getter)] pub fn get_index(this: &$name, idx: u32) -> $ty; @@ -5678,7 +6248,7 @@ macro_rules! arrays { /// This function returns a new typed array which is a view into /// wasm's memory. This view does not copy the underlying data. /// - /// # Unsafety + /// # Safety /// /// Views into WebAssembly memory are only valid so long as the /// backing buffer isn't resized in JS. Once this function is called @@ -5707,7 +6277,7 @@ macro_rules! arrays { /// This function returns a new typed array which is a view into /// wasm's memory. This view does not copy the underlying data. /// - /// # Unsafety + /// # Safety /// /// Views into WebAssembly memory are only valid so long as the /// backing buffer isn't resized in JS. Once this function is called @@ -5715,7 +6285,7 @@ macro_rules! arrays { /// the returned value here to be invalidated. Use with caution! /// /// Additionally the returned object can be safely mutated, - /// the changes are guranteed to be reflected in the input array. + /// the changes are guaranteed to be reflected in the input array. pub unsafe fn view_mut_raw(ptr: *mut $ty, length: usize) -> $name { let buf = wasm_bindgen::memory(); let mem = buf.unchecked_ref::(); @@ -5731,10 +6301,10 @@ macro_rules! arrays { /// Rust pointer. /// /// This function will efficiently copy the memory from a typed - /// array into this wasm module's own linear memory, initializing + /// array into this Wasm module's own linear memory, initializing /// the memory destination provided. /// - /// # Unsafety + /// # Safety /// /// This function requires `dst` to point to a buffer /// large enough to fit this array's contents. @@ -5750,7 +6320,7 @@ macro_rules! arrays { /// Rust slice. /// /// This function will efficiently copy the memory from a typed - /// array into this wasm module's own linear memory, initializing + /// array into this Wasm module's own linear memory, initializing /// the memory destination provided. /// /// # Panics @@ -5758,22 +6328,39 @@ macro_rules! arrays { /// This function will panic if this typed array's length is /// different than the length of the provided `dst` array. pub fn copy_to(&self, dst: &mut [$ty]) { - assert_eq!(self.length() as usize, dst.len()); + core::assert_eq!(self.length() as usize, dst.len()); unsafe { self.raw_copy_to_ptr(dst.as_mut_ptr()); } } + /// Copy the contents of this JS typed array into the destination + /// Rust slice. + /// + /// This function will efficiently copy the memory from a typed + /// array into this Wasm module's own linear memory, initializing + /// the memory destination provided. + /// + /// # Panics + /// + /// This function will panic if this typed array's length is + /// different than the length of the provided `dst` array. + pub fn copy_to_uninit<'dst>(&self, dst: &'dst mut [MaybeUninit<$ty>]) -> &'dst mut [$ty] { + core::assert_eq!(self.length() as usize, dst.len()); + unsafe { self.raw_copy_to_ptr(dst.as_mut_ptr().cast()); } + unsafe { &mut *(dst as *mut [MaybeUninit<$ty>] as *mut [$ty]) } + } + /// Copy the contents of the source Rust slice into this /// JS typed array. /// /// This function will efficiently copy the memory from within - /// the wasm module's own linear memory to this typed array. + /// the Wasm module's own linear memory to this typed array. /// /// # Panics /// /// This function will panic if this typed array's length is /// different than the length of the provided `src` array. pub fn copy_from(&self, src: &[$ty]) { - assert_eq!(self.length() as usize, src.len()); + core::assert_eq!(self.length() as usize, src.len()); // This is safe because the `set` function copies from its TypedArray argument unsafe { self.set(&$name::view(src), 0) } } @@ -5844,9 +6431,9 @@ arrays! { /// `BigInt64Array()` /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array - BigInt64Array: BigInt, + BigInt64Array: i64, /// `BigUint64Array()` /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array - BigUint64Array: BigInt, + BigUint64Array: u64, } diff --git a/crates/js-sys/tests/browser.rs b/crates/js-sys/tests/browser.rs new file mode 100644 index 00000000000..38b55e9792c --- /dev/null +++ b/crates/js-sys/tests/browser.rs @@ -0,0 +1,11 @@ +#![cfg(target_arch = "wasm32")] + +extern crate js_sys; +extern crate wasm_bindgen; +extern crate wasm_bindgen_test; + +use wasm_bindgen_test::*; + +wasm_bindgen_test_configure!(run_in_browser); + +pub mod common; diff --git a/crates/js-sys/tests/headless.js b/crates/js-sys/tests/common/headless.js similarity index 100% rename from crates/js-sys/tests/headless.js rename to crates/js-sys/tests/common/headless.js diff --git a/crates/js-sys/tests/headless.rs b/crates/js-sys/tests/common/mod.rs similarity index 81% rename from crates/js-sys/tests/headless.rs rename to crates/js-sys/tests/common/mod.rs index aafa6b0ae2a..b5cdd579c76 100644 --- a/crates/js-sys/tests/headless.rs +++ b/crates/js-sys/tests/common/mod.rs @@ -1,16 +1,8 @@ -#![cfg(target_arch = "wasm32")] - -extern crate js_sys; -extern crate wasm_bindgen; -extern crate wasm_bindgen_test; - use js_sys::Array; use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; -wasm_bindgen_test_configure!(run_in_browser); - -#[wasm_bindgen(module = "/tests/headless.js")] +#[wasm_bindgen(module = "/tests/common/headless.js")] extern "C" { fn is_array_values_supported() -> bool; } diff --git a/crates/js-sys/tests/node.rs b/crates/js-sys/tests/node.rs new file mode 100644 index 00000000000..d4d5d1139c9 --- /dev/null +++ b/crates/js-sys/tests/node.rs @@ -0,0 +1,11 @@ +#![cfg(target_arch = "wasm32")] + +extern crate js_sys; +extern crate wasm_bindgen; +extern crate wasm_bindgen_test; + +use wasm_bindgen_test::*; + +wasm_bindgen_test_configure!(run_in_node_experimental); + +pub mod common; diff --git a/crates/js-sys/tests/wasm/Array.js b/crates/js-sys/tests/wasm/Array.js index 8810bd9db88..f4d6ab71382 100644 --- a/crates/js-sys/tests/wasm/Array.js +++ b/crates/js-sys/tests/wasm/Array.js @@ -1,6 +1,7 @@ // Used for `Array.rs` tests -exports.populate_array = function(arr, start, len) { +exports.populate_array = function(arr, start, len) { + var isBigInt = typeof(arr[0]) === "bigint"; for (i = 0; i < len; i++) { - arr[i] = start + i; + arr[i] = isBigInt ? BigInt(start + i) : start + i; } }; diff --git a/crates/js-sys/tests/wasm/Array.rs b/crates/js-sys/tests/wasm/Array.rs index 9554f39f711..53a4bc0e30b 100644 --- a/crates/js-sys/tests/wasm/Array.rs +++ b/crates/js-sys/tests/wasm/Array.rs @@ -1,8 +1,6 @@ use js_sys::*; use std::iter::FromIterator; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; -use wasm_bindgen::JsValue; use wasm_bindgen_test::*; macro_rules! js_array { @@ -15,9 +13,7 @@ macro_rules! js_array { macro_rules! array { ($($e:expr),*) => ({ - let mut __x = Vec::new(); - $(__x.push(JsValue::from($e));)* - __x + vec![$(JsValue::from($e)),*] }) } @@ -40,7 +36,7 @@ fn from_iter() { assert_eq!( to_rust( - &vec![JsValue::from("a"), JsValue::from("b"), JsValue::from("c"),] + &[JsValue::from("a"), JsValue::from("b"), JsValue::from("c")] .iter() .collect() ), @@ -55,7 +51,7 @@ fn from_iter() { ); assert_eq!( - to_rust(&vec![array.clone(),].iter().collect()), + to_rust(&[array.clone()].iter().collect()), vec![JsValue::from(array)], ); @@ -76,7 +72,7 @@ fn from_iter() { let v = vec!["a", "b", "c"]; assert_eq!( - to_rust(&Array::from_iter(v.into_iter().map(|s| JsValue::from(s)))), + to_rust(&Array::from_iter(v.into_iter().map(JsValue::from))), vec!["a", "b", "c"], ); } @@ -292,6 +288,7 @@ fn sort() { } #[wasm_bindgen_test] +#[allow(clippy::cmp_owned)] fn some() { let array = js_array!["z", 1, "y", 2]; assert!(array.some(&mut |e| e == JsValue::from(2))); @@ -465,6 +462,25 @@ fn find() { ); } +#[wasm_bindgen_test] +fn find_last() { + let even = js_array![2, 4, 6, 8]; + assert_eq!( + even.find_last(&mut |x, _, _| x.as_f64().unwrap() % 2.0 == 0.0), + 8 + ); + let odd = js_array![1, 3, 5, 7]; + assert_eq!( + odd.find_last(&mut |x, _, _| x.as_f64().unwrap() % 2.0 == 0.0), + JsValue::undefined(), + ); + let mixed = js_array![3, 5, 7, 10]; + assert_eq!( + mixed.find_last(&mut |x, _, _| x.as_f64().unwrap() % 2.0 != 0.0), + 7 + ); +} + #[wasm_bindgen_test] fn map() { let numbers = js_array![1, 4, 9]; @@ -513,11 +529,30 @@ fn find_index() { ); } +#[wasm_bindgen_test] +fn find_last_index() { + let even = js_array![2, 4, 6, 8]; + assert_eq!( + even.find_last_index(&mut |e, _, _| e.as_f64().unwrap() % 2. == 0.), + 3 + ); + let odd = js_array![1, 3, 5, 7]; + assert_eq!( + odd.find_last_index(&mut |e, _, _| e.as_f64().unwrap() % 2. == 0.), + -1 + ); + let mixed = js_array![3, 5, 7, 10]; + assert_eq!( + mixed.find_last_index(&mut |e, _, _| e.as_f64().unwrap() % 2. != 0.), + 2 + ); +} + #[wasm_bindgen_test] fn to_locale_string() { let output = js_array![1, "a", Date::new(&"21 Dec 1997 14:12:00 UTC".into())] .to_locale_string(&"en".into(), &JsValue::undefined()); - assert!(String::from(output).len() > 0); + assert!(!String::from(output).is_empty()); } #[wasm_bindgen_test] @@ -531,11 +566,38 @@ fn for_each() { res } - assert_eq!(sum_indices_of_evens(&js_array![2, 4, 6, 8]), 0 + 1 + 2 + 3); + assert_eq!(sum_indices_of_evens(&js_array![2, 4, 6, 8]), 1 + 2 + 3); assert_eq!(sum_indices_of_evens(&js_array![1, 3, 5, 7]), 0); assert_eq!(sum_indices_of_evens(&js_array![3, 5, 7, 10]), 3); } +#[wasm_bindgen_test] +fn set_length() { + let array = js_array![1, 2, 3, 4, 5]; + array.set_length(3); + assert_eq!( + array.iter().collect::>(), + [1.0, 2.0, 3.0].map(JsValue::from_f64) + ); + + array.set_length(7); + assert_eq!( + array.iter().collect::>(), + [1.0, 2.0, 3.0] + .iter() + .copied() + .map(JsValue::from_f64) + .chain([JsValue::UNDEFINED; 4]) + .collect::>() + ); + + let mut calls = 0; + array.for_each(&mut |_, _, _| calls += 1); + // The later elements don't get filled with `undefined`, they get filled with + // empty slots, which get skipped by `for_each`. + assert_eq!(calls, 3); +} + #[wasm_bindgen_test] fn array_inheritance() { let array = Array::new(); @@ -557,8 +619,7 @@ fn test_array_view_mut_raw( let start: u8 = 10; let len: usize = 32; let end: u8 = start + len as u8; - let mut buffer: Vec = Vec::new(); - buffer.reserve(len); + let mut buffer: Vec = Vec::with_capacity(len); unsafe { let array: ArrT = sut(buffer.as_mut_ptr(), len); populate_array( @@ -594,6 +655,15 @@ fn Int32Array_view_mut_raw() { test_array_view_mut_raw(js_sys::Int32Array::view_mut_raw, i32::from, JsValue::from); } +#[wasm_bindgen_test] +fn BigInt64Array_view_mut_raw() { + test_array_view_mut_raw( + js_sys::BigInt64Array::view_mut_raw, + i64::from, + JsValue::from, + ); +} + #[wasm_bindgen_test] fn Uint8Array_view_mut_raw() { test_array_view_mut_raw(js_sys::Uint8Array::view_mut_raw, u8::from, JsValue::from); @@ -618,6 +688,15 @@ fn Uint32Array_view_mut_raw() { test_array_view_mut_raw(js_sys::Uint32Array::view_mut_raw, u32::from, JsValue::from); } +#[wasm_bindgen_test] +fn BigUint64Array_view_mut_raw() { + test_array_view_mut_raw( + js_sys::BigUint64Array::view_mut_raw, + u64::from, + JsValue::from, + ); +} + #[wasm_bindgen_test] fn Float32Array_view_mut_raw() { test_array_view_mut_raw(js_sys::Float32Array::view_mut_raw, f32::from, JsValue::from); diff --git a/crates/js-sys/tests/wasm/BigInt.rs b/crates/js-sys/tests/wasm/BigInt.rs new file mode 100644 index 00000000000..a9cd30dfb0d --- /dev/null +++ b/crates/js-sys/tests/wasm/BigInt.rs @@ -0,0 +1,43 @@ +use js_sys::BigInt; +use wasm_bindgen::prelude::*; +use wasm_bindgen_test::wasm_bindgen_test; + +/// `assert_eq!`, but the arguments are converted to `JsValue`s. +#[track_caller] +fn assert_jsvalue_eq(a: impl Into, b: impl Into) { + assert_eq!(a.into(), b.into()); +} + +#[wasm_bindgen_test] +fn from() { + // Test that all the `From` impls work properly. + assert_jsvalue_eq(BigInt::from(1u8), 1u64); + assert_jsvalue_eq(BigInt::from(1u16), 1u64); + assert_jsvalue_eq(BigInt::from(1u32), 1u64); + assert_jsvalue_eq(BigInt::from(1u64), 1u64); + assert_jsvalue_eq(BigInt::from(1u128), 1u64); + assert_jsvalue_eq(BigInt::from(1usize), 1u64); + assert_jsvalue_eq(BigInt::from(-3i8), -3i64); + assert_jsvalue_eq(BigInt::from(-3i16), -3i64); + assert_jsvalue_eq(BigInt::from(-3i32), -3i64); + assert_jsvalue_eq(BigInt::from(-3i64), -3i64); + assert_jsvalue_eq(BigInt::from(-3i128), -3i64); + assert_jsvalue_eq(BigInt::from(-3isize), -3i64); +} + +#[wasm_bindgen_test] +fn eq() { + // Test that all the `Eq` impls work properly. + assert_eq!(BigInt::from(1u64), 1u8); + assert_eq!(BigInt::from(1u64), 1u16); + assert_eq!(BigInt::from(1u64), 1u32); + assert_eq!(BigInt::from(1u64), 1u64); + assert_eq!(BigInt::from(1u64), 1u128); + assert_eq!(BigInt::from(1u64), 1usize); + assert_eq!(BigInt::from(-3i64), -3i8); + assert_eq!(BigInt::from(-3i64), -3i16); + assert_eq!(BigInt::from(-3i64), -3i32); + assert_eq!(BigInt::from(-3i64), -3i64); + assert_eq!(BigInt::from(-3i64), -3i128); + assert_eq!(BigInt::from(-3i64), -3isize); +} diff --git a/crates/js-sys/tests/wasm/Boolean.rs b/crates/js-sys/tests/wasm/Boolean.rs index 5e4b3faa486..ed1eddf5465 100644 --- a/crates/js-sys/tests/wasm/Boolean.rs +++ b/crates/js-sys/tests/wasm/Boolean.rs @@ -6,13 +6,13 @@ use wasm_bindgen_test::*; #[allow(deprecated)] #[wasm_bindgen_test] fn new_undefined() { - assert_eq!(Boolean::new(&JsValue::undefined()).value_of(), false); + assert!(!Boolean::new(&JsValue::undefined()).value_of()); } #[allow(deprecated)] #[wasm_bindgen_test] -fn new_truely() { - assert_eq!(Boolean::new(&JsValue::from("foo")).value_of(), true); +fn new_truly() { + assert!(Boolean::new(&JsValue::from("foo")).value_of()); } #[allow(deprecated)] diff --git a/crates/js-sys/tests/wasm/DataView.rs b/crates/js-sys/tests/wasm/DataView.rs index 7747019a5c4..e2014ca3ee2 100644 --- a/crates/js-sys/tests/wasm/DataView.rs +++ b/crates/js-sys/tests/wasm/DataView.rs @@ -7,8 +7,7 @@ use wasm_bindgen_test::*; fn test() { let bytes = Int8Array::new(&JsValue::from(10)); - // TODO: figure out how to do `bytes[2] = 2` - bytes.subarray(2, 3).fill(2, 0, 1); + bytes.set_index(2, 2); let v = DataView::new(&bytes.buffer(), 2, 8); assert_eq!(v.byte_offset(), 2); @@ -63,18 +62,14 @@ fn test() { v.set_int8(0, 42); - // TODO: figure out how to do `bytes[2]` - bytes - .subarray(2, 3) - .for_each(&mut |x, _, _| assert_eq!(x, 42)); + assert_eq!(bytes.get_index(2), 42); } #[wasm_bindgen_test] fn dataview_inheritance() { let bytes = Int8Array::new(&JsValue::from(10)); - // TODO: figure out how to do `bytes[2] = 2` - bytes.subarray(2, 3).fill(2, 0, 1); + bytes.set_index(2, 2); let v = DataView::new(&bytes.buffer(), 2, 8); diff --git a/crates/js-sys/tests/wasm/Date.rs b/crates/js-sys/tests/wasm/Date.rs index 712862ed72a..16ccb3f1529 100644 --- a/crates/js-sys/tests/wasm/Date.rs +++ b/crates/js-sys/tests/wasm/Date.rs @@ -441,7 +441,12 @@ fn set_utc_seconds() { #[wasm_bindgen_test] fn to_date_string() { - let date = Date::new(&"05 October 2011 14:48 UTC".into()); + // Create the date from date components rather than a string because this + // constructor interprets it as a date in the local time zone, which is how + // `toDateString` outputs it. This makes sure that this test will work in any + // time zone. + // October is 9 rather than 10 because the months count from 0. + let date = Date::new_with_year_month_day_hr_min(2011, 9, 5, 14, 48); assert_eq!(JsValue::from(date.to_date_string()), "Wed Oct 05 2011"); } @@ -482,6 +487,10 @@ fn to_locale_time_string() { JsValue::from(date.to_locale_time_string("en-US")), "11:15:30 PM", ); + assert_eq!( + JsValue::from(date.to_locale_time_string_with_options("en-US", &JsValue::undefined())), + "11:15:30 PM", + ); } #[wasm_bindgen_test] diff --git a/crates/js-sys/tests/wasm/Function.rs b/crates/js-sys/tests/wasm/Function.rs index c87a46cca2d..e9e2ad3acc1 100644 --- a/crates/js-sys/tests/wasm/Function.rs +++ b/crates/js-sys/tests/wasm/Function.rs @@ -5,13 +5,13 @@ use wasm_bindgen_test::*; #[wasm_bindgen] extern "C" { - #[wasm_bindgen(js_name = max, js_namespace = Math)] + #[wasm_bindgen(thread_local_v2, js_name = max, js_namespace = Math)] static MAX: Function; type ArrayPrototype; #[wasm_bindgen(method, getter, structural)] pub fn push(this: &ArrayPrototype) -> Function; - #[wasm_bindgen(js_name = prototype, js_namespace = Array)] + #[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Array)] static ARRAY_PROTOTYPE2: ArrayPrototype; } @@ -21,12 +21,19 @@ fn apply() { args.push(&1.into()); args.push(&2.into()); args.push(&3.into()); - assert_eq!(MAX.apply(&JsValue::undefined(), &args).unwrap(), 3); + assert_eq!( + MAX.with(|max| max.apply(&JsValue::undefined(), &args)) + .unwrap(), + 3 + ); let arr = JsValue::from(Array::new()); let args = Array::new(); args.push(&1.into()); - ARRAY_PROTOTYPE2.push().apply(&arr, &args).unwrap(); + ARRAY_PROTOTYPE2 + .with(ArrayPrototype::push) + .apply(&arr, &args) + .unwrap(); assert_eq!(Array::from(&arr).length(), 1); } @@ -111,24 +118,29 @@ fn bind3() { #[wasm_bindgen_test] fn length() { - assert_eq!(MAX.length(), 2); - assert_eq!(ARRAY_PROTOTYPE2.push().length(), 1); + assert_eq!(MAX.with(Function::length), 2); + assert_eq!(ARRAY_PROTOTYPE2.with(ArrayPrototype::push).length(), 1); } #[wasm_bindgen_test] fn name() { - assert_eq!(JsValue::from(MAX.name()), "max"); - assert_eq!(JsValue::from(ARRAY_PROTOTYPE2.push().name()), "push"); + assert_eq!(JsValue::from(MAX.with(Function::name)), "max"); + assert_eq!( + JsValue::from(ARRAY_PROTOTYPE2.with(ArrayPrototype::push).name()), + "push" + ); } #[wasm_bindgen_test] fn to_string() { - assert!(MAX.to_string().length() > 0); + assert!(MAX.with(Function::to_string).length() > 0); } #[wasm_bindgen_test] fn function_inheritance() { - assert!(MAX.is_instance_of::()); - assert!(MAX.is_instance_of::()); - let _: &Object = MAX.as_ref(); + assert!(MAX.with(Function::is_instance_of::)); + assert!(MAX.with(Function::is_instance_of::)); + MAX.with(|max| { + let _: &Object = max.as_ref(); + }); } diff --git a/crates/js-sys/tests/wasm/Intl.rs b/crates/js-sys/tests/wasm/Intl.rs index 427ea00a5da..5d4675e8a5f 100644 --- a/crates/js-sys/tests/wasm/Intl.rs +++ b/crates/js-sys/tests/wasm/Intl.rs @@ -112,6 +112,26 @@ fn plural_rules() { assert!(a.is_instance_of::()); } +#[wasm_bindgen_test] +fn relative_time_format() { + let locales = Array::of1(&JsValue::from("en-US")); + let opts = Object::new(); + + let c = Intl::RelativeTimeFormat::new(&locales, &opts); + assert!(c.format(1_f64, "seconds").is_string()); + assert!(c + .format_to_parts(1_f64, "seconds") + .is_instance_of::()); + assert!(c.resolved_options().is_instance_of::()); + + assert_eq!(c.format(1_f64, "seconds"), "in 1 second"); + assert_eq!(c.format(1.5, "seconds"), "in 1.5 seconds"); + assert_eq!(c.format(-1.5, "seconds"), "1.5 seconds ago"); + + let a = Intl::RelativeTimeFormat::supported_locales_of(&locales, &opts); + assert!(a.is_instance_of::()); +} + #[wasm_bindgen_test] fn plural_rules_inheritance() { let locales = Array::of1(&JsValue::from("en-US")); diff --git a/crates/js-sys/tests/wasm/JSON.rs b/crates/js-sys/tests/wasm/JSON.rs index 920ac1d6f62..a5b006759da 100644 --- a/crates/js-sys/tests/wasm/JSON.rs +++ b/crates/js-sys/tests/wasm/JSON.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen_test] diff --git a/crates/js-sys/tests/wasm/JsString.rs b/crates/js-sys/tests/wasm/JsString.rs index 33cd53bce9f..31aed27f589 100644 --- a/crates/js-sys/tests/wasm/JsString.rs +++ b/crates/js-sys/tests/wasm/JsString.rs @@ -1,7 +1,7 @@ +#![cfg(test)] + use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; -use wasm_bindgen::JsValue; use wasm_bindgen_test::*; #[wasm_bindgen(module = "tests/wasm/JsString.js")] @@ -71,9 +71,9 @@ fn ends_with() { let js = JsString::from(s); // TODO: remove third parameter once we have optional parameters - assert_eq!(js.ends_with("question.", s.len() as i32), true); - assert_eq!(js.ends_with("to be", s.len() as i32), false); - assert_eq!(js.ends_with("to be", 19), true); + assert!(js.ends_with("question.", s.len() as i32)); + assert!(!js.ends_with("to be", s.len() as i32)); + assert!(js.ends_with("to be", 19)); } #[wasm_bindgen_test] @@ -95,7 +95,7 @@ fn from_char_code() { let codes_u16: Vec = codes .into_iter() .map(|code| { - assert!(code <= u32::from(u16::max_value())); + assert!(code <= u32::from(u16::MAX)); code as u16 }) .collect(); @@ -123,9 +123,9 @@ fn from_code_point() { ); assert_eq!(JsString::from_code_point(&codes).unwrap(), "☃★♲你"); - assert!(!JsString::from_code_point1(0x10FFFF).is_err()); + assert!(JsString::from_code_point1(0x10FFFF).is_ok()); assert!(JsString::from_code_point1(0x110000).is_err()); - assert!(JsString::from_code_point1(u32::max_value()).is_err()); + assert!(JsString::from_code_point1(u32::MAX).is_err()); } #[wasm_bindgen_test] @@ -133,13 +133,13 @@ fn includes() { let str = JsString::from("Blue Whale"); // TODO: remove second parameter once we have optional parameters - assert_eq!(str.includes("Blue", 0), true); - assert_eq!(str.includes("Blute", 0), false); - assert_eq!(str.includes("Whale", 0), true); - assert_eq!(str.includes("Whale", 5), true); - assert_eq!(str.includes("Whale", 7), false); - assert_eq!(str.includes("", 0), true); - assert_eq!(str.includes("", 16), true); + assert!(str.includes("Blue", 0)); + assert!(!str.includes("Blute", 0)); + assert!(str.includes("Whale", 0)); + assert!(str.includes("Whale", 5)); + assert!(!str.includes("Whale", 7)); + assert!(str.includes("", 0)); + assert!(str.includes("", 16)); } #[wasm_bindgen_test] @@ -227,12 +227,12 @@ fn match_all() { .unwrap(); let obj = &result[0]; - assert_eq!(Reflect::get(obj.as_ref(), &"0".into()).unwrap(), "The"); - assert_eq!(Reflect::get(obj.as_ref(), &"1".into()).unwrap(), "he"); + assert_eq!(Reflect::get(obj, &"0".into()).unwrap(), "The"); + assert_eq!(Reflect::get(obj, &"1".into()).unwrap(), "he"); let obj = &result[1]; - assert_eq!(Reflect::get(obj.as_ref(), &"0".into()).unwrap(), "It"); - assert_eq!(Reflect::get(obj.as_ref(), &"1".into()).unwrap(), "t"); + assert_eq!(Reflect::get(obj, &"0".into()).unwrap(), "It"); + assert_eq!(Reflect::get(obj, &"1".into()).unwrap(), "t"); let result: Vec<_> = JsString::from("foo") .match_all(&re) @@ -251,29 +251,20 @@ fn match_all() { let obj = &result[0]; assert_eq!( - Reflect::get(obj.as_ref(), &"0".into()).unwrap(), + Reflect::get(obj, &"0".into()).unwrap(), "see Chapter 3.4.5.1" ); - assert_eq!( - Reflect::get(obj.as_ref(), &"1".into()).unwrap(), - "Chapter 3.4.5.1" - ); - assert_eq!(Reflect::get(obj.as_ref(), &"2".into()).unwrap(), ".1"); - assert_eq!(Reflect::get(obj.as_ref(), &"index".into()).unwrap(), 22); - assert_eq!(Reflect::get(obj.as_ref(), &"input".into()).unwrap(), s); + assert_eq!(Reflect::get(obj, &"1".into()).unwrap(), "Chapter 3.4.5.1"); + assert_eq!(Reflect::get(obj, &"2".into()).unwrap(), ".1"); + assert_eq!(Reflect::get(obj, &"index".into()).unwrap(), 22); + assert_eq!(Reflect::get(obj, &"input".into()).unwrap(), s); let obj = &result[1]; - assert_eq!( - Reflect::get(obj.as_ref(), &"0".into()).unwrap(), - "see Chapter 3.1.4" - ); - assert_eq!( - Reflect::get(obj.as_ref(), &"1".into()).unwrap(), - "Chapter 3.1.4" - ); - assert_eq!(Reflect::get(obj.as_ref(), &"2".into()).unwrap(), ".4"); - assert_eq!(Reflect::get(obj.as_ref(), &"index".into()).unwrap(), 48); - assert_eq!(Reflect::get(obj.as_ref(), &"input".into()).unwrap(), s); + assert_eq!(Reflect::get(obj, &"0".into()).unwrap(), "see Chapter 3.1.4"); + assert_eq!(Reflect::get(obj, &"1".into()).unwrap(), "Chapter 3.1.4"); + assert_eq!(Reflect::get(obj, &"2".into()).unwrap(), ".4"); + assert_eq!(Reflect::get(obj, &"index".into()).unwrap(), 48); + assert_eq!(Reflect::get(obj, &"input".into()).unwrap(), s); } #[wasm_bindgen_test] @@ -514,8 +505,8 @@ fn to_locale_lower_case() { let js = JsString::from("Mozilla"); assert_eq!(js.to_locale_lower_case(None), "mozilla"); let s = JsString::from("\u{0130}"); - assert_eq!(s.to_locale_lower_case(Some("tr".into())), "i"); - assert_ne!(s.to_locale_lower_case(Some("en-US".into())), "i"); + assert_eq!(s.to_locale_lower_case(Some("tr")), "i"); + assert_ne!(s.to_locale_lower_case(Some("en-US")), "i"); } #[wasm_bindgen_test] @@ -523,8 +514,8 @@ fn to_locale_upper_case() { let js = JsString::from("mozilla"); assert_eq!(js.to_locale_upper_case(None), "MOZILLA"); let s = JsString::from("i\u{0307}"); - assert_eq!(s.to_locale_upper_case(Some("lt".into())), "I"); - assert_ne!(s.to_locale_upper_case(Some("en-US".into())), "I"); + assert_eq!(s.to_locale_upper_case(Some("lt")), "I"); + assert_ne!(s.to_locale_upper_case(Some("en-US")), "I"); } #[wasm_bindgen_test] @@ -575,7 +566,7 @@ fn value_of() { fn raw() { let call_site = Object::new(); let raw = Array::of3(&"foo".into(), &"bar".into(), &"123".into()); - Reflect::set(&call_site.as_ref(), &"raw".into(), &raw.into()).unwrap(); + Reflect::set(call_site.as_ref(), &"raw".into(), &raw.into()).unwrap(); assert_eq!( JsString::raw_2(&call_site, "5", "JavaScript").unwrap(), "foo5barJavaScript123" diff --git a/crates/js-sys/tests/wasm/Map.rs b/crates/js-sys/tests/wasm/Map.rs index 8223c6e709e..3bdff9b504e 100644 --- a/crates/js-sys/tests/wasm/Map.rs +++ b/crates/js-sys/tests/wasm/Map.rs @@ -19,8 +19,8 @@ fn delete() { let map = Map::new(); map.set(&"foo".into(), &"bar".into()); assert_eq!(map.size(), 1); - assert_eq!(map.delete(&"foo".into()), true); - assert_eq!(map.delete(&"bar".into()), false); + assert!(map.delete(&"foo".into())); + assert!(!map.delete(&"bar".into())); assert_eq!(map.size(), 0); } @@ -63,8 +63,8 @@ fn get() { fn has() { let map = Map::new(); map.set(&"foo".into(), &"bar".into()); - assert_eq!(map.has(&"foo".into()), true); - assert_eq!(map.has(&"bar".into()), false); + assert!(map.has(&"foo".into())); + assert!(!map.has(&"bar".into())); } #[wasm_bindgen_test] @@ -76,8 +76,8 @@ fn new() { fn set() { let map = Map::new(); let new = map.set(&"foo".into(), &"bar".into()); - assert_eq!(map.has(&"foo".into()), true); - assert_eq!(new.has(&"foo".into()), true); + assert!(map.has(&"foo".into())); + assert!(new.has(&"foo".into())); } #[wasm_bindgen_test] diff --git a/crates/js-sys/tests/wasm/MapIterator.rs b/crates/js-sys/tests/wasm/MapIterator.rs index 6a6eec391fb..6b64c0861bd 100644 --- a/crates/js-sys/tests/wasm/MapIterator.rs +++ b/crates/js-sys/tests/wasm/MapIterator.rs @@ -9,7 +9,7 @@ fn entries() { let entries = map.entries(); let next = entries.next().unwrap(); - assert_eq!(next.done(), false); + assert!(!next.done()); assert!(next.value().is_object()); assert_eq!(Reflect::get(&next.value(), &0.into()).unwrap(), "uno"); assert_eq!(Reflect::get(&next.value(), &1.into()).unwrap(), 1); @@ -27,7 +27,7 @@ fn keys() { let keys = map.keys(); let next = keys.next().unwrap(); - assert_eq!(next.done(), false); + assert!(!next.done()); assert_eq!(next.value(), "uno"); let next = keys.next().unwrap(); @@ -43,7 +43,7 @@ fn values() { let values = map.values(); let next = values.next().unwrap(); - assert_eq!(next.done(), false); + assert!(!next.done()); assert_eq!(next.value(), 1); let next = values.next().unwrap(); diff --git a/crates/js-sys/tests/wasm/Math.rs b/crates/js-sys/tests/wasm/Math.rs index 95b70b5c00d..e1e97ee0620 100644 --- a/crates/js-sys/tests/wasm/Math.rs +++ b/crates/js-sys/tests/wasm/Math.rs @@ -1,5 +1,4 @@ -use std::f64::consts::PI; -use std::f64::{NAN, NEG_INFINITY}; +use std::f64::consts::{FRAC_PI_3, LN_2, LOG10_2, PI}; use js_sys::*; use wasm_bindgen_test::*; @@ -30,7 +29,7 @@ fn abs() { #[wasm_bindgen_test] fn acos() { assert_eq!(Math::acos(-1.), PI); - assert_eq!(Math::acos(0.5), 1.0471975511965979); + assert_eq!(Math::acos(0.5), FRAC_PI_3); assert!(Math::acos(2.).is_nan()); } @@ -127,9 +126,9 @@ fn floor() { #[wasm_bindgen_test] fn fround() { assert!(Math::fround(5.5) == 5.5); - assert!(Math::fround(5.05) == 5.050000190734863); + assert!(Math::fround(5.05) == 5.05); assert!(Math::fround(5.) == 5.); - assert!(Math::fround(-5.05) == -5.050000190734863); + assert!(Math::fround(-5.05) == -5.05); } #[wasm_bindgen_test] @@ -157,14 +156,14 @@ fn log() { fn log10() { assert_eq!(Math::log10(100000.), 5.); assert_eq!(Math::log10(1.), 0.); - assert_eq!(Math::log10(2.), 0.3010299956639812); + assert_eq!(Math::log10(2.), LOG10_2); } #[wasm_bindgen_test] fn log1p() { - assert_eq!(Math::log1p(1.), 0.6931471805599453); + assert_eq!(Math::log1p(1.), LN_2); assert_eq!(Math::log1p(0.), 0.); - assert_eq!(Math::log1p(-1.), NEG_INFINITY); + assert_eq!(Math::log1p(-1.), f64::NEG_INFINITY); assert!(Math::log1p(-2.).is_nan()); } @@ -173,7 +172,7 @@ fn log2() { assert_eq!(Math::log2(3.), 1.584962500721156); assert_eq!(Math::log2(2.), 1.); assert_eq!(Math::log2(1.), 0.); - assert_eq!(Math::log2(0.), NEG_INFINITY); + assert_eq!(Math::log2(0.), f64::NEG_INFINITY); } #[wasm_bindgen_test] @@ -222,7 +221,7 @@ fn sign() { assert_eq!(Math::sign(-3.), -1.); assert_eq!(Math::sign(2.3), 1.); assert_eq!(Math::sign(0.), 0.); - assert!(Math::sign(NAN).is_nan()); + assert!(Math::sign(f64::NAN).is_nan()); } #[wasm_bindgen_test] diff --git a/crates/js-sys/tests/wasm/Number.rs b/crates/js-sys/tests/wasm/Number.rs index 6c3416eda5b..55199bfbb83 100644 --- a/crates/js-sys/tests/wasm/Number.rs +++ b/crates/js-sys/tests/wasm/Number.rs @@ -1,8 +1,7 @@ -use std::f64::{INFINITY, NAN}; +use std::convert::TryFrom; use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen(module = "tests/wasm/Number.js")] @@ -21,8 +20,8 @@ fn is_finite() { assert!(Number::is_finite(&42.into())); assert!(Number::is_finite(&42.1.into())); assert!(!Number::is_finite(&"42".into())); - assert!(!Number::is_finite(&NAN.into())); - assert!(!Number::is_finite(&INFINITY.into())); + assert!(!Number::is_finite(&f64::NAN.into())); + assert!(!Number::is_finite(&f64::INFINITY.into())); } #[wasm_bindgen_test] @@ -33,7 +32,7 @@ fn is_integer() { #[wasm_bindgen_test] fn is_nan() { - assert!(Number::is_nan(&NAN.into())); + assert!(Number::is_nan(&f64::NAN.into())); assert!(!Number::is_nan(&JsValue::TRUE)); assert!(!Number::is_nan(&JsValue::NULL)); @@ -51,16 +50,13 @@ fn is_nan() { #[wasm_bindgen_test] fn is_safe_integer() { - assert_eq!(Number::is_safe_integer(&42.into()), true); - assert_eq!( - Number::is_safe_integer(&(Math::pow(2., 53.) - 1.).into()), - true - ); - assert_eq!(Number::is_safe_integer(&Math::pow(2., 53.).into()), false); - assert_eq!(Number::is_safe_integer(&"42".into()), false); - assert_eq!(Number::is_safe_integer(&42.1.into()), false); - assert_eq!(Number::is_safe_integer(&NAN.into()), false); - assert_eq!(Number::is_safe_integer(&INFINITY.into()), false); + assert!(Number::is_safe_integer(&42.into())); + assert!(Number::is_safe_integer(&(Math::pow(2., 53.) - 1.).into())); + assert!(!Number::is_safe_integer(&Math::pow(2., 53.).into())); + assert!(!Number::is_safe_integer(&"42".into())); + assert!(!Number::is_safe_integer(&42.1.into())); + assert!(!Number::is_safe_integer(&f64::NAN.into())); + assert!(!Number::is_safe_integer(&f64::INFINITY.into())); } #[allow(deprecated)] @@ -72,6 +68,21 @@ fn new() { assert_eq!(Number::from(v).value_of(), 42.); } +#[wasm_bindgen_test] +fn try_from() { + assert_eq!(Number::try_from(42u128).unwrap(), 42.); + assert_eq!( + Number::try_from(Number::MAX_SAFE_INTEGER as u64).unwrap(), + Number::MAX_SAFE_INTEGER + ); + assert_eq!( + Number::try_from(Number::MIN_SAFE_INTEGER as i128).unwrap(), + Number::MIN_SAFE_INTEGER + ); + assert!(Number::try_from(Number::MAX_SAFE_INTEGER as u128 + 1).is_err()); + assert!(Number::try_from(Number::MIN_SAFE_INTEGER as i64 - 1).is_err()); +} + #[wasm_bindgen_test] fn parse_int_float() { assert_eq!(Number::parse_int("42", 10), 42.); diff --git a/crates/js-sys/tests/wasm/Object.rs b/crates/js-sys/tests/wasm/Object.rs index 4f1ade9727c..7388c4e1046 100644 --- a/crates/js-sys/tests/wasm/Object.rs +++ b/crates/js-sys/tests/wasm/Object.rs @@ -1,7 +1,7 @@ +#![cfg(test)] + use js_sys::*; -use std::f64::NAN; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen] @@ -10,9 +10,9 @@ extern "C" { #[wasm_bindgen(method, setter, structural)] fn set_foo(this: &Foo42, val: JsValue); - #[wasm_bindgen(js_name = prototype, js_namespace = Object)] + #[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Object)] static OBJECT_PROTOTYPE: JsValue; - #[wasm_bindgen(js_name = prototype, js_namespace = Array)] + #[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Array)] static ARRAY_PROTOTYPE: JsValue; type DefinePropertyAttrs; @@ -33,9 +33,9 @@ extern "C" { #[wasm_bindgen(constructor)] fn new() -> Foo; - #[wasm_bindgen(js_name = prototype, js_namespace = Foo)] + #[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Foo)] static FOO_PROTOTYPE: Object; - #[wasm_bindgen(js_name = prototype, js_namespace = Bar)] + #[wasm_bindgen(thread_local_v2, js_name = prototype, js_namespace = Bar)] static BAR_PROTOTYPE: Object; } @@ -179,9 +179,9 @@ fn get_own_property_symbols() { #[wasm_bindgen_test] fn get_prototype_of() { let proto = JsValue::from(Object::get_prototype_of(&Object::new().into())); - assert_eq!(proto, *OBJECT_PROTOTYPE); + OBJECT_PROTOTYPE.with(|op| assert_eq!(proto, *op)); let proto = JsValue::from(Object::get_prototype_of(&Array::new().into())); - assert_eq!(proto, *ARRAY_PROTOTYPE); + ARRAY_PROTOTYPE.with(|ap| assert_eq!(proto, *ap)); } #[wasm_bindgen_test] @@ -214,7 +214,10 @@ fn is() { assert!(Object::is(&JsValue::FALSE, &JsValue::FALSE)); assert!(Object::is(&"foo".into(), &"foo".into())); assert!(Object::is(&JsValue::from(42), &JsValue::from(42))); - assert!(Object::is(&JsValue::from(NAN), &JsValue::from(NAN))); + assert!(Object::is( + &JsValue::from(f64::NAN), + &JsValue::from(f64::NAN) + )); let another_object = JsValue::from(Object::new()); assert!(!Object::is(&object, &another_object)); @@ -250,8 +253,8 @@ fn is_sealed() { #[wasm_bindgen_test] fn is_prototype_of() { let foo = JsValue::from(Foo::new()); - assert!(FOO_PROTOTYPE.is_prototype_of(&foo)); - assert!(!BAR_PROTOTYPE.is_prototype_of(&foo)); + assert!(FOO_PROTOTYPE.with(|fp| fp.is_prototype_of(&foo))); + assert!(!BAR_PROTOTYPE.with(|bp| bp.is_prototype_of(&foo))); } #[wasm_bindgen_test] @@ -297,7 +300,10 @@ fn value_of() { let a = JsValue::from(foo_42()); let b = JsValue::from(foo_42()); let a2 = JsValue::from(Object::from(a.clone()).value_of()); - assert_eq!(a, a); + #[allow(clippy::eq_op)] + { + assert_eq!(a, a); + } assert_eq!(a, a2); assert_ne!(a, b); assert_ne!(a2, b); diff --git a/crates/js-sys/tests/wasm/Reflect.rs b/crates/js-sys/tests/wasm/Reflect.rs index d50629ec12b..5936b013d9e 100644 --- a/crates/js-sys/tests/wasm/Reflect.rs +++ b/crates/js-sys/tests/wasm/Reflect.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use js_sys::*; use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; diff --git a/crates/js-sys/tests/wasm/Set.rs b/crates/js-sys/tests/wasm/Set.rs index 045e192e6dd..3346de472d0 100644 --- a/crates/js-sys/tests/wasm/Set.rs +++ b/crates/js-sys/tests/wasm/Set.rs @@ -1,12 +1,11 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; fn set2vec(s: &Set) -> Vec { let mut result = Vec::new(); s.for_each(&mut |x, _, _| result.push(x)); - return result; + result } #[wasm_bindgen_test] diff --git a/crates/js-sys/tests/wasm/SharedArrayBuffer.rs b/crates/js-sys/tests/wasm/SharedArrayBuffer.rs index fdfd55d9bbb..6b50d7278b5 100644 --- a/crates/js-sys/tests/wasm/SharedArrayBuffer.rs +++ b/crates/js-sys/tests/wasm/SharedArrayBuffer.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen(module = "tests/wasm/SharedArrayBuffer.js")] diff --git a/crates/js-sys/tests/wasm/Symbol.rs b/crates/js-sys/tests/wasm/Symbol.rs index 0f1e3d0f63d..0f7a8868309 100644 --- a/crates/js-sys/tests/wasm/Symbol.rs +++ b/crates/js-sys/tests/wasm/Symbol.rs @@ -1,3 +1,5 @@ +#![cfg(test)] + use js_sys::*; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::JsFuture; @@ -85,8 +87,11 @@ fn to_string_tag() { fn for_() { let foo = JsValue::from(Symbol::for_("foo")); let bar = JsValue::from(Symbol::for_("bar")); - assert_eq!(foo, foo); - assert_eq!(bar, bar); + #[allow(clippy::eq_op)] + { + assert_eq!(foo, foo); + assert_eq!(bar, bar); + } assert_ne!(foo, bar); assert_ne!(bar, foo); diff --git a/crates/js-sys/tests/wasm/Temporal.rs b/crates/js-sys/tests/wasm/Temporal.rs index 5ea651bee06..feff11991c3 100644 --- a/crates/js-sys/tests/wasm/Temporal.rs +++ b/crates/js-sys/tests/wasm/Temporal.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen(module = "tests/wasm/Temporal.js")] diff --git a/crates/js-sys/tests/wasm/TypedArray.rs b/crates/js-sys/tests/wasm/TypedArray.rs index ef06a4c440b..262021255ac 100644 --- a/crates/js-sys/tests/wasm/TypedArray.rs +++ b/crates/js-sys/tests/wasm/TypedArray.rs @@ -1,6 +1,7 @@ +use std::mem::MaybeUninit; + use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; macro_rules! each { @@ -17,7 +18,7 @@ macro_rules! each { }; } -macro_rules! test_inheritence { +macro_rules! test_inheritance { ($arr:ident) => {{ let arr = $arr::new(&JsValue::undefined()); assert!(arr.is_instance_of::<$arr>()); @@ -26,8 +27,8 @@ macro_rules! test_inheritence { }}; } #[wasm_bindgen_test] -fn inheritence() { - each!(test_inheritence); +fn inheritance() { + each!(test_inheritance); } macro_rules! test_undefined { @@ -101,6 +102,24 @@ fn new_at() { each!(test_at); } +macro_rules! test_copy_within { + ($arr:ident) => {{ + let x: Vec<_> = vec![8, 5, 4, 3, 1, 2]; + let array = $arr::from(x.into_iter().map(|v| v as _).collect::>().as_slice()); + array.copy_within(1, 4, 5); + + assert_eq!(array.get_index(1) as f64, 1f64); + + // if negatives were used + array.copy_within(-1, -3, -2); + assert_eq!(array.get_index(5) as f64, 3f64); + }}; +} +#[wasm_bindgen_test] +fn new_copy_within() { + each!(test_copy_within); +} + macro_rules! test_get_set { ($arr:ident) => {{ let arr = $arr::new(&1.into()); @@ -157,6 +176,17 @@ fn copy_to() { } } +#[wasm_bindgen_test] +fn copy_to_uninit() { + let mut x = [MaybeUninit::uninit(); 10]; + let array = Int32Array::new(&10.into()); + array.fill(5, 0, 10); + let x = array.copy_to_uninit(&mut x); + for i in x.iter() { + assert_eq!(*i, 5); + } +} + #[wasm_bindgen_test] fn copy_from() { let x = [1, 2, 3]; diff --git a/crates/js-sys/tests/wasm/WeakMap.rs b/crates/js-sys/tests/wasm/WeakMap.rs index 1eab1cb9d99..b308c05f478 100644 --- a/crates/js-sys/tests/wasm/WeakMap.rs +++ b/crates/js-sys/tests/wasm/WeakMap.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen] diff --git a/crates/js-sys/tests/wasm/WeakSet.rs b/crates/js-sys/tests/wasm/WeakSet.rs index 094038b5fc3..2e5d576d2a4 100644 --- a/crates/js-sys/tests/wasm/WeakSet.rs +++ b/crates/js-sys/tests/wasm/WeakSet.rs @@ -1,6 +1,5 @@ use js_sys::*; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; #[wasm_bindgen] diff --git a/crates/js-sys/tests/wasm/WebAssembly.rs b/crates/js-sys/tests/wasm/WebAssembly.rs index 7a06e256a2c..ed28d764137 100644 --- a/crates/js-sys/tests/wasm/WebAssembly.rs +++ b/crates/js-sys/tests/wasm/WebAssembly.rs @@ -1,5 +1,5 @@ use js_sys::*; -use wasm_bindgen::{prelude::*, JsCast}; +use wasm_bindgen::prelude::*; use wasm_bindgen_futures::JsFuture; use wasm_bindgen_test::*; @@ -101,7 +101,7 @@ fn module_imports() { #[wasm_bindgen_test] fn table_inheritance() { - let table = WebAssembly::Table::new(&get_table_object().into()).unwrap(); + let table = WebAssembly::Table::new(&get_table_object()).unwrap(); assert!(table.is_instance_of::()); assert!(table.is_instance_of::()); @@ -118,7 +118,7 @@ fn table_error() { #[wasm_bindgen_test] fn table() { - let table = WebAssembly::Table::new(&get_table_object().into()).unwrap(); + let table = WebAssembly::Table::new(&get_table_object()).unwrap(); assert_eq!(table.length(), 1); assert!(table.get(0).is_ok()); @@ -183,17 +183,6 @@ async fn instantiate_module() { assert!(inst.is_instance_of::()); } -#[wasm_bindgen_test] -async fn instantiate_streaming() { - let response = Promise::resolve(&get_valid_wasm()); - let imports = get_imports(); - let p = WebAssembly::instantiate_streaming(&response, &imports); - let obj = JsFuture::from(p).await.unwrap(); - assert!(Reflect::get(obj.as_ref(), &"instance".into()) - .unwrap() - .is_instance_of::()); -} - #[wasm_bindgen_test] fn memory_works() { let obj = Object::new(); diff --git a/crates/js-sys/tests/wasm/global_fns.rs b/crates/js-sys/tests/wasm/global_fns.rs index 1a2c5e1c573..b15344bdf4e 100644 --- a/crates/js-sys/tests/wasm/global_fns.rs +++ b/crates/js-sys/tests/wasm/global_fns.rs @@ -1,12 +1,9 @@ -use std::f64::{INFINITY, NAN}; - use js_sys::*; use wasm_bindgen_test::*; #[wasm_bindgen_test] fn test_decode_uri() { let x = decode_uri("https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B") - .ok() .expect("should decode URI OK"); assert_eq!(String::from(x), "https://mozilla.org/?x=шеллы"); @@ -15,9 +12,7 @@ fn test_decode_uri() { #[wasm_bindgen_test] fn test_decode_uri_component() { - let x = decode_uri_component("%3Fx%3Dtest") - .ok() - .expect("should decode URI OK"); + let x = decode_uri_component("%3Fx%3Dtest").expect("should decode URI OK"); assert_eq!(String::from(x), "?x=test"); assert!(decode_uri_component("%E0%A4%A").is_err()); @@ -37,12 +32,10 @@ fn test_encode_uri_component() { #[wasm_bindgen_test] fn test_eval() { - let x = eval("42").ok().expect("should eval OK"); + let x = eval("42").expect("should eval OK"); assert_eq!(x.as_f64().unwrap(), 42.0); - let err = eval("(function () { throw 42; }())") - .err() - .expect("eval should throw"); + let err = eval("(function () { throw 42; }())").expect_err("eval should throw"); assert_eq!(err.as_f64().unwrap(), 42.0); } @@ -51,8 +44,8 @@ fn test_is_finite() { assert!(is_finite(&42.into())); assert!(is_finite(&42.1.into())); assert!(is_finite(&"42".into())); - assert!(!is_finite(&NAN.into())); - assert!(!is_finite(&INFINITY.into())); + assert!(!is_finite(&f64::NAN.into())); + assert!(!is_finite(&f64::INFINITY.into())); } #[wasm_bindgen_test] diff --git a/crates/js-sys/tests/wasm/main.rs b/crates/js-sys/tests/wasm/main.rs index 82e96759d03..627c88ddf88 100644 --- a/crates/js-sys/tests/wasm/main.rs +++ b/crates/js-sys/tests/wasm/main.rs @@ -4,6 +4,7 @@ pub mod Array; pub mod ArrayBuffer; pub mod ArrayIterator; +pub mod BigInt; pub mod Boolean; pub mod DataView; pub mod Date; diff --git a/crates/macro-support/Cargo.toml b/crates/macro-support/Cargo.toml index 3bebaa3fe93..2a7067ca9fb 100644 --- a/crates/macro-support/Cargo.toml +++ b/crates/macro-support/Cargo.toml @@ -1,24 +1,28 @@ [package] -name = "wasm-bindgen-macro-support" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro-support" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen" description = """ The part of the implementation of the `#[wasm_bindgen]` attribute that is not in the shared backend crate """ -edition = '2018' +documentation = "https://docs.rs/wasm-bindgen" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-macro-support" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro-support" +rust-version = "1.57" +version = "0.2.100" [features] -spans = ["wasm-bindgen-backend/spans"] extra-traits = ["syn/extra-traits"] strict-macro = [] [dependencies] -syn = { version = '1.0.67', features = ['visit', 'full'] } -quote = '1.0' proc-macro2 = "1.0" -wasm-bindgen-backend = { path = "../backend", version = "=0.2.80" } -wasm-bindgen-shared = { path = "../shared", version = "=0.2.80" } +quote = '1.0' +syn = { version = '2.0', features = ['visit', 'visit-mut', 'full'] } +wasm-bindgen-backend = { path = "../backend", version = "=0.2.100" } +wasm-bindgen-shared = { path = "../shared", version = "=0.2.100" } + +[lints] +workspace = true diff --git a/crates/macro-support/src/lib.rs b/crates/macro-support/src/lib.rs index 9996849596a..3070be02807 100644 --- a/crates/macro-support/src/lib.rs +++ b/crates/macro-support/src/lib.rs @@ -12,9 +12,10 @@ extern crate wasm_bindgen_backend as backend; extern crate wasm_bindgen_shared as shared; pub use crate::parser::BindgenAttrs; -use crate::parser::MacroParse; +use crate::parser::{ConvertToAst, MacroParse}; use backend::{Diagnostic, TryToTokens}; use proc_macro2::TokenStream; +use quote::quote; use quote::ToTokens; use quote::TokenStreamExt; use syn::parse::{Parse, ParseStream, Result as SynResult}; @@ -24,9 +25,25 @@ mod parser; /// Takes the parsed input from a `#[wasm_bindgen]` macro and returns the generated bindings pub fn expand(attr: TokenStream, input: TokenStream) -> Result { parser::reset_attrs_used(); + // if struct is encountered, add `derive` attribute and let everything happen there (workaround + // to help parsing cfg_attr correctly). let item = syn::parse2::(input)?; - let opts = syn::parse2(attr)?; + if let syn::Item::Struct(s) = item { + let opts: BindgenAttrs = syn::parse2(attr.clone())?; + let wasm_bindgen = opts + .wasm_bindgen() + .cloned() + .unwrap_or_else(|| syn::parse_quote! { wasm_bindgen }); + + let item = quote! { + #[derive(#wasm_bindgen::__rt::BindgenedStruct)] + #[wasm_bindgen(#attr)] + #s + }; + return Ok(item); + } + let opts = syn::parse2(attr)?; let mut tokens = proc_macro2::TokenStream::new(); let mut program = backend::ast::Program::default(); item.macro_parse(&mut program, (Some(opts), &mut tokens))?; @@ -35,7 +52,19 @@ pub fn expand(attr: TokenStream, input: TokenStream) -> Result Result { + parser::reset_attrs_used(); + let opts = syn::parse2(input)?; + + let mut tokens = proc_macro2::TokenStream::new(); + let link = parser::link_to(opts)?; + link.try_to_tokens(&mut tokens)?; Ok(tokens) } @@ -46,12 +75,11 @@ pub fn expand_class_marker( input: TokenStream, ) -> Result { parser::reset_attrs_used(); - let mut item = syn::parse2::(input)?; + let mut item = syn::parse2::(input)?; let opts: ClassMarker = syn::parse2(attr)?; let mut program = backend::ast::Program::default(); - item.macro_parse(&mut program, (&opts.class, &opts.js_class))?; - parser::assert_all_attrs_checked(); // same as above + item.macro_parse(&mut program, &opts)?; // This is where things are slightly different, we are being expanded in the // context of an impl so we can't inject arbitrary item-like tokens into the @@ -62,13 +90,14 @@ pub fn expand_class_marker( // statics and such, and they should all be valid in the context of the // start of a function. // - // We manually implement `ToTokens for ImplItemMethod` here, injecting our + // We manually implement `ToTokens for ImplItemFn` here, injecting our // program's tokens before the actual method's inner body tokens. let mut tokens = proc_macro2::TokenStream::new(); - tokens.append_all(item.attrs.iter().filter(|attr| match attr.style { - syn::AttrStyle::Outer => true, - _ => false, - })); + tokens.append_all( + item.attrs + .iter() + .filter(|attr| matches!(attr.style, syn::AttrStyle::Outer)), + ); item.vis.to_tokens(&mut tokens); item.sig.to_tokens(&mut tokens); let mut err = None; @@ -76,10 +105,12 @@ pub fn expand_class_marker( if let Err(e) = program.try_to_tokens(tokens) { err = Some(e); } - tokens.append_all(item.attrs.iter().filter(|attr| match attr.style { - syn::AttrStyle::Inner(_) => true, - _ => false, - })); + parser::check_unused_attrs(tokens); // same as above + tokens.append_all( + item.attrs + .iter() + .filter(|attr| matches!(attr.style, syn::AttrStyle::Inner(_))), + ); tokens.append_all(&item.block.stmts); }); @@ -93,13 +124,80 @@ pub fn expand_class_marker( struct ClassMarker { class: syn::Ident, js_class: String, + wasm_bindgen: syn::Path, + wasm_bindgen_futures: syn::Path, } impl Parse for ClassMarker { fn parse(input: ParseStream) -> SynResult { let class = input.parse::()?; input.parse::()?; - let js_class = input.parse::()?.value(); - Ok(ClassMarker { class, js_class }) + let mut js_class = input.parse::()?.value(); + js_class = js_class + .strip_prefix("r#") + .map(String::from) + .unwrap_or(js_class); + + let mut wasm_bindgen = None; + let mut wasm_bindgen_futures = None; + + loop { + if input.parse::>()?.is_some() { + let ident = input.parse::()?; + + if ident == "wasm_bindgen" { + if wasm_bindgen.is_some() { + return Err(syn::Error::new( + ident.span(), + "found duplicate `wasm_bindgen`", + )); + } + + input.parse::()?; + wasm_bindgen = Some(input.parse::()?); + } else if ident == "wasm_bindgen_futures" { + if wasm_bindgen_futures.is_some() { + return Err(syn::Error::new( + ident.span(), + "found duplicate `wasm_bindgen_futures`", + )); + } + + input.parse::()?; + wasm_bindgen_futures = Some(input.parse::()?); + } else { + return Err(syn::Error::new( + ident.span(), + "expected `wasm_bindgen` or `wasm_bindgen_futures`", + )); + } + } else { + break; + } + } + + Ok(ClassMarker { + class, + js_class, + wasm_bindgen: wasm_bindgen.unwrap_or_else(|| syn::parse_quote! { wasm_bindgen }), + wasm_bindgen_futures: wasm_bindgen_futures + .unwrap_or_else(|| syn::parse_quote! { wasm_bindgen_futures }), + }) } } + +pub fn expand_struct_marker(item: TokenStream) -> Result { + parser::reset_attrs_used(); + + let mut s: syn::ItemStruct = syn::parse2(item)?; + + let mut program = backend::ast::Program::default(); + program.structs.push((&mut s).convert(&program)?); + + let mut tokens = proc_macro2::TokenStream::new(); + program.try_to_tokens(&mut tokens)?; + + parser::check_unused_attrs(&mut tokens); + + Ok(tokens) +} diff --git a/crates/macro-support/src/parser.rs b/crates/macro-support/src/parser.rs index 4768b3d15de..41e54d7531e 100644 --- a/crates/macro-support/src/parser.rs +++ b/crates/macro-support/src/parser.rs @@ -1,24 +1,140 @@ -use std::cell::Cell; -use std::char; +use std::cell::{Cell, RefCell}; +use std::collections::HashMap; use std::str::Chars; +use std::{char, iter}; use ast::OperationKind; -use backend::ast; +use backend::ast::{self, ThreadLocal}; use backend::util::{ident_ty, ShortHash}; use backend::Diagnostic; -use proc_macro2::{Delimiter, Ident, Span, TokenStream, TokenTree}; +use proc_macro2::{Ident, Span, TokenStream, TokenTree}; use quote::ToTokens; -use shared; -use syn; +use shared::identifier::is_valid_ident; +use syn::ext::IdentExt; use syn::parse::{Parse, ParseStream, Result as SynResult}; use syn::spanned::Spanned; +use syn::visit_mut::VisitMut; +use syn::{ItemFn, Lit, MacroDelimiter, ReturnType}; + +use crate::ClassMarker; thread_local!(static ATTRS: AttributeParseState = Default::default()); +/// Javascript keywords. +/// +/// Note that some of these keywords are only reserved in strict mode. Since we +/// generate strict mode JS code, we treat all of these as reserved. +/// +/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#reserved_words +const JS_KEYWORDS: [&str; 47] = [ + "arguments", + "break", + "case", + "catch", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "else", + "enum", + "eval", + "export", + "extends", + "false", + "finally", + "for", + "function", + "if", + "implements", + "import", + "in", + "instanceof", + "interface", + "let", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "static", + "super", + "switch", + "this", + "throw", + "true", + "try", + "typeof", + "var", + "void", + "while", + "with", + "yield", +]; + +/// Javascript keywords that behave like values in that they can be called like +/// functions or have properties accessed on them. +/// +/// Naturally, this list is a subset of `JS_KEYWORDS`. +const VALUE_LIKE_JS_KEYWORDS: [&str; 7] = [ + "eval", // eval is a function-like keyword, so e.g. `eval(...)` is valid + "false", // false resolves to a boolean value, so e.g. `false.toString()` is valid + "import", // import.meta and import() + "new", // new.target + "super", // super can be used for a function call (`super(...)`) or property lookup (`super.prop`) + "this", // this obviously can be used as a value + "true", // true resolves to a boolean value, so e.g. `false.toString()` is valid +]; + +/// Returns whether the given string is a JS keyword. +fn is_js_keyword(keyword: &str) -> bool { + JS_KEYWORDS.contains(&keyword) +} +/// Returns whether the given string is a JS keyword that does NOT behave like +/// a value. +/// +/// Value-like keywords can be called like functions or have properties +/// accessed, which makes it possible to use them in imports. In general, +/// imports should use this function to check for reserved keywords. +fn is_non_value_js_keyword(keyword: &str) -> bool { + JS_KEYWORDS.contains(&keyword) && !VALUE_LIKE_JS_KEYWORDS.contains(&keyword) +} + +/// Return an [`Err`] if the given string contains a comment close syntax (`*/``). +fn check_js_comment_close(str: &str, span: Span) -> Result<(), Diagnostic> { + if str.contains("*/") { + Err(Diagnostic::span_error( + span, + "contains comment close syntax", + )) + } else { + Ok(()) + } +} + +/// Return an [`Err`] if the given string is a JS keyword or contains a comment close syntax (`*/``). +fn check_invalid_type(str: &str, span: Span) -> Result<(), Diagnostic> { + if is_js_keyword(str) { + return Err(Diagnostic::span_error(span, "collides with JS keyword")); + } + check_js_comment_close(str, span)?; + Ok(()) +} + #[derive(Default)] struct AttributeParseState { parsed: Cell, checks: Cell, + unused_attrs: RefCell>, +} + +struct UnusedState { + error: bool, + ident: Ident, } /// Parsed attributes from a `#[wasm_bindgen(..)]`. @@ -28,52 +144,71 @@ pub struct BindgenAttrs { pub attrs: Vec<(Cell, BindgenAttr)>, } +/// A list of identifiers representing the namespace prefix of an imported +/// function or constant. +/// +/// The list is guaranteed to be non-empty and not start with a JS keyword. +#[cfg_attr(feature = "extra-traits", derive(Debug))] +#[derive(Clone)] +pub struct JsNamespace(Vec); + macro_rules! attrgen { ($mac:ident) => { $mac! { - (catch, Catch(Span)), - (constructor, Constructor(Span)), - (method, Method(Span)), - (static_method_of, StaticMethodOf(Span, Ident)), - (js_namespace, JsNamespace(Span, Vec, Vec)), - (module, Module(Span, String, Span)), - (raw_module, RawModule(Span, String, Span)), - (inline_js, InlineJs(Span, String, Span)), - (getter, Getter(Span, Option)), - (setter, Setter(Span, Option)), - (indexing_getter, IndexingGetter(Span)), - (indexing_setter, IndexingSetter(Span)), - (indexing_deleter, IndexingDeleter(Span)), - (structural, Structural(Span)), - (r#final, Final(Span)), - (readonly, Readonly(Span)), - (js_name, JsName(Span, String, Span)), - (js_class, JsClass(Span, String, Span)), - (inspectable, Inspectable(Span)), - (is_type_of, IsTypeOf(Span, syn::Expr)), - (extends, Extends(Span, syn::Path)), - (no_deref, NoDeref(Span)), - (vendor_prefix, VendorPrefix(Span, Ident)), - (variadic, Variadic(Span)), - (typescript_custom_section, TypescriptCustomSection(Span)), - (skip_typescript, SkipTypescript(Span)), - (start, Start(Span)), - (skip, Skip(Span)), - (typescript_type, TypeScriptType(Span, String, Span)), - (getter_with_clone, GetterWithClone(Span)), + (catch, false, Catch(Span)), + (constructor, false, Constructor(Span)), + (method, false, Method(Span)), + (static_method_of, false, StaticMethodOf(Span, Ident)), + (js_namespace, false, JsNamespace(Span, JsNamespace, Vec)), + (module, false, Module(Span, String, Span)), + (raw_module, false, RawModule(Span, String, Span)), + (inline_js, false, InlineJs(Span, String, Span)), + (getter, false, Getter(Span, Option)), + (setter, false, Setter(Span, Option)), + (indexing_getter, false, IndexingGetter(Span)), + (indexing_setter, false, IndexingSetter(Span)), + (indexing_deleter, false, IndexingDeleter(Span)), + (structural, false, Structural(Span)), + (r#final, false, Final(Span)), + (readonly, false, Readonly(Span)), + (js_name, false, JsName(Span, String, Span)), + (js_class, false, JsClass(Span, String, Span)), + (inspectable, false, Inspectable(Span)), + (is_type_of, false, IsTypeOf(Span, syn::Expr)), + (extends, false, Extends(Span, syn::Path)), + (no_deref, false, NoDeref(Span)), + (vendor_prefix, false, VendorPrefix(Span, Ident)), + (variadic, false, Variadic(Span)), + (typescript_custom_section, false, TypescriptCustomSection(Span)), + (skip_typescript, false, SkipTypescript(Span)), + (skip_jsdoc, false, SkipJsDoc(Span)), + (main, false, Main(Span)), + (start, false, Start(Span)), + (wasm_bindgen, false, WasmBindgen(Span, syn::Path)), + (js_sys, false, JsSys(Span, syn::Path)), + (wasm_bindgen_futures, false, WasmBindgenFutures(Span, syn::Path)), + (skip, false, Skip(Span)), + (typescript_type, false, TypeScriptType(Span, String, Span)), + (getter_with_clone, false, GetterWithClone(Span)), + (static_string, false, StaticString(Span)), + (thread_local, false, ThreadLocal(Span)), + (thread_local_v2, false, ThreadLocalV2(Span)), + (unchecked_return_type, true, ReturnType(Span, String, Span)), + (return_description, true, ReturnDesc(Span, String, Span)), + (unchecked_param_type, true, ParamType(Span, String, Span)), + (param_description, true, ParamDesc(Span, String, Span)), // For testing purposes only. - (assert_no_shim, AssertNoShim(Span)), + (assert_no_shim, false, AssertNoShim(Span)), } }; } macro_rules! methods { - ($(($name:ident, $variant:ident($($contents:tt)*)),)*) => { + ($(($name:ident, $invalid_unused:literal, $variant:ident($($contents:tt)*)),)*) => { $(methods!(@method $name, $variant($($contents)*));)* - #[cfg(feature = "strict-macro")] - fn check_used(self) -> Result<(), Diagnostic> { + fn enforce_used(self) -> Result<(), Diagnostic> { // Account for the fact this method was called ATTRS.with(|state| state.checks.set(state.checks.get() + 1)); @@ -82,87 +217,93 @@ macro_rules! methods { if used.get() { continue } - // The check below causes rustc to crash on powerpc64 platforms - // with an LLVM error. To avoid this, we instead use #[cfg()] - // and duplicate the function below. See #58516 for details. - /*if !cfg!(feature = "strict-macro") { - continue - }*/ let span = match attr { $(BindgenAttr::$variant(span, ..) => span,)* }; - errors.push(Diagnostic::span_error(*span, "unused #[wasm_bindgen] attribute")); + errors.push(Diagnostic::span_error(*span, "unused wasm_bindgen attribute")); } Diagnostic::from_vec(errors) } - #[cfg(not(feature = "strict-macro"))] - fn check_used(self) -> Result<(), Diagnostic> { + fn check_used(self) { // Account for the fact this method was called - ATTRS.with(|state| state.checks.set(state.checks.get() + 1)); - Ok(()) + ATTRS.with(|state| { + state.checks.set(state.checks.get() + 1); + + state.unused_attrs.borrow_mut().extend( + self.attrs + .iter() + .filter_map(|(used, attr)| if used.get() { None } else { Some(attr) }) + .map(|attr| { + match attr { + $(BindgenAttr::$variant(span, ..) => { + UnusedState { + error: $invalid_unused, + ident: syn::parse_quote_spanned!(*span => $name) + } + })* + } + }) + ); + }); } }; (@method $name:ident, $variant:ident(Span, String, Span)) => { - fn $name(&self) -> Option<(&str, Span)> { + pub(crate) fn $name(&self) -> Option<(&str, Span)> { self.attrs .iter() - .filter_map(|a| match &a.1 { + .find_map(|a| match &a.1 { BindgenAttr::$variant(_, s, span) => { a.0.set(true); Some((&s[..], *span)) } _ => None, }) - .next() } }; - (@method $name:ident, $variant:ident(Span, Vec, Vec)) => { - fn $name(&self) -> Option<(&[String], &[Span])> { + (@method $name:ident, $variant:ident(Span, JsNamespace, Vec)) => { + pub(crate) fn $name(&self) -> Option<(JsNamespace, &[Span])> { self.attrs .iter() - .filter_map(|a| match &a.1 { + .find_map(|a| match &a.1 { BindgenAttr::$variant(_, ss, spans) => { a.0.set(true); - Some((&ss[..], &spans[..])) + Some((ss.clone(), &spans[..])) } _ => None, }) - .next() } }; (@method $name:ident, $variant:ident(Span, $($other:tt)*)) => { #[allow(unused)] - fn $name(&self) -> Option<&$($other)*> { + pub(crate) fn $name(&self) -> Option<&$($other)*> { self.attrs .iter() - .filter_map(|a| match &a.1 { + .find_map(|a| match &a.1 { BindgenAttr::$variant(_, s) => { a.0.set(true); Some(s) } _ => None, }) - .next() } }; (@method $name:ident, $variant:ident($($other:tt)*)) => { #[allow(unused)] - fn $name(&self) -> Option<&$($other)*> { + pub(crate) fn $name(&self) -> Option<&$($other)*> { self.attrs .iter() - .filter_map(|a| match &a.1 { + .find_map(|a| match &a.1 { BindgenAttr::$variant(s) => { a.0.set(true); Some(s) } _ => None, }) - .next() } }; } @@ -175,29 +316,45 @@ impl BindgenAttrs { let pos = attrs .iter() .enumerate() - .find(|&(_, ref m)| m.path.segments[0].ident == "wasm_bindgen") + .find(|&(_, m)| m.path().segments[0].ident == "wasm_bindgen") .map(|a| a.0); let pos = match pos { Some(i) => i, None => return Ok(ret), }; let attr = attrs.remove(pos); - let mut tts = attr.tokens.clone().into_iter(); - let group = match tts.next() { - Some(TokenTree::Group(d)) => d, - Some(_) => bail_span!(attr, "malformed #[wasm_bindgen] attribute"), - None => continue, + let tokens = match attr.meta { + syn::Meta::Path(_) => continue, + syn::Meta::List(syn::MetaList { + delimiter: MacroDelimiter::Paren(_), + tokens, + .. + }) => tokens, + syn::Meta::List(_) | syn::Meta::NameValue(_) => { + bail_span!(attr, "malformed #[wasm_bindgen] attribute") + } }; - if tts.next().is_some() { - bail_span!(attr, "malformed #[wasm_bindgen] attribute"); - } - if group.delimiter() != Delimiter::Parenthesis { - bail_span!(attr, "malformed #[wasm_bindgen] attribute"); + let mut attrs: BindgenAttrs = syn::parse2(tokens)?; + ret.attrs.append(&mut attrs.attrs); + attrs.check_used(); + } + } + + fn get_thread_local(&self) -> Result, Diagnostic> { + let mut thread_local = self.thread_local_v2().map(|_| ThreadLocal::V2); + + if let Some(span) = self.thread_local() { + if thread_local.is_some() { + return Err(Diagnostic::span_error( + *span, + "`thread_local` can't be used with `thread_local_v2`", + )); + } else { + thread_local = Some(ThreadLocal::V1) } - let mut attrs: BindgenAttrs = syn::parse2(group.stream())?; - ret.attrs.extend(attrs.attrs.drain(..)); - attrs.check_used()?; } + + Ok(thread_local) } attrgen!(methods); @@ -227,7 +384,7 @@ impl Parse for BindgenAttrs { } macro_rules! gen_bindgen_attr { - ($(($method:ident, $($variants:tt)*),)*) => { + ($(($method:ident, $_:literal, $($variants:tt)*),)*) => { /// The possible attributes in the `#[wasm_bindgen]`. #[cfg_attr(feature = "extra-traits", derive(Debug))] pub enum BindgenAttr { @@ -247,7 +404,7 @@ impl Parse for BindgenAttr { let raw_attr_string = format!("r#{}", attr_string); macro_rules! parsers { - ($(($name:ident, $($contents:tt)*),)*) => { + ($(($name:ident, $_:literal, $($contents:tt)*),)*) => { $( if attr_string == stringify!($name) || raw_attr_string == stringify!($name) { parsers!( @@ -268,10 +425,15 @@ impl Parse for BindgenAttr { return Ok(BindgenAttr::$variant(attr_span, ident)) }); - (@parser $variant:ident(Span, Option)) => ({ + (@parser $variant:ident(Span, Option)) => ({ if input.parse::().is_ok() { + if input.peek(syn::LitStr) { + let litstr = input.parse::()?; + return Ok(BindgenAttr::$variant(attr_span, Some(litstr.value()))) + } + let ident = input.parse::()?.0; - return Ok(BindgenAttr::$variant(attr_span, Some(ident))) + return Ok(BindgenAttr::$variant(attr_span, Some(ident.to_string()))) } else { return Ok(BindgenAttr::$variant(attr_span, None)); } @@ -299,7 +461,7 @@ impl Parse for BindgenAttr { return Ok(BindgenAttr::$variant(attr_span, val, span)) }); - (@parser $variant:ident(Span, Vec, Vec)) => ({ + (@parser $variant:ident(Span, JsNamespace, Vec)) => ({ input.parse::()?; let (vals, spans) = match input.parse::() { Ok(exprs) => { @@ -318,6 +480,10 @@ impl Parse for BindgenAttr { } } + if vals.is_empty() { + return Err(syn::Error::new(exprs.span(), "Empty namespace lists are not allowed.")); + } + (vals, spans) }, Err(_) => { @@ -325,13 +491,24 @@ impl Parse for BindgenAttr { (vec![ident.to_string()], vec![ident.span()]) } }; - return Ok(BindgenAttr::$variant(attr_span, vals, spans)) + + let first = &vals[0]; + if is_non_value_js_keyword(first) { + let msg = format!("Namespace cannot start with the JS keyword `{}`", first); + return Err(syn::Error::new(spans[0], msg)); + } + + return Ok(BindgenAttr::$variant(attr_span, JsNamespace(vals), spans)) }); } attrgen!(parsers); - return Err(original.error("unknown attribute")); + Err(original.error(if attr_string.starts_with('_') { + "unknown attribute: it's safe to remove unused attributes entirely." + } else { + "unknown attribute" + })) } } @@ -350,7 +527,7 @@ impl Parse for AnyIdent { /// /// Used to convert syn tokens into an AST, that we can then use to generate glue code. The context /// (`Ctx`) is used to pass in the attributes from the `#[wasm_bindgen]`, if needed. -trait ConvertToAst { +pub(crate) trait ConvertToAst { /// What we are converting to. type Target; /// Convert into our target. @@ -359,38 +536,47 @@ trait ConvertToAst { fn convert(self, context: Ctx) -> Result; } -impl<'a> ConvertToAst for &'a mut syn::ItemStruct { +impl ConvertToAst<&ast::Program> for &mut syn::ItemStruct { type Target = ast::Struct; - fn convert(self, attrs: BindgenAttrs) -> Result { - if self.generics.params.len() > 0 { + fn convert(self, program: &ast::Program) -> Result { + if !self.generics.params.is_empty() { bail_span!( self.generics, "structs with #[wasm_bindgen] cannot have lifetime or \ type parameters currently" ); } + let attrs = BindgenAttrs::find(&mut self.attrs)?; + let mut fields = Vec::new(); let js_name = attrs .js_name() .map(|s| s.0.to_string()) - .unwrap_or(self.ident.to_string()); + .unwrap_or(self.ident.unraw().to_string()); + if is_js_keyword(&js_name) { + bail_span!( + self.ident, + "struct cannot use the JS keyword `{}` as its name", + js_name + ); + } + let is_inspectable = attrs.inspectable().is_some(); - let getter_with_clone = attrs.getter_with_clone().is_some(); + let getter_with_clone = attrs.getter_with_clone(); for (i, field) in self.fields.iter_mut().enumerate() { match field.vis { syn::Visibility::Public(..) => {} _ => continue, } let (js_field_name, member) = match &field.ident { - Some(ident) => (ident.to_string(), syn::Member::Named(ident.clone())), + Some(ident) => (ident.unraw().to_string(), syn::Member::Named(ident.clone())), None => (i.to_string(), syn::Member::Unnamed(i.into())), }; let attrs = BindgenAttrs::find(&mut field.attrs)?; - assert_not_variadic(&attrs)?; if attrs.skip().is_some() { - attrs.check_used()?; + attrs.check_used(); continue; } @@ -413,13 +599,15 @@ impl<'a> ConvertToAst for &'a mut syn::ItemStruct { setter: Ident::new(&setter, Span::call_site()), comments, generate_typescript: attrs.skip_typescript().is_none(), - getter_with_clone: getter_with_clone || attrs.getter_with_clone().is_some(), + generate_jsdoc: attrs.skip_jsdoc().is_none(), + getter_with_clone: attrs.getter_with_clone().or(getter_with_clone).copied(), + wasm_bindgen: program.wasm_bindgen.clone(), }); - attrs.check_used()?; + attrs.check_used(); } let generate_typescript = attrs.skip_typescript().is_none(); let comments: Vec = extract_doc_comments(&self.attrs); - attrs.check_used()?; + attrs.check_used(); Ok(ast::Struct { rust_name: self.ident.clone(), js_name, @@ -427,6 +615,7 @@ impl<'a> ConvertToAst for &'a mut syn::ItemStruct { comments, is_inspectable, generate_typescript, + wasm_bindgen: program.wasm_bindgen.clone(), }) } } @@ -447,23 +636,24 @@ fn get_expr(mut expr: &syn::Expr) -> &syn::Expr { expr } -impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignItemFn { +impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option)> + for syn::ForeignItemFn +{ type Target = ast::ImportKind; fn convert( self, - (opts, module): (BindgenAttrs, &'a ast::ImportModule), + (program, opts, module): (&ast::Program, BindgenAttrs, &'a Option), ) -> Result { - let wasm = function_from_decl( + let (mut wasm, _) = function_from_decl( &self.sig.ident, &opts, self.sig.clone(), self.attrs.clone(), self.vis.clone(), - false, + FunctionPosition::Extern, None, - )? - .0; + )?; let catch = opts.catch().is_some(); let variadic = opts.variadic().is_some(); let js_ret = if catch { @@ -474,25 +664,25 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte // * The actual type is the first type parameter // // should probably fix this one day... - extract_first_ty_param(wasm.ret.as_ref())? + extract_first_ty_param(wasm.ret.as_ref().map(|ret| &ret.r#type))? } else { - wasm.ret.clone() + wasm.ret.as_ref().map(|ret| ret.r#type.clone()) }; let operation_kind = operation_kind(&opts); let kind = if opts.method().is_some() { - let class = wasm.arguments.get(0).ok_or_else(|| { + let class = wasm.arguments.first().ok_or_else(|| { err_span!(self, "imported methods must have at least one argument") })?; - let class = match get_ty(&class.ty) { + let class = match get_ty(&class.pat_type.ty) { syn::Type::Reference(syn::TypeReference { mutability: None, elem, .. }) => &**elem, _ => bail_span!( - class.ty, + class.pat_type.ty, "first argument of method must be a shared reference" ), }; @@ -551,7 +741,7 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte .unwrap_or_else(|| class_name.to_string()); ast::ImportFunctionKind::Method { - class: class_name.to_string(), + class: class_name, ty: class.clone(), kind: ast::MethodKind::Constructor, } @@ -564,7 +754,7 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte ast::ImportFunctionKind::Normal => (0, "n"), ast::ImportFunctionKind::Method { ref class, .. } => (1, &class[..]), }; - let data = (ns, &self.sig.ident, module); + let data = (ns, self.sig.to_token_stream().to_string(), module); format!( "__wbg_{}_{}", wasm.name @@ -581,6 +771,46 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte } } let assert_no_shim = opts.assert_no_shim().is_some(); + + let mut doc_comment = String::new(); + // Extract the doc comments from our list of attributes. + wasm.rust_attrs.retain(|attr| { + /// Returns the contents of the passed `#[doc = "..."]` attribute, + /// or `None` if it isn't one. + fn get_docs(attr: &syn::Attribute) -> Option { + if attr.path().is_ident("doc") { + if let syn::Meta::NameValue(syn::MetaNameValue { + value: + syn::Expr::Lit(syn::ExprLit { + lit: Lit::Str(str), .. + }), + .. + }) = &attr.meta + { + Some(str.value()) + } else { + None + } + } else { + None + } + } + + if let Some(docs) = get_docs(attr) { + if !doc_comment.is_empty() { + // Add newlines between the doc comments + doc_comment.push('\n'); + } + // Add this doc comment to the complete docs + doc_comment.push_str(&docs); + + // Remove it from the list of regular attributes + false + } else { + true + } + }); + let ret = ast::ImportKind::Function(ast::ImportFunction { function: wasm, assert_no_shim, @@ -589,28 +819,36 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte catch, variadic, structural: opts.structural().is_some() || opts.r#final().is_none(), - rust_name: self.sig.ident.clone(), + rust_name: self.sig.ident, shim: Ident::new(&shim, Span::call_site()), - doc_comment: None, + doc_comment, + wasm_bindgen: program.wasm_bindgen.clone(), + wasm_bindgen_futures: program.wasm_bindgen_futures.clone(), }); - opts.check_used()?; + opts.check_used(); Ok(ret) } } -impl ConvertToAst for syn::ForeignItemType { +impl ConvertToAst<(&ast::Program, BindgenAttrs)> for syn::ForeignItemType { type Target = ast::ImportKind; - fn convert(self, attrs: BindgenAttrs) -> Result { - assert_not_variadic(&attrs)?; + fn convert( + self, + (program, attrs): (&ast::Program, BindgenAttrs), + ) -> Result { let js_name = attrs .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 shim = format!( + "__wbg_instanceof_{}_{}", + self.ident, + ShortHash((attrs.js_namespace().map(|(ns, _)| ns.0), &self.ident)) + ); let mut extends = Vec::new(); let mut vendor_prefixes = Vec::new(); let no_deref = attrs.no_deref().is_some(); @@ -627,7 +865,7 @@ impl ConvertToAst for syn::ForeignItemType { _ => {} } } - attrs.check_used()?; + attrs.check_used(); Ok(ast::ImportKind::Type(ast::ImportType { vis: self.vis, attrs: self.attrs, @@ -640,21 +878,31 @@ impl ConvertToAst for syn::ForeignItemType { extends, vendor_prefixes, no_deref, + wasm_bindgen: program.wasm_bindgen.clone(), })) } } -impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignItemStatic { +impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option)> + for syn::ForeignItemStatic +{ type Target = ast::ImportKind; fn convert( self, - (opts, module): (BindgenAttrs, &'a ast::ImportModule), + (program, opts, module): (&ast::Program, BindgenAttrs, &'a Option), ) -> Result { - if self.mutability.is_some() { + if let syn::StaticMutability::Mut(_) = self.mutability { bail_span!(self.mutability, "cannot import mutable globals yet") } - assert_not_variadic(&opts)?; + + if let Some(span) = opts.static_string() { + return Err(Diagnostic::span_error( + *span, + "static strings require a string literal", + )); + } + let default_name = self.ident.to_string(); let js_name = opts .js_name() @@ -666,23 +914,92 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte self.ident, ShortHash((&js_name, module, &self.ident)), ); - opts.check_used()?; + let thread_local = opts.get_thread_local()?; + + opts.check_used(); Ok(ast::ImportKind::Static(ast::ImportStatic { ty: *self.ty, vis: self.vis, rust_name: self.ident.clone(), js_name, shim: Ident::new(&shim, Span::call_site()), + wasm_bindgen: program.wasm_bindgen.clone(), + thread_local, })) } } -impl ConvertToAst for syn::ItemFn { +impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option)> + for syn::ItemStatic +{ + type Target = ast::ImportKind; + + fn convert( + self, + (program, opts, module): (&ast::Program, BindgenAttrs, &'a Option), + ) -> Result { + if let syn::StaticMutability::Mut(_) = self.mutability { + bail_span!(self.mutability, "cannot import mutable globals yet") + } + + let string = if let syn::Expr::Lit(syn::ExprLit { + lit: syn::Lit::Str(string), + .. + }) = *self.expr.clone() + { + string.value() + } else { + bail_span!( + self.expr, + "statics with a value can only be string literals" + ) + }; + + if opts.static_string().is_none() { + bail_span!( + self, + "static strings require `#[wasm_bindgen(static_string)]`" + ) + } + + let thread_local = if let Some(thread_local) = opts.get_thread_local()? { + thread_local + } else { + bail_span!( + self, + "static strings require `#[wasm_bindgen(thread_local_v2)]`" + ) + }; + + let shim = format!( + "__wbg_string_{}_{}", + self.ident, + ShortHash((&module, &self.ident)), + ); + opts.check_used(); + Ok(ast::ImportKind::String(ast::ImportString { + ty: *self.ty, + vis: self.vis, + rust_name: self.ident.clone(), + shim: Ident::new(&shim, Span::call_site()), + wasm_bindgen: program.wasm_bindgen.clone(), + js_sys: program.js_sys.clone(), + string, + thread_local, + })) + } +} + +impl ConvertToAst<(BindgenAttrs, Vec)> for syn::ItemFn { type Target = ast::Function; - fn convert(self, attrs: BindgenAttrs) -> Result { + fn convert( + self, + (attrs, args_attrs): (BindgenAttrs, Vec), + ) -> Result { match self.vis { syn::Visibility::Public(_) => {} + _ if attrs.start().is_some() => {} _ => bail_span!(self, "can only #[wasm_bindgen] public functions"), } if self.sig.constness.is_some() { @@ -691,39 +1008,69 @@ impl ConvertToAst for syn::ItemFn { "can only #[wasm_bindgen] non-const functions" ); } - if self.sig.unsafety.is_some() { - bail_span!(self.sig.unsafety, "can only #[wasm_bindgen] safe functions"); - } - assert_not_variadic(&attrs)?; - let ret = function_from_decl( + let (mut ret, _) = function_from_decl( &self.sig.ident, &attrs, self.sig.clone(), self.attrs, self.vis, - false, - None, + FunctionPosition::Free, + Some(args_attrs), )?; - attrs.check_used()?; - Ok(ret.0) + attrs.check_used(); + + // Due to legacy behavior, we need to escape all keyword identifiers as + // `_keyword`, except `default` + if is_js_keyword(&ret.name) && ret.name != "default" { + ret.name = format!("_{}", ret.name); + } + + Ok(ret) } } +/// Returns whether `self` is passed by reference or by value. +fn get_self_method(r: syn::Receiver) -> ast::MethodSelf { + // The tricky part here is that `r` can have many forms. E.g. `self`, + // `&self`, `&mut self`, `self: Self`, `self: &Self`, `self: &mut Self`, + // `self: Box`, `self: Rc`, etc. + // Luckily, syn always populates the `ty` field with the type of `self`, so + // e.g. `&self` gets the type `&Self`. So we only have check whether the + // type is a reference or not. + match &*r.ty { + syn::Type::Reference(ty) => { + if ty.mutability.is_some() { + ast::MethodSelf::RefMutable + } else { + ast::MethodSelf::RefShared + } + } + _ => ast::MethodSelf::ByValue, + } +} + +enum FunctionPosition<'a> { + Extern, + Free, + Impl { self_ty: &'a Ident }, +} + /// Construct a function (and gets the self type if appropriate) for our AST from a syn function. +#[allow(clippy::too_many_arguments)] fn function_from_decl( decl_name: &syn::Ident, opts: &BindgenAttrs, sig: syn::Signature, attrs: Vec, vis: syn::Visibility, - allow_self: bool, - self_ty: Option<&Ident>, + position: FunctionPosition, + args_attrs: Option>, ) -> Result<(ast::Function, Option), Diagnostic> { if sig.variadic.is_some() { bail_span!(sig.variadic, "can't #[wasm_bindgen] variadic functions"); } - if sig.generics.params.len() > 0 { + if !sig.generics.params.is_empty() { bail_span!( sig.generics, "can't #[wasm_bindgen] functions with lifetime or type parameters", @@ -734,87 +1081,214 @@ fn function_from_decl( let syn::Signature { inputs, output, .. } = sig; - let replace_self = |t: syn::Type| { - let self_ty = match self_ty { - Some(i) => i, - None => return t, - }; - let path = match get_ty(&t) { - syn::Type::Path(syn::TypePath { qself: None, path }) => path.clone(), - other => return other.clone(), - }; - let new_path = if path.segments.len() == 1 && path.segments[0].ident == "Self" { - self_ty.clone().into() - } else { - path - }; - syn::Type::Path(syn::TypePath { - qself: None, - path: new_path, - }) + // A helper function to replace `Self` in the function signature of methods. + // E.g. `fn get(&self) -> Option` to `fn get(&self) -> Option` + // The following comment explains why this is necessary: + // https://github.com/rustwasm/wasm-bindgen/issues/3105#issuecomment-1275160744 + let replace_self = |mut t: syn::Type| { + if let FunctionPosition::Impl { self_ty } = position { + // This uses a visitor to replace all occurrences of `Self` with + // the actual type identifier. The visitor guarantees that we find + // all occurrences of `Self`, even if deeply nested and even if + // future Rust versions add more places where `Self` can appear. + struct SelfReplace(Ident); + impl VisitMut for SelfReplace { + fn visit_ident_mut(&mut self, i: &mut proc_macro2::Ident) { + if i == "Self" { + *i = self.0.clone(); + } + } + } + + let mut replace = SelfReplace(self_ty.clone()); + replace.visit_type_mut(&mut t); + } + t + }; + + // A helper function to replace argument names that are JS keywords. + // E.g. this will replace `fn foo(class: u32)` to `fn foo(_class: u32)` + let replace_colliding_arg = |i: &mut syn::PatType| { + if let syn::Pat::Ident(ref mut i) = *i.pat { + let ident = i.ident.unraw().to_string(); + // JS keywords are NEVER allowed as argument names. Since argument + // names are considered an implementation detail in JS, we can + // safely rename them to avoid collisions. + if is_js_keyword(&ident) { + i.ident = Ident::new(format!("_{}", ident).as_str(), i.ident.span()); + } + } }; let mut method_self = None; - let arguments = inputs - .into_iter() - .filter_map(|arg| match arg { + let mut arguments = Vec::new(); + for arg in inputs.into_iter() { + match arg { syn::FnArg::Typed(mut c) => { + // typical arguments like foo: u32 + replace_colliding_arg(&mut c); c.ty = Box::new(replace_self(*c.ty)); - Some(c) + arguments.push(c); } syn::FnArg::Receiver(r) => { - if !allow_self { - panic!("arguments cannot be `self`") + // the self argument, so self, &self, &mut self, self: Box, etc. + + // `self` is only allowed for `fn`s inside an `impl` block. + match position { + FunctionPosition::Free => { + bail_span!( + r.self_token, + "the `self` argument is only allowed for functions in `impl` blocks.\n\n\ + If the function is already in an `impl` block, did you perhaps forget to add `#[wasm_bindgen]` to the `impl` block?" + ); + } + FunctionPosition::Extern => { + bail_span!( + r.self_token, + "the `self` argument is not allowed for `extern` functions.\n\n\ + Did you perhaps mean `this`? For more information on importing JavaScript functions, see:\n\ + https://rustwasm.github.io/docs/wasm-bindgen/examples/import-js.html" + ); + } + FunctionPosition::Impl { .. } => {} } + + // We need to know *how* `self` is passed to the method (by + // value or by reference) to generate the correct JS shim. assert!(method_self.is_none()); - if r.reference.is_none() { - method_self = Some(ast::MethodSelf::ByValue); - } else if r.mutability.is_some() { - method_self = Some(ast::MethodSelf::RefMutable); - } else { - method_self = Some(ast::MethodSelf::RefShared); - } - None + method_self = Some(get_self_method(r)); } - }) - .collect::>(); + } + } + // process function return data + let ret_ty_override = opts.unchecked_return_type(); + let ret_desc = opts.return_description(); let ret = match output { syn::ReturnType::Default => None, - syn::ReturnType::Type(_, ty) => Some(replace_self(*ty)), + syn::ReturnType::Type(_, ty) => Some(ast::FunctionReturnData { + r#type: replace_self(*ty), + js_type: ret_ty_override + .as_ref() + .map_or::, _>(Ok(None), |(ty, span)| { + check_invalid_type(ty, *span)?; + Ok(Some(ty.to_string())) + })?, + desc: ret_desc.as_ref().map_or::, _>( + Ok(None), + |(desc, span)| { + check_js_comment_close(desc, *span)?; + Ok(Some(desc.to_string())) + }, + )?, + }), }; + // error if there were description or type override specified for + // function return while it doesn't actually return anything + if ret.is_none() && (ret_ty_override.is_some() || ret_desc.is_some()) { + if let Some((_, span)) = ret_ty_override { + return Err(Diagnostic::span_error( + span, + "cannot specify return type for a function that doesn't return", + )); + } + if let Some((_, span)) = ret_desc { + return Err(Diagnostic::span_error( + span, + "cannot specify return description for a function that doesn't return", + )); + } + } let (name, name_span, renamed_via_js_name) = if let Some((js_name, js_name_span)) = opts.js_name() { - let kind = operation_kind(&opts); + let kind = operation_kind(opts); let prefix = match kind { OperationKind::Setter(_) => "set_", _ => "", }; - ( - format!("{}{}", prefix, js_name.to_string()), - js_name_span, - true, - ) + (format!("{}{}", prefix, js_name), js_name_span, true) } else { - (decl_name.to_string(), decl_name.span(), false) + (decl_name.unraw().to_string(), decl_name.span(), false) }; + Ok(( ast::Function { - arguments, name_span, name, renamed_via_js_name, - ret, rust_attrs: attrs, rust_vis: vis, + r#unsafe: sig.unsafety.is_some(), r#async: sig.asyncness.is_some(), generate_typescript: opts.skip_typescript().is_none(), + generate_jsdoc: opts.skip_jsdoc().is_none(), + variadic: opts.variadic().is_some(), + ret, + arguments: arguments + .into_iter() + .zip( + args_attrs + .into_iter() + .flatten() + .chain(iter::repeat(FnArgAttrs::default())), + ) + .map(|(pat_type, attrs)| ast::FunctionArgumentData { + pat_type, + js_name: attrs.js_name, + js_type: attrs.js_type, + desc: attrs.desc, + }) + .collect(), }, method_self, )) } +/// Helper struct to store extracted function argument attrs +#[derive(Default, Clone)] +struct FnArgAttrs { + js_name: Option, + js_type: Option, + desc: Option, +} + +/// Extracts function arguments attributes +fn extract_args_attrs(sig: &mut syn::Signature) -> Result, Diagnostic> { + let mut args_attrs = vec![]; + for input in sig.inputs.iter_mut() { + if let syn::FnArg::Typed(pat_type) = input { + let attrs = BindgenAttrs::find(&mut pat_type.attrs)?; + let arg_attrs = FnArgAttrs { + js_name: attrs + .js_name() + .map_or(Ok(None), |(js_name_override, span)| { + if is_js_keyword(js_name_override) || !is_valid_ident(js_name_override) { + return Err(Diagnostic::span_error(span, "invalid JS identifier")); + } + Ok(Some(js_name_override.to_string())) + })?, + js_type: attrs + .unchecked_param_type() + .map_or::, _>(Ok(None), |(ty, span)| { + check_invalid_type(ty, span)?; + Ok(Some(ty.to_string())) + })?, + desc: attrs + .param_description() + .map_or::, _>(Ok(None), |(description, span)| { + check_js_comment_close(description, span)?; + Ok(Some(description.to_string())) + })?, + }; + // throw error for any unused attrs + attrs.enforce_used()?; + args_attrs.push(arg_attrs); + } + } + Ok(args_attrs) +} + pub(crate) trait MacroParse { /// Parse the contents of an object into our AST, with a context if necessary. /// @@ -831,26 +1305,43 @@ impl<'a> MacroParse<(Option, &'a mut TokenStream)> for syn::Item { ) -> Result<(), Diagnostic> { match self { syn::Item::Fn(mut f) => { + let opts = opts.unwrap_or_default(); + if let Some(path) = opts.wasm_bindgen() { + program.wasm_bindgen = path.clone(); + } + if let Some(path) = opts.js_sys() { + program.js_sys = path.clone(); + } + if let Some(path) = opts.wasm_bindgen_futures() { + program.wasm_bindgen_futures = path.clone(); + } + + if opts.main().is_some() { + opts.check_used(); + return main(program, f, tokens); + } + let no_mangle = f .attrs .iter() .enumerate() - .filter_map(|(i, m)| m.parse_meta().ok().map(|m| (i, m))) .find(|(_, m)| m.path().is_ident("no_mangle")); - match no_mangle { - Some((i, _)) => { - f.attrs.remove(i); - } - _ => {} + if let Some((i, _)) = no_mangle { + f.attrs.remove(i); } + // extract fn args attributes before parsing to tokens stream + let args_attrs = extract_args_attrs(&mut f.sig)?; let comments = extract_doc_comments(&f.attrs); + // If the function isn't used for anything other than being exported to JS, + // it'll be unused when not building for the Wasm target and produce a + // `dead_code` warning. So, add `#[allow(dead_code)]` before it to avoid that. + tokens.extend(quote::quote! { #[allow(dead_code)] }); f.to_tokens(tokens); - let opts = opts.unwrap_or_default(); if opts.start().is_some() { - if f.sig.generics.params.len() > 0 { + if !f.sig.generics.params.is_empty() { bail_span!(&f.sig.generics, "the start function cannot have generics",); } - if f.sig.inputs.len() > 0 { + if !f.sig.inputs.is_empty() { bail_span!(&f.sig.inputs, "the start function cannot have arguments",); } } @@ -860,22 +1351,20 @@ impl<'a> MacroParse<(Option, &'a mut TokenStream)> for syn::Item { }); let rust_name = f.sig.ident.clone(); let start = opts.start().is_some(); + program.exports.push(ast::Export { comments, - function: f.convert(opts)?, + function: f.convert((opts, args_attrs))?, js_class: None, method_kind, method_self: None, rust_class: None, rust_name, start, + wasm_bindgen: program.wasm_bindgen.clone(), + wasm_bindgen_futures: program.wasm_bindgen_futures.clone(), }); } - syn::Item::Struct(mut s) => { - let opts = opts.unwrap_or_default(); - program.structs.push((&mut s).convert(opts)?); - s.to_tokens(tokens); - } syn::Item::Impl(mut i) => { let opts = opts.unwrap_or_default(); (&mut i).macro_parse(program, opts)?; @@ -915,12 +1404,8 @@ impl<'a> MacroParse<(Option, &'a mut TokenStream)> for syn::Item { } } -impl<'a> MacroParse for &'a mut syn::ItemImpl { - fn macro_parse( - self, - _program: &mut ast::Program, - opts: BindgenAttrs, - ) -> Result<(), Diagnostic> { +impl MacroParse for &mut syn::ItemImpl { + fn macro_parse(self, program: &mut ast::Program, opts: BindgenAttrs) -> Result<(), Diagnostic> { if self.defaultness.is_some() { bail_span!( self.defaultness, @@ -936,7 +1421,7 @@ impl<'a> MacroParse for &'a mut syn::ItemImpl { if let Some((_, path, _)) = &self.trait_ { bail_span!(path, "#[wasm_bindgen] trait impls are not supported"); } - if self.generics.params.len() > 0 { + if !self.generics.params.is_empty() { bail_span!( self.generics, "#[wasm_bindgen] generic impls aren't supported" @@ -954,12 +1439,12 @@ impl<'a> MacroParse for &'a mut syn::ItemImpl { }; let mut errors = Vec::new(); for item in self.items.iter_mut() { - if let Err(e) = prepare_for_impl_recursion(item, &name, &opts) { + if let Err(e) = prepare_for_impl_recursion(item, name, program, &opts) { errors.push(e); } } Diagnostic::from_vec(errors)?; - opts.check_used()?; + opts.check_used(); Ok(()) } } @@ -975,10 +1460,11 @@ impl<'a> MacroParse for &'a mut syn::ItemImpl { fn prepare_for_impl_recursion( item: &mut syn::ImplItem, class: &syn::Path, + program: &ast::Program, impl_opts: &BindgenAttrs, ) -> Result<(), Diagnostic> { let method = match item { - syn::ImplItem::Method(m) => m, + syn::ImplItem::Fn(m) => m, syn::ImplItem::Const(_) => { bail_span!( &*item, @@ -1007,26 +1493,35 @@ fn prepare_for_impl_recursion( .map(|s| s.0.to_string()) .unwrap_or(ident.to_string()); + let wasm_bindgen = &program.wasm_bindgen; + let wasm_bindgen_futures = &program.wasm_bindgen_futures; method.attrs.insert( 0, syn::Attribute { pound_token: Default::default(), style: syn::AttrStyle::Outer, bracket_token: Default::default(), - path: syn::parse_quote! { wasm_bindgen::prelude::__wasm_bindgen_class_marker }, - tokens: quote::quote! { (#class = #js_class) }.into(), + meta: syn::parse_quote! { #wasm_bindgen::prelude::__wasm_bindgen_class_marker(#class = #js_class, wasm_bindgen = #wasm_bindgen, wasm_bindgen_futures = #wasm_bindgen_futures) }, }, ); Ok(()) } -impl<'a, 'b> MacroParse<(&'a Ident, &'a str)> for &'b mut syn::ImplItemMethod { +impl MacroParse<&ClassMarker> for &mut syn::ImplItemFn { fn macro_parse( self, program: &mut ast::Program, - (class, js_class): (&'a Ident, &'a str), + ClassMarker { + class, + js_class, + wasm_bindgen, + wasm_bindgen_futures, + }: &ClassMarker, ) -> Result<(), Diagnostic> { + program.wasm_bindgen = wasm_bindgen.clone(); + program.wasm_bindgen_futures = wasm_bindgen_futures.clone(); + match self.vis { syn::Visibility::Public(_) => {} _ => return Ok(()), @@ -1040,20 +1535,18 @@ impl<'a, 'b> MacroParse<(&'a Ident, &'a str)> for &'b mut syn::ImplItemMethod { "can only #[wasm_bindgen] non-const functions", ); } - if self.sig.unsafety.is_some() { - bail_span!(self.sig.unsafety, "can only bindgen safe functions",); - } let opts = BindgenAttrs::find(&mut self.attrs)?; let comments = extract_doc_comments(&self.attrs); + let args_attrs: Vec = extract_args_attrs(&mut self.sig)?; let (function, method_self) = function_from_decl( &self.sig.ident, &opts, self.sig.clone(), self.attrs.clone(), self.vis.clone(), - true, - Some(class), + FunctionPosition::Impl { self_ty: class }, + Some(args_attrs), )?; let method_kind = if opts.constructor().is_some() { ast::MethodKind::Constructor @@ -1071,26 +1564,29 @@ 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, + wasm_bindgen: program.wasm_bindgen.clone(), + wasm_bindgen_futures: program.wasm_bindgen_futures.clone(), }); - opts.check_used()?; + opts.check_used(); Ok(()) } } -fn import_enum(enum_: syn::ItemEnum, program: &mut ast::Program) -> Result<(), Diagnostic> { +fn string_enum( + enum_: syn::ItemEnum, + program: &mut ast::Program, + js_name: String, + generate_typescript: bool, + comments: Vec, +) -> 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]"), - } - let (_, expr) = match &v.discriminant { Some(pair) => pair, None => { - bail_span!(v, "all variants must have a value"); + bail_span!(v, "all variants of a string enum must have a string value"); } }; match get_expr(expr) { @@ -1109,138 +1605,224 @@ fn import_enum(enum_: syn::ItemEnum, program: &mut ast::Program) -> Result<(), D } program.imports.push(ast::Import { - module: ast::ImportModule::None, + module: None, js_namespace: None, - kind: ast::ImportKind::Enum(ast::ImportEnum { + kind: ast::ImportKind::Enum(ast::StringEnum { vis: enum_.vis, name: enum_.ident, + js_name, variants, variant_values, + comments, rust_attrs: enum_.attrs, + generate_typescript, + wasm_bindgen: program.wasm_bindgen.clone(), }), }); Ok(()) } +/// Represents a possibly negative numeric value as base 10 digits. +struct NumericValue<'a> { + negative: bool, + base10_digits: &'a str, +} +impl<'a> NumericValue<'a> { + fn from_expr(expr: &'a syn::Expr) -> Option { + match get_expr(expr) { + syn::Expr::Lit(syn::ExprLit { + lit: syn::Lit::Int(int_lit), + .. + }) => Some(Self { + negative: false, + base10_digits: int_lit.base10_digits(), + }), + syn::Expr::Unary(syn::ExprUnary { + op: syn::UnOp::Neg(_), + expr, + .. + }) => Self::from_expr(expr).map(|n| n.neg()), + _ => None, + } + } + + fn parse(&self) -> Option { + let mut value = self.base10_digits.parse::().ok()?; + if self.negative { + value = -value; + } + Some(value) + } + + fn neg(self) -> Self { + Self { + negative: !self.negative, + base10_digits: self.base10_digits, + } + } +} + impl<'a> MacroParse<(&'a mut TokenStream, BindgenAttrs)> for syn::ItemEnum { fn macro_parse( self, program: &mut ast::Program, (tokens, opts): (&'a mut TokenStream, BindgenAttrs), ) -> Result<(), Diagnostic> { - if self.variants.len() == 0 { + if self.variants.is_empty() { bail_span!(self, "cannot export empty enums to JS"); } - let generate_typescript = opts.skip_typescript().is_none(); - - // Check if the first value is a string literal - if let Some((_, expr)) = &self.variants[0].discriminant { - match get_expr(expr) { - syn::Expr::Lit(syn::ExprLit { - attrs: _, - lit: syn::Lit::Str(_), - }) => { - opts.check_used()?; - return import_enum(self, program); - } - _ => {} + for variant in self.variants.iter() { + match variant.fields { + syn::Fields::Unit => (), + _ => bail_span!( + variant.fields, + "enum variants with associated data are not supported with #[wasm_bindgen]" + ), } } + + let generate_typescript = opts.skip_typescript().is_none(); + let comments = extract_doc_comments(&self.attrs); let js_name = opts .js_name() .map(|s| s.0) .map_or_else(|| self.ident.to_string(), |s| s.to_string()); - opts.check_used()?; + if is_js_keyword(&js_name) { + bail_span!( + self.ident, + "enum cannot use the JS keyword `{}` as its name", + js_name + ); + } + + opts.check_used(); - let has_discriminant = self.variants[0].discriminant.is_some(); + // Check if the enum is a string enum, by checking whether any variant has a string discriminant. + let is_string_enum = self.variants.iter().any(|v| { + if let Some((_, expr)) = &v.discriminant { + if let syn::Expr::Lit(syn::ExprLit { + lit: syn::Lit::Str(_), + .. + }) = get_expr(expr) + { + return true; + } + } + false + }); + if is_string_enum { + return string_enum(self, program, js_name, generate_typescript, comments); + } match self.vis { syn::Visibility::Public(_) => {} _ => bail_span!(self, "only public enums are allowed with #[wasm_bindgen]"), } + // Go through all variants once first to determine whether the enum is + // signed or unsigned. We don't need to actually parse the discriminant + // values yet, we just need to know their sign. The actual parsing is + // done in a second pass. + let signed = self.variants.iter().any(|v| match &v.discriminant { + Some((_, expr)) => NumericValue::from_expr(expr).map_or(false, |n| n.negative), + None => false, + }); + let underlying_min = if signed { i32::MIN as i64 } else { 0 }; + let underlying_max = if signed { + i32::MAX as i64 + } else { + u32::MAX as i64 + }; + + let mut last_discriminant: Option = None; + let mut discriminant_map: HashMap = HashMap::new(); + let variants = self .variants .iter() - .enumerate() - .map(|(i, v)| { - match v.fields { - syn::Fields::Unit => (), - _ => bail_span!(v.fields, "only C-Style enums allowed with #[wasm_bindgen]"), - } + .map(|v| { + let value: i64 = match &v.discriminant { + Some((_, expr)) => match NumericValue::from_expr(expr).and_then(|n| n.parse()) { + Some(value) => value, + _ => bail_span!( + expr, + "C-style enums with #[wasm_bindgen] may only have \ + numeric literal values that fit in a 32-bit integer as discriminants. \ + Expressions or variables are not supported.", + ), + }, + None => { + // Use the same algorithm as rustc to determine the next discriminant + // https://doc.rust-lang.org/reference/items/enumerations.html#implicit-discriminants + last_discriminant.map_or(0, |last| last + 1) + } + }; + + last_discriminant = Some(value); - // Require that everything either has a discriminant or doesn't. - // We don't really want to get in the business of emulating how - // rustc assigns values to enums. - if v.discriminant.is_some() != has_discriminant { + // check that the value fits within the underlying type + let underlying = if signed { "i32" } else { "u32" }; + let numbers = if signed { "signed numbers" } else { "unsigned numbers" }; + if value < underlying_min { bail_span!( v, - "must either annotate discriminant of all variants or none" + "C-style enums with #[wasm_bindgen] can only support {0} that can be represented by `{2}`, \ + but `{1}` is too small for `{2}`", + numbers, + value, + underlying + ); + } + if value > underlying_max { + bail_span!( + v, + "C-style enums with #[wasm_bindgen] can only support {0} that can be represented by `{2}`, \ + but `{1}` is too large for `{2}`", + numbers, + value, + underlying ); } - let value = match &v.discriminant { - Some((_, expr)) => match get_expr(expr) { - syn::Expr::Lit(syn::ExprLit { - attrs: _, - lit: syn::Lit::Int(int_lit), - }) => match int_lit.base10_digits().parse::() { - Ok(v) => v, - Err(_) => { - bail_span!( - int_lit, - "enums with #[wasm_bindgen] can only support \ - numbers that can be represented as u32" - ); - } - }, - expr => bail_span!( - expr, - "enums with #[wasm_bindgen] may only have \ - number literal values", - ), - }, - None => i as u32, - }; + // detect duplicate discriminants + if let Some(old) = discriminant_map.insert(value, v) { + bail_span!( + v, + "discriminant value `{}` is already used by {} in this enum", + value, + old.ident + ); + } let comments = extract_doc_comments(&v.attrs); Ok(ast::Variant { name: v.ident.clone(), - value, + // due to the above checks, we know that the value fits + // within 32 bits, so this cast doesn't lose any information + value: value as u32, comments, }) }) .collect::, Diagnostic>>()?; - let mut values = variants.iter().map(|v| v.value).collect::>(); - values.sort(); - let hole = values - .windows(2) - .filter_map(|window| { - if window[0] + 1 != window[1] { - Some(window[0] + 1) - } else { - None - } - }) - .next() - .unwrap_or(*values.last().unwrap() + 1); - for value in values { - assert!(hole != value); - } - - let comments = extract_doc_comments(&self.attrs); + // To make all the code handling holes simpler, we only consider + // non-negative holes. This allows us to use `u32` to represent holes. + let hole = (0..=underlying_max) + .find(|v| !discriminant_map.contains_key(v)) + .unwrap() as u32; self.to_tokens(tokens); program.enums.push(ast::Enum { rust_name: self.ident, js_name, + signed, variants, comments, hole, generate_typescript, + wasm_bindgen: program.wasm_bindgen.clone(), }); Ok(()) } @@ -1253,19 +1835,19 @@ impl MacroParse for syn::ItemConst { bail_span!(self, "#[wasm_bindgen] will not work on constants unless you are defining a #[wasm_bindgen(typescript_custom_section)]."); } - match get_expr(&self.expr) { + let typescript_custom_section = match get_expr(&self.expr) { syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Str(litstr), .. - }) => { - program.typescript_custom_sections.push(litstr.value()); - } - expr => { - bail_span!(expr, "Expected a string literal to be used with #[wasm_bindgen(typescript_custom_section)]."); - } - } + }) => ast::LitOrExpr::Lit(litstr.value()), + expr => ast::LitOrExpr::Expr(expr.clone()), + }; + + program + .typescript_custom_sections + .push(typescript_custom_section); - opts.check_used()?; + opts.check_used(); Ok(()) } @@ -1274,73 +1856,127 @@ impl MacroParse for syn::ItemConst { impl MacroParse for syn::ItemForeignMod { fn macro_parse(self, program: &mut ast::Program, opts: BindgenAttrs) -> Result<(), Diagnostic> { let mut errors = Vec::new(); - match self.abi.name { - Some(ref l) if l.value() == "C" => {} - None => {} - Some(ref other) => { - errors.push(err_span!( - other, - "only foreign mods with the `C` ABI are allowed" - )); - } + if let Some(other) = self.abi.name.filter(|l| l.value() != "C") { + errors.push(err_span!( + other, + "only foreign mods with the `C` ABI are allowed" + )); } - let module = if let Some((name, span)) = opts.module() { - if opts.inline_js().is_some() { - let msg = "cannot specify both `module` and `inline_js`"; - errors.push(Diagnostic::span_error(span, msg)); - } - if opts.raw_module().is_some() { - let msg = "cannot specify both `module` and `raw_module`"; - errors.push(Diagnostic::span_error(span, msg)); - } - ast::ImportModule::Named(name.to_string(), span) - } else if let Some((name, span)) = opts.raw_module() { - if opts.inline_js().is_some() { - let msg = "cannot specify both `raw_module` and `inline_js`"; - errors.push(Diagnostic::span_error(span, msg)); - } - ast::ImportModule::RawNamed(name.to_string(), span) - } else if let Some((js, span)) = opts.inline_js() { - let i = program.inline_js.len(); - program.inline_js.push(js.to_string()); - ast::ImportModule::Inline(i, span) - } else { - ast::ImportModule::None - }; + let js_namespace = opts.js_namespace().map(|(s, _)| s); + let module = module_from_opts(program, &opts) + .map_err(|e| errors.push(e)) + .unwrap_or_default(); for item in self.items.into_iter() { - if let Err(e) = item.macro_parse(program, module.clone()) { + let ctx = ForeignItemCtx { + module: module.clone(), + js_namespace: js_namespace.clone(), + }; + if let Err(e) = item.macro_parse(program, ctx) { errors.push(e); } } Diagnostic::from_vec(errors)?; - opts.check_used()?; + opts.check_used(); Ok(()) } } -impl MacroParse for syn::ForeignItem { +struct ForeignItemCtx { + module: Option, + js_namespace: Option, +} + +impl MacroParse for syn::ForeignItem { fn macro_parse( mut self, program: &mut ast::Program, - module: ast::ImportModule, + ctx: ForeignItemCtx, ) -> Result<(), Diagnostic> { let item_opts = { let attrs = match self { syn::ForeignItem::Fn(ref mut f) => &mut f.attrs, syn::ForeignItem::Type(ref mut t) => &mut t.attrs, syn::ForeignItem::Static(ref mut s) => &mut s.attrs, + syn::ForeignItem::Verbatim(v) => { + let mut item: syn::ItemStatic = + syn::parse(v.into()).expect("only foreign functions/types allowed for now"); + let item_opts = BindgenAttrs::find(&mut item.attrs)?; + let kind = item.convert((program, item_opts, &ctx.module))?; + + program.imports.push(ast::Import { + module: None, + js_namespace: None, + kind, + }); + + return Ok(()); + } _ => panic!("only foreign functions/types allowed for now"), }; BindgenAttrs::find(attrs)? }; - let js_namespace = item_opts.js_namespace().map(|(s, _)| s.to_owned()); + + let js_namespace = item_opts + .js_namespace() + .map(|(s, _)| s) + .or(ctx.js_namespace) + .map(|s| s.0); + let module = ctx.module; + let kind = match self { - syn::ForeignItem::Fn(f) => f.convert((item_opts, &module))?, - syn::ForeignItem::Type(t) => t.convert(item_opts)?, - syn::ForeignItem::Static(s) => s.convert((item_opts, &module))?, + syn::ForeignItem::Fn(f) => f.convert((program, item_opts, &module))?, + syn::ForeignItem::Type(t) => t.convert((program, item_opts))?, + syn::ForeignItem::Static(s) => s.convert((program, item_opts, &module))?, _ => panic!("only foreign functions/types allowed for now"), }; + // check for JS keywords + + // We only need to check if there isn't a JS namespace or module. If + // there is namespace, then we already checked the namespace while + // parsing. If there is a module, we can rename the import symbol to + // avoid using keywords. + let needs_check = js_namespace.is_none() && module.is_none(); + if needs_check { + match &kind { + ast::ImportKind::Function(import_function) => { + if matches!(import_function.kind, ast::ImportFunctionKind::Normal) + && is_non_value_js_keyword(&import_function.function.name) + { + bail_span!( + import_function.rust_name, + "Imported function cannot use the JS keyword `{}` as its name.", + import_function.function.name + ); + } + } + ast::ImportKind::Static(import_static) => { + if is_non_value_js_keyword(&import_static.js_name) { + bail_span!( + import_static.rust_name, + "Imported static cannot use the JS keyword `{}` as its name.", + import_static.js_name + ); + } + } + ast::ImportKind::String(_) => { + // static strings don't have JS names, so we don't need to check for JS keywords + } + ast::ImportKind::Type(import_type) => { + if is_non_value_js_keyword(&import_type.js_name) { + bail_span!( + import_type.rust_name, + "Imported type cannot use the JS keyword `{}` as its name.", + import_type.js_name + ); + } + } + ast::ImportKind::Enum(_) => { + // string enums aren't possible here + } + } + } + program.imports.push(ast::Import { module, js_namespace, @@ -1351,13 +1987,57 @@ impl MacroParse for syn::ForeignItem { } } +pub fn module_from_opts( + program: &mut ast::Program, + opts: &BindgenAttrs, +) -> Result, Diagnostic> { + if let Some(path) = opts.wasm_bindgen() { + program.wasm_bindgen = path.clone(); + } + + if let Some(path) = opts.js_sys() { + program.js_sys = path.clone(); + } + + if let Some(path) = opts.wasm_bindgen_futures() { + program.wasm_bindgen_futures = path.clone(); + } + + let mut errors = Vec::new(); + let module = if let Some((name, span)) = opts.module() { + if opts.inline_js().is_some() { + let msg = "cannot specify both `module` and `inline_js`"; + errors.push(Diagnostic::span_error(span, msg)); + } + if opts.raw_module().is_some() { + let msg = "cannot specify both `module` and `raw_module`"; + errors.push(Diagnostic::span_error(span, msg)); + } + Some(ast::ImportModule::Named(name.to_string(), span)) + } else if let Some((name, span)) = opts.raw_module() { + if opts.inline_js().is_some() { + let msg = "cannot specify both `raw_module` and `inline_js`"; + errors.push(Diagnostic::span_error(span, msg)); + } + Some(ast::ImportModule::RawNamed(name.to_string(), span)) + } else if let Some((js, span)) = opts.inline_js() { + let i = program.inline_js.len(); + program.inline_js.push(js.to_string()); + Some(ast::ImportModule::Inline(i, span)) + } else { + None + }; + Diagnostic::from_vec(errors)?; + Ok(module) +} + /// Get the first type parameter of a generic type, errors on incorrect input. fn extract_first_ty_param(ty: Option<&syn::Type>) -> Result, Diagnostic> { let t = match ty { Some(t) => t, None => return Ok(None), }; - let path = match *get_ty(&t) { + let path = match *get_ty(t) { syn::Type::Path(syn::TypePath { qself: None, ref path, @@ -1380,8 +2060,8 @@ fn extract_first_ty_param(ty: Option<&syn::Type>) -> Result, D syn::GenericArgument::Type(t) => t, other => bail_span!(other, "must be a type parameter"), }; - match get_ty(&ty) { - syn::Type::Tuple(t) if t.elems.len() == 0 => return Ok(None), + match get_ty(ty) { + syn::Type::Tuple(t) if t.elems.is_empty() => return Ok(None), _ => {} } Ok(Some(ty.clone())) @@ -1394,13 +2074,19 @@ fn extract_doc_comments(attrs: &[syn::Attribute]) -> Vec { .filter_map(|a| { // if the path segments include an ident of "doc" we know this // this is a doc comment - if a.path.segments.iter().any(|s| s.ident.to_string() == "doc") { + if a.path().segments.iter().any(|s| s.ident == "doc") { + let tokens = match &a.meta { + syn::Meta::Path(_) => None, + syn::Meta::List(list) => Some(list.tokens.clone()), + syn::Meta::NameValue(name_value) => Some(name_value.value.to_token_stream()), + }; + Some( // We want to filter out any Puncts so just grab the Literals - a.tokens.clone().into_iter().filter_map(|t| match t { + tokens.into_iter().flatten().filter_map(|t| match t { TokenTree::Literal(lit) => { let quoted = lit.to_string(); - Some(try_unescape("ed).unwrap_or_else(|| quoted)) + Some(try_unescape("ed).unwrap_or(quoted)) } _ => None, }), @@ -1417,25 +2103,13 @@ fn extract_doc_comments(attrs: &[syn::Attribute]) -> Vec { } // Unescapes a quoted string. char::escape_debug() was used to escape the text. -fn try_unescape(s: &str) -> Option { - if s.is_empty() { - return Some(String::new()); - } +fn try_unescape(mut s: &str) -> Option { + s = s.strip_prefix('"').unwrap_or(s); + s = s.strip_suffix('"').unwrap_or(s); let mut result = String::with_capacity(s.len()); let mut chars = s.chars(); - for i in 0.. { - let c = match chars.next() { - Some(c) => c, - None => { - if result.ends_with('"') { - result.pop(); - } - return Some(result); - } - }; - if i == 0 && c == '"' { - // ignore it - } else if c == '\\' { + while let Some(c) = chars.next() { + if c == '\\' { let c = chars.next()?; match c { 't' => result.push('\t'), @@ -1458,30 +2132,17 @@ fn try_unescape(s: &str) -> Option { result.push(c); } } - None + Some(result) } fn unescape_unicode(chars: &mut Chars) -> Option<(char, char)> { let mut value = 0; - for i in 0..7 { - let c = chars.next()?; - let num = if c >= '0' && c <= '9' { - c as u32 - '0' as u32 - } else if c >= 'a' && c <= 'f' { - c as u32 - 'a' as u32 + 10 - } else if c >= 'A' && c <= 'F' { - c as u32 - 'A' as u32 + 10 - } else { - if i == 0 { - return None; - } - let decoded = char::from_u32(value)?; - return Some((decoded, c)); - }; - if i >= 6 { - return None; + for (i, c) in chars.enumerate() { + match (i, c.to_digit(16)) { + (0..=5, Some(num)) => value = (value << 4) | num, + (1.., None) => return Some((char::from_u32(value)?, c)), + _ => break, } - value = (value << 4) | num; } None } @@ -1495,7 +2156,7 @@ fn assert_no_lifetimes(sig: &syn::Signature) -> Result<(), Diagnostic> { impl<'ast> syn::visit::Visit<'ast> for Walk { fn visit_lifetime(&mut self, i: &'ast syn::Lifetime) { self.diagnostics.push(err_span!( - &*i, + i, "it is currently not sound to use lifetimes in function \ signatures" )); @@ -1508,16 +2169,6 @@ fn assert_no_lifetimes(sig: &syn::Signature) -> Result<(), Diagnostic> { Diagnostic::from_vec(walk.diagnostics) } -/// This method always fails if the BindgenAttrs contain variadic -fn assert_not_variadic(attrs: &BindgenAttrs) -> Result<(), Diagnostic> { - if let Some(span) = attrs.variadic() { - let msg = "the `variadic` attribute can only be applied to imported \ - (`extern`) functions"; - return Err(Diagnostic::span_error(*span, msg)); - } - Ok(()) -} - /// Extracts the last ident from the path fn extract_path_ident(path: &syn::Path) -> Result { for segment in path.segments.iter() { @@ -1539,12 +2190,30 @@ pub fn reset_attrs_used() { ATTRS.with(|state| { state.parsed.set(0); state.checks.set(0); + state.unused_attrs.borrow_mut().clear(); }) } -pub fn assert_all_attrs_checked() { +pub fn check_unused_attrs(tokens: &mut TokenStream) { ATTRS.with(|state| { assert_eq!(state.parsed.get(), state.checks.get()); + let unused_attrs = &*state.unused_attrs.borrow(); + if !unused_attrs.is_empty() { + let unused_attrs = unused_attrs.iter().map(|UnusedState { error, ident }| { + if *error { + let text = format!("invalid attribute {} in this position", ident); + quote::quote! { ::core::compile_error!(#text); } + } else { + quote::quote! { let #ident: (); } + } + }); + tokens.extend(quote::quote! { + // Anonymous scope to prevent name clashes. + const _: () = { + #(#unused_attrs)* + }; + }); + } }) } @@ -1567,3 +2236,97 @@ fn operation_kind(opts: &BindgenAttrs) -> ast::OperationKind { } operation_kind } + +pub fn link_to(opts: BindgenAttrs) -> Result { + let mut program = ast::Program::default(); + let module = module_from_opts(&mut program, &opts)?.ok_or_else(|| { + Diagnostic::span_error(Span::call_site(), "`link_to!` requires a module.") + })?; + if let ast::ImportModule::Named(p, s) | ast::ImportModule::RawNamed(p, s) = &module { + if !p.starts_with("./") && !p.starts_with("../") && !p.starts_with('/') { + return Err(Diagnostic::span_error( + *s, + "`link_to!` does not support module paths.", + )); + } + } + opts.enforce_used()?; + program.linked_modules.push(module); + Ok(ast::LinkToModule(program)) +} + +fn main(program: &ast::Program, mut f: ItemFn, tokens: &mut TokenStream) -> Result<(), Diagnostic> { + if f.sig.ident != "main" { + bail_span!(&f.sig.ident, "the main function has to be called main"); + } + if let Some(constness) = f.sig.constness { + bail_span!(&constness, "the main function cannot be const"); + } + if !f.sig.generics.params.is_empty() { + bail_span!(&f.sig.generics, "the main function cannot have generics"); + } + if !f.sig.inputs.is_empty() { + bail_span!(&f.sig.inputs, "the main function cannot have arguments"); + } + + let r#return = f.sig.output; + f.sig.output = ReturnType::Default; + let body = f.block; + + let wasm_bindgen = &program.wasm_bindgen; + let wasm_bindgen_futures = &program.wasm_bindgen_futures; + + if f.sig.asyncness.take().is_some() { + f.block = Box::new( + syn::parse2(quote::quote! { + { + async fn __wasm_bindgen_generated_main() #r#return #body + #wasm_bindgen_futures::spawn_local( + async move { + use #wasm_bindgen::__rt::Main; + let __ret = __wasm_bindgen_generated_main(); + (&mut &mut &mut #wasm_bindgen::__rt::MainWrapper(Some(__ret.await))).__wasm_bindgen_main() + }, + ) + } + }) + .unwrap(), + ); + } else { + f.block = Box::new( + syn::parse2(quote::quote! { + { + fn __wasm_bindgen_generated_main() #r#return #body + use #wasm_bindgen::__rt::Main; + let __ret = __wasm_bindgen_generated_main(); + (&mut &mut &mut #wasm_bindgen::__rt::MainWrapper(Some(__ret))).__wasm_bindgen_main() + } + }) + .unwrap(), + ); + } + + f.to_tokens(tokens); + + Ok(()) +} + +#[cfg(test)] +mod tests { + #[test] + fn test_try_unescape() { + use super::try_unescape; + assert_eq!(try_unescape("hello").unwrap(), "hello"); + assert_eq!(try_unescape("\"hello").unwrap(), "hello"); + assert_eq!(try_unescape("hello\"").unwrap(), "hello"); + assert_eq!(try_unescape("\"hello\"").unwrap(), "hello"); + assert_eq!(try_unescape("hello\\\\").unwrap(), "hello\\"); + assert_eq!(try_unescape("hello\\n").unwrap(), "hello\n"); + assert_eq!(try_unescape("hello\\u"), None); + assert_eq!(try_unescape("hello\\u{"), None); + assert_eq!(try_unescape("hello\\u{}"), None); + assert_eq!(try_unescape("hello\\u{0}").unwrap(), "hello\0"); + assert_eq!(try_unescape("hello\\u{000000}").unwrap(), "hello\0"); + assert_eq!(try_unescape("hello\\u{0000000}"), None); + } +} diff --git a/crates/macro/Cargo.toml b/crates/macro/Cargo.toml index 510c3b9fab6..4e0fb0988c8 100644 --- a/crates/macro/Cargo.toml +++ b/crates/macro/Cargo.toml @@ -1,29 +1,35 @@ [package] -name = "wasm-bindgen-macro" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen" description = """ Definition of the `#[wasm_bindgen]` attribute, an internal dependency """ -edition = "2018" +documentation = "https://docs.rs/wasm-bindgen" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-macro" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro" +rust-version = "1.57" +version = "0.2.100" [lib] proc-macro = true [features] -spans = ["wasm-bindgen-macro-support/spans"] -xxx_debug_only_print_generated_code = [] strict-macro = ["wasm-bindgen-macro-support/strict-macro"] +xxx_debug_only_print_generated_code = [] [dependencies] -wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.80" } quote = "1.0" +wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.100" } [dev-dependencies] +js-sys = { path = "../js-sys" } trybuild = "1.0" -wasm-bindgen = { path = "../..", version = "0.2.80", features = ['strict-macro'] } -wasm-bindgen-futures = { path = "../futures", version = "0.4.30" } +wasm-bindgen = { path = "../.." } +wasm-bindgen-futures = { path = "../futures" } +web-sys = { path = "../web-sys", features = ["Worker"] } + +[lints] +workspace = true diff --git a/crates/macro/README.md b/crates/macro/README.md index 353829869f2..71e35ab29ff 100644 --- a/crates/macro/README.md +++ b/crates/macro/README.md @@ -17,12 +17,10 @@ To add a test: * Create `ui-tests/my-awesome-test.rs` * Write an invalid `#[wasm_bindgen]` invocation, testing the error you're generating -* Execute `cargo test -p ui-tests`, the test will fail +* Execute `cargo test -p wasm-bindgen-macro --test ui`, the test will fail * From within the `ui-tests` folder, execute `./update-all-references.sh`. This should create a `my-awesome-test.stderr` file. -* Inspect `my-awesome-test.stderr` to make sure it looks ok -* Rerun `cargo test -p ui-tests` and your tests should pass! -Testing here is a work in progress, see -[#601](https://github.com/rustwasm/wasm-bindgen/issues/601) for more -information. + OR if you are on Windows, set the `TRYBUILD=overwrite` environment variable (this is done as `$env:TRYBUILD="overwrite"` [in powershell](https://stackoverflow.com/a/1333717/7595472)) and run the command again. +* Inspect `my-awesome-test.stderr` to make sure it looks ok +* Rerun `cargo test -p wasm-bindgen-macro --test ui` and your tests should pass! diff --git a/crates/macro/src/lib.rs b/crates/macro/src/lib.rs index c677aaf24bf..51656f335ee 100644 --- a/crates/macro/src/lib.rs +++ b/crates/macro/src/lib.rs @@ -5,6 +5,7 @@ extern crate proc_macro; use proc_macro::TokenStream; use quote::quote; +/// A list of all the attributes can be found here: https://rustwasm.github.io/docs/wasm-bindgen/reference/attributes/index.html #[proc_macro_attribute] pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream { match wasm_bindgen_macro_support::expand(attr.into(), input.into()) { @@ -18,6 +19,35 @@ pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream { } } +/// This macro takes a JS module as input and returns a URL that can be used to +/// access it at runtime. +/// +/// The module can be specified in a few ways: +/// - You can use `inline_js = "..."` to create an inline JS file. +/// - You can use `module = "/foo/bar"` to reference a file relative to the +/// root of the crate the macro is invoked in. +/// +/// The returned URL can be used for things like creating workers/worklets: +/// ```no_run +/// use web_sys::Worker; +/// let worker = Worker::new(&wasm_bindgen::link_to!(module = "/src/worker.js")); +/// ``` +#[proc_macro] +pub fn link_to(input: TokenStream) -> TokenStream { + match wasm_bindgen_macro_support::expand_link_to(input.into()) { + Ok(tokens) => { + if cfg!(feature = "xxx_debug_only_print_generated_code") { + println!("{}", tokens); + } + tokens.into() + } + // This `String::clone` is here so that IDEs know this is supposed to be a + // `String` and can keep type-checking the rest of the program even if the macro + // fails. + Err(diagnostic) => (quote! { String::clone(#diagnostic) }).into(), + } +} + #[proc_macro_attribute] pub fn __wasm_bindgen_class_marker(attr: TokenStream, input: TokenStream) -> TokenStream { match wasm_bindgen_macro_support::expand_class_marker(attr.into(), input.into()) { @@ -30,3 +60,16 @@ pub fn __wasm_bindgen_class_marker(attr: TokenStream, input: TokenStream) -> Tok Err(diagnostic) => (quote! { #diagnostic }).into(), } } + +#[proc_macro_derive(BindgenedStruct, attributes(wasm_bindgen))] +pub fn __wasm_bindgen_struct_marker(item: TokenStream) -> TokenStream { + match wasm_bindgen_macro_support::expand_struct_marker(item.into()) { + Ok(tokens) => { + if cfg!(feature = "xxx_debug_only_print_generated_code") { + println!("{}", tokens); + } + tokens.into() + } + Err(diagnostic) => (quote! { #diagnostic }).into(), + } +} diff --git a/crates/macro/src/worker.js b/crates/macro/src/worker.js new file mode 100644 index 00000000000..360d4d42923 --- /dev/null +++ b/crates/macro/src/worker.js @@ -0,0 +1 @@ +// This file is needed for the doctest of `crate::link_to`. diff --git a/crates/macro/ui-tests/async-errors.stderr b/crates/macro/ui-tests/async-errors.stderr index 492492a181e..a13c8fceac8 100644 --- a/crates/macro/ui-tests/async-errors.stderr +++ b/crates/macro/ui-tests/async-errors.stderr @@ -1,68 +1,48 @@ error[E0277]: the trait bound `Result<(), ()>: IntoJsResult` is not satisfied - --> ui-tests/async-errors.rs:30:1 - | -30 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), ()>` - | - = help: the following implementations were found: - as IntoJsResult> - as IntoJsResult> -note: required by `into_js_result` - --> $WORKSPACE/src/lib.rs - | - | fn into_js_result(self) -> Result; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/async-errors.rs:31:24 + | +31 | pub async fn bad1() -> Result<(), ()> { loop {} } + | ^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), ()>` + | + = help: the following other types implement trait `IntoJsResult`: + Result<(), E> + Result error[E0277]: the trait bound `Result<(), BadType>: IntoJsResult` is not satisfied - --> ui-tests/async-errors.rs:32:1 - | -32 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), BadType>` - | - = help: the following implementations were found: - as IntoJsResult> - as IntoJsResult> -note: required by `into_js_result` - --> $WORKSPACE/src/lib.rs - | - | fn into_js_result(self) -> Result; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/async-errors.rs:33:24 + | +33 | pub async fn bad2() -> Result<(), BadType> { loop {} } + | ^^^^^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result<(), BadType>` + | + = help: the following other types implement trait `IntoJsResult`: + Result<(), E> + Result error[E0277]: the trait bound `wasm_bindgen::JsValue: From` is not satisfied - --> ui-tests/async-errors.rs:34:1 - | -34 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `From` is not implemented for `wasm_bindgen::JsValue` - | - = help: the following implementations were found: - > - > - > - > - and 73 others - = note: required because of the requirements on the impl of `Into` for `BadType` - = note: required because of the requirements on the impl of `IntoJsResult` for `BadType` -note: required by `into_js_result` - --> $WORKSPACE/src/lib.rs - | - | fn into_js_result(self) -> Result; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/async-errors.rs:35:24 + | +35 | pub async fn bad3() -> BadType { loop {} } + | ^^^^^^^ the trait `From` is not implemented for `wasm_bindgen::JsValue`, which is required by `BadType: IntoJsResult` + | + = help: the following other types implement trait `From`: + > + > + > + > + > + > + > + > + and $N others + = note: required for `BadType` to implement `Into` + = note: required for `BadType` to implement `IntoJsResult` error[E0277]: the trait bound `Result: IntoJsResult` is not satisfied - --> ui-tests/async-errors.rs:36:1 - | -36 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result` - | - = help: the following implementations were found: - as IntoJsResult> - as IntoJsResult> -note: required by `into_js_result` - --> $WORKSPACE/src/lib.rs - | - | fn into_js_result(self) -> Result; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/async-errors.rs:37:24 + | +37 | pub async fn bad4() -> Result { loop {} } + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoJsResult` is not implemented for `Result` + | + = help: the following other types implement trait `IntoJsResult`: + Result<(), E> + Result diff --git a/crates/macro/ui-tests/illegal-char-fn-attrs.rs b/crates/macro/ui-tests/illegal-char-fn-attrs.rs new file mode 100644 index 00000000000..11ba1fa8cda --- /dev/null +++ b/crates/macro/ui-tests/illegal-char-fn-attrs.rs @@ -0,0 +1,34 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn fn_with_illegal_char_attr1( + #[wasm_bindgen(unchecked_param_type = "abcd */firstArg")] arg1: u32, +) -> JsValue { + arg1.into() +} + +#[wasm_bindgen] +pub async fn fn_with_illegal_char_attr2( + #[wasm_bindgen(unchecked_param_type = "num*/ber")] arg1: u32, +) -> JsValue { + arg1.into() +} + +#[wasm_bindgen] +pub async fn fn_with_illegal_char_attr3( + #[wasm_bindgen(param_description = "/* some description */")] arg1: u32, +) -> JsValue { + arg1.into() +} + +#[wasm_bindgen(return_description = "*/ some description")] +pub async fn fn_with_illegal_char_attr4(arg1: u32) -> JsValue { + arg1.into() +} + +#[wasm_bindgen(unchecked_return_type = "number */ abcd")] +pub async fn fn_with_illegal_char_attr5(arg1: u32) -> JsValue { + arg1.into() +} + +fn main() {} diff --git a/crates/macro/ui-tests/illegal-char-fn-attrs.stderr b/crates/macro/ui-tests/illegal-char-fn-attrs.stderr new file mode 100644 index 00000000000..ef9de562305 --- /dev/null +++ b/crates/macro/ui-tests/illegal-char-fn-attrs.stderr @@ -0,0 +1,29 @@ +error: contains comment close syntax + --> ui-tests/illegal-char-fn-attrs.rs:5:43 + | +5 | #[wasm_bindgen(unchecked_param_type = "abcd */firstArg")] arg1: u32, + | ^^^^^^^^^^^^^^^^^ + +error: contains comment close syntax + --> ui-tests/illegal-char-fn-attrs.rs:12:43 + | +12 | #[wasm_bindgen(unchecked_param_type = "num*/ber")] arg1: u32, + | ^^^^^^^^^^ + +error: contains comment close syntax + --> ui-tests/illegal-char-fn-attrs.rs:19:40 + | +19 | #[wasm_bindgen(param_description = "/* some description */")] arg1: u32, + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: contains comment close syntax + --> ui-tests/illegal-char-fn-attrs.rs:24:37 + | +24 | #[wasm_bindgen(return_description = "*/ some description")] + | ^^^^^^^^^^^^^^^^^^^^^ + +error: contains comment close syntax + --> ui-tests/illegal-char-fn-attrs.rs:29:40 + | +29 | #[wasm_bindgen(unchecked_return_type = "number */ abcd")] + | ^^^^^^^^^^^^^^^^ diff --git a/crates/macro/ui-tests/import-keyword.rs b/crates/macro/ui-tests/import-keyword.rs new file mode 100644 index 00000000000..3c44a45c84d --- /dev/null +++ b/crates/macro/ui-tests/import-keyword.rs @@ -0,0 +1,68 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + type A; + + // directly import function with reserved keywords + #[wasm_bindgen] + fn function(); + // directly import function with reserved keywords + #[wasm_bindgen(js_name = "var")] + fn keyword_var(); + + // this is fine, because it's a method + #[wasm_bindgen(method, js_name = "let")] + fn keyword_let(arg: &A); + // this is fine, because it's static + #[wasm_bindgen(static_method_of = A, js_name = "let")] + fn static_keyword_let(); + + // directly import static with reserved keywords + #[wasm_bindgen(thread_local_v2, js_name = "const")] + static CONST: u32; + + // directly import type with reserved keywords + #[wasm_bindgen(js_name = "throw")] + type B; + // fine with a namespace + #[wasm_bindgen(js_name = "throw", js_namespace = ["foo"])] + type C; +} + +// Namespaces + +// namespace on extern block +#[wasm_bindgen(js_namespace = ["public", "foo"])] +extern "C" {} + +#[wasm_bindgen] +extern "C" { + // invalid, because of its namespace + #[wasm_bindgen(js_namespace = ["const", "bar"])] + fn function(); + // okay, because it defines its own namespace + #[wasm_bindgen(thread_local_v2, js_name = "const", js_namespace = ["bar", "new"])] + static CONST: u32; +} + +#[wasm_bindgen] +extern "C" { + // empty namespace to be funny + #[wasm_bindgen(js_namespace = [])] + fn function(); +} + +// Classes and enums + +#[wasm_bindgen] +pub struct class; +#[wasm_bindgen] +pub struct r#true; // forbid value-like keywords +#[wasm_bindgen] +pub enum switch { + A, + B, +} + +fn main() {} diff --git a/crates/macro/ui-tests/import-keyword.stderr b/crates/macro/ui-tests/import-keyword.stderr new file mode 100644 index 00000000000..b2c3d8e3fd3 --- /dev/null +++ b/crates/macro/ui-tests/import-keyword.stderr @@ -0,0 +1,73 @@ +error: Imported function cannot use the JS keyword `function` as its name. + --> ui-tests/import-keyword.rs:9:8 + | +9 | fn function(); + | ^^^^^^^^ + +error: Imported function cannot use the JS keyword `var` as its name. + --> ui-tests/import-keyword.rs:12:8 + | +12 | fn keyword_var(); + | ^^^^^^^^^^^ + +error: Imported static cannot use the JS keyword `const` as its name. + --> ui-tests/import-keyword.rs:23:12 + | +23 | static CONST: u32; + | ^^^^^ + +error: Imported type cannot use the JS keyword `throw` as its name. + --> ui-tests/import-keyword.rs:27:10 + | +27 | type B; + | ^ + +error: Namespace cannot start with the JS keyword `public` + --> ui-tests/import-keyword.rs:36:32 + | +36 | #[wasm_bindgen(js_namespace = ["public", "foo"])] + | ^^^^^^^^ + +error: Namespace cannot start with the JS keyword `const` + --> ui-tests/import-keyword.rs:42:36 + | +42 | #[wasm_bindgen(js_namespace = ["const", "bar"])] + | ^^^^^^^ + +error: Empty namespace lists are not allowed. + --> ui-tests/import-keyword.rs:52:35 + | +52 | #[wasm_bindgen(js_namespace = [])] + | ^^ + +error: struct cannot use the JS keyword `class` as its name + --> ui-tests/import-keyword.rs:59:12 + | +59 | pub struct class; + | ^^^^^ + +error: struct cannot use the JS keyword `true` as its name + --> ui-tests/import-keyword.rs:61:12 + | +61 | pub struct r#true; // forbid value-like keywords + | ^^^^^^ + +error: enum cannot use the JS keyword `switch` as its name + --> ui-tests/import-keyword.rs:63:10 + | +63 | pub enum switch { + | ^^^^^^ + +warning: type `class` should have an upper camel case name + --> ui-tests/import-keyword.rs:59:12 + | +59 | pub struct class; + | ^^^^^ help: convert the identifier to upper camel case (notice the capitalization): `Class` + | + = note: `#[warn(non_camel_case_types)]` on by default + +warning: type `true` should have an upper camel case name + --> ui-tests/import-keyword.rs:61:12 + | +61 | pub struct r#true; // forbid value-like keywords + | ^^^^^^ help: convert the identifier to upper camel case: `True` diff --git a/crates/macro/ui-tests/invalid-enums.rs b/crates/macro/ui-tests/invalid-enums.rs index abea3fa6712..571a39fb7c9 100644 --- a/crates/macro/ui-tests/invalid-enums.rs +++ b/crates/macro/ui-tests/invalid-enums.rs @@ -18,4 +18,61 @@ pub enum D { X = 4294967296, } +#[wasm_bindgen] +pub enum E { + A = 1, + B = "foo", +} + +#[wasm_bindgen] +pub enum F { + A = "foo", + B = 1, +} + +#[wasm_bindgen] +enum G { + A = "foo", + B = "bar", + C, +} + +#[wasm_bindgen] +pub enum H { + A = 1, + B = 1, // collision +} + +#[wasm_bindgen] +pub enum I { + A = 4294967294, // = u32::MAX - 1 + B, // = u32::MAX + C, // = u32::MAX + 1 +} + +#[wasm_bindgen] +pub enum J { + A, // = 0 + B = 0, // collision +} + +#[wasm_bindgen] +pub enum K { + A = 3, + B = 2, + C, // = 3 -> collision +} + +#[wasm_bindgen] +pub enum L { + A = -2147483648, // i32::MIN + B = -2147483649, // i32::MIN - 1 +} + +#[wasm_bindgen] +pub enum M { + A = -1, + B = 2147483648, // i32::MAX + 1 +} + fn main() {} diff --git a/crates/macro/ui-tests/invalid-enums.stderr b/crates/macro/ui-tests/invalid-enums.stderr index 7ad51f9a5a2..270de3b54b1 100644 --- a/crates/macro/ui-tests/invalid-enums.stderr +++ b/crates/macro/ui-tests/invalid-enums.stderr @@ -1,23 +1,77 @@ error: cannot export empty enums to JS - --> $DIR/invalid-enums.rs:4:1 + --> ui-tests/invalid-enums.rs:4:1 | 4 | enum A {} | ^^^^^^^^^ -error: only C-Style enums allowed with #[wasm_bindgen] - --> $DIR/invalid-enums.rs:8:6 +error: enum variants with associated data are not supported with #[wasm_bindgen] + --> ui-tests/invalid-enums.rs:8:6 | 8 | D(u32), | ^^^^^ -error: enums with #[wasm_bindgen] may only have number literal values - --> $DIR/invalid-enums.rs:13:9 +error: C-style enums with #[wasm_bindgen] may only have numeric literal values that fit in a 32-bit integer as discriminants. Expressions or variables are not supported. + --> ui-tests/invalid-enums.rs:13:9 | 13 | X = 1 + 3, | ^^^^^ -error: enums with #[wasm_bindgen] can only support numbers that can be represented as u32 - --> $DIR/invalid-enums.rs:18:9 +error: C-style enums with #[wasm_bindgen] can only support unsigned numbers that can be represented by `u32`, but `4294967296` is too large for `u32` + --> ui-tests/invalid-enums.rs:18:5 | 18 | X = 4294967296, - | ^^^^^^^^^^ + | ^^^^^^^^^^^^^^ + +error: enums with #[wasm_bindgen] cannot mix string and non-string values + --> ui-tests/invalid-enums.rs:23:9 + | +23 | A = 1, + | ^ + +error: enums with #[wasm_bindgen] cannot mix string and non-string values + --> ui-tests/invalid-enums.rs:30:9 + | +30 | B = 1, + | ^ + +error: all variants of a string enum must have a string value + --> ui-tests/invalid-enums.rs:37:5 + | +37 | C, + | ^ + +error: discriminant value `1` is already used by A in this enum + --> ui-tests/invalid-enums.rs:43:5 + | +43 | B = 1, // collision + | ^^^^^ + +error: C-style enums with #[wasm_bindgen] can only support unsigned numbers that can be represented by `u32`, but `4294967296` is too large for `u32` + --> ui-tests/invalid-enums.rs:50:5 + | +50 | C, // = u32::MAX + 1 + | ^ + +error: discriminant value `0` is already used by A in this enum + --> ui-tests/invalid-enums.rs:56:5 + | +56 | B = 0, // collision + | ^^^^^ + +error: discriminant value `3` is already used by A in this enum + --> ui-tests/invalid-enums.rs:63:5 + | +63 | C, // = 3 -> collision + | ^ + +error: C-style enums with #[wasm_bindgen] can only support signed numbers that can be represented by `i32`, but `-2147483649` is too small for `i32` + --> ui-tests/invalid-enums.rs:69:5 + | +69 | B = -2147483649, // i32::MIN - 1 + | ^^^^^^^^^^^^^^^ + +error: C-style enums with #[wasm_bindgen] can only support signed numbers that can be represented by `i32`, but `2147483648` is too large for `i32` + --> ui-tests/invalid-enums.rs:75:5 + | +75 | B = 2147483648, // i32::MAX + 1 + | ^^^^^^^^^^^^^^ diff --git a/crates/macro/ui-tests/invalid-fn-arg-name.rs b/crates/macro/ui-tests/invalid-fn-arg-name.rs new file mode 100644 index 00000000000..d6e882db168 --- /dev/null +++ b/crates/macro/ui-tests/invalid-fn-arg-name.rs @@ -0,0 +1,93 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn fn_with_invalid_arg_name1( + #[wasm_bindgen(js_name = "*firstArg")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub fn fn_with_invalid_arg_name2( + #[wasm_bindgen(js_name = "#firstArg")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub fn fn_with_invalid_arg_name3( + #[wasm_bindgen(js_name = "firstArg#")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub fn fn_with_invalid_arg_name4( + #[wasm_bindgen(js_name = "first-Arg")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub fn fn_with_invalid_arg_name5( + #[wasm_bindgen(js_name = "--firstArg")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub fn fn_with_invalid_arg_name6( + #[wasm_bindgen(js_name = " first Arg")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub struct A {} + +#[wasm_bindgen] +impl A { + #[wasm_bindgen] + pub async fn method_with_invalid_arg_name1( + #[wasm_bindgen(js_name = "(firstArg)")] arg: u32, + ) -> JsValue { + arg.into() + } + + #[wasm_bindgen] + pub async fn method_with_invalid_arg_name2( + #[wasm_bindgen(js_name = "[firstArg]")] arg: u32, + ) -> JsValue { + arg.into() + } + + #[wasm_bindgen] + pub async fn method_with_invalid_arg_name3( + #[wasm_bindgen(js_name = "")] arg: u32, + ) -> JsValue { + arg.into() + } + + #[wasm_bindgen] + pub async fn method_with_invalid_arg_name4( + #[wasm_bindgen(js_name = "firstArg+")] arg: u32, + ) -> JsValue { + arg.into() + } + + #[wasm_bindgen] + pub async fn method_with_invalid_arg_name5( + #[wasm_bindgen(js_name = "@firstArg")] arg: u32, + ) -> JsValue { + arg.into() + } + + #[wasm_bindgen] + pub async fn method_with_invalid_arg_name6( + #[wasm_bindgen(js_name = "!firstArg")] arg: u32, + ) -> JsValue { + arg.into() + } +} + +fn main() {} diff --git a/crates/macro/ui-tests/invalid-fn-arg-name.stderr b/crates/macro/ui-tests/invalid-fn-arg-name.stderr new file mode 100644 index 00000000000..bee7bd83a04 --- /dev/null +++ b/crates/macro/ui-tests/invalid-fn-arg-name.stderr @@ -0,0 +1,71 @@ +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:5:30 + | +5 | #[wasm_bindgen(js_name = "*firstArg")] arg: u32, + | ^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:12:30 + | +12 | #[wasm_bindgen(js_name = "#firstArg")] arg: u32, + | ^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:19:30 + | +19 | #[wasm_bindgen(js_name = "firstArg#")] arg: u32, + | ^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:26:30 + | +26 | #[wasm_bindgen(js_name = "first-Arg")] arg: u32, + | ^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:33:30 + | +33 | #[wasm_bindgen(js_name = "--firstArg")] arg: u32, + | ^^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:40:30 + | +40 | #[wasm_bindgen(js_name = " first Arg")] arg: u32, + | ^^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:52:34 + | +52 | #[wasm_bindgen(js_name = "(firstArg)")] arg: u32, + | ^^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:59:34 + | +59 | #[wasm_bindgen(js_name = "[firstArg]")] arg: u32, + | ^^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:66:34 + | +66 | #[wasm_bindgen(js_name = "")] arg: u32, + | ^^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:73:34 + | +73 | #[wasm_bindgen(js_name = "firstArg+")] arg: u32, + | ^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:80:34 + | +80 | #[wasm_bindgen(js_name = "@firstArg")] arg: u32, + | ^^^^^^^^^^^ + +error: invalid JS identifier + --> ui-tests/invalid-fn-arg-name.rs:87:34 + | +87 | #[wasm_bindgen(js_name = "!firstArg")] arg: u32, + | ^^^^^^^^^^^ diff --git a/crates/macro/ui-tests/invalid-imports.rs b/crates/macro/ui-tests/invalid-imports.rs index ecd223b706a..ceb7d33bf81 100644 --- a/crates/macro/ui-tests/invalid-imports.rs +++ b/crates/macro/ui-tests/invalid-imports.rs @@ -19,7 +19,7 @@ extern "C" { #[wasm_bindgen(method)] fn f4(x: &Bar); #[wasm_bindgen(method)] - fn f4(x: &Fn(T)); + fn f4(x: &dyn Fn(T)); #[wasm_bindgen(constructor)] fn f(); diff --git a/crates/macro/ui-tests/invalid-imports.stderr b/crates/macro/ui-tests/invalid-imports.stderr index aeb09c574cb..c83c040e862 100644 --- a/crates/macro/ui-tests/invalid-imports.stderr +++ b/crates/macro/ui-tests/invalid-imports.stderr @@ -1,71 +1,71 @@ error: it is currently not sound to use lifetimes in function signatures - --> $DIR/invalid-imports.rs:7:16 + --> ui-tests/invalid-imports.rs:7:16 | 7 | fn f() -> &'static u32; | ^^^^^^^ error: imported methods must have at least one argument - --> $DIR/invalid-imports.rs:10:5 + --> ui-tests/invalid-imports.rs:10:5 | 10 | fn f1(); | ^^^^^^^^ error: first argument of method must be a shared reference - --> $DIR/invalid-imports.rs:12:14 + --> ui-tests/invalid-imports.rs:12:14 | 12 | fn f2(x: u32); | ^^^ error: first argument of method must be a path - --> $DIR/invalid-imports.rs:14:14 + --> ui-tests/invalid-imports.rs:14:15 | 14 | fn f3(x: &&u32); - | ^^^^^ + | ^^^^ error: paths with type parameters are not supported yet - --> $DIR/invalid-imports.rs:20:15 + --> ui-tests/invalid-imports.rs:20:15 | 20 | fn f4(x: &Bar); | ^^^^^^ -error: paths with type parameters are not supported yet - --> $DIR/invalid-imports.rs:22:15 +error: first argument of method must be a path + --> ui-tests/invalid-imports.rs:22:15 | -22 | fn f4(x: &Fn(T)); - | ^^^^^ +22 | fn f4(x: &dyn Fn(T)); + | ^^^^^^^^^ error: constructor returns must be bare types - --> $DIR/invalid-imports.rs:25:5 + --> ui-tests/invalid-imports.rs:25:5 | 25 | fn f(); | ^^^^^^^ error: return value of constructor must be a bare path - --> $DIR/invalid-imports.rs:29:5 + --> ui-tests/invalid-imports.rs:29:5 | 29 | fn f() -> &Bar; | ^^^^^^^^^^^^^^^ error: must be Result<...> - --> $DIR/invalid-imports.rs:32:15 + --> ui-tests/invalid-imports.rs:32:15 | 32 | fn f() -> u32; | ^^^ error: must be Result<...> - --> $DIR/invalid-imports.rs:34:15 + --> ui-tests/invalid-imports.rs:34:15 | 34 | fn f() -> &u32; | ^^^^ error: must have at least one generic parameter - --> $DIR/invalid-imports.rs:36:15 + --> ui-tests/invalid-imports.rs:36:15 | 36 | fn f() -> Result<>; | ^^^^^^^^ error: it is currently not sound to use lifetimes in function signatures - --> $DIR/invalid-imports.rs:38:22 + --> ui-tests/invalid-imports.rs:38:22 | 38 | fn f() -> Result<'a>; | ^^ diff --git a/crates/macro/ui-tests/invalid-items.rs b/crates/macro/ui-tests/invalid-items.rs index 562a10ee33a..96a91f1da7a 100644 --- a/crates/macro/ui-tests/invalid-items.rs +++ b/crates/macro/ui-tests/invalid-items.rs @@ -3,9 +3,6 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen] fn foo() {} -#[wasm_bindgen] -pub unsafe fn foo1() {} - #[wasm_bindgen] pub const fn foo2() {} @@ -13,15 +10,26 @@ pub const fn foo2() {} struct Foo(T); #[wasm_bindgen] +#[rustfmt::skip] extern "C" { static mut FOO: u32; + #[wasm_bindgen(static_string)] + static FOO2: JsString; + + #[wasm_bindgen(thread_local_v2, static_string)] + static FOO3: JsString; + + static FOO4: JsString = "test"; + + #[wasm_bindgen(static_string)] + static FOO5: JsString = "test"; + pub fn foo3(x: i32, ...); } #[wasm_bindgen] -extern "system" { -} +extern "system" {} #[wasm_bindgen] pub fn foo4() {} diff --git a/crates/macro/ui-tests/invalid-items.stderr b/crates/macro/ui-tests/invalid-items.stderr index 2df6351b1b4..f1600b1fda7 100644 --- a/crates/macro/ui-tests/invalid-items.stderr +++ b/crates/macro/ui-tests/invalid-items.stderr @@ -4,62 +4,80 @@ error: can only #[wasm_bindgen] public functions 4 | fn foo() {} | ^^^^^^^^^^^ -error: can only #[wasm_bindgen] safe functions +error: can only #[wasm_bindgen] non-const functions --> $DIR/invalid-items.rs:7:5 | -7 | pub unsafe fn foo1() {} - | ^^^^^^ - -error: can only #[wasm_bindgen] non-const functions - --> $DIR/invalid-items.rs:10:5 - | -10 | pub const fn foo2() {} - | ^^^^^ +7 | pub const fn foo2() {} + | ^^^^^ error: structs with #[wasm_bindgen] cannot have lifetime or type parameters currently - --> $DIR/invalid-items.rs:13:11 + --> $DIR/invalid-items.rs:10:11 | -13 | struct Foo(T); +10 | struct Foo(T); | ^^^ error: cannot import mutable globals yet - --> $DIR/invalid-items.rs:17:12 + --> $DIR/invalid-items.rs:15:12 | -17 | static mut FOO: u32; +15 | static mut FOO: u32; | ^^^ +error: static strings require a string literal + --> $DIR/invalid-items.rs:17:20 + | +17 | #[wasm_bindgen(static_string)] + | ^^^^^^^^^^^^^ + +error: static strings require a string literal + --> $DIR/invalid-items.rs:20:37 + | +20 | #[wasm_bindgen(thread_local_v2, static_string)] + | ^^^^^^^^^^^^^ + +error: static strings require `#[wasm_bindgen(static_string)]` + --> $DIR/invalid-items.rs:23:5 + | +23 | static FOO4: JsString = "test"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: static strings require `#[wasm_bindgen(thread_local_v2)]` + --> $DIR/invalid-items.rs:26:5 + | +26 | static FOO5: JsString = "test"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: can't #[wasm_bindgen] variadic functions - --> $DIR/invalid-items.rs:19:25 + --> $DIR/invalid-items.rs:28:25 | -19 | pub fn foo3(x: i32, ...); +28 | pub fn foo3(x: i32, ...); | ^^^ error: only foreign mods with the `C` ABI are allowed - --> $DIR/invalid-items.rs:23:8 + --> $DIR/invalid-items.rs:32:8 | -23 | extern "system" { +32 | extern "system" {} | ^^^^^^^^ error: can't #[wasm_bindgen] functions with lifetime or type parameters - --> $DIR/invalid-items.rs:27:12 + --> $DIR/invalid-items.rs:35:12 | -27 | pub fn foo4() {} +35 | pub fn foo4() {} | ^^^ error: can't #[wasm_bindgen] functions with lifetime or type parameters - --> $DIR/invalid-items.rs:29:12 + --> $DIR/invalid-items.rs:37:12 | -29 | pub fn foo5<'a>() {} +37 | pub fn foo5<'a>() {} | ^^^^ error: can't #[wasm_bindgen] functions with lifetime or type parameters - --> $DIR/invalid-items.rs:31:12 + --> $DIR/invalid-items.rs:39:12 | -31 | pub fn foo6<'a, T>() {} +39 | pub fn foo6<'a, T>() {} | ^^^^^^^ error: #[wasm_bindgen] can only be applied to a function, struct, enum, impl, or extern block - --> $DIR/invalid-items.rs:34:1 + --> $DIR/invalid-items.rs:42:1 | -34 | trait X {} +42 | trait X {} | ^^^^^^^^^^ diff --git a/crates/macro/ui-tests/invalid-methods.rs b/crates/macro/ui-tests/invalid-methods.rs index 864abdfc314..bd69e6d31cf 100644 --- a/crates/macro/ui-tests/invalid-methods.rs +++ b/crates/macro/ui-tests/invalid-methods.rs @@ -39,9 +39,4 @@ impl A { pub const fn foo() {} } -#[wasm_bindgen] -impl A { - pub unsafe fn foo() {} -} - fn main() {} diff --git a/crates/macro/ui-tests/invalid-methods.stderr b/crates/macro/ui-tests/invalid-methods.stderr index 4268864b275..798e1af9aec 100644 --- a/crates/macro/ui-tests/invalid-methods.stderr +++ b/crates/macro/ui-tests/invalid-methods.stderr @@ -1,67 +1,61 @@ error: #[wasm_bindgen] default impls are not supported - --> $DIR/invalid-methods.rs:7:1 + --> ui-tests/invalid-methods.rs:7:1 | 7 | default impl A { | ^^^^^^^ error: #[wasm_bindgen] unsafe impls are not supported - --> $DIR/invalid-methods.rs:11:1 + --> ui-tests/invalid-methods.rs:11:1 | 11 | unsafe impl A { | ^^^^^^ error: #[wasm_bindgen] trait impls are not supported - --> $DIR/invalid-methods.rs:15:6 + --> ui-tests/invalid-methods.rs:15:6 | 15 | impl Clone for A { | ^^^^^ error: #[wasm_bindgen] generic impls aren't supported - --> $DIR/invalid-methods.rs:19:5 + --> ui-tests/invalid-methods.rs:19:5 | 19 | impl A { | ^^^ error: unsupported self type in #[wasm_bindgen] impl - --> $DIR/invalid-methods.rs:23:6 + --> ui-tests/invalid-methods.rs:23:6 | 23 | impl &'static A { | ^^^^^^^^^^ error: const definitions aren't supported with #[wasm_bindgen] - --> $DIR/invalid-methods.rs:30:5 + --> ui-tests/invalid-methods.rs:30:5 | 30 | const X: u32 = 3; | ^^^^^^^^^^^^^^^^^ error: type definitions in impls aren't supported with #[wasm_bindgen] - --> $DIR/invalid-methods.rs:31:5 + --> ui-tests/invalid-methods.rs:31:5 | 31 | type Y = u32; | ^^^^^^^^^^^^^ error: macros in impls aren't supported - --> $DIR/invalid-methods.rs:32:5 + --> ui-tests/invalid-methods.rs:32:5 | 32 | x!(); | ^^^^^ error: can only #[wasm_bindgen] non-const functions - --> $DIR/invalid-methods.rs:39:9 + --> ui-tests/invalid-methods.rs:39:9 | 39 | pub const fn foo() {} | ^^^^^ -error: can only bindgen safe functions - --> $DIR/invalid-methods.rs:44:9 - | -44 | pub unsafe fn foo() {} - | ^^^^^^ - -warning: unused macro definition - --> $DIR/invalid-methods.rs:26:1 +warning: unused macro definition: `x` + --> ui-tests/invalid-methods.rs:26:14 | 26 | macro_rules! x { () => () } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^ | = note: `#[warn(unused_macros)]` on by default diff --git a/crates/macro/ui-tests/invalid-self-fn-attrs.rs b/crates/macro/ui-tests/invalid-self-fn-attrs.rs new file mode 100644 index 00000000000..628a9a38b49 --- /dev/null +++ b/crates/macro/ui-tests/invalid-self-fn-attrs.rs @@ -0,0 +1,29 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub struct A { + inner: u32 +} + +#[wasm_bindgen] +impl A { + #[wasm_bindgen] + pub fn method_with_self_attr1( + #[wasm_bindgen(unchecked_param_type = "number")] + &self, + arg: u32 + ) -> JsValue { + (self.inner + arg).into() + } + + #[wasm_bindgen] + pub fn method_with_self_attr2( + #[wasm_bindgen(param_description = "some description")] + &self, + arg: u32 + ) -> JsValue { + (self.inner + arg).into() + } +} + +fn main() {} diff --git a/crates/macro/ui-tests/invalid-self-fn-attrs.stderr b/crates/macro/ui-tests/invalid-self-fn-attrs.stderr new file mode 100644 index 00000000000..885f1465c67 --- /dev/null +++ b/crates/macro/ui-tests/invalid-self-fn-attrs.stderr @@ -0,0 +1,11 @@ +error: expected non-macro attribute, found attribute macro `wasm_bindgen` + --> ui-tests/invalid-self-fn-attrs.rs:12:11 + | +12 | #[wasm_bindgen(unchecked_param_type = "number")] + | ^^^^^^^^^^^^ not a non-macro attribute + +error: expected non-macro attribute, found attribute macro `wasm_bindgen` + --> ui-tests/invalid-self-fn-attrs.rs:21:11 + | +21 | #[wasm_bindgen(param_description = "some description")] + | ^^^^^^^^^^^^ not a non-macro attribute diff --git a/crates/macro/ui-tests/invalid-self.rs b/crates/macro/ui-tests/invalid-self.rs new file mode 100644 index 00000000000..1e6ecd01585 --- /dev/null +++ b/crates/macro/ui-tests/invalid-self.rs @@ -0,0 +1,23 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub struct A { + data: u32, +} + +// oh no, I forgot to add `#[wasm_bindgen]` to the impl block +impl A { + #[wasm_bindgen(js_name = bar)] + pub fn foo(&self) {} +} + +#[wasm_bindgen] +extern "C" { + type MyClass; + + // oops, I mixed up `self` and `this` + #[wasm_bindgen(method)] + fn render(self: &MyClass) -> String; +} + +fn main() {} diff --git a/crates/macro/ui-tests/invalid-self.stderr b/crates/macro/ui-tests/invalid-self.stderr new file mode 100644 index 00000000000..7a1c6ff66a6 --- /dev/null +++ b/crates/macro/ui-tests/invalid-self.stderr @@ -0,0 +1,16 @@ +error: the `self` argument is only allowed for functions in `impl` blocks. + + If the function is already in an `impl` block, did you perhaps forget to add `#[wasm_bindgen]` to the `impl` block? + --> ui-tests/invalid-self.rs:11:17 + | +11 | pub fn foo(&self) {} + | ^^^^ + +error: the `self` argument is not allowed for `extern` functions. + + Did you perhaps mean `this`? For more information on importing JavaScript functions, see: + https://rustwasm.github.io/docs/wasm-bindgen/examples/import-js.html + --> ui-tests/invalid-self.rs:20:15 + | +20 | fn render(self: &MyClass) -> String; + | ^^^^ diff --git a/crates/macro/ui-tests/invalid-static-string.rs b/crates/macro/ui-tests/invalid-static-string.rs new file mode 100644 index 00000000000..ddb0a9a62d7 --- /dev/null +++ b/crates/macro/ui-tests/invalid-static-string.rs @@ -0,0 +1,10 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +#[rustfmt::skip] +extern "C" { + #[wasm_bindgen(thread_local_v2, static_string)] + static FOO: JsValue = "test"; +} + +fn main() {} diff --git a/crates/macro/ui-tests/invalid-static-string.stderr b/crates/macro/ui-tests/invalid-static-string.stderr new file mode 100644 index 00000000000..7d1872a10ec --- /dev/null +++ b/crates/macro/ui-tests/invalid-static-string.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/invalid-static-string.rs:3:1 + | +3 | #[wasm_bindgen] + | ^^^^^^^^^^^^^^^ + | | + | expected `JsString`, found `JsValue` + | expected `JsString` because of return type + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) +help: call `Into::into` on this expression to convert `wasm_bindgen::JsValue` into `JsString` + | +3 | #[wasm_bindgen].into() + | +++++++ diff --git a/crates/macro/ui-tests/link-to.rs b/crates/macro/ui-tests/link-to.rs new file mode 100644 index 00000000000..ce51c128e2e --- /dev/null +++ b/crates/macro/ui-tests/link-to.rs @@ -0,0 +1,32 @@ +fn good1() -> String { + wasm_bindgen::link_to!(inline_js = "console.log('Hello world!');") +} + +fn good2() -> String { + wasm_bindgen::link_to!(raw_module = "./foo.js") +} + +fn bad1() -> String { + wasm_bindgen::link_to!(module = "package/foo.js") +} + +fn bad2() -> String { + wasm_bindgen::link_to!(raw_module = "package/foo.js") +} + +fn bad3() -> String { + wasm_bindgen::link_to!(module = "/src/not-found.js") +} + +fn bad4() -> String { + wasm_bindgen::link_to!() +} + +fn bad5() -> String { + wasm_bindgen::link_to!( + inline_js = "console.log('Hello world!');", + js_namespace = foo + ) +} + +fn main() {} diff --git a/crates/macro/ui-tests/link-to.stderr b/crates/macro/ui-tests/link-to.stderr new file mode 100644 index 00000000000..61aaec7830f --- /dev/null +++ b/crates/macro/ui-tests/link-to.stderr @@ -0,0 +1,31 @@ +error: `link_to!` does not support module paths. + --> ui-tests/link-to.rs:10:37 + | +10 | wasm_bindgen::link_to!(module = "package/foo.js") + | ^^^^^^^^^^^^^^^^ + +error: `link_to!` does not support module paths. + --> ui-tests/link-to.rs:14:41 + | +14 | wasm_bindgen::link_to!(raw_module = "package/foo.js") + | ^^^^^^^^^^^^^^^^ + +error: failed to read file `$WORKSPACE/target/tests/trybuild/wasm-bindgen-macro/src/not-found.js`: No such file or directory (os error 2) + --> ui-tests/link-to.rs:18:37 + | +18 | wasm_bindgen::link_to!(module = "/src/not-found.js") + | ^^^^^^^^^^^^^^^^^^^ + +error: `link_to!` requires a module. + --> ui-tests/link-to.rs:22:5 + | +22 | wasm_bindgen::link_to!() + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the macro `wasm_bindgen::link_to` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: unused wasm_bindgen attribute + --> ui-tests/link-to.rs:28:9 + | +28 | js_namespace = foo + | ^^^^^^^^^^^^ diff --git a/crates/macro/ui-tests/main-async.rs b/crates/macro/ui-tests/main-async.rs new file mode 100644 index 00000000000..8e11f45b386 --- /dev/null +++ b/crates/macro/ui-tests/main-async.rs @@ -0,0 +1,7 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +async fn main() {} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/crates/macro/ui-tests/main-async.stderr b/crates/macro/ui-tests/main-async.stderr new file mode 100644 index 00000000000..71c4689a049 --- /dev/null +++ b/crates/macro/ui-tests/main-async.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-async.rs:7:4 + | +7 | fn fail() {} + | ^^^^ diff --git a/crates/macro/ui-tests/main-debug.rs b/crates/macro/ui-tests/main-debug.rs new file mode 100644 index 00000000000..ba163e4cf18 --- /dev/null +++ b/crates/macro/ui-tests/main-debug.rs @@ -0,0 +1,18 @@ +use std::fmt; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() -> Result<(), Test> { + unimplemented!() +} + +struct Test; + +impl fmt::Debug for Test { + fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { + unimplemented!() + } +} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/crates/macro/ui-tests/main-debug.stderr b/crates/macro/ui-tests/main-debug.stderr new file mode 100644 index 00000000000..2b3c670ecf6 --- /dev/null +++ b/crates/macro/ui-tests/main-debug.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-debug.rs:18:4 + | +18 | fn fail() {} + | ^^^^ diff --git a/crates/macro/ui-tests/main-infallible.rs b/crates/macro/ui-tests/main-infallible.rs new file mode 100644 index 00000000000..75ccd429a7b --- /dev/null +++ b/crates/macro/ui-tests/main-infallible.rs @@ -0,0 +1,10 @@ +use std::convert::Infallible; +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() -> Infallible { + unimplemented!() +} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/crates/macro/ui-tests/main-infallible.stderr b/crates/macro/ui-tests/main-infallible.stderr new file mode 100644 index 00000000000..4487bdcfcf6 --- /dev/null +++ b/crates/macro/ui-tests/main-infallible.stderr @@ -0,0 +1,22 @@ +error: the main function has to be called main + --> ui-tests/main-infallible.rs:10:4 + | +10 | fn fail() {} + | ^^^^ + +warning: unreachable expression + --> ui-tests/main-infallible.rs:4:1 + | +4 | #[wasm_bindgen(main)] + | ^^^^^^^^^^^^^^^^^^^^^ + | | + | unreachable expression + | any code following this expression is unreachable + | +note: this expression has type `Infallible`, which is uninhabited + --> ui-tests/main-infallible.rs:4:1 + | +4 | #[wasm_bindgen(main)] + | ^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(unreachable_code)]` on by default + = note: this warning originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/macro/ui-tests/main-jsvalue.rs b/crates/macro/ui-tests/main-jsvalue.rs new file mode 100644 index 00000000000..d2f5816acce --- /dev/null +++ b/crates/macro/ui-tests/main-jsvalue.rs @@ -0,0 +1,9 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() -> Result<(), JsValue> { + unimplemented!() +} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/crates/macro/ui-tests/main-jsvalue.stderr b/crates/macro/ui-tests/main-jsvalue.stderr new file mode 100644 index 00000000000..6d32d6209d0 --- /dev/null +++ b/crates/macro/ui-tests/main-jsvalue.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-jsvalue.rs:9:4 + | +9 | fn fail() {} + | ^^^^ diff --git a/crates/macro/ui-tests/main-unit.rs b/crates/macro/ui-tests/main-unit.rs new file mode 100644 index 00000000000..5e04c8dc772 --- /dev/null +++ b/crates/macro/ui-tests/main-unit.rs @@ -0,0 +1,7 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() -> () {} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/crates/macro/ui-tests/main-unit.stderr b/crates/macro/ui-tests/main-unit.stderr new file mode 100644 index 00000000000..f49066e906b --- /dev/null +++ b/crates/macro/ui-tests/main-unit.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main-unit.rs:7:4 + | +7 | fn fail() {} + | ^^^^ diff --git a/crates/macro/ui-tests/main.rs b/crates/macro/ui-tests/main.rs new file mode 100644 index 00000000000..5babfb92a9e --- /dev/null +++ b/crates/macro/ui-tests/main.rs @@ -0,0 +1,7 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(main)] +fn main() {} + +#[wasm_bindgen(main)] +fn fail() {} diff --git a/crates/macro/ui-tests/main.stderr b/crates/macro/ui-tests/main.stderr new file mode 100644 index 00000000000..94f13b1db70 --- /dev/null +++ b/crates/macro/ui-tests/main.stderr @@ -0,0 +1,5 @@ +error: the main function has to be called main + --> ui-tests/main.rs:7:4 + | +7 | fn fail() {} + | ^^^^ diff --git a/crates/macro/ui-tests/missing-catch.stderr b/crates/macro/ui-tests/missing-catch.stderr index 4c20dbe76f7..b420b787da7 100644 --- a/crates/macro/ui-tests/missing-catch.stderr +++ b/crates/macro/ui-tests/missing-catch.stderr @@ -1,17 +1,55 @@ error[E0277]: the trait bound `Result: FromWasmAbi` is not satisfied - --> $DIR/missing-catch.rs:6:9 - | -6 | pub fn foo() -> Result; - | ^^^ the trait `FromWasmAbi` is not implemented for `Result` - | -note: required by a bound in `FromWasmAbi` - --> $DIR/traits.rs:23:1 - | -23 | / pub trait FromWasmAbi: WasmDescribe { -24 | | /// The wasm ABI type that this converts from when coming back out from the -25 | | /// ABI boundary. -26 | | type Abi: WasmAbi; -... | -35 | | unsafe fn from_abi(js: Self::Abi) -> Self; -36 | | } - | |_^ required by this bound in `FromWasmAbi` + --> ui-tests/missing-catch.rs:6:9 + | +3 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +... +6 | pub fn foo() -> Result; + | ^^^ the trait `FromWasmAbi` is not implemented for `Result` + | + = help: the following other types implement trait `FromWasmAbi`: + bool + char + isize + i8 + i16 + i32 + i64 + i128 + and $N others + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `Result: FromWasmAbi` is not satisfied + --> ui-tests/missing-catch.rs:3:1 + | +3 | #[wasm_bindgen] + | ^^^^^^^^^^^^^^^ the trait `FromWasmAbi` is not implemented for `Result` + | + = help: the following other types implement trait `FromWasmAbi`: + bool + char + isize + i8 + i16 + i32 + i64 + i128 + and $N others + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `Result: FromWasmAbi` is not satisfied + --> ui-tests/missing-catch.rs:6:18 + | +6 | pub fn foo() -> Result; + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromWasmAbi` is not implemented for `Result` + | + = help: the following other types implement trait `FromWasmAbi`: + bool + char + isize + i8 + i16 + i32 + i64 + i128 + and $N others diff --git a/crates/macro/ui-tests/no-ret-fn-attr.rs b/crates/macro/ui-tests/no-ret-fn-attr.rs new file mode 100644 index 00000000000..afd2d764f31 --- /dev/null +++ b/crates/macro/ui-tests/no-ret-fn-attr.rs @@ -0,0 +1,21 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(unchecked_return_type = "number")] +pub fn no_ret_fn1() {} + +#[wasm_bindgen(return_description = "some description")] +pub async fn no_ret_fn2() {} + +#[wasm_bindgen] +pub struct A {} + +#[wasm_bindgen] +impl A { + #[wasm_bindgen(unchecked_return_type = "number")] + pub async fn no_ret_method1() {} + + #[wasm_bindgen(return_description = "some description")] + pub fn no_ret_method2() {} +} + +fn main() {} diff --git a/crates/macro/ui-tests/no-ret-fn-attr.stderr b/crates/macro/ui-tests/no-ret-fn-attr.stderr new file mode 100644 index 00000000000..66a6bdda801 --- /dev/null +++ b/crates/macro/ui-tests/no-ret-fn-attr.stderr @@ -0,0 +1,23 @@ +error: cannot specify return type for a function that doesn't return + --> ui-tests/no-ret-fn-attr.rs:3:40 + | +3 | #[wasm_bindgen(unchecked_return_type = "number")] + | ^^^^^^^^ + +error: cannot specify return description for a function that doesn't return + --> ui-tests/no-ret-fn-attr.rs:6:37 + | +6 | #[wasm_bindgen(return_description = "some description")] + | ^^^^^^^^^^^^^^^^^^ + +error: cannot specify return type for a function that doesn't return + --> ui-tests/no-ret-fn-attr.rs:14:44 + | +14 | #[wasm_bindgen(unchecked_return_type = "number")] + | ^^^^^^^^ + +error: cannot specify return description for a function that doesn't return + --> ui-tests/no-ret-fn-attr.rs:17:41 + | +17 | #[wasm_bindgen(return_description = "some description")] + | ^^^^^^^^^^^^^^^^^^ diff --git a/crates/macro/ui-tests/pub-not-copy.stderr b/crates/macro/ui-tests/pub-not-copy.stderr index 0cb088cd129..a7d2930b854 100644 --- a/crates/macro/ui-tests/pub-not-copy.stderr +++ b/crates/macro/ui-tests/pub-not-copy.stderr @@ -1,6 +1,9 @@ error[E0277]: the trait bound `String: std::marker::Copy` is not satisfied --> $DIR/pub-not-copy.rs:5:16 | +3 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +4 | pub struct A { 5 | pub field: String, | ^^^^^^ the trait `std::marker::Copy` is not implemented for `String` | @@ -9,4 +12,4 @@ note: required by a bound in `assert_copy` | 3 | #[wasm_bindgen] | ^^^^^^^^^^^^^^^ required by this bound in `assert_copy` - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `wasm_bindgen::__rt::BindgenedStruct` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/macro/ui-tests/start-function.rs b/crates/macro/ui-tests/start-function.rs index 65ad90bf283..6bc94c3be08 100644 --- a/crates/macro/ui-tests/start-function.rs +++ b/crates/macro/ui-tests/start-function.rs @@ -1,33 +1,33 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen(start)] -pub fn foo() {} +fn foo() {} #[wasm_bindgen(start)] -pub fn foo2(x: u32) {} +fn foo2(x: u32) {} #[wasm_bindgen(start)] -pub fn foo3() {} +fn foo3() {} #[wasm_bindgen(start)] -pub fn foo4() -> Result<(), JsValue> { Ok(()) } +fn foo4() -> Result<(), JsValue> { Ok(()) } #[wasm_bindgen(start)] -pub fn foo5() -> Result { Err(()) } +fn foo5() -> Result { Err(()) } #[wasm_bindgen(start)] -pub fn foo6() -> Result { Ok(JsValue::from(1u32)) } +fn foo6() -> Result { Ok(JsValue::from(1u32)) } #[wasm_bindgen(start)] -pub async fn foo_async1() {} +async fn foo_async1() {} #[wasm_bindgen(start)] -pub async fn foo_async2() -> Result<(), JsValue> { Ok(()) } +async fn foo_async2() -> Result<(), JsValue> { Ok(()) } #[wasm_bindgen(start)] -pub async fn foo_async3() -> Result { Err(()) } +async fn foo_async3() -> Result { Err(()) } #[wasm_bindgen(start)] -pub async fn foo_async4() -> Result { Ok(JsValue::from(1u32)) } +async fn foo_async4() -> Result { Ok(JsValue::from(1u32)) } fn main() {} diff --git a/crates/macro/ui-tests/start-function.stderr b/crates/macro/ui-tests/start-function.stderr index 8f459863d2e..cc25189ba49 100644 --- a/crates/macro/ui-tests/start-function.stderr +++ b/crates/macro/ui-tests/start-function.stderr @@ -1,71 +1,43 @@ error: the start function cannot have arguments - --> ui-tests/start-function.rs:7:13 + --> ui-tests/start-function.rs:7:9 | -7 | pub fn foo2(x: u32) {} - | ^^^^^^ +7 | fn foo2(x: u32) {} + | ^^^^^^ error: the start function cannot have generics - --> ui-tests/start-function.rs:10:12 + --> ui-tests/start-function.rs:10:8 | -10 | pub fn foo3() {} - | ^^^ +10 | fn foo3() {} + | ^^^ error[E0277]: the trait bound `Result: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:15:1 - | -15 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` - | - = help: the following implementations were found: - as wasm_bindgen::__rt::Start> -note: required by `start` - --> $WORKSPACE/src/lib.rs - | - | fn start(self); - | ^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/start-function.rs:16:14 + | +16 | fn foo5() -> Result { Err(()) } + | ^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` + | + = help: the trait `wasm_bindgen::__rt::Start` is implemented for `Result<(), E>` error[E0277]: the trait bound `Result: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:18:1 - | -18 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` - | - = help: the following implementations were found: - as wasm_bindgen::__rt::Start> -note: required by `start` - --> $WORKSPACE/src/lib.rs - | - | fn start(self); - | ^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/start-function.rs:19:14 + | +19 | fn foo6() -> Result { Ok(JsValue::from(1u32)) } + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` + | + = help: the trait `wasm_bindgen::__rt::Start` is implemented for `Result<(), E>` error[E0277]: the trait bound `Result: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:27:1 - | -27 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` - | - = help: the following implementations were found: - as wasm_bindgen::__rt::Start> -note: required by `start` - --> $WORKSPACE/src/lib.rs - | - | fn start(self); - | ^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/start-function.rs:28:26 + | +28 | async fn foo_async3() -> Result { Err(()) } + | ^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` + | + = help: the trait `wasm_bindgen::__rt::Start` is implemented for `Result<(), E>` error[E0277]: the trait bound `Result: wasm_bindgen::__rt::Start` is not satisfied - --> ui-tests/start-function.rs:30:1 - | -30 | #[wasm_bindgen(start)] - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` - | - = help: the following implementations were found: - as wasm_bindgen::__rt::Start> -note: required by `start` - --> $WORKSPACE/src/lib.rs - | - | fn start(self); - | ^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/start-function.rs:31:26 + | +31 | async fn foo_async4() -> Result { Ok(JsValue::from(1u32)) } + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `wasm_bindgen::__rt::Start` is not implemented for `Result` + | + = help: the trait `wasm_bindgen::__rt::Start` is implemented for `Result<(), E>` diff --git a/crates/macro/ui-tests/struct-fields.rs b/crates/macro/ui-tests/struct-fields.rs new file mode 100644 index 00000000000..dee2c89343d --- /dev/null +++ b/crates/macro/ui-tests/struct-fields.rs @@ -0,0 +1,15 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +extern "C" { + pub type Foo; +} + +#[wasm_bindgen] +struct Bar { + pub a: Foo, + #[wasm_bindgen(getter_with_clone)] + pub b: Foo, +} + +fn main() {} diff --git a/crates/macro/ui-tests/struct-fields.stderr b/crates/macro/ui-tests/struct-fields.stderr new file mode 100644 index 00000000000..0005e6740eb --- /dev/null +++ b/crates/macro/ui-tests/struct-fields.stderr @@ -0,0 +1,27 @@ +error[E0277]: the trait bound `Foo: std::marker::Copy` is not satisfied + --> ui-tests/struct-fields.rs:10:12 + | +8 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +9 | struct Bar { +10 | pub a: Foo, + | ^^^ the trait `std::marker::Copy` is not implemented for `Foo` + | +note: required by a bound in `__wbg_get_bar_a::assert_copy` + --> ui-tests/struct-fields.rs:8:1 + | +8 | #[wasm_bindgen] + | ^^^^^^^^^^^^^^^ required by this bound in `assert_copy` + = note: this error originates in the derive macro `wasm_bindgen::__rt::BindgenedStruct` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `Foo: Clone` is not satisfied + --> ui-tests/struct-fields.rs:12:12 + | +12 | pub b: Foo, + | ^^^ the trait `Clone` is not implemented for `Foo` + | +help: consider annotating `Foo` with `#[derive(Clone)]` + | +3 + #[derive(Clone)] +4 | #[wasm_bindgen] + | diff --git a/crates/macro/ui-tests/traits-not-implemented.stderr b/crates/macro/ui-tests/traits-not-implemented.stderr index 7b0f90f574c..2f7e9887747 100644 --- a/crates/macro/ui-tests/traits-not-implemented.stderr +++ b/crates/macro/ui-tests/traits-not-implemented.stderr @@ -1,18 +1,55 @@ error[E0277]: the trait bound `A: IntoWasmAbi` is not satisfied - --> $DIR/traits-not-implemented.rs:5:1 - | -5 | #[wasm_bindgen] - | ^^^^^^^^^^^^^^^ the trait `IntoWasmAbi` is not implemented for `A` - | -note: required by a bound in `IntoWasmAbi` - --> $DIR/traits.rs:9:1 - | -9 | / pub trait IntoWasmAbi: WasmDescribe { -10 | | /// The wasm ABI type that this converts into when crossing the ABI -11 | | /// boundary. -12 | | type Abi: WasmAbi; -... | -16 | | fn into_abi(self) -> Self::Abi; -17 | | } - | |_^ required by this bound in `IntoWasmAbi` - = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + --> ui-tests/traits-not-implemented.rs:5:1 + | +5 | #[wasm_bindgen] + | ^^^^^^^^^^^^^^^ the trait `IntoWasmAbi` is not implemented for `A` + | + = help: the following other types implement trait `IntoWasmAbi`: + bool + char + isize + i8 + i16 + i32 + i64 + i128 + and $N others + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `A: IntoWasmAbi` is not satisfied + --> ui-tests/traits-not-implemented.rs:8:19 + | +8 | pub fn foo(a: A); + | ^ the trait `IntoWasmAbi` is not implemented for `A` + | + = help: the following other types implement trait `IntoWasmAbi`: + bool + char + isize + i8 + i16 + i32 + i64 + i128 + and $N others + +error[E0277]: the trait bound `A: IntoWasmAbi` is not satisfied + --> ui-tests/traits-not-implemented.rs:8:12 + | +5 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +... +8 | pub fn foo(a: A); + | ^^^ the trait `IntoWasmAbi` is not implemented for `A` + | + = help: the following other types implement trait `IntoWasmAbi`: + bool + char + isize + i8 + i16 + i32 + i64 + i128 + and $N others + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/macro/ui-tests/unknown-type-in-import.stderr b/crates/macro/ui-tests/unknown-type-in-import.stderr index e7bb64c5340..9dc814804d0 100644 --- a/crates/macro/ui-tests/unknown-type-in-import.stderr +++ b/crates/macro/ui-tests/unknown-type-in-import.stderr @@ -1,7 +1,16 @@ error[E0412]: cannot find type `A` in this scope - --> $DIR/unknown-type-in-import.rs:6:19 + --> ui-tests/unknown-type-in-import.rs:6:19 | 6 | pub fn foo(a: A); - | - ^ not found in this scope - | | - | help: you might be missing a type parameter: `` + | ^ not found in this scope + | +help: you might be missing a type parameter + | +6 | pub fn foo(a: A); + | +++ + +error[E0412]: cannot find type `A` in this scope + --> ui-tests/unknown-type-in-import.rs:6:19 + | +6 | pub fn foo(a: A); + | ^ not found in this scope diff --git a/crates/macro/ui-tests/unsupported-options.rs b/crates/macro/ui-tests/unsupported-options.rs new file mode 100644 index 00000000000..1589027f30c --- /dev/null +++ b/crates/macro/ui-tests/unsupported-options.rs @@ -0,0 +1,82 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub struct RustStruct { + data: u32, +} + +#[wasm_bindgen] +impl RustStruct { + pub fn instance_method(&self) {} + fn priv_instance_method(&self) {} + pub fn static_method() {} + + #[wasm_bindgen(constructor)] + pub fn new() -> Self { + Self { data: 0 } + } + + #[wasm_bindgen(getter)] + pub fn prop(self) -> u32 { + 32 + } + #[wasm_bindgen(setter)] + pub fn set_prop(self, _value: u32) {} + + #[wasm_bindgen(getter)] + pub fn static_prop() -> u32 { + 32 + } + #[wasm_bindgen(setter)] + pub fn set_static_prop(_value: u32) {} + + #[wasm_bindgen(indexing_getter)] + pub fn indexing_getter(self) -> u32 { + 32 + } + #[wasm_bindgen(indexing_setter)] + pub fn indexing_setter(self, _value: u32) {} + #[wasm_bindgen(indexing_deleter)] + pub fn indexing_deleter(self, _value: u32) {} +} + +#[wasm_bindgen] +pub enum RustEnum { + A = 0, + B = 1, +} + +#[wasm_bindgen] +impl RustEnum { + pub fn instance_method(self) {} + fn priv_instance_method(self) {} + pub fn static_method() {} + + #[wasm_bindgen(constructor)] + pub fn new() -> Self { + Self::A + } + + #[wasm_bindgen(getter)] + pub fn prop(self) -> u32 { + 32 + } + #[wasm_bindgen(setter)] + pub fn set_prop(self, _value: u32) {} + + #[wasm_bindgen(getter)] + pub fn static_prop() -> u32 { + 32 + } + #[wasm_bindgen(setter)] + pub fn set_static_prop(_value: u32) {} +} + +pub struct NonWasmType; + +#[wasm_bindgen] +impl NonWasmType { + pub fn static_method() {} +} + +fn main() {} diff --git a/crates/macro/ui-tests/unsupported-options.stderr b/crates/macro/ui-tests/unsupported-options.stderr new file mode 100644 index 00000000000..7a6dcd70537 --- /dev/null +++ b/crates/macro/ui-tests/unsupported-options.stderr @@ -0,0 +1,95 @@ +error[E0277]: JavaScript constructors are not supported for `RustEnum` + --> ui-tests/unsupported-options.rs:56:12 + | +49 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +... +56 | pub fn new() -> Self { + | ^^^ this function cannot be the constructor of `RustEnum` + | + = help: the trait `SupportsConstructor` is not implemented for `RustEnum` + = note: `#[wasm_bindgen(constructor)]` is only supported for `struct`s and cannot be used for `enum`s. + = note: Consider removing the `constructor` option and using a regular static method instead. + = help: the trait `SupportsConstructor` is implemented for `RustStruct` +note: required by a bound in `CheckSupportsConstructor` + --> $WORKSPACE/src/rt/marker.rs + | + | pub struct CheckSupportsConstructor(T); + | ^^^^^^^^^^^^^^^^^^^ required by this bound in `CheckSupportsConstructor` + = note: this error originates in the attribute macro `wasm_bindgen::prelude::__wasm_bindgen_class_marker` which comes from the expansion of the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: JavaScript instance getters and setters are not supported for `RustEnum` + --> ui-tests/unsupported-options.rs:61:12 + | +49 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +... +61 | pub fn prop(self) -> u32 { + | ^^^^ this method cannot be a getter or setter for `RustEnum` + | + = help: the trait `SupportsInstanceProperty` is not implemented for `RustEnum` + = note: `#[wasm_bindgen(getter)]` and `#[wasm_bindgen(setter)]` are only supported for `struct`s and cannot be used for `enum`s. + = help: the trait `SupportsInstanceProperty` is implemented for `RustStruct` +note: required by a bound in `CheckSupportsInstanceProperty` + --> $WORKSPACE/src/rt/marker.rs + | + | pub struct CheckSupportsInstanceProperty(T); + | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `CheckSupportsInstanceProperty` + = note: this error originates in the attribute macro `wasm_bindgen::prelude::__wasm_bindgen_class_marker` which comes from the expansion of the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: JavaScript instance getters and setters are not supported for `RustEnum` + --> ui-tests/unsupported-options.rs:65:12 + | +49 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +... +65 | pub fn set_prop(self, _value: u32) {} + | ^^^^^^^^ this method cannot be a getter or setter for `RustEnum` + | + = help: the trait `SupportsInstanceProperty` is not implemented for `RustEnum` + = note: `#[wasm_bindgen(getter)]` and `#[wasm_bindgen(setter)]` are only supported for `struct`s and cannot be used for `enum`s. + = help: the trait `SupportsInstanceProperty` is implemented for `RustStruct` +note: required by a bound in `CheckSupportsInstanceProperty` + --> $WORKSPACE/src/rt/marker.rs + | + | pub struct CheckSupportsInstanceProperty(T); + | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `CheckSupportsInstanceProperty` + = note: this error originates in the attribute macro `wasm_bindgen::prelude::__wasm_bindgen_class_marker` which comes from the expansion of the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: JavaScript static getters and setters are not supported for `RustEnum` + --> ui-tests/unsupported-options.rs:68:12 + | +49 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +... +68 | pub fn static_prop() -> u32 { + | ^^^^^^^^^^^ this static function cannot be a static getter or setter on `RustEnum` + | + = help: the trait `SupportsStaticProperty` is not implemented for `RustEnum` + = note: `#[wasm_bindgen(getter)]` and `#[wasm_bindgen(setter)]` are only supported for `struct`s and cannot be used for `enum`s. + = help: the trait `SupportsStaticProperty` is implemented for `RustStruct` +note: required by a bound in `CheckSupportsStaticProperty` + --> $WORKSPACE/src/rt/marker.rs + | + | pub struct CheckSupportsStaticProperty(T); + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `CheckSupportsStaticProperty` + = note: this error originates in the attribute macro `wasm_bindgen::prelude::__wasm_bindgen_class_marker` which comes from the expansion of the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: JavaScript static getters and setters are not supported for `RustEnum` + --> ui-tests/unsupported-options.rs:72:12 + | +49 | #[wasm_bindgen] + | --------------- in this procedural macro expansion +... +72 | pub fn set_static_prop(_value: u32) {} + | ^^^^^^^^^^^^^^^ this static function cannot be a static getter or setter on `RustEnum` + | + = help: the trait `SupportsStaticProperty` is not implemented for `RustEnum` + = note: `#[wasm_bindgen(getter)]` and `#[wasm_bindgen(setter)]` are only supported for `struct`s and cannot be used for `enum`s. + = help: the trait `SupportsStaticProperty` is implemented for `RustStruct` +note: required by a bound in `CheckSupportsStaticProperty` + --> $WORKSPACE/src/rt/marker.rs + | + | pub struct CheckSupportsStaticProperty(T); + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `CheckSupportsStaticProperty` + = note: this error originates in the attribute macro `wasm_bindgen::prelude::__wasm_bindgen_class_marker` which comes from the expansion of the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/macro/ui-tests/unused-attributes.rs b/crates/macro/ui-tests/unused-attributes.rs index de7962e4646..f517dcc4b55 100644 --- a/crates/macro/ui-tests/unused-attributes.rs +++ b/crates/macro/ui-tests/unused-attributes.rs @@ -1,12 +1,31 @@ +#![deny(unused_variables)] + use wasm_bindgen::prelude::*; -struct A; +struct A {} #[wasm_bindgen] impl A { #[wasm_bindgen(method)] - #[wasm_bindgen(method)] - pub fn foo() { + pub fn foo() {} +} + +#[wasm_bindgen] +pub struct MyStruct { + hello: String, +} + +#[wasm_bindgen(getter, typescript_custom_section)] +pub const FOO: &'static str = "FOO"; + +#[wasm_bindgen(readonly)] +pub fn bar() {} + +#[wasm_bindgen(getter_with_clone, final)] +impl MyStruct { + #[wasm_bindgen(getter, typescript_type = "Thing[]")] + pub fn hello(&self) -> String { + self.hello.clone() } } diff --git a/crates/macro/ui-tests/unused-attributes.stderr b/crates/macro/ui-tests/unused-attributes.stderr index 12f2c01f31e..1df8f26a021 100644 --- a/crates/macro/ui-tests/unused-attributes.stderr +++ b/crates/macro/ui-tests/unused-attributes.stderr @@ -1,11 +1,41 @@ -error: unused #[wasm_bindgen] attribute - --> $DIR/unused-attributes.rs:7:20 +error: unused variable: `method` + --> ui-tests/unused-attributes.rs:9:20 | -7 | #[wasm_bindgen(method)] - | ^^^^^^ - -error: unused #[wasm_bindgen] attribute - --> $DIR/unused-attributes.rs:8:20 +9 | #[wasm_bindgen(method)] + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_method` + | +note: the lint level is defined here + --> ui-tests/unused-attributes.rs:1:9 | -8 | #[wasm_bindgen(method)] - | ^^^^^^ +1 | #![deny(unused_variables)] + | ^^^^^^^^^^^^^^^^ + +error: unused variable: `getter` + --> ui-tests/unused-attributes.rs:18:16 + | +18 | #[wasm_bindgen(getter, typescript_custom_section)] + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_getter` + +error: unused variable: `readonly` + --> ui-tests/unused-attributes.rs:21:16 + | +21 | #[wasm_bindgen(readonly)] + | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_readonly` + +error: unused variable: `typescript_type` + --> ui-tests/unused-attributes.rs:26:28 + | +26 | #[wasm_bindgen(getter, typescript_type = "Thing[]")] + | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_typescript_type` + +error: unused variable: `getter_with_clone` + --> ui-tests/unused-attributes.rs:24:16 + | +24 | #[wasm_bindgen(getter_with_clone, final)] + | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_getter_with_clone` + +error: unused variable: `final` + --> ui-tests/unused-attributes.rs:24:35 + | +24 | #[wasm_bindgen(getter_with_clone, final)] + | ^^^^^ help: if this is intentional, prefix it with an underscore: `_final` diff --git a/crates/macro/ui-tests/unused-fn-attrs.rs b/crates/macro/ui-tests/unused-fn-attrs.rs new file mode 100644 index 00000000000..d483273a5cd --- /dev/null +++ b/crates/macro/ui-tests/unused-fn-attrs.rs @@ -0,0 +1,85 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn fn_with_unused_attr1( + #[wasm_bindgen(js_name = "firstArg", js_name = "anotherFirstArg")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub async fn fn_with_unused_attr2( + #[wasm_bindgen(unchecked_param_type = "number", unchecked_param_type = "bigint")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub async fn fn_with_unused_attr3( + #[wasm_bindgen(unchecked_return_type = "number")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub async fn fn_with_unused_attr4( + #[wasm_bindgen(return_description = "some description")] arg: u32, +) -> JsValue { + arg.into() +} + +#[wasm_bindgen] +pub struct A {} + +#[wasm_bindgen] +impl A { + #[wasm_bindgen] + pub async fn fn_with_unused_attr( + #[wasm_bindgen(param_description = "some number")] + #[wasm_bindgen(param_description = "some other description")] arg: u32, + ) -> JsValue { + arg.into() + } +} + +#[wasm_bindgen( + unchecked_return_type = "something", + return_description = "something", + unchecked_param_type = "something", + param_description = "somthing" +)] +struct B {} + +#[wasm_bindgen( + unchecked_return_type = "something", + return_description = "something", + unchecked_param_type = "something", + param_description = "somthing" +)] +impl B { + #[wasm_bindgen] + pub fn foo() {} +} + +#[wasm_bindgen( + unchecked_return_type = "something", + return_description = "something", + unchecked_param_type = "something", + param_description = "somthing" +)] +pub enum C { + Variat +} + +#[wasm_bindgen( + unchecked_return_type = "something", + return_description = "something", + unchecked_param_type = "something", + param_description = "somthing" +)] +impl C { + #[wasm_bindgen] + pub fn foo() {} +} + +fn main() {} diff --git a/crates/macro/ui-tests/unused-fn-attrs.stderr b/crates/macro/ui-tests/unused-fn-attrs.stderr new file mode 100644 index 00000000000..056946c4fd6 --- /dev/null +++ b/crates/macro/ui-tests/unused-fn-attrs.stderr @@ -0,0 +1,237 @@ +error: unused wasm_bindgen attribute + --> ui-tests/unused-fn-attrs.rs:5:42 + | +5 | #[wasm_bindgen(js_name = "firstArg", js_name = "anotherFirstArg")] arg: u32, + | ^^^^^^^ + +error: unused wasm_bindgen attribute + --> ui-tests/unused-fn-attrs.rs:12:53 + | +12 | #[wasm_bindgen(unchecked_param_type = "number", unchecked_param_type = "bigint")] arg: u32, + | ^^^^^^^^^^^^^^^^^^^^ + +error: unused wasm_bindgen attribute + --> ui-tests/unused-fn-attrs.rs:19:20 + | +19 | #[wasm_bindgen(unchecked_return_type = "number")] arg: u32, + | ^^^^^^^^^^^^^^^^^^^^^ + +error: unused wasm_bindgen attribute + --> ui-tests/unused-fn-attrs.rs:26:20 + | +26 | #[wasm_bindgen(return_description = "some description")] arg: u32, + | ^^^^^^^^^^^^^^^^^^ + +error: unused wasm_bindgen attribute + --> ui-tests/unused-fn-attrs.rs:39:24 + | +39 | #[wasm_bindgen(param_description = "some other description")] arg: u32, + | ^^^^^^^^^^^^^^^^^ + +error: invalid attribute unchecked_return_type in this position + --> ui-tests/unused-fn-attrs.rs:45:1 + | +45 | / #[wasm_bindgen( +46 | | unchecked_return_type = "something", +47 | | return_description = "something", +48 | | unchecked_param_type = "something", +49 | | param_description = "somthing" +50 | | )] + | |__^ + | + = note: this error originates in the derive macro `wasm_bindgen::__rt::BindgenedStruct` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute return_description in this position + --> ui-tests/unused-fn-attrs.rs:45:1 + | +45 | / #[wasm_bindgen( +46 | | unchecked_return_type = "something", +47 | | return_description = "something", +48 | | unchecked_param_type = "something", +49 | | param_description = "somthing" +50 | | )] + | |__^ + | + = note: this error originates in the derive macro `wasm_bindgen::__rt::BindgenedStruct` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute unchecked_param_type in this position + --> ui-tests/unused-fn-attrs.rs:45:1 + | +45 | / #[wasm_bindgen( +46 | | unchecked_return_type = "something", +47 | | return_description = "something", +48 | | unchecked_param_type = "something", +49 | | param_description = "somthing" +50 | | )] + | |__^ + | + = note: this error originates in the derive macro `wasm_bindgen::__rt::BindgenedStruct` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute param_description in this position + --> ui-tests/unused-fn-attrs.rs:45:1 + | +45 | / #[wasm_bindgen( +46 | | unchecked_return_type = "something", +47 | | return_description = "something", +48 | | unchecked_param_type = "something", +49 | | param_description = "somthing" +50 | | )] + | |__^ + | + = note: this error originates in the derive macro `wasm_bindgen::__rt::BindgenedStruct` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute unchecked_return_type in this position + --> ui-tests/unused-fn-attrs.rs:53:1 + | +53 | / #[wasm_bindgen( +54 | | unchecked_return_type = "something", +55 | | return_description = "something", +56 | | unchecked_param_type = "something", +57 | | param_description = "somthing" +58 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute return_description in this position + --> ui-tests/unused-fn-attrs.rs:53:1 + | +53 | / #[wasm_bindgen( +54 | | unchecked_return_type = "something", +55 | | return_description = "something", +56 | | unchecked_param_type = "something", +57 | | param_description = "somthing" +58 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute unchecked_param_type in this position + --> ui-tests/unused-fn-attrs.rs:53:1 + | +53 | / #[wasm_bindgen( +54 | | unchecked_return_type = "something", +55 | | return_description = "something", +56 | | unchecked_param_type = "something", +57 | | param_description = "somthing" +58 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute param_description in this position + --> ui-tests/unused-fn-attrs.rs:53:1 + | +53 | / #[wasm_bindgen( +54 | | unchecked_return_type = "something", +55 | | return_description = "something", +56 | | unchecked_param_type = "something", +57 | | param_description = "somthing" +58 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute unchecked_return_type in this position + --> ui-tests/unused-fn-attrs.rs:64:1 + | +64 | / #[wasm_bindgen( +65 | | unchecked_return_type = "something", +66 | | return_description = "something", +67 | | unchecked_param_type = "something", +68 | | param_description = "somthing" +69 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute return_description in this position + --> ui-tests/unused-fn-attrs.rs:64:1 + | +64 | / #[wasm_bindgen( +65 | | unchecked_return_type = "something", +66 | | return_description = "something", +67 | | unchecked_param_type = "something", +68 | | param_description = "somthing" +69 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute unchecked_param_type in this position + --> ui-tests/unused-fn-attrs.rs:64:1 + | +64 | / #[wasm_bindgen( +65 | | unchecked_return_type = "something", +66 | | return_description = "something", +67 | | unchecked_param_type = "something", +68 | | param_description = "somthing" +69 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute param_description in this position + --> ui-tests/unused-fn-attrs.rs:64:1 + | +64 | / #[wasm_bindgen( +65 | | unchecked_return_type = "something", +66 | | return_description = "something", +67 | | unchecked_param_type = "something", +68 | | param_description = "somthing" +69 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute unchecked_return_type in this position + --> ui-tests/unused-fn-attrs.rs:74:1 + | +74 | / #[wasm_bindgen( +75 | | unchecked_return_type = "something", +76 | | return_description = "something", +77 | | unchecked_param_type = "something", +78 | | param_description = "somthing" +79 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute return_description in this position + --> ui-tests/unused-fn-attrs.rs:74:1 + | +74 | / #[wasm_bindgen( +75 | | unchecked_return_type = "something", +76 | | return_description = "something", +77 | | unchecked_param_type = "something", +78 | | param_description = "somthing" +79 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute unchecked_param_type in this position + --> ui-tests/unused-fn-attrs.rs:74:1 + | +74 | / #[wasm_bindgen( +75 | | unchecked_return_type = "something", +76 | | return_description = "something", +77 | | unchecked_param_type = "something", +78 | | param_description = "somthing" +79 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: invalid attribute param_description in this position + --> ui-tests/unused-fn-attrs.rs:74:1 + | +74 | / #[wasm_bindgen( +75 | | unchecked_return_type = "something", +76 | | return_description = "something", +77 | | unchecked_param_type = "something", +78 | | param_description = "somthing" +79 | | )] + | |__^ + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/macro/ui-tests/wasm-bindgen.rs b/crates/macro/ui-tests/wasm-bindgen.rs new file mode 100644 index 00000000000..1675034a438 --- /dev/null +++ b/crates/macro/ui-tests/wasm-bindgen.rs @@ -0,0 +1,43 @@ +extern crate wasm_bindgen as extern_test; + +use wasm_bindgen::prelude::*; + +mod test { + pub use wasm_bindgen as test; + pub use wasm_bindgen; +} + +#[wasm_bindgen(wasm_bindgen = wasm_bindgen)] +pub fn good1() {} + +#[wasm_bindgen(wasm_bindgen = ::wasm_bindgen)] +pub fn good2() {} + +#[wasm_bindgen(wasm_bindgen = test::wasm_bindgen)] +pub fn good3() {} + +#[wasm_bindgen(wasm_bindgen = test::test)] +pub fn good4() {} + +#[wasm_bindgen(wasm_bindgen = extern_test)] +pub fn good5() {} + +#[wasm_bindgen(wasm_bindgen_futures = wasm_bindgen_futures)] +pub fn good6() {} + +#[wasm_bindgen(wasm_bindgen = wasm_bindgen)] +pub async fn good7() {} + +#[wasm_bindgen(wasm_bindgen_futures = wasm_bindgen_futures)] +pub async fn good8() {} + +#[wasm_bindgen(wasm_bindgen = wasm_bindgen, wasm_bindgen_futures = wasm_bindgen_futures)] +pub async fn good9() {} + +#[wasm_bindgen(wasm_bindgen = test)] +pub fn bad1() {} + +#[wasm_bindgen(wasm_bindgen_futures = test)] +pub async fn bad2() {} + +fn main() {} diff --git a/crates/macro/ui-tests/wasm-bindgen.stderr b/crates/macro/ui-tests/wasm-bindgen.stderr new file mode 100644 index 00000000000..2dfacc7b209 --- /dev/null +++ b/crates/macro/ui-tests/wasm-bindgen.stderr @@ -0,0 +1,19 @@ +error[E0433]: failed to resolve: could not find `__wbindgen_coverage` in `test` + --> ui-tests/wasm-bindgen.rs:37:1 + | +37 | #[wasm_bindgen(wasm_bindgen = test)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `__wbindgen_coverage` in `test` + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0425]: cannot find function `future_to_promise` in module `test` + --> ui-tests/wasm-bindgen.rs:40:1 + | +40 | #[wasm_bindgen(wasm_bindgen_futures = test)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `test` + | + = note: this error originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider importing this function + | +3 + use wasm_bindgen_futures::future_to_promise; + | diff --git a/crates/msrv/cli/Cargo.toml b/crates/msrv/cli/Cargo.toml new file mode 100644 index 00000000000..8bbe4ef76c9 --- /dev/null +++ b/crates/msrv/cli/Cargo.toml @@ -0,0 +1,8 @@ +[package] +edition = "2021" +name = "msrv-cli-test" +publish = false +version = "0.0.0" + +[dependencies] +wasm-bindgen-cli = { path = "../../cli" } diff --git a/tests/no-std/lib.rs b/crates/msrv/cli/src/lib.rs similarity index 100% rename from tests/no-std/lib.rs rename to crates/msrv/cli/src/lib.rs diff --git a/crates/msrv/lib/Cargo.toml b/crates/msrv/lib/Cargo.toml new file mode 100644 index 00000000000..8bff4349dd4 --- /dev/null +++ b/crates/msrv/lib/Cargo.toml @@ -0,0 +1,33 @@ +[package] +edition = "2021" +name = "msrv-library-test" +publish = false +version = "0.0.0" + +[features] +default = [ + "wasm-bindgen/default", + "js-sys/default", + "wasm-bindgen-futures/default", + "web-sys/default", + "wasm-bindgen-test/default", +] +msrv = ["wasm-bindgen/msrv"] +std = [ + "wasm-bindgen/std", + "js-sys/std", + "wasm-bindgen-futures/std", + "web-sys/std", + "wasm-bindgen-test/std", +] + +[dependencies] +js-sys = { path = "../../js-sys", default-features = false } +wasm-bindgen = { path = "../../../", default-features = false } +wasm-bindgen-futures = { path = "../../futures", default-features = false } +wasm-bindgen-test = { path = "../../test", default-features = false } +web-sys = { path = "../../web-sys", default-features = false } + +# Pinned sub-dependencies for MSRV +bumpalo = "=3.12.0" +log = "=0.4.18" diff --git a/crates/msrv/lib/src/lib.rs b/crates/msrv/lib/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/crates/msrv/resolver/Cargo.toml b/crates/msrv/resolver/Cargo.toml new file mode 100644 index 00000000000..842ce86ec82 --- /dev/null +++ b/crates/msrv/resolver/Cargo.toml @@ -0,0 +1,30 @@ +[package] +edition = "2021" +name = "msrv-resolver-test" +publish = false +resolver = "1" +version = "0.0.0" + +[features] +default = [ + "wasm-bindgen/default", + "js-sys/default", + "wasm-bindgen-futures/default", + "web-sys/default", + "wasm-bindgen-test/default", +] +msrv = ["wasm-bindgen/msrv"] +std = [ + "wasm-bindgen/std", + "js-sys/std", + "wasm-bindgen-futures/std", + "web-sys/std", + "wasm-bindgen-test/std", +] + +[dependencies] +js-sys = { path = "../../js-sys", default-features = false } +wasm-bindgen = { path = "../../../", default-features = false } +wasm-bindgen-futures = { path = "../../futures", default-features = false } +wasm-bindgen-test = { path = "../../test", default-features = false } +web-sys = { path = "../../web-sys", default-features = false } diff --git a/crates/msrv/resolver/src/lib.rs b/crates/msrv/resolver/src/lib.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/crates/multi-value-xform/Cargo.toml b/crates/multi-value-xform/Cargo.toml index f2c947adee3..e9cf5ccc369 100644 --- a/crates/multi-value-xform/Cargo.toml +++ b/crates/multi-value-xform/Cargo.toml @@ -1,26 +1,32 @@ [package] -name = "wasm-bindgen-multi-value-xform" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/multi-value-xform" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen-multi-value-xform" description = """ Internal multi-value transformations for wasm-bindgen """ -edition = "2018" +documentation = "https://docs.rs/wasm-bindgen-multi-value-xform" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-multi-value-xform" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/multi-value-xform" +rust-version = "1.76" +version = "0.2.100" [dependencies] anyhow = "1.0" -walrus = "0.19.0" +walrus = "0.23" +wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.100" } [dev-dependencies] rayon = "1.0" -wasmprinter = "0.2" -wast = "21.0" +wasmprinter = "0.214" +wast = "214" wat = "1.0" +[lints] +workspace = true + [[test]] -name = "all" harness = false +name = "all" diff --git a/crates/multi-value-xform/src/lib.rs b/crates/multi-value-xform/src/lib.rs index 072aca16462..955cb0d2bfa 100644 --- a/crates/multi-value-xform/src/lib.rs +++ b/crates/multi-value-xform/src/lib.rs @@ -58,33 +58,33 @@ //! //! (func $pairWrapper (param i32 i32) (result i32 i32) //! ;; Our return pointer that points to the scratch space we are allocating -//! ;; on the shadow stack for calling `$pair`. +//! ;; on the stack for calling `$pair`. //! (local i32) //! -//! ;; Allocate space on the shadow stack for the result. -//! global.get $shadowStackPointer +//! ;; Allocate space on the stack for the result. +//! global.get $stackPointer //! i32.const 8 //! i32.sub //! local.tee 2 -//! global.set $shadowStackPointer +//! global.set $stackPointer //! -//! ;; Call `$pair` with our allocated shadow stack space for its results. +//! ;; Call `$pair` with our allocated stack space for its results. //! local.get 2 //! local.get 0 //! local.get 1 //! call $pair //! -//! ;; Copy the return values from the shadow stack to the wasm stack. +//! ;; Copy the return values from the stack to the Wasm stack. //! local.get 2 //! i32.load //! local.get 2 offset=4 //! i32.load //! -//! ;; Finally, restore the shadow stack pointer. +//! ;; Finally, restore the stack pointer. //! local.get 2 //! i32.const 8 //! i32.add -//! global.set $shadowStackPointer) +//! global.set $stackPointer) //! ``` //! //! This `$pairWrapper` function is what we actually end up exporting instead of @@ -92,16 +92,17 @@ #![deny(missing_docs, missing_debug_implementations)] +use anyhow::Context; + /// Run the transformation. /// /// See the module-level docs for details on the transformation. /// -/// * `memory` is the module's memory that has the shadow stack where return +/// * `memory` is the module's memory that has the stack where return /// pointers are allocated within. /// -/// * `shadow_stack_pointer` is the global that is being used as the stack -/// pointer for the shadow stack. With LLVM, this is typically the first -/// global. +/// * `__stack_pointer` is the global that is being used as the stack +/// pointer. With LLVM, this is typically the first global. /// /// * `to_xform` is the set of exported functions we want to transform and /// information required to transform them. The `usize` is the index of the @@ -114,15 +115,19 @@ pub fn run( module: &mut walrus::Module, memory: walrus::MemoryId, - shadow_stack_pointer: walrus::GlobalId, + stack_pointer: walrus::GlobalId, to_xform: &[(walrus::FunctionId, usize, Vec)], ) -> Result, anyhow::Error> { + // Insert multi-value to the target features section. + wasm_bindgen_wasm_conventions::insert_target_feature(module, "multivalue") + .context("failed to parse `target_features` custom section")?; + let mut wrappers = Vec::new(); for (func, return_pointer_index, results) in to_xform { wrappers.push(xform_one( module, memory, - shadow_stack_pointer, + stack_pointer, *func, *return_pointer_index, results, @@ -140,13 +145,13 @@ fn round_up_to_alignment(n: u32, align: u32) -> u32 { fn xform_one( module: &mut walrus::Module, memory: walrus::MemoryId, - shadow_stack_pointer: walrus::GlobalId, + stack_pointer: walrus::GlobalId, func: walrus::FunctionId, return_pointer_index: usize, results: &[walrus::ValType], ) -> Result { - if module.globals.get(shadow_stack_pointer).ty != walrus::ValType::I32 { - anyhow::bail!("shadow stack pointer global does not have type `i32`"); + if module.globals.get(stack_pointer).ty != walrus::ValType::I32 { + anyhow::bail!("stack pointer global does not have type `i32`"); } // Compute the total size of all results, potentially with padding to ensure @@ -162,7 +167,7 @@ fn xform_one( round_up_to_alignment(results_size, 8) + 8 } walrus::ValType::V128 => round_up_to_alignment(results_size, 16) + 16, - walrus::ValType::Externref | walrus::ValType::Funcref => anyhow::bail!( + walrus::ValType::Ref(_) => anyhow::bail!( "cannot multi-value transform functions that return \ reference types, since they can't go into linear memory" ), @@ -204,18 +209,18 @@ fn xform_one( // The locals for the function parameters. let params: Vec<_> = new_params.iter().map(|ty| module.locals.add(*ty)).collect(); - // A local to hold our shadow stack-allocated return pointer. + // A local to hold our stack-allocated return pointer. let return_pointer = module.locals.add(walrus::ValType::I32); let mut wrapper = walrus::FunctionBuilder::new(&mut module.types, &new_params, results); let mut body = wrapper.func_body(); - // Allocate space in the shadow stack for the call. - body.global_get(shadow_stack_pointer) + // Allocate space in the stack for the call. + body.global_get(stack_pointer) .i32_const(results_size as i32) .binop(walrus::ir::BinaryOp::I32Sub) .local_tee(return_pointer) - .global_set(shadow_stack_pointer); + .global_set(stack_pointer); // Push the parameters for calling our wrapped function -- including the // return pointer! -- on to the stack. @@ -232,8 +237,7 @@ fn xform_one( // Call our wrapped function. body.call(func); - // Copy the return values from our shadow stack-allocated space and onto the - // Wasm stack. + // Copy the return values from our stack-allocated space and onto the Wasm stack. let mut offset = 0; for ty in results { debug_assert!(offset < results_size); @@ -284,15 +288,15 @@ fn xform_one( ); offset += 16; } - walrus::ValType::Externref | walrus::ValType::Funcref => unreachable!(), + walrus::ValType::Ref(_) => unreachable!(), } } - // Finally, restore the shadow stack pointer. + // Finally, restore the stack pointer. body.local_get(return_pointer) .i32_const(results_size as i32) .binop(walrus::ir::BinaryOp::I32Add) - .global_set(shadow_stack_pointer); + .global_set(stack_pointer); let wrapper = wrapper.finish(params, &mut module.funcs); if let Some(name) = &module.funcs.get(func).name { @@ -306,7 +310,7 @@ fn xform_one( mod tests { #[test] fn round_up_to_alignment_works() { - for (n, align, expected) in vec![ + for &(n, align, expected) in &[ (0, 1, 0), (1, 1, 1), (2, 1, 2), diff --git a/crates/multi-value-xform/tests/align.wat b/crates/multi-value-xform/tests/align.wat index 5c53ddaa458..89c63267867 100644 --- a/crates/multi-value-xform/tests/align.wat +++ b/crates/multi-value-xform/tests/align.wat @@ -11,7 +11,7 @@ (module (type (;0;) (func (result f64 i32 i64))) (type (;1;) (func (param i32))) - (func $#func0 (@name "foo multivalue shim") (type 0) (result f64 i32 i64) + (func $"foo multivalue shim" (;0;) (type 0) (result f64 i32 i64) (local i32) global.get 0 i32.const 32 @@ -29,9 +29,12 @@ local.get 0 i32.const 32 i32.add - global.set 0) - (func $foo (type 1) (param i32)) + global.set 0 + ) + (func $foo (;1;) (type 1) (param i32)) (memory (;0;) 1) (global (;0;) (mut i32) i32.const 0) - (export "foo" (func $#func0))) + (export "foo" (func $"foo multivalue shim")) + (@custom "target_features" (after code) "\01+\0amultivalue") +) ;) diff --git a/crates/multi-value-xform/tests/all.rs b/crates/multi-value-xform/tests/all.rs index 588abd26f20..8b3638c2497 100644 --- a/crates/multi-value-xform/tests/all.rs +++ b/crates/multi-value-xform/tests/all.rs @@ -11,6 +11,7 @@ use rayon::prelude::*; use std::env; use std::fs; use std::path::{Path, PathBuf}; +use walrus::ModuleConfig; use wast::parser::{Parse, Parser}; fn main() { @@ -19,7 +20,9 @@ fn main() { fn runtest(test: &Test) -> Result { let wasm = wat::parse_file(&test.file)?; - let mut walrus = walrus::Module::from_buffer(&wasm)?; + let mut walrus = ModuleConfig::new() + .generate_producers_section(false) + .parse(&wasm)?; let mut exports = Vec::new(); let mut xforms = Vec::new(); for directive in test.directives.iter() { @@ -42,7 +45,7 @@ fn runtest(test: &Test) -> Result { walrus.exports.get_mut(export).item = walrus::ExportItem::Function(id); } walrus::passes::gc::run(&mut walrus); - let printed = wasmprinter::print_bytes(&walrus.emit_wasm())?; + let printed = wasmprinter::print_bytes(walrus.emit_wasm())?; Ok(printed) } @@ -130,15 +133,12 @@ impl Test { while let Some(line) = iter.next() { if line.starts_with("(; CHECK-ALL:") { let mut pattern = String::new(); - while let Some(line) = iter.next() { + for line in iter.by_ref() { if line == ";)" { break; } pattern.push_str(line); - pattern.push_str("\n"); - } - while pattern.ends_with("\n") { - pattern.pop(); + pattern.push('\n'); } if iter.next().is_some() { bail!("CHECK-ALL must be at the end of the file"); @@ -170,8 +170,8 @@ impl Test { } bail!( "expected\n {}\n\nactual\n {}", - pattern.replace("\n", "\n "), - output.replace("\n", "\n ") + pattern.replace('\n', "\n "), + output.replace('\n', "\n ") ); } else { bail!( @@ -190,7 +190,7 @@ fn update_output(path: &Path, output: &str) -> Result<()> { let mut new_output = String::new(); for line in output.lines() { new_output.push_str(line); - new_output.push_str("\n"); + new_output.push('\n'); } let new = format!( "{}\n\n(; CHECK-ALL:\n{}\n;)\n", @@ -203,7 +203,7 @@ fn update_output(path: &Path, output: &str) -> Result<()> { impl<'a> Parse<'a> for Directive { fn parse(parser: Parser<'a>) -> wast::parser::Result { - use wast::{kw, ValType}; + use wast::{core::ValType, kw}; parser.parse::()?; let name = parser.parse()?; diff --git a/crates/multi-value-xform/tests/many.wat b/crates/multi-value-xform/tests/many.wat index df78e205ffb..c4fee08a895 100644 --- a/crates/multi-value-xform/tests/many.wat +++ b/crates/multi-value-xform/tests/many.wat @@ -11,7 +11,7 @@ (module (type (;0;) (func (result i32 f32 f64 i64))) (type (;1;) (func (param i32))) - (func $#func0 (@name "foo multivalue shim") (type 0) (result i32 f32 f64 i64) + (func $"foo multivalue shim" (;0;) (type 0) (result i32 f32 f64 i64) (local i32) global.get 0 i32.const 32 @@ -31,9 +31,12 @@ local.get 0 i32.const 32 i32.add - global.set 0) - (func $foo (type 1) (param i32)) + global.set 0 + ) + (func $foo (;1;) (type 1) (param i32)) (memory (;0;) 1) (global (;0;) (mut i32) i32.const 0) - (export "foo" (func $#func0))) + (export "foo" (func $"foo multivalue shim")) + (@custom "target_features" (after code) "\01+\0amultivalue") +) ;) diff --git a/crates/multi-value-xform/tests/simple.wat b/crates/multi-value-xform/tests/simple.wat index 9e89e3c76ea..b0f1c0d942a 100644 --- a/crates/multi-value-xform/tests/simple.wat +++ b/crates/multi-value-xform/tests/simple.wat @@ -20,7 +20,7 @@ (type (;2;) (func (result f32))) (type (;3;) (func (result f64))) (type (;4;) (func (param i32))) - (func $#func0 (@name "i32 multivalue shim") (type 0) (result i32) + (func $"i32 multivalue shim" (;0;) (type 0) (result i32) (local i32) global.get 0 i32.const 16 @@ -34,8 +34,9 @@ local.get 0 i32.const 16 i32.add - global.set 0) - (func $#func1 (@name "i64 multivalue shim") (type 1) (result i64) + global.set 0 + ) + (func $"i64 multivalue shim" (;1;) (type 1) (result i64) (local i32) global.get 0 i32.const 16 @@ -49,8 +50,9 @@ local.get 0 i32.const 16 i32.add - global.set 0) - (func $#func2 (@name "f32 multivalue shim") (type 2) (result f32) + global.set 0 + ) + (func $"f32 multivalue shim" (;2;) (type 2) (result f32) (local i32) global.get 0 i32.const 16 @@ -64,8 +66,9 @@ local.get 0 i32.const 16 i32.add - global.set 0) - (func $#func3 (@name "f64 multivalue shim") (type 3) (result f64) + global.set 0 + ) + (func $"f64 multivalue shim" (;3;) (type 3) (result f64) (local i32) global.get 0 i32.const 16 @@ -79,15 +82,18 @@ local.get 0 i32.const 16 i32.add - global.set 0) - (func $i32 (type 4) (param i32)) - (func $i64 (type 4) (param i32)) - (func $f32 (type 4) (param i32)) - (func $f64 (type 4) (param i32)) + global.set 0 + ) + (func $i32 (;4;) (type 4) (param i32)) + (func $i64 (;5;) (type 4) (param i32)) + (func $f32 (;6;) (type 4) (param i32)) + (func $f64 (;7;) (type 4) (param i32)) (memory (;0;) 1) (global (;0;) (mut i32) i32.const 0) - (export "i32" (func $#func0)) - (export "i64" (func $#func1)) - (export "f32" (func $#func2)) - (export "f64" (func $#func3))) + (export "i32" (func $"i32 multivalue shim")) + (export "i64" (func $"i64 multivalue shim")) + (export "f32" (func $"f32 multivalue shim")) + (export "f64" (func $"f64 multivalue shim")) + (@custom "target_features" (after code) "\01+\0amultivalue") +) ;) diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index 3e76f2c1fb6..cc22b103c56 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -1,18 +1,26 @@ [package] -name = "wasm-bindgen-shared" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/shared" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen-shared" description = """ Shared support between wasm-bindgen and wasm-bindgen cli, an internal dependency. """ -edition = "2018" +documentation = "https://docs.rs/wasm-bindgen-shared" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/build.rs", "/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-shared" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/shared" +rust-version = "1.57" +version = "0.2.100" # Because only a single `wasm_bindgen` version can be used in a dependency # graph, pretend we link a native library so that `cargo` will provide better # error messages than the esoteric linker errors we would otherwise trigger. links = "wasm_bindgen" + +[lints] +workspace = true + +[dependencies] +unicode-ident = "1.0.5" diff --git a/crates/shared/src/identifier.rs b/crates/shared/src/identifier.rs new file mode 100644 index 00000000000..51ebcc81f58 --- /dev/null +++ b/crates/shared/src/identifier.rs @@ -0,0 +1,42 @@ +/// Returns whether a character has the Unicode `ID_Start` properly. +/// +/// This is only ever-so-slightly different from `XID_Start` in a few edge +/// cases, so we handle those edge cases manually and delegate everything else +/// to `unicode-ident`. +fn is_id_start(c: char) -> bool { + match c { + '\u{037A}' | '\u{0E33}' | '\u{0EB3}' | '\u{309B}' | '\u{309C}' | '\u{FC5E}' + | '\u{FC5F}' | '\u{FC60}' | '\u{FC61}' | '\u{FC62}' | '\u{FC63}' | '\u{FDFA}' + | '\u{FDFB}' | '\u{FE70}' | '\u{FE72}' | '\u{FE74}' | '\u{FE76}' | '\u{FE78}' + | '\u{FE7A}' | '\u{FE7C}' | '\u{FE7E}' | '\u{FF9E}' | '\u{FF9F}' => true, + _ => unicode_ident::is_xid_start(c), + } +} + +/// Returns whether a character has the Unicode `ID_Continue` properly. +/// +/// This is only ever-so-slightly different from `XID_Continue` in a few edge +/// cases, so we handle those edge cases manually and delegate everything else +/// to `unicode-ident`. +fn is_id_continue(c: char) -> bool { + match c { + '\u{037A}' | '\u{309B}' | '\u{309C}' | '\u{FC5E}' | '\u{FC5F}' | '\u{FC60}' + | '\u{FC61}' | '\u{FC62}' | '\u{FC63}' | '\u{FDFA}' | '\u{FDFB}' | '\u{FE70}' + | '\u{FE72}' | '\u{FE74}' | '\u{FE76}' | '\u{FE78}' | '\u{FE7A}' | '\u{FE7C}' + | '\u{FE7E}' => true, + _ => unicode_ident::is_xid_continue(c), + } +} + +/// Returns whether a string is a valid JavaScript identifier. +/// Defined at https://tc39.es/ecma262/#prod-IdentifierName. +pub fn is_valid_ident(name: &str) -> bool { + !name.is_empty() + && name.chars().enumerate().all(|(i, char)| { + if i == 0 { + is_id_start(char) || char == '$' || char == '_' + } else { + is_id_continue(char) || char == '$' || char == '\u{200C}' || char == '\u{200D}' + } + }) +} diff --git a/crates/shared/src/lib.rs b/crates/shared/src/lib.rs index 2c2eecd33a8..20b1164efb3 100644 --- a/crates/shared/src/lib.rs +++ b/crates/shared/src/lib.rs @@ -1,12 +1,13 @@ #![doc(html_root_url = "https://docs.rs/wasm-bindgen-shared/0.2")] +pub mod identifier; #[cfg(test)] mod schema_hash_approval; // This gets changed whenever our schema changes. // At this time versions of wasm-bindgen and wasm-bindgen-cli are required to have the exact same // SCHEMA_VERSION in order to work together. -pub const SCHEMA_VERSION: &str = "0.2.74"; +pub const SCHEMA_VERSION: &str = "0.2.100"; #[macro_export] macro_rules! shared_api { @@ -17,21 +18,30 @@ macro_rules! shared_api { enums: Vec>, imports: Vec>, structs: Vec>, - typescript_custom_sections: Vec<&'a str>, + // NOTE: Originally typescript_custom_sections are just some strings + // But the expression type can only be parsed into a string during compilation + // So when encoding, LitOrExpr contains two types, one is that expressions are parsed into strings during compilation, and the other is can be parsed directly. + // When decoding, LitOrExpr can be decoded as a string. + typescript_custom_sections: Vec>, local_modules: Vec>, inline_js: Vec<&'a str>, unique_crate_identifier: &'a str, package_json: Option<&'a str>, + linked_modules: Vec>, } struct Import<'a> { - module: ImportModule<'a>, + module: Option>, js_namespace: Option>, kind: ImportKind<'a>, } + struct LinkedModule<'a> { + module: ImportModule<'a>, + link_function_name: &'a str, + } + enum ImportModule<'a> { - None, Named(&'a str), RawNamed(&'a str), Inline(u32), @@ -40,8 +50,9 @@ macro_rules! shared_api { enum ImportKind<'a> { Function(ImportFunction<'a>), Static(ImportStatic<'a>), + String(ImportString<'a>), Type(ImportType<'a>), - Enum(ImportEnum), + Enum(StringEnum<'a>), } struct ImportFunction<'a> { @@ -83,13 +94,23 @@ macro_rules! shared_api { shim: &'a str, } + struct ImportString<'a> { + shim: &'a str, + string: &'a str, + } + struct ImportType<'a> { name: &'a str, instanceof_shim: &'a str, vendor_prefixes: Vec<&'a str>, } - struct ImportEnum {} + struct StringEnum<'a> { + name: &'a str, + variant_values: Vec<&'a str>, + comments: Vec<&'a str>, + generate_typescript: bool, + } struct Export<'a> { class: Option<&'a str>, @@ -102,6 +123,7 @@ macro_rules! shared_api { struct Enum<'a> { name: &'a str, + signed: bool, variants: Vec>, comments: Vec<&'a str>, generate_typescript: bool, @@ -114,10 +136,20 @@ macro_rules! shared_api { } struct Function<'a> { - arg_names: Vec, + args: Vec>, asyncness: bool, name: &'a str, generate_typescript: bool, + generate_jsdoc: bool, + variadic: bool, + ret_ty_override: Option<&'a str>, + ret_desc: Option<&'a str>, + } + + struct FunctionArgumentData<'a> { + name: String, + ty_override: Option<&'a str>, + desc: Option<&'a str>, } struct Struct<'a> { @@ -133,28 +165,37 @@ macro_rules! shared_api { readonly: bool, comments: Vec<&'a str>, generate_typescript: bool, + generate_jsdoc: bool, } struct LocalModule<'a> { identifier: &'a str, contents: &'a str, + linked_module: bool, } } }; // end of mac case } // end of mac definition pub fn new_function(struct_name: &str) -> String { - let mut name = format!("__wbg_"); + let mut name = "__wbg_".to_string(); name.extend(struct_name.chars().flat_map(|s| s.to_lowercase())); name.push_str("_new"); - return name; + name } pub fn free_function(struct_name: &str) -> String { - let mut name = format!("__wbg_"); + let mut name = "__wbg_".to_string(); name.extend(struct_name.chars().flat_map(|s| s.to_lowercase())); name.push_str("_free"); - return name; + name +} + +pub fn unwrap_function(struct_name: &str) -> String { + let mut name = "__wbg_".to_string(); + name.extend(struct_name.chars().flat_map(|s| s.to_lowercase())); + name.push_str("_unwrap"); + name } pub fn free_function_export_name(function_name: &str) -> String { @@ -166,25 +207,25 @@ pub fn struct_function_export_name(struct_: &str, f: &str) -> String { .chars() .flat_map(|s| s.to_lowercase()) .collect::(); - name.push_str("_"); + name.push('_'); name.push_str(f); - return name; + name } pub fn struct_field_get(struct_: &str, f: &str) -> String { let mut name = String::from("__wbg_get_"); name.extend(struct_.chars().flat_map(|s| s.to_lowercase())); - name.push_str("_"); + name.push('_'); name.push_str(f); - return name; + name } pub fn struct_field_set(struct_: &str, f: &str) -> String { let mut name = String::from("__wbg_set_"); name.extend(struct_.chars().flat_map(|s| s.to_lowercase())); - name.push_str("_"); + name.push('_'); name.push_str(f); - return name; + name } pub fn version() -> String { @@ -192,7 +233,7 @@ pub fn version() -> String { if let Some(s) = option_env!("WBG_VERSION") { v.push_str(" ("); v.push_str(s); - v.push_str(")"); + v.push(')'); } - return v; + v } diff --git a/crates/shared/src/schema_hash_approval.rs b/crates/shared/src/schema_hash_approval.rs index 32a0f51d419..16747438d63 100644 --- a/crates/shared/src/schema_hash_approval.rs +++ b/crates/shared/src/schema_hash_approval.rs @@ -8,7 +8,7 @@ // If the schema in this library has changed then: // 1. Bump the version in `crates/shared/Cargo.toml` // 2. Change the `SCHEMA_VERSION` in this library to this new Cargo.toml version -const APPROVED_SCHEMA_FILE_HASH: &'static str = "3468290064813615840"; +const APPROVED_SCHEMA_FILE_HASH: &str = "6242250402756688161"; #[test] fn schema_version() { diff --git a/crates/test-macro/Cargo.toml b/crates/test-macro/Cargo.toml index a234d252ec1..e0acc967d0b 100644 --- a/crates/test-macro/Cargo.toml +++ b/crates/test-macro/Cargo.toml @@ -1,15 +1,31 @@ [package] -name = "wasm-bindgen-test-macro" -version = "0.3.30" authors = ["The wasm-bindgen Developers"] description = "Internal testing macro for wasm-bindgen" -license = "MIT/Apache-2.0" +edition = "2021" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-test-macro" repository = "https://github.com/rustwasm/wasm-bindgen" -edition = "2018" +rust-version = "1.57" +version = "0.3.50" + +[lib] +proc-macro = true [dependencies] proc-macro2 = "1.0" quote = "1.0" +syn = { version = "2.0", default-features = false, features = [ + "parsing", + "proc-macro", + "derive", + "printing", +] } -[lib] -proc-macro = true +[dev-dependencies] +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } +trybuild = "1.0" +wasm-bindgen-test = { path = "../test" } + +[lints] +workspace = true diff --git a/crates/test-macro/README.md b/crates/test-macro/README.md index 64f20b4a8b4..c58270f0832 100644 --- a/crates/test-macro/README.md +++ b/crates/test-macro/README.md @@ -1,5 +1,5 @@ # wasm-bindgen-test-runner This is an **experimental** crate for enabling `cargo test --target -wasm32-unknown-unknown`. For more information see the README fo +wasm32-unknown-unknown`. For more information see the README of `wasm-bindgen-test`. diff --git a/crates/test-macro/src/lib.rs b/crates/test-macro/src/lib.rs index b5a8032b298..c9e27eb6f63 100644 --- a/crates/test-macro/src/lib.rs +++ b/crates/test-macro/src/lib.rs @@ -5,38 +5,59 @@ extern crate proc_macro; use proc_macro2::*; use quote::quote; -use std::sync::atomic::*; - -static CNT: AtomicUsize = AtomicUsize::new(0); +use quote::quote_spanned; #[proc_macro_attribute] pub fn wasm_bindgen_test( attr: proc_macro::TokenStream, body: proc_macro::TokenStream, ) -> proc_macro::TokenStream { - let mut attr = attr.into_iter(); - let mut r#async = false; - while let Some(token) = attr.next() { - match &token { - proc_macro::TokenTree::Ident(i) if i.to_string() == "async" => r#async = true, - _ => panic!("malformed `#[wasm_bindgen_test]` attribute"), - } - match &attr.next() { - Some(proc_macro::TokenTree::Punct(op)) if op.as_char() == ',' => {} - Some(_) => panic!("malformed `#[wasm_bindgen_test]` attribute"), - None => break, - } - } + let mut attributes = Attributes::default(); + let attribute_parser = syn::meta::parser(|meta| attributes.parse(meta)); - let mut body = TokenStream::from(body).into_iter(); + syn::parse_macro_input!(attr with attribute_parser); + let mut should_panic = None; + let mut ignore = None; + + let mut body = TokenStream::from(body).into_iter().peekable(); // Skip over other attributes to `fn #ident ...`, and extract `#ident` let mut leading_tokens = Vec::new(); while let Some(token) = body.next() { + match parse_should_panic(&mut body, &token) { + Ok(Some((new_should_panic, span))) => { + if should_panic.replace(new_should_panic).is_some() { + return compile_error(span, "duplicate `should_panic` attribute"); + } + + // If we found a `should_panic`, we should skip the `#` and `[...]`. + // The `[...]` is skipped here, the current `#` is skipped by using `continue`. + body.next(); + continue; + } + Ok(None) => (), + Err(error) => return error, + } + + match parse_ignore(&mut body, &token) { + Ok(Some((new_ignore, span))) => { + if ignore.replace(new_ignore).is_some() { + return compile_error(span, "duplicate `ignore` attribute"); + } + + // If we found a `new_ignore`, we should skip the `#` and `[...]`. + // The `[...]` is skipped here, the current `#` is skipped by using `continue`. + body.next(); + continue; + } + Ok(None) => (), + Err(error) => return error, + } + leading_tokens.push(token.clone()); if let TokenTree::Ident(token) = token { if token == "async" { - r#async = true; + attributes.r#async = true; } if token == "fn" { break; @@ -47,28 +68,76 @@ pub fn wasm_bindgen_test( let mut tokens = Vec::::new(); - let test_body = if r#async { - quote! { cx.execute_async(test_name, #ident); } + let should_panic_par = match &should_panic { + Some(Some(lit)) => { + quote! { ::core::option::Option::Some(::core::option::Option::Some(#lit)) } + } + Some(None) => quote! { ::core::option::Option::Some(::core::option::Option::None) }, + None => quote! { ::core::option::Option::None }, + }; + + let ignore_par = match &ignore { + Some(Some(lit)) => { + quote! { ::core::option::Option::Some(::core::option::Option::Some(#lit)) } + } + Some(None) => quote! { ::core::option::Option::Some(::core::option::Option::None) }, + None => quote! { ::core::option::Option::None }, + }; + + let test_body = if attributes.r#async { + quote! { cx.execute_async(test_name, #ident, #should_panic_par, #ignore_par); } } else { - quote! { cx.execute_sync(test_name, #ident); } + quote! { cx.execute_sync(test_name, #ident, #should_panic_par, #ignore_par); } }; - // We generate a `#[no_mangle]` with a known prefix so the test harness can - // later slurp up all of these functions and pass them as arguments to the - // main test harness. This is the entry point for all tests. - let name = format!("__wbgt_{}_{}", ident, CNT.fetch_add(1, Ordering::SeqCst)); - let name = Ident::new(&name, Span::call_site()); + let ignore_name = if ignore.is_some() { "$" } else { "" }; + + let wasm_bindgen_path = attributes.wasm_bindgen_path; tokens.extend( - (quote! { - #[no_mangle] - pub extern "C" fn #name(cx: &::wasm_bindgen_test::__rt::Context) { - let test_name = ::core::concat!(::core::module_path!(), "::", ::core::stringify!(#ident)); - #test_body - } - }) - .into_iter(), + quote! { + const _: () = { + #wasm_bindgen_path::__rt::wasm_bindgen::__wbindgen_coverage! { + #[export_name = ::core::concat!("__wbgt_", #ignore_name, "_", ::core::module_path!(), "::", ::core::stringify!(#ident))] + #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] + extern "C" fn __wbgt_test(cx: &#wasm_bindgen_path::__rt::Context) { + let test_name = ::core::concat!(::core::module_path!(), "::", ::core::stringify!(#ident)); + #test_body + } + } + }; + }, ); + if let Some(path) = attributes.unsupported { + tokens.extend( + quote! { #[cfg_attr(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))), #path)] }, + ); + + if let Some(should_panic) = should_panic { + let should_panic = if let Some(lit) = should_panic { + quote! { should_panic = #lit } + } else { + quote! { should_panic } + }; + + tokens.extend( + quote! { #[cfg_attr(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))), #should_panic)] } + ) + } + + if let Some(ignore) = ignore { + let ignore = if let Some(lit) = ignore { + quote! { ignore = #lit } + } else { + quote! { ignore } + }; + + tokens.extend( + quote! { #[cfg_attr(not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none"))), #ignore)] } + ) + } + } + tokens.extend(leading_tokens); tokens.push(ident.into()); tokens.extend(body); @@ -76,7 +145,144 @@ pub fn wasm_bindgen_test( tokens.into_iter().collect::().into() } -fn find_ident(iter: &mut token_stream::IntoIter) -> Option { +fn parse_should_panic( + body: &mut std::iter::Peekable, + token: &TokenTree, +) -> Result, Span)>, proc_macro::TokenStream> { + // Start by parsing the `#` + match token { + TokenTree::Punct(op) if op.as_char() == '#' => (), + _ => return Ok(None), + } + + // Parse `[...]` + let group = match body.peek() { + Some(TokenTree::Group(group)) if group.delimiter() == Delimiter::Bracket => group, + _ => return Ok(None), + }; + + let mut stream = group.stream().into_iter(); + + // Parse `should_panic` + let mut span = match stream.next() { + Some(TokenTree::Ident(token)) if token == "should_panic" => token.span(), + _ => return Ok(None), + }; + + let should_panic = span; + + // We are interested in the `expected` attribute or string if there is any + match stream.next() { + // Parse the `(...)` in `#[should_panic(...)]` + Some(TokenTree::Group(group)) if group.delimiter() == Delimiter::Parenthesis => { + let span = group.span(); + stream = group.stream().into_iter(); + + // Parse `expected` + match stream.next() { + Some(TokenTree::Ident(token)) if token == "expected" => (), + _ => { + return Err(compile_error( + span, + "malformed `#[should_panic(...)]` attribute", + )) + } + } + + // Parse `=` + match stream.next() { + Some(TokenTree::Punct(op)) if op.as_char() == '=' => (), + _ => { + return Err(compile_error( + span, + "malformed `#[should_panic(...)]` attribute", + )) + } + } + } + // Parse `=` + Some(TokenTree::Punct(op)) if op.as_char() == '=' => (), + Some(token) => { + return Err(compile_error( + token.span(), + "malformed `#[should_panic = \"...\"]` attribute", + )) + } + None => { + return Ok(Some((None, should_panic))); + } + } + + // Parse string in `#[should_panic(expected = "string")]` or `#[should_panic = "string"]` + if let Some(TokenTree::Literal(lit)) = stream.next() { + span = lit.span(); + let string = lit.to_string(); + + // Verify it's a string. + if string.starts_with('"') && string.ends_with('"') { + return Ok(Some((Some(lit), should_panic))); + } + } + + Err(compile_error(span, "malformed `#[should_panic]` attribute")) +} + +fn parse_ignore( + body: &mut std::iter::Peekable, + token: &TokenTree, +) -> Result, Span)>, proc_macro::TokenStream> { + // Start by parsing the `#` + match token { + TokenTree::Punct(op) if op.as_char() == '#' => (), + _ => return Ok(None), + } + + // Parse `[...]` + let group = match body.peek() { + Some(TokenTree::Group(group)) if group.delimiter() == Delimiter::Bracket => group, + _ => return Ok(None), + }; + + let mut stream = group.stream().into_iter(); + + // Parse `ignore` + let mut span = match stream.next() { + Some(TokenTree::Ident(token)) if token == "ignore" => token.span(), + _ => return Ok(None), + }; + + let ignore = span; + + // We are interested in the reason string if there is any + match stream.next() { + // Parse `=` + Some(TokenTree::Punct(op)) if op.as_char() == '=' => (), + Some(token) => { + return Err(compile_error( + token.span(), + "malformed `#[ignore = \"...\"]` attribute", + )) + } + None => { + return Ok(Some((None, ignore))); + } + } + + // Parse string in `#[ignore = "string"]` + if let Some(TokenTree::Literal(lit)) = stream.next() { + span = lit.span(); + let string = lit.to_string(); + + // Verify it's a string. + if string.starts_with('"') && string.ends_with('"') { + return Ok(Some((Some(lit), ignore))); + } + } + + Err(compile_error(span, "malformed `#[ignore]` attribute")) +} + +fn find_ident(iter: &mut impl Iterator) -> Option { match iter.next()? { TokenTree::Ident(i) => Some(i), TokenTree::Group(g) if g.delimiter() == Delimiter::None => { @@ -85,3 +291,38 @@ fn find_ident(iter: &mut token_stream::IntoIter) -> Option { _ => None, } } + +fn compile_error(span: Span, msg: &str) -> proc_macro::TokenStream { + quote_spanned! { span => compile_error!(#msg); }.into() +} + +struct Attributes { + r#async: bool, + wasm_bindgen_path: syn::Path, + unsupported: Option, +} + +impl Default for Attributes { + fn default() -> Self { + Self { + r#async: false, + wasm_bindgen_path: syn::parse_quote!(::wasm_bindgen_test), + unsupported: None, + } + } +} + +impl Attributes { + fn parse(&mut self, meta: syn::meta::ParseNestedMeta) -> syn::parse::Result<()> { + if meta.path.is_ident("async") { + self.r#async = true; + } else if meta.path.is_ident("crate") { + self.wasm_bindgen_path = meta.value()?.parse::()?; + } else if meta.path.is_ident("unsupported") { + self.unsupported = Some(meta.value()?.parse::()?); + } else { + return Err(meta.error("unknown attribute")); + } + Ok(()) + } +} diff --git a/crates/test-macro/tests/ui.rs b/crates/test-macro/tests/ui.rs new file mode 100644 index 00000000000..da15c92148c --- /dev/null +++ b/crates/test-macro/tests/ui.rs @@ -0,0 +1,5 @@ +#[test] +fn ui() { + let t = trybuild::TestCases::new(); + t.compile_fail("ui-tests/*.rs"); +} diff --git a/crates/test-macro/ui-tests/crate.rs b/crates/test-macro/ui-tests/crate.rs new file mode 100644 index 00000000000..d7d2d3fd908 --- /dev/null +++ b/crates/test-macro/ui-tests/crate.rs @@ -0,0 +1,20 @@ +#![no_implicit_prelude] + +extern crate wasm_bindgen_test_macro; +// +use wasm_bindgen_test_macro::wasm_bindgen_test; + +pub mod wasm { + pub extern crate wasm_bindgen_test as test; +} + +#[wasm_bindgen_test(crate = ::wasm_bindgen_test)] +fn success_1() {} + +#[wasm_bindgen_test(crate = crate::wasm::test)] +fn success_2() {} + +#[wasm_bindgen_test(crate(foo))] +fn failure_1() {} + +fn main() {} diff --git a/crates/test-macro/ui-tests/crate.stderr b/crates/test-macro/ui-tests/crate.stderr new file mode 100644 index 00000000000..88ba023c969 --- /dev/null +++ b/crates/test-macro/ui-tests/crate.stderr @@ -0,0 +1,5 @@ +error: expected `=` + --> ui-tests/crate.rs:17:26 + | +17 | #[wasm_bindgen_test(crate(foo))] + | ^ diff --git a/crates/test-macro/ui-tests/ignore.rs b/crates/test-macro/ui-tests/ignore.rs new file mode 100644 index 00000000000..9e842518ed7 --- /dev/null +++ b/crates/test-macro/ui-tests/ignore.rs @@ -0,0 +1,52 @@ +#![no_implicit_prelude] + +extern crate wasm_bindgen_test_macro; + +use wasm_bindgen_test_macro::wasm_bindgen_test; + +#[wasm_bindgen_test] +#[ignore] +fn success_1() {} + +#[wasm_bindgen_test] +#[ignore = "test"] +fn success_2() {} + +#[wasm_bindgen_test] +#[ignore] +async fn async_success_1() {} + +#[wasm_bindgen_test] +#[ignore = "test"] +async fn async_success_2() {} + +#[wasm_bindgen_test] +#[ignore::error] +fn fail_1() {} + +#[wasm_bindgen_test] +#[ignore = 42] +fn fail_2() {} + +#[wasm_bindgen_test] +#[ignore[]] +fn fail_3() {} + +#[wasm_bindgen_test] +#[ignore(42)] +fn fail_4() {} + +#[wasm_bindgen_test] +#[ignore(test)] +fn fail_5() {} + +#[wasm_bindgen_test] +#[ignore("test")] +fn fail_6() {} + +#[wasm_bindgen_test] +#[ignore = "test"] +#[ignore = "test"] +fn fail_7() {} + +fn main() {} diff --git a/crates/test-macro/ui-tests/ignore.stderr b/crates/test-macro/ui-tests/ignore.stderr new file mode 100644 index 00000000000..1435f37c9e4 --- /dev/null +++ b/crates/test-macro/ui-tests/ignore.stderr @@ -0,0 +1,41 @@ +error: malformed `#[ignore = "..."]` attribute + --> ui-tests/ignore.rs:24:9 + | +24 | #[ignore::error] + | ^ + +error: malformed `#[ignore]` attribute + --> ui-tests/ignore.rs:28:12 + | +28 | #[ignore = 42] + | ^^ + +error: malformed `#[ignore = "..."]` attribute + --> ui-tests/ignore.rs:32:9 + | +32 | #[ignore[]] + | ^^ + +error: malformed `#[ignore = "..."]` attribute + --> ui-tests/ignore.rs:36:9 + | +36 | #[ignore(42)] + | ^^^^ + +error: malformed `#[ignore = "..."]` attribute + --> ui-tests/ignore.rs:40:9 + | +40 | #[ignore(test)] + | ^^^^^^ + +error: malformed `#[ignore = "..."]` attribute + --> ui-tests/ignore.rs:44:9 + | +44 | #[ignore("test")] + | ^^^^^^^^ + +error: duplicate `ignore` attribute + --> ui-tests/ignore.rs:49:3 + | +49 | #[ignore = "test"] + | ^^^^^^ diff --git a/crates/test-macro/ui-tests/should_panic.rs b/crates/test-macro/ui-tests/should_panic.rs new file mode 100644 index 00000000000..d3399050e88 --- /dev/null +++ b/crates/test-macro/ui-tests/should_panic.rs @@ -0,0 +1,72 @@ +#![no_implicit_prelude] + +extern crate wasm_bindgen_test_macro; + +use wasm_bindgen_test_macro::wasm_bindgen_test; + +#[wasm_bindgen_test] +#[should_panic] +fn success_1() {} + +#[wasm_bindgen_test] +#[should_panic = "test"] +fn success_2() {} + +#[wasm_bindgen_test] +#[should_panic(expected = "test")] +fn success_3() {} + +#[wasm_bindgen_test] +#[should_panic] +async fn async_success_1() {} + +#[wasm_bindgen_test] +#[should_panic = "test"] +async fn async_success_2() {} + +#[wasm_bindgen_test] +#[should_panic(expected = "test")] +async fn async_success_3() {} + +#[wasm_bindgen_test] +#[should_panic::error] +fn fail_1() {} + +#[wasm_bindgen_test] +#[should_panic = 42] +fn fail_2() {} + +#[wasm_bindgen_test] +#[should_panic[]] +fn fail_3() {} + +#[wasm_bindgen_test] +#[should_panic(42)] +fn fail_4() {} + +#[wasm_bindgen_test] +#[should_panic(test)] +fn fail_5() {} + +#[wasm_bindgen_test] +#[should_panic(expected)] +fn fail_6() {} + +#[wasm_bindgen_test] +#[should_panic(expected::error)] +fn fail_7() {} + +#[wasm_bindgen_test] +#[should_panic(expected =)] +fn fail_8() {} + +#[wasm_bindgen_test] +#[should_panic(expected = 5)] +fn fail_9() {} + +#[wasm_bindgen_test] +#[should_panic = "test"] +#[should_panic = "test"] +fn fail_10() {} + +fn main() {} diff --git a/crates/test-macro/ui-tests/should_panic.stderr b/crates/test-macro/ui-tests/should_panic.stderr new file mode 100644 index 00000000000..9436970aec1 --- /dev/null +++ b/crates/test-macro/ui-tests/should_panic.stderr @@ -0,0 +1,59 @@ +error: malformed `#[should_panic = "..."]` attribute + --> ui-tests/should_panic.rs:32:15 + | +32 | #[should_panic::error] + | ^ + +error: malformed `#[should_panic]` attribute + --> ui-tests/should_panic.rs:36:18 + | +36 | #[should_panic = 42] + | ^^ + +error: malformed `#[should_panic = "..."]` attribute + --> ui-tests/should_panic.rs:40:15 + | +40 | #[should_panic[]] + | ^^ + +error: malformed `#[should_panic(...)]` attribute + --> ui-tests/should_panic.rs:44:15 + | +44 | #[should_panic(42)] + | ^^^^ + +error: malformed `#[should_panic(...)]` attribute + --> ui-tests/should_panic.rs:48:15 + | +48 | #[should_panic(test)] + | ^^^^^^ + +error: malformed `#[should_panic(...)]` attribute + --> ui-tests/should_panic.rs:52:15 + | +52 | #[should_panic(expected)] + | ^^^^^^^^^^ + +error: malformed `#[should_panic(...)]` attribute + --> ui-tests/should_panic.rs:56:15 + | +56 | #[should_panic(expected::error)] + | ^^^^^^^^^^^^^^^^^ + +error: malformed `#[should_panic]` attribute + --> ui-tests/should_panic.rs:60:3 + | +60 | #[should_panic(expected =)] + | ^^^^^^^^^^^^ + +error: malformed `#[should_panic]` attribute + --> ui-tests/should_panic.rs:64:27 + | +64 | #[should_panic(expected = 5)] + | ^ + +error: duplicate `should_panic` attribute + --> ui-tests/should_panic.rs:69:3 + | +69 | #[should_panic = "test"] + | ^^^^^^^^^^^^ diff --git a/crates/test-macro/ui-tests/unsupported.rs b/crates/test-macro/ui-tests/unsupported.rs new file mode 100644 index 00000000000..f4c70c7fc40 --- /dev/null +++ b/crates/test-macro/ui-tests/unsupported.rs @@ -0,0 +1,17 @@ +#![no_implicit_prelude] + +extern crate wasm_bindgen_test_macro; +extern crate tokio; +// +use wasm_bindgen_test_macro::wasm_bindgen_test; + +#[wasm_bindgen_test(unsupported = tokio::test(flavor = "multi_thread", worker_threads = 1))] +async fn success() {} + +#[wasm_bindgen_test(unsupported)] +fn failure_1() {} + +#[wasm_bindgen_test(unsupported(test))] +fn failure_2() {} + +fn main() {} diff --git a/crates/test-macro/ui-tests/unsupported.stderr b/crates/test-macro/ui-tests/unsupported.stderr new file mode 100644 index 00000000000..0bc93ec5b90 --- /dev/null +++ b/crates/test-macro/ui-tests/unsupported.stderr @@ -0,0 +1,13 @@ +error: expected `=` + --> ui-tests/unsupported.rs:11:1 + | +11 | #[wasm_bindgen_test(unsupported)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in the attribute macro `wasm_bindgen_test` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: expected `=` + --> ui-tests/unsupported.rs:14:32 + | +14 | #[wasm_bindgen_test(unsupported(test))] + | ^ diff --git a/crates/test/Cargo.toml b/crates/test/Cargo.toml index bbd83209373..114304a778e 100644 --- a/crates/test/Cargo.toml +++ b/crates/test/Cargo.toml @@ -1,19 +1,37 @@ [package] -name = "wasm-bindgen-test" -version = "0.3.30" authors = ["The wasm-bindgen Developers"] description = "Internal testing crate for wasm-bindgen" -license = "MIT/Apache-2.0" +edition = "2021" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-test" repository = "https://github.com/rustwasm/wasm-bindgen" -edition = "2018" +rust-version = "1.57" +version = "0.3.50" + +[features] +default = ["std"] +std = ["wasm-bindgen/std", "js-sys/std", "wasm-bindgen-futures/std"] [dependencies] -console_error_panic_hook = '0.1' -js-sys = { path = '../js-sys', version = '0.3.57' } -scoped-tls = "1.0" -wasm-bindgen = { path = '../..', version = '0.2.80' } -wasm-bindgen-futures = { path = '../futures', version = '0.4.30' } -wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.3.30' } +gg-alloc = { version = "1.0", optional = true } +js-sys = { path = '../js-sys', version = '=0.3.77', default-features = false } +wasm-bindgen = { path = '../..', version = '=0.2.100', default-features = false } +wasm-bindgen-futures = { path = '../futures', version = '=0.4.50', default-features = false } +wasm-bindgen-test-macro = { path = '../test-macro', version = '=0.3.50' } + +[target.'cfg(all(target_arch = "wasm32", wasm_bindgen_unstable_test_coverage))'.dependencies] +minicov = "0.3" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] } + +[lints.clippy] +large_enum_variant = "allow" +new_without_default = "allow" +overly_complex_bool_expr = "allow" +too_many_arguments = "allow" +type_complexity = "allow" [lib] test = false diff --git a/crates/test/README.md b/crates/test/README.md index fb7cdc1844e..833d0106758 100644 --- a/crates/test/README.md +++ b/crates/test/README.md @@ -34,7 +34,7 @@ provides the support for: * Catching JS exceptions so tests can continue to run after a test fails * Driving execution of all tests -This is the crate which you actually link to in your wasm test and through which +This is the crate which you actually link to in your Wasm test and through which you import the `#[wasm_bindgen_test]` macro. Otherwise this crate provides a `console_log!` macro that's a utility like `println!` only using `console.log`. @@ -46,7 +46,7 @@ bare bones! This is where the secret sauce comes into play. We configured Cargo to execute this binary *instead* of directly executing the `*.wasm` file (which Cargo would otherwise try to do). This means that whenever a test is executed it executes -this binary with the wasm file as an argument, allowing it to take full control +this binary with the Wasm file as an argument, allowing it to take full control over the test process! The test runner is currently pretty simple, executing a few steps: @@ -59,8 +59,8 @@ The test runner is currently pretty simple, executing a few steps: tests. In essence what happens is that this test runner automatically executes -`wasm-bindgen` and then uses Node to actually execute the wasm file, meaning -that your wasm code currently runs in a Node environment. +`wasm-bindgen` and then uses Node to actually execute the Wasm file, meaning +that your Wasm code currently runs in a Node environment. ## Future Work @@ -68,5 +68,5 @@ Things that'd be awesome to support in the future: * Arguments to `wasm-bindgen-test-runner` which are the same as `wasm-bindgen`, for example `--debug` to affect the generated output. -* Running each test in its own wasm instance to avoid poisoning the environment +* Running each test in its own Wasm instance to avoid poisoning the environment on panic diff --git a/crates/test/sample/Cargo.toml b/crates/test/sample/Cargo.toml index 05544ab4a3d..e6d8ea5dee4 100644 --- a/crates/test/sample/Cargo.toml +++ b/crates/test/sample/Cargo.toml @@ -1,8 +1,9 @@ [package] -name = "sample" -version = "0.1.0" authors = ["The wasm-bindgen Developers"] -edition = "2018" +edition = "2021" +name = "sample" +publish = false +version = "0.0.0" [lib] test = false diff --git a/crates/test/sample/tests/common/mod.rs b/crates/test/sample/tests/common/mod.rs index 0f729006e2c..09d34843fbd 100644 --- a/crates/test/sample/tests/common/mod.rs +++ b/crates/test/sample/tests/common/mod.rs @@ -10,25 +10,74 @@ fn pass() { #[wasm_bindgen_test] async fn pass_after_2s() { console_log!("immediate log"); - Timeout::new(Duration::new(1, 0)).await; + Timeout::new(Duration::from_secs(1)).await; console_log!("log after 1s"); - Timeout::new(Duration::new(1, 0)).await; + Timeout::new(Duration::from_secs(1)).await; console_log!("log at end"); } #[wasm_bindgen_test] fn fail() { - console_log!("helpful messsage, please see me"); + console_log!("helpful message, please see me"); panic!("this is a failing test"); } #[wasm_bindgen_test] async fn fail_after_3s() { console_log!("immediate log"); - Timeout::new(Duration::new(1, 0)).await; + Timeout::new(Duration::from_secs(1)).await; console_log!("log after 1s"); - Timeout::new(Duration::new(1, 0)).await; + Timeout::new(Duration::from_secs(1)).await; console_log!("log after 2s"); - Timeout::new(Duration::new(1, 0)).await; + Timeout::new(Duration::from_secs(1)).await; panic!("end"); } + +#[wasm_bindgen_test] +fn result_fail() -> Result<(), Box> { + Err("failed via Result".into()) +} + +#[wasm_bindgen_test] +async fn result_fail_after_1s() -> Result<(), Box> { + Timeout::new(Duration::from_secs(1)).await; + Err("failed via Result".into()) +} + +#[wasm_bindgen_test] +fn panic_before_result_fail() -> Result<(), Box> { + panic!("panic before Result fail"); + + #[allow(unreachable_code)] + Err("failed via Result".into()) +} + +#[wasm_bindgen_test] +#[should_panic] +fn should_panic() { + panic!() +} + +#[wasm_bindgen_test] +#[should_panic = "error message"] +fn should_panic_string() { + panic!("error message") +} + +#[wasm_bindgen_test] +#[should_panic(expected = "error message")] +fn should_panic_expected() { + panic!("error message") +} + +#[wasm_bindgen_test] +#[ignore] +async fn ignore() { + console_log!("IGNORED"); +} + +#[wasm_bindgen_test] +#[should_panic = "reason"] +async fn ignore_reason() { + panic!("IGNORED WITH A REASON") +} diff --git a/crates/test/src/coverage.rs b/crates/test/src/coverage.rs new file mode 100644 index 00000000000..2fe38443ccf --- /dev/null +++ b/crates/test/src/coverage.rs @@ -0,0 +1,25 @@ +use alloc::vec::Vec; +use wasm_bindgen::prelude::wasm_bindgen; + +#[cfg(wasm_bindgen_unstable_test_coverage)] +#[wasm_bindgen] +pub fn __wbgtest_cov_dump() -> Option> { + let mut coverage = Vec::new(); + // SAFETY: this function is not thread-safe, but our whole test runner is running single-threaded. + unsafe { + minicov::capture_coverage(&mut coverage).unwrap(); + } + if coverage.is_empty() { + console_error!( + "Empty coverage data received. Make sure you compile the tests with + RUSTFLAGS=\"-Cinstrument-coverage -Zno-profile-runtime --emit=llvm-ir\"", + ); + } + Some(coverage) +} + +#[cfg(not(wasm_bindgen_unstable_test_coverage))] +#[wasm_bindgen] +pub fn __wbgtest_cov_dump() -> Option> { + None +} diff --git a/crates/test/src/lib.rs b/crates/test/src/lib.rs index 7fc5bc0a239..36ee18248c9 100644 --- a/crates/test/src/lib.rs +++ b/crates/test/src/lib.rs @@ -2,16 +2,34 @@ //! //! More documentation can be found in the README for this crate! +#![cfg_attr(not(feature = "std"), no_std)] #![deny(missing_docs)] +extern crate alloc; + pub use wasm_bindgen_test_macro::wasm_bindgen_test; +// Custom allocator that only returns pointers in the 2GB-4GB range +// To ensure we actually support more than 2GB of memory +#[cfg(all(test, feature = "gg-alloc"))] +#[global_allocator] +static A: gg_alloc::GgAlloc = gg_alloc::GgAlloc::new(std::alloc::System); + +/// Helper macro which acts like `println!` only routes to `console.error` +/// instead. +#[macro_export] +macro_rules! console_error { + ($($arg:tt)*) => ( + $crate::__rt::console_error(&format_args!($($arg)*)) + ) +} + /// Helper macro which acts like `println!` only routes to `console.log` /// instead. #[macro_export] macro_rules! console_log { ($($arg:tt)*) => ( - $crate::__rt::log(&format_args!($($arg)*)) + $crate::__rt::console_log(&format_args!($($arg)*)) ) } @@ -29,19 +47,73 @@ macro_rules! console_log { /// /// * `run_in_browser` - requires that this test is run in a browser rather than /// node.js, which is the default for executing tests. +/// * `run_in_dedicated_worker` - requires that this test is run in a web worker rather than +/// node.js, which is the default for executing tests. +/// * `run_in_shared_worker` - requires that this test is run in a shared worker rather than +/// node.js, which is the default for executing tests. +/// * `run_in_service_worker` - requires that this test is run in a service worker rather than +/// node.js, which is the default for executing tests. /// /// This macro may be invoked at most one time per test suite (an entire binary /// like `tests/foo.rs`, not per module) #[macro_export] macro_rules! wasm_bindgen_test_configure { (run_in_browser $($others:tt)*) => ( - #[link_section = "__wasm_bindgen_test_unstable"] - #[cfg(target_arch = "wasm32")] - pub static __WBG_TEST_RUN_IN_BROWSER: [u8; 1] = [0x01]; - $crate::wasm_bindgen_test_configure!($($others)*); + const _: () = { + #[link_section = "__wasm_bindgen_test_unstable"] + #[cfg(target_arch = "wasm32")] + pub static __WBG_TEST_RUN_IN_BROWSER: [u8; 1] = [0x01]; + $crate::wasm_bindgen_test_configure!($($others)*); + }; + ); + (run_in_worker $($others:tt)*) => ( + const _: () = { + #[link_section = "__wasm_bindgen_test_unstable"] + #[cfg(target_arch = "wasm32")] + pub static __WBG_TEST_RUN_IN_DEDICATED_WORKER: [u8; 1] = [0x02]; + $crate::wasm_bindgen_test_configure!($($others)*); + }; + ); + (run_in_dedicated_worker $($others:tt)*) => ( + const _: () = { + #[link_section = "__wasm_bindgen_test_unstable"] + #[cfg(target_arch = "wasm32")] + pub static __WBG_TEST_RUN_IN_DEDICATED_WORKER: [u8; 1] = [0x02]; + $crate::wasm_bindgen_test_configure!($($others)*); + }; + ); + (run_in_shared_worker $($others:tt)*) => ( + const _: () = { + #[link_section = "__wasm_bindgen_test_unstable"] + #[cfg(target_arch = "wasm32")] + pub static __WBG_TEST_RUN_IN_SHARED_WORKER: [u8; 1] = [0x03]; + $crate::wasm_bindgen_test_configure!($($others)*); + }; + ); + (run_in_service_worker $($others:tt)*) => ( + const _: () = { + #[link_section = "__wasm_bindgen_test_unstable"] + #[cfg(target_arch = "wasm32")] + pub static __WBG_TEST_RUN_IN_SERVICE_WORKER: [u8; 1] = [0x04]; + $crate::wasm_bindgen_test_configure!($($others)*); + }; + ); + (run_in_node_experimental $($others:tt)*) => ( + const _: () = { + #[link_section = "__wasm_bindgen_test_unstable"] + #[cfg(target_arch = "wasm32")] + pub static __WBG_TEST_run_in_node_experimental: [u8; 1] = [0x05]; + $crate::wasm_bindgen_test_configure!($($others)*); + }; ); () => () } #[path = "rt/mod.rs"] pub mod __rt; + +// Make this only available to wasm32 so that we don't +// import minicov on other archs. +// That way you can use normal cargo test without minicov +#[cfg(target_arch = "wasm32")] +mod coverage; diff --git a/crates/test/src/rt/browser.rs b/crates/test/src/rt/browser.rs index d488a0dd512..39c4666c6c2 100644 --- a/crates/test/src/rt/browser.rs +++ b/crates/test/src/rt/browser.rs @@ -3,9 +3,13 @@ //! Currently this is quite simple, rendering the same as the console tests in //! node.js. Output here is rendered in a `pre`, however. +use alloc::format; +use alloc::string::String; use js_sys::Error; use wasm_bindgen::prelude::*; +use super::TestResult; + /// Implementation of `Formatter` for browsers. /// /// Routes all output to a `pre` on the page currently. Eventually this probably @@ -17,7 +21,8 @@ pub struct Browser { #[wasm_bindgen] extern "C" { type HTMLDocument; - static document: HTMLDocument; + #[wasm_bindgen(thread_local_v2, js_name = document)] + static DOCUMENT: HTMLDocument; #[wasm_bindgen(method, structural)] fn getElementById(this: &HTMLDocument, id: &str) -> Element; @@ -36,7 +41,7 @@ impl Browser { /// Creates a new instance of `Browser`, assuming that its APIs will work /// (requires `Node::new()` to have return `None` first). pub fn new() -> Browser { - let pre = document.getElementById("output"); + let pre = DOCUMENT.with(|document| document.getElementById("output")); pre.set_text_content(""); Browser { pre } } @@ -49,9 +54,8 @@ impl super::Formatter for Browser { self.pre.set_text_content(&html); } - fn log_test(&self, name: &str, result: &Result<(), JsValue>) { - let s = if result.is_ok() { "ok" } else { "FAIL" }; - self.writeln(&format!("test {} ... {}", name, s)); + fn log_test(&self, name: &str, result: &TestResult) { + self.writeln(&format!("test {} ... {}", name, result)); } fn stringify_error(&self, err: &JsValue) -> String { diff --git a/crates/test/src/rt/detect.rs b/crates/test/src/rt/detect.rs index 6f83bae8440..b2b6af2d496 100644 --- a/crates/test/src/rt/detect.rs +++ b/crates/test/src/rt/detect.rs @@ -1,26 +1,53 @@ //! Runtime detection of whether we're in node.js or a browser. -use js_sys; +use alloc::string::String; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; #[wasm_bindgen] extern "C" { type This; #[wasm_bindgen(method, getter, structural, js_name = self)] - fn self_(me: &This) -> JsValue; + fn self_(me: &This) -> Option; + + type Scope; + #[wasm_bindgen(method, getter, structural)] + fn constructor(me: &Scope) -> Constructor; + + #[wasm_bindgen(method, getter, structural, js_name = Deno)] + fn deno(me: &Scope) -> Option; + + type Deno; + + type Constructor; + #[wasm_bindgen(method, getter, structural)] + fn name(me: &Constructor) -> String; +} + +/// Detecting the current JS scope +pub fn detect() -> Runtime { + // Test whether we're in a browser/worker by seeing if the `self` property is + // defined on the global object and it is not equal to a WorkerScope, which should in turn + // only be true in browsers. + match js_sys::global().unchecked_into::().self_() { + Some(scope) => match scope.constructor().name().as_str() { + "DedicatedWorkerGlobalScope" + | "SharedWorkerGlobalScope" + | "ServiceWorkerGlobalScope" => Runtime::Worker, + _ => match scope.deno() { + Some(_) => Runtime::Node, + _ => Runtime::Browser, + }, + }, + None => Runtime::Node, + } } -/// Returns whether it's likely we're executing in a browser environment, as -/// opposed to node.js. -// If this function is inlined then there's no other functions in this module -// (which becomes an object file) to actually pull in the custom section listed -// above. Force this to never be inlined so if this module is needed its forced -// to pull in the descriptor section from `#[wasm_bindgen]` above. -#[inline(never)] -pub fn is_browser() -> bool { - // Test whether we're in a browser by seeing if the `self` property is - // defined on the global object, which should in turn only be true in - // browsers. - js_sys::global().unchecked_into::().self_() != JsValue::undefined() +/// Current runtime environment +pub enum Runtime { + /// Current scope is a browser scope + Browser, + /// Current scope is a node scope + Node, + /// Current scope is a worker scope + Worker, } diff --git a/crates/test/src/rt/mod.rs b/crates/test/src/rt/mod.rs index bf08fe19e42..7fd7c54a6b7 100644 --- a/crates/test/src/rt/mod.rs +++ b/crates/test/src/rt/mod.rs @@ -6,8 +6,8 @@ // # Architecture of `wasm_bindgen_test` // // This module can seem a bit funky, but it's intended to be the runtime support -// of the `#[wasm_bindgen_test]` macro and be amenable to executing wasm test -// suites. The general idea is that for a wasm test binary there will be a set +// of the `#[wasm_bindgen_test]` macro and be amenable to executing Wasm test +// suites. The general idea is that for a Wasm test binary there will be a set // of functions tagged `#[wasm_bindgen_test]`. It's the job of the runtime // support to execute all of these functions, collecting and collating the // results. @@ -22,11 +22,11 @@ // // * First, the user runs `cargo test --target wasm32-unknown-unknown` // -// * Cargo then compiles all the test suites (aka `tests/*.rs`) as wasm binaries +// * Cargo then compiles all the test suites (aka `tests/*.rs`) as Wasm binaries // (the `bin` crate type). These binaries all have entry points that are // `main` functions, but it's actually not used. The binaries are also // compiled with `--test`, which means they're linked to the standard `test` -// crate, but this crate doesn't work on wasm and so we bypass it entirely. +// crate, but this crate doesn't work on Wasm and so we bypass it entirely. // // * Instead of using `#[test]`, which doesn't work, users wrote tests with // `#[wasm_bindgen_test]`. This macro expands to a bunch of `#[no_mangle]` @@ -44,7 +44,7 @@ // // * The `wasm-bindgen-test-runner` binary generates a JS entry point. This // entry point creates a `Context` below. The runner binary also parses the -// wasm file and finds all functions that are named `__wbg_test_*`. The +// Wasm file and finds all functions that are named `__wbg_test_*`. The // generate file gathers up all these functions into an array and then passes // them to `Context` below. Note that these functions are passed as *JS // values*. @@ -61,7 +61,7 @@ // This is used for test filters today. // // * The `Context::run` function is called. Again, the generated JS has gathered -// all wasm tests to be executed into a list, and it's passed in here. +// all Wasm tests to be executed into a list, and it's passed in here. // // * Next, `Context::run` returns a `Promise` representing the eventual // execution of all the tests. The Rust `Future` that's returned will work @@ -87,14 +87,19 @@ // Overall this is all somewhat in flux as it's pretty new, and feedback is // always of course welcome! -use console_error_panic_hook; +use alloc::borrow::ToOwned; +use alloc::boxed::Box; +use alloc::format; +use alloc::rc::Rc; +use alloc::string::{String, ToString}; +use alloc::vec::Vec; +use core::cell::{Cell, RefCell}; +use core::fmt::{self, Display}; +use core::future::Future; +use core::pin::Pin; +use core::task::{self, Poll}; use js_sys::{Array, Function, Promise}; -use std::cell::{Cell, RefCell}; -use std::fmt; -use std::future::Future; -use std::pin::Pin; -use std::rc::Rc; -use std::task::{self, Poll}; +pub use wasm_bindgen; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::future_to_promise; @@ -109,6 +114,8 @@ const CONCURRENCY: usize = 1; pub mod browser; pub mod detect; pub mod node; +mod scoped_tls; +pub mod worker; /// Runtime test harness support instantiated in JS. /// @@ -120,23 +127,23 @@ pub struct Context { } struct State { - /// An optional filter used to restrict which tests are actually executed - /// and which are ignored. This is passed via the `args` function which - /// comes from the command line of `wasm-bindgen-test-runner`. Currently - /// this is the only "CLI option" - filter: RefCell>, + /// Include ignored tests. + include_ignored: Cell, /// Counter of the number of tests that have succeeded. - succeeded: Cell, + succeeded_count: Cell, - /// Counter of the number of tests that have been ignored - ignored: Cell, + /// Number of tests that have been filtered. + filtered_count: Cell, + + /// Number of tests that have been ignored. + ignored_count: Cell, /// A list of all tests which have failed. /// /// Each test listed here is paired with a `JsValue` that represents the /// exception thrown which caused the test to fail. - failures: RefCell>, + failures: RefCell>, /// Remaining tests to execute, when empty we're just waiting on the /// `Running` tests to finish. @@ -149,6 +156,20 @@ struct State { /// How to actually format output, either node.js or browser-specific /// implementation. formatter: Box, + + /// Timing the total duration. + timer: Option, +} + +/// Failure reasons. +enum Failure { + /// Normal failing test. + Error(JsValue), + /// A test that `should_panic` but didn't. + ShouldPanic, + /// A test that `should_panic` with a specific message, + /// but panicked with a different message. + ShouldPanicExpected, } /// Representation of one test that needs to be executed. @@ -159,6 +180,7 @@ struct Test { name: String, future: Pin>>>, output: Rc>, + should_panic: Option>, } /// Captured output of each test. @@ -169,6 +191,34 @@ struct Output { info: String, warn: String, error: String, + panic: String, + should_panic: bool, +} + +enum TestResult { + Ok, + Err(JsValue), + Ignored(Option), +} + +impl From> for TestResult { + fn from(value: Result<(), JsValue>) -> Self { + match value { + Ok(()) => Self::Ok, + Err(err) => Self::Err(err), + } + } +} + +impl Display for TestResult { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + TestResult::Ok => write!(f, "ok"), + TestResult::Err(_) => write!(f, "FAIL"), + TestResult::Ignored(None) => write!(f, "ignored"), + TestResult::Ignored(Some(reason)) => write!(f, "ignored, {}", reason), + } + } } trait Formatter { @@ -176,7 +226,7 @@ trait Formatter { fn writeln(&self, line: &str); /// Log the result of a test, either passing or failing. - fn log_test(&self, name: &str, result: &Result<(), JsValue>); + fn log_test(&self, name: &str, result: &TestResult); /// Convert a thrown value into a string, using platform-specific apis /// perhaps to turn the error into a string. @@ -189,16 +239,37 @@ extern "C" { #[doc(hidden)] pub fn js_console_log(s: &str); + #[wasm_bindgen(js_namespace = console, js_name = error)] + #[doc(hidden)] + pub fn js_console_error(s: &str); + // General-purpose conversion into a `String`. #[wasm_bindgen(js_name = String)] fn stringify(val: &JsValue) -> String; + + type Global; + + #[wasm_bindgen(method, getter)] + fn performance(this: &Global) -> JsValue; + + /// Type for the [`Performance` object](https://developer.mozilla.org/en-US/docs/Web/API/Performance). + type Performance; + + /// Binding to [`Performance.now()`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now). + #[wasm_bindgen(method)] + fn now(this: &Performance) -> f64; } /// Internal implementation detail of the `console_log!` macro. -pub fn log(args: &fmt::Arguments) { +pub fn console_log(args: &fmt::Arguments) { js_console_log(&args.to_string()); } +/// Internal implementation detail of the `console_error!` macro. +pub fn console_error(args: &fmt::Arguments) { + js_console_error(&args.to_string()); +} + #[wasm_bindgen(js_class = WasmBindgenTestContext)] impl Context { /// Creates a new context ready to run tests. @@ -208,46 +279,86 @@ impl Context { /// tests. #[wasm_bindgen(constructor)] pub fn new() -> Context { - console_error_panic_hook::set_once(); + fn panic_handling(mut message: String) { + let should_panic = CURRENT_OUTPUT.with(|output| { + let mut output = output.borrow_mut(); + output.panic.push_str(&message); + output.should_panic + }); + + // See https://github.com/rustwasm/console_error_panic_hook/blob/4dc30a5448ed3ffcfb961b1ad54d000cca881b84/src/lib.rs#L83-L123. + if !should_panic { + #[wasm_bindgen] + extern "C" { + type Error; + + #[wasm_bindgen(constructor)] + fn new() -> Error; + + #[wasm_bindgen(method, getter)] + fn stack(error: &Error) -> String; + } - let formatter = match node::Node::new() { - Some(node) => Box::new(node) as Box, - None => Box::new(browser::Browser::new()), + message.push_str("\n\nStack:\n\n"); + let e = Error::new(); + let stack = e.stack(); + message.push_str(&stack); + + message.push_str("\n\n"); + + js_console_error(&message); + } + } + #[cfg(feature = "std")] + static SET_HOOK: std::sync::Once = std::sync::Once::new(); + #[cfg(feature = "std")] + SET_HOOK.call_once(|| { + std::panic::set_hook(Box::new(|panic_info| { + panic_handling(panic_info.to_string()); + })); + }); + #[cfg(all( + not(feature = "std"), + target_arch = "wasm32", + any(target_os = "unknown", target_os = "none") + ))] + #[panic_handler] + fn panic_handler(panic_info: &core::panic::PanicInfo<'_>) -> ! { + panic_handling(panic_info.to_string()); + core::arch::wasm32::unreachable(); + } + + let formatter = match detect::detect() { + detect::Runtime::Browser => Box::new(browser::Browser::new()) as Box, + detect::Runtime::Node => Box::new(node::Node::new()) as Box, + detect::Runtime::Worker => Box::new(worker::Worker::new()) as Box, }; + + let timer = Timer::new(); + Context { state: Rc::new(State { - filter: Default::default(), + include_ignored: Default::default(), failures: Default::default(), - ignored: Default::default(), + succeeded_count: Default::default(), + filtered_count: Default::default(), + ignored_count: Default::default(), remaining: Default::default(), running: Default::default(), - succeeded: Default::default(), formatter, + timer, }), } } - /// Inform this context about runtime arguments passed to the test - /// harness. - /// - /// Eventually this will be used to support flags, but for now it's just - /// used to support test filters. - pub fn args(&mut self, args: Vec) { - // Here we want to reject all flags like `--foo` or `-f` as we don't - // support anything, and also we only support at most one non-flag - // argument as a test filter. - // - // Everything else is rejected. - let mut filter = self.state.filter.borrow_mut(); - for arg in args { - let arg = arg.as_string().unwrap(); - if arg.starts_with("-") { - panic!("flag {} not supported", arg); - } else if filter.is_some() { - panic!("more than one filter argument cannot be passed"); - } - *filter = Some(arg); - } + /// Handle `--include-ignored` flag. + pub fn include_ignored(&mut self, include_ignored: bool) { + self.state.include_ignored.set(include_ignored); + } + + /// Handle filter argument. + pub fn filtered_count(&mut self, filtered: usize) { + self.state.filtered_count.set(filtered); } /// Executes a list of tests, returning a promise representing their @@ -264,9 +375,8 @@ impl Context { self.state .formatter .writeln(&format!("running {} {}", tests.len(), noun)); - self.state.formatter.writeln(""); - // Execute all our test functions through their wasm shims (unclear how + // Execute all our test functions through their Wasm shims (unclear how // to pass native function pointers around here). Each test will // execute one of the `execute_*` tests below which will push a // future onto our `remaining` list, which we'll process later. @@ -294,7 +404,7 @@ impl Context { } } -scoped_tls::scoped_thread_local!(static CURRENT_OUTPUT: RefCell); +crate::scoped_thread_local!(static CURRENT_OUTPUT: RefCell); /// Handler for `console.log` invocations. /// @@ -347,46 +457,95 @@ fn record(args: &Array, dst: impl FnOnce(&mut Output) -> &mut String) { let dst = dst(&mut out); args.for_each(&mut |val, idx, _array| { if idx != 0 { - dst.push_str(" "); + dst.push(' '); } dst.push_str(&stringify(&val)); }); - dst.push_str("\n"); + dst.push('\n'); }); } +/// Similar to [`std::process::Termination`], but for wasm-bindgen tests. +pub trait Termination { + /// Convert this into a JS result. + fn into_js_result(self) -> Result<(), JsValue>; +} + +impl Termination for () { + fn into_js_result(self) -> Result<(), JsValue> { + Ok(()) + } +} + +impl Termination for Result<(), E> { + fn into_js_result(self) -> Result<(), JsValue> { + self.map_err(|e| JsError::new(&format!("{:?}", e)).into()) + } +} + impl Context { /// Entry point for a synchronous test in wasm. The `#[wasm_bindgen_test]` /// macro generates invocations of this method. - pub fn execute_sync(&self, name: &str, f: impl FnOnce() + 'static) { - self.execute(name, async { f() }); + pub fn execute_sync( + &self, + name: &str, + f: impl 'static + FnOnce() -> T, + should_panic: Option>, + ignore: Option>, + ) { + self.execute(name, async { f().into_js_result() }, should_panic, ignore); } /// Entry point for an asynchronous in wasm. The /// `#[wasm_bindgen_test(async)]` macro generates invocations of this /// method. - pub fn execute_async(&self, name: &str, f: impl FnOnce() -> F + 'static) - where - F: Future + 'static, + pub fn execute_async( + &self, + name: &str, + f: impl FnOnce() -> F + 'static, + should_panic: Option>, + ignore: Option>, + ) where + F: Future + 'static, + F::Output: Termination, { - self.execute(name, async { f().await }) + self.execute( + name, + async { f().await.into_js_result() }, + should_panic, + ignore, + ) } - fn execute(&self, name: &str, test: impl Future + 'static) { - // If our test is filtered out, record that it was filtered and move - // on, nothing to do here. - let filter = self.state.filter.borrow(); - if let Some(filter) = &*filter { - if !name.contains(filter) { - let ignored = self.state.ignored.get(); - self.state.ignored.set(ignored + 1); + fn execute( + &self, + name: &str, + test: impl Future> + 'static, + should_panic: Option>, + ignore: Option>, + ) { + // Remove the crate name to mimic libtest more closely. + // This also removes our `__wbgt_` prefix and the `ignored` and `should_panic` modifiers. + let name = name.split_once("::").unwrap().1; + + if let Some(ignore) = ignore { + if !self.state.include_ignored.get() { + self.state + .formatter + .log_test(name, &TestResult::Ignored(ignore.map(str::to_owned))); + let ignored = self.state.ignored_count.get(); + self.state.ignored_count.set(ignored + 1); return; } } // Looks like we've got a test that needs to be executed! Push it onto // the list of remaining tests. - let output = Rc::new(RefCell::new(Output::default())); + let output = Output { + should_panic: should_panic.is_some(), + ..Default::default() + }; + let output = Rc::new(RefCell::new(output)); let future = TestFuture { output: output.clone(), test, @@ -395,6 +554,7 @@ impl Context { name: name.to_string(), future: Pin::from(Box::new(future)), output, + should_panic, }); } } @@ -416,7 +576,7 @@ impl Future for ExecuteTests { Poll::Pending => continue, }; let test = running.remove(i); - self.0.log_test_result(test, result); + self.0.log_test_result(test, result.into()); } // Next up, try to schedule as many tests as we can. Once we get a test @@ -435,7 +595,7 @@ impl Future for ExecuteTests { continue; } }; - self.0.log_test_result(test, result); + self.0.log_test_result(test, result.into()); } // Tests are still executing, we're registered to get a notification, @@ -455,15 +615,39 @@ impl Future for ExecuteTests { } impl State { - fn log_test_result(&self, test: Test, result: Result<(), JsValue>) { - // Print out information about the test passing or failing - self.formatter.log_test(&test.name, &result); - + fn log_test_result(&self, test: Test, result: TestResult) { // Save off the test for later processing when we print the final // results. - match result { - Ok(()) => self.succeeded.set(self.succeeded.get() + 1), - Err(e) => self.failures.borrow_mut().push((test, e)), + if let Some(should_panic) = test.should_panic { + if let TestResult::Err(_e) = result { + if let Some(expected) = should_panic { + if !test.output.borrow().panic.contains(expected) { + self.formatter + .log_test(&test.name, &TestResult::Err(JsValue::NULL)); + self.failures + .borrow_mut() + .push((test, Failure::ShouldPanicExpected)); + return; + } + } + + self.formatter.log_test(&test.name, &TestResult::Ok); + self.succeeded_count.set(self.succeeded_count.get() + 1); + } else { + self.formatter + .log_test(&test.name, &TestResult::Err(JsValue::NULL)); + self.failures + .borrow_mut() + .push((test, Failure::ShouldPanic)); + } + } else { + self.formatter.log_test(&test.name, &result); + + match result { + TestResult::Ok => self.succeeded_count.set(self.succeeded_count.get() + 1), + TestResult::Err(e) => self.failures.borrow_mut().push((test, Failure::Error(e))), + _ => (), + } } } @@ -471,24 +655,33 @@ impl State { let failures = self.failures.borrow(); if failures.len() > 0 { self.formatter.writeln("\nfailures:\n"); - for (test, error) in failures.iter() { - self.print_failure(test, error); + for (test, failure) in failures.iter() { + self.print_failure(test, failure); } self.formatter.writeln("failures:\n"); for (test, _) in failures.iter() { self.formatter.writeln(&format!(" {}", test.name)); } } + let finished_in = if let Some(timer) = &self.timer { + format!("; finished in {:.2?}s", timer.elapsed()) + } else { + String::new() + }; self.formatter.writeln(""); self.formatter.writeln(&format!( "test result: {}. \ {} passed; \ {} failed; \ - {} ignored\n", + {} ignored; \ + {} filtered out\ + {}\n", if failures.len() == 0 { "ok" } else { "FAILED" }, - self.succeeded.get(), + self.succeeded_count.get(), failures.len(), - self.ignored.get(), + self.ignored_count.get(), + self.filtered_count.get(), + finished_in, )); } @@ -502,17 +695,39 @@ impl State { logs.push('\n'); } - fn print_failure(&self, test: &Test, error: &JsValue) { + fn print_failure(&self, test: &Test, failure: &Failure) { let mut logs = String::new(); let output = test.output.borrow(); + + match failure { + Failure::ShouldPanic => { + logs.push_str(&format!( + "note: {} did not panic as expected\n\n", + test.name + )); + } + Failure::ShouldPanicExpected => { + logs.push_str("note: panic did not contain expected string\n"); + logs.push_str(&format!(" panic message: `\"{}\"`,\n", output.panic)); + logs.push_str(&format!( + " expected substring: `\"{}\"`\n\n", + test.should_panic.unwrap().unwrap() + )); + } + _ => (), + } + self.accumulate_console_output(&mut logs, "debug", &output.debug); self.accumulate_console_output(&mut logs, "log", &output.log); self.accumulate_console_output(&mut logs, "info", &output.info); self.accumulate_console_output(&mut logs, "warn", &output.warn); self.accumulate_console_output(&mut logs, "error", &output.error); - logs.push_str("JS exception that was thrown:\n"); - let error_string = self.formatter.stringify_error(error); - logs.push_str(&tab(&error_string)); + + if let Failure::Error(error) = failure { + logs.push_str("JS exception that was thrown:\n"); + let error_string = self.formatter.stringify_error(error); + logs.push_str(&tab(&error_string)); + } let msg = format!("---- {} output ----\n{}", test.name, tab(&logs)); self.formatter.writeln(&msg); @@ -528,7 +743,7 @@ impl State { /// variable to capture output for the current test. That way at least when /// we've got Rust code running we'll be able to capture output. /// -/// * Next, this "catches panics". Right now all wasm code is configured as +/// * Next, this "catches panics". Right now all Wasm code is configured as /// panic=abort, but it's more like an exception in JS. It's pretty sketchy /// to actually continue executing Rust code after an "abort", but we don't /// have much of a choice for now. @@ -557,8 +772,8 @@ extern "C" { fn __wbg_test_invoke(f: &mut dyn FnMut()) -> Result<(), JsValue>; } -impl Future for TestFuture { - type Output = Result; +impl>> Future for TestFuture { + type Output = F::Output; fn poll(self: Pin<&mut Self>, cx: &mut task::Context) -> Poll { let output = self.output.clone(); @@ -574,7 +789,7 @@ impl Future for TestFuture { }) }); match (result, future_output) { - (_, Some(Poll::Ready(e))) => Poll::Ready(Ok(e)), + (_, Some(Poll::Ready(result))) => Poll::Ready(result), (_, Some(Poll::Pending)) => Poll::Pending, (Err(e), _) => Poll::Ready(Err(e)), (Ok(_), None) => wasm_bindgen::throw_str("invalid poll state"), @@ -587,7 +802,31 @@ fn tab(s: &str) -> String { for line in s.lines() { result.push_str(" "); result.push_str(line); - result.push_str("\n"); + result.push('\n'); + } + result +} + +struct Timer { + performance: Performance, + started: f64, +} + +impl Timer { + fn new() -> Option { + let global: Global = js_sys::global().unchecked_into(); + let performance = global.performance(); + (!performance.is_undefined()).then(|| { + let performance: Performance = performance.unchecked_into(); + let started = performance.now(); + Self { + performance, + started, + } + }) + } + + fn elapsed(&self) -> f64 { + (self.performance.now() - self.started) / 1000. } - return result; } diff --git a/crates/test/src/rt/node.rs b/crates/test/src/rt/node.rs index ecfa4bd4f73..40e5276b3dd 100644 --- a/crates/test/src/rt/node.rs +++ b/crates/test/src/rt/node.rs @@ -3,8 +3,12 @@ //! This currently uses the same output as `libtest`, only reimplemented here //! for node itself. +use alloc::format; +use alloc::string::String; use wasm_bindgen::prelude::*; +use super::TestResult; + /// Implementation of the `Formatter` trait for node.js pub struct Node {} @@ -15,27 +19,24 @@ extern "C" { type NodeError; #[wasm_bindgen(method, getter, js_class = "Error", structural)] fn stack(this: &NodeError) -> String; + #[wasm_bindgen(js_name = __wbgtest_og_console_log)] + fn og_console_log(s: &str); } impl Node { - /// Attempts to create a new formatter for node.js, returning `None` if this - /// is executing in a browser and Node won't work. - pub fn new() -> Option { - if super::detect::is_browser() { - return None; - } - Some(Node {}) + /// Attempts to create a new formatter for node.js + pub fn new() -> Node { + Node {} } } impl super::Formatter for Node { fn writeln(&self, line: &str) { - super::js_console_log(line); + og_console_log(line); } - fn log_test(&self, name: &str, result: &Result<(), JsValue>) { - let s = if result.is_ok() { "ok" } else { "FAIL" }; - self.writeln(&format!("test {} ... {}", name, s)); + fn log_test(&self, name: &str, result: &TestResult) { + self.writeln(&format!("test {} ... {}", name, result)); } fn stringify_error(&self, err: &JsValue) -> String { diff --git a/crates/test/src/rt/scoped_tls.rs b/crates/test/src/rt/scoped_tls.rs new file mode 100644 index 00000000000..042160fb52d --- /dev/null +++ b/crates/test/src/rt/scoped_tls.rs @@ -0,0 +1,85 @@ +//! See . + +use core::cell::Cell; +use core::marker::PhantomData; + +/// `no_std` polyfill for [`scoped_tls`](https://crates.io/crates/scoped-tls). +#[macro_export] +macro_rules! scoped_thread_local { + (static $name:ident: $ty:ty) => { + static $name: scoped_tls::ScopedKey<$ty> = unsafe { + static FOO: scoped_tls::Wrapper<::core::cell::Cell<*const ()>> = + scoped_tls::Wrapper::new(::core::cell::Cell::new(::core::ptr::null())); + // Safety: nothing else can access FOO since it's hidden in its own scope + scoped_tls::ScopedKey::new(&FOO) + }; + }; +} + +pub(super) struct Wrapper(T); + +impl Wrapper { + pub(super) const fn new(value: T) -> Self { + Self(value) + } +} + +unsafe impl Sync for Wrapper {} + +pub struct ScopedKey { + inner: &'static Wrapper>, + _marker: PhantomData, +} + +unsafe impl Sync for ScopedKey {} + +impl ScopedKey { + #[doc(hidden)] + /// # Safety + /// `inner` must only be accessed through `ScopedKey`'s API + pub(super) const unsafe fn new(inner: &'static Wrapper>) -> Self { + Self { + inner, + _marker: PhantomData, + } + } + + pub fn set(&'static self, t: &T, f: F) -> R + where + F: FnOnce() -> R, + { + struct Reset { + key: &'static Wrapper>, + val: *const (), + } + impl Drop for Reset { + fn drop(&mut self) { + self.key.0.set(self.val); + } + } + let prev = self.inner.0.get(); + self.inner.0.set(t as *const T as *const ()); + let _reset = Reset { + key: self.inner, + val: prev, + }; + f() + } + + pub fn with(&'static self, f: F) -> R + where + F: FnOnce(&T) -> R, + { + let val = self.inner.0.get(); + assert!( + !val.is_null(), + "cannot access a scoped thread local variable without calling `set` first" + ); + unsafe { f(&*(val as *const T)) } + } + + /// Test whether this TLS key has been `set` for the current thread. + pub fn is_set(&'static self) -> bool { + !self.inner.0.get().is_null() + } +} diff --git a/crates/test/src/rt/worker.rs b/crates/test/src/rt/worker.rs new file mode 100644 index 00000000000..e9a35242615 --- /dev/null +++ b/crates/test/src/rt/worker.rs @@ -0,0 +1,69 @@ +//! Support for printing status information of a test suite in a browser. +//! +//! Currently this is quite simple, rendering the same as the console tests in +//! node.js. Output here is rendered in a `pre`, however. + +use alloc::format; +use alloc::string::String; +use js_sys::Error; +use wasm_bindgen::prelude::*; + +use super::TestResult; + +/// Implementation of `Formatter` for browsers. +/// +/// Routes all output to a `pre` on the page currently. Eventually this probably +/// wants to be a pretty table with colors and folding and whatnot. +pub struct Worker {} + +#[wasm_bindgen] +extern "C" { + type WorkerError; + #[wasm_bindgen(method, getter, structural)] + fn stack(this: &WorkerError) -> JsValue; + + #[wasm_bindgen(js_name = "__wbg_test_output_writeln")] + fn write_output_line(data: JsValue); +} + +impl Worker { + /// Attempts to create a new formatter for web worker + pub fn new() -> Worker { + Worker {} + } +} + +impl super::Formatter for Worker { + fn writeln(&self, line: &str) { + write_output_line(JsValue::from(String::from(line))); + } + + fn log_test(&self, name: &str, result: &TestResult) { + self.writeln(&format!("test {} ... {}", name, result)); + } + + fn stringify_error(&self, err: &JsValue) -> String { + // TODO: this should be a checked cast to `Error` + let error = Error::from(err.clone()); + let name = String::from(error.name()); + let message = String::from(error.message()); + let err = WorkerError::from(err.clone()); + let stack = err.stack(); + + let header = format!("{}: {}", name, message); + let stack = match stack.as_string() { + Some(stack) => stack, + None => return header, + }; + + // If the `stack` variable contains the name/message already, this is + // probably a chome-like error which is already rendered well, so just + // return this info + if stack.contains(&header) { + return stack; + } + + // Fallback to make sure we don't lose any info + format!("{}\n{}", header, stack) + } +} diff --git a/crates/threads-xform/Cargo.toml b/crates/threads-xform/Cargo.toml index 306a6d510c5..f32e53d59e2 100644 --- a/crates/threads-xform/Cargo.toml +++ b/crates/threads-xform/Cargo.toml @@ -1,27 +1,32 @@ [package] -name = "wasm-bindgen-threads-xform" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/threads-xform" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen-threads-xform" description = """ Support for threading-related transformations in wasm-bindgen """ -edition = "2018" +documentation = "https://docs.rs/wasm-bindgen-threads-xform" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-threads-xform" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/threads-xform" +rust-version = "1.76" +version = "0.2.100" [dependencies] anyhow = "1.0" -walrus = "0.19.0" -wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.80" } +walrus = "0.23" +wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "=0.2.100" } [dev-dependencies] rayon = "1.0" -wasmprinter = "0.2" -wasmparser = "0.82" +wasmparser = "0.214" +wasmprinter = "0.214" wat = "1.0" +[lints] +workspace = true + [[test]] -name = "all" harness = false +name = "all" diff --git a/crates/threads-xform/src/lib.rs b/crates/threads-xform/src/lib.rs index 7a7cb898f73..c131446ca86 100644 --- a/crates/threads-xform/src/lib.rs +++ b/crates/threads-xform/src/lib.rs @@ -1,171 +1,149 @@ use anyhow::{anyhow, bail, Error}; use std::cmp; -use std::env; use walrus::ir::Value; +use walrus::FunctionBuilder; use walrus::{ - ir::MemArg, ExportItem, FunctionId, GlobalId, GlobalKind, InitExpr, InstrSeqBuilder, MemoryId, + ir::MemArg, ConstExpr, ExportItem, FunctionId, GlobalId, GlobalKind, InstrSeqBuilder, MemoryId, Module, ValType, }; use wasm_bindgen_wasm_conventions as wasm_conventions; -const PAGE_SIZE: u32 = 1 << 16; +pub const PAGE_SIZE: u32 = 1 << 16; +const DEFAULT_THREAD_STACK_SIZE: u32 = 1 << 21; // 2MB const ATOMIC_MEM_ARG: MemArg = MemArg { align: 4, offset: 0, }; -/// Configuration for the transformation pass in this module. -/// -/// Created primarily through `new` and then executed through `run`. -pub struct Config { - maximum_memory: u32, - thread_stack_size: u32, - enabled: bool, -} - -impl Config { - /// Create a new configuration with default settings. - pub fn new() -> Config { - Config { - maximum_memory: 1 << 30, // 1GB - thread_stack_size: 1 << 20, // 1MB - enabled: env::var("WASM_BINDGEN_THREADS").is_ok(), - } - } - - /// Is threaded Wasm enabled? - pub fn is_enabled(&self, module: &Module) -> bool { - if self.enabled { - return true; - } - - // Compatibility with older LLVM outputs. Newer LLVM outputs, when - // atomics are enabled, emit a shared memory. That's a good indicator - // that we have work to do. If shared memory isn't enabled, though then - // this isn't an atomic module so there's nothing to do. We still allow, - // though, an environment variable to force us to go down this path to - // remain compatibile with older LLVM outputs. - match wasm_conventions::get_memory(module) { - Ok(memory) => module.memories.get(memory).shared, - Err(_) => false, - } - } - - /// Specify the maximum amount of memory the wasm module can ever have. - /// - /// We'll be specifying that the memory for this wasm module is shared, and - /// all shared memories must have their maximum limit specified (whereas - /// by default Rust/LLVM/LLD don't specify a maximum). - /// - /// The default for this option is 16MB, and this can be used to change - /// the maximum memory we'll be specifying. - /// - /// The `max` argument is in units of bytes. - /// - /// If the maximum memory is already specified this setting won't have any - /// affect. - pub fn maximum_memory(&mut self, max: u32) -> &mut Config { - self.maximum_memory = max; - self +#[derive(Clone, Copy)] +pub struct ThreadCount(walrus::LocalId); + +/// Is threaded Wasm enabled? +pub fn is_enabled(module: &Module) -> bool { + // Compatibility with older LLVM outputs. Newer LLVM outputs, when + // atomics are enabled, emit a shared memory. That's a good indicator + // that we have work to do. If shared memory isn't enabled, though then + // this isn't an atomic module so there's nothing to do. We still allow, + // though, an environment variable to force us to go down this path to + // remain compatible with older LLVM outputs. + match wasm_conventions::get_memory(module) { + Ok(memory) => module.memories.get(memory).shared, + Err(_) => false, } +} - /// Specify the stack size for all threads spawned. - /// - /// The stack size is typically set by rustc as an argument to LLD and - /// defaults to 1MB for the main thread. All threads spawned by the - /// main thread, however, need to allocate their own stack! - /// - /// This configuration option indicates how large the stack of each child - /// thread will be. This will be allocated as part of the `start` function - /// and will be stored in LLVM's global stack pointer. - pub fn thread_stack_size(&mut self, size: u32) -> &mut Config { - self.thread_stack_size = size; - self +/// Execute the transformation on the parsed Wasm module specified. +/// +/// This function will prepare `Module` to be run on multiple threads, +/// performing steps such as: +/// +/// * All data segments are switched to "passive" data segments to ensure +/// they're only initialized once (coming later) +/// * If memory is exported from this module, it is instead switched to +/// being imported (with the same parameters). +/// * The imported memory is required to be `shared`, ensuring it's backed +/// by a `SharedArrayBuffer` on the web. +/// * A `global` for a thread ID is injected. +/// * Four bytes in linear memory are reserved for the counter of thread +/// IDs. +/// * A `start` function is injected (or prepended if one already exists) +/// which initializes memory for the first thread and otherwise allocates +/// thread ids for all threads. +/// * Some stack space is prepared for each thread after the first one. +/// +/// More and/or less may happen here over time, stay tuned! +pub fn run(module: &mut Module) -> Result, Error> { + if !is_enabled(module) { + return Ok(None); } - /// Execute the transformation on the parsed wasm module specified. - /// - /// This function will prepare `Module` to be run on multiple threads, - /// performing steps such as: - /// - /// * All data segments are switched to "passive" data segments to ensure - /// they're only initialized once (coming later) - /// * If memory is exported from this module, it is instead switched to - /// being imported (with the same parameters). - /// * The imported memory is required to be `shared`, ensuring it's backed - /// by a `SharedArrayBuffer` on the web. - /// * A `global` for a thread ID is injected. - /// * Four bytes in linear memory are reserved for the counter of thread - /// IDs. - /// * A `start` function is injected (or prepended if one already exists) - /// which initializes memory for the first thread and otherwise allocates - /// thread ids for all threads. - /// * Some stack space is prepared for each thread after the first one. - /// - /// More and/or less may happen here over time, stay tuned! - pub fn run(&self, module: &mut Module) -> Result<(), Error> { - if !self.is_enabled(module) { - return Ok(()); - } - - let memory = wasm_conventions::get_memory(module)?; - - // Now we need to allocate extra static memory for: - // - A thread id counter. - // - A temporary stack for calls to `malloc()` and `free()`. - // - A lock to synchronize usage of the above stack. - // For this, we allocate 1 extra page of memory (should be enough as temporary - // stack) and grab the first 2 _aligned_ i32 words to use as counter and lock. - let static_data_align = 4; - let static_data_pages = 1; - let (base, addr) = - allocate_static_data(module, memory, static_data_pages, static_data_align)?; - - let mem = module.memories.get_mut(memory); - assert!(mem.shared); - let prev_max = mem.maximum.unwrap(); - assert!(mem.import.is_some()); - mem.maximum = Some(cmp::max(self.maximum_memory / PAGE_SIZE, prev_max)); - assert!(mem.data_segments.is_empty()); - - let tls = Tls { - init: delete_synthetic_func(module, "__wasm_init_tls")?, - size: delete_synthetic_global(module, "__tls_size")?, - align: delete_synthetic_global(module, "__tls_align")?, - base: wasm_conventions::get_tls_base(module) - .ok_or_else(|| anyhow!("failed to find tls base"))?, - }; - - let thread_counter_addr = addr as i32; - - let stack_alloc = - module - .globals - .add_local(ValType::I32, true, InitExpr::Value(Value::I32(0))); - - // Make sure the temporary stack is aligned down - let temp_stack = (base + static_data_pages * PAGE_SIZE) & !(static_data_align - 1); - - let stack = Stack { - pointer: wasm_conventions::get_shadow_stack_pointer(module) - .ok_or_else(|| anyhow!("failed to find shadow stack pointer"))?, - temp: temp_stack as i32, - temp_lock: thread_counter_addr + 4, - alloc: stack_alloc, - size: self.thread_stack_size, - }; + let memory = wasm_conventions::get_memory(module)?; + + // Now we need to allocate extra static memory for: + // - A thread id counter. + // - A temporary stack for calls to `malloc()` and `free()`. + // - A lock to synchronize usage of the above stack. + // For this, we allocate 1 extra page of memory (should be enough as temporary + // stack) and grab the first 2 _aligned_ i32 words to use as counter and lock. + let static_data_align = 4; + let static_data_pages = 1; + let (base, addr) = allocate_static_data(module, memory, static_data_pages, static_data_align)?; + + let mem = module.memories.get(memory); + assert!(mem.shared); + assert!(mem.import.is_some()); + assert!(mem.data_segments.is_empty()); + + let tls = Tls { + init: delete_synthetic_func(module, "__wasm_init_tls")?, + size: delete_synthetic_global(module, "__tls_size")?, + align: delete_synthetic_global(module, "__tls_align")?, + base: wasm_conventions::get_tls_base(module) + .ok_or_else(|| anyhow!("failed to find tls base"))?, + }; - inject_start(module, &tls, &stack, thread_counter_addr, memory)?; + let thread_counter_addr = addr as i32; + + let stack_alloc = + module + .globals + .add_local(ValType::I32, true, false, ConstExpr::Value(Value::I32(0))); + + // Make sure the temporary stack is aligned down + let temp_stack = (base + static_data_pages * PAGE_SIZE) & !(static_data_align - 1); + + const _: () = assert!(DEFAULT_THREAD_STACK_SIZE % PAGE_SIZE == 0); + + let stack = Stack { + pointer: wasm_conventions::get_stack_pointer(module) + .ok_or_else(|| anyhow!("failed to find stack pointer"))?, + temp: temp_stack as i32, + temp_lock: thread_counter_addr + 4, + alloc: stack_alloc, + size: module.globals.add_local( + ValType::I32, + true, + false, + ConstExpr::Value(Value::I32(DEFAULT_THREAD_STACK_SIZE as i32)), + ), + }; - // we expose a `__wbindgen_thread_destroy()` helper function that deallocates stack space. - // - // ## Safety - // After calling this function in a given agent, the instance should be considered - // "destroyed" and any further invocations into it will trigger UB. This function - // should not be called from an agent that cannot block (e.g. the main document thread). - inject_destroy(module, &tls, &stack, memory)?; + let _ = module.exports.add("__stack_alloc", stack.alloc); + + let thread_count = inject_start(module, &tls, &stack, thread_counter_addr, memory)?; + + // we expose a `__wbindgen_thread_destroy()` helper function that deallocates stack space. + // + // ## Safety + // After calling this function in a given agent, the instance should be considered + // "destroyed" and any further invocations into it will trigger UB. This function + // should not be called from an agent that cannot block (e.g. the main document thread). + // + // You can also call it from a "leader" agent, passing appropriate values, if said leader + // is in charge of cleaning up after a "follower" agent. In that case: + // - The "appropriate values" are the values of the `__tls_base` and `__stack_alloc` globals + // and the stack size from the follower thread, after initialization. + // - The leader does _not_ need to block. + // - Similar restrictions apply: the follower thread should be considered unusable afterwards, + // the leader should not call this function with the same set of parameters twice. + // - Moreover, concurrent calls can lead to UB: the follower could be in the middle of a + // call while the leader is destroying its stack! You should make sure that this cannot happen. + inject_destroy(module, &tls, &stack, memory)?; + + Ok(Some(thread_count)) +} - Ok(()) +impl ThreadCount { + pub fn wrap_start(self, builder: &mut FunctionBuilder, start: FunctionId) { + // We only want to call the start function if we are in the first thread. + // The thread counter should be 0 for the first thread. + builder.func_body().local_get(self.0).if_else( + None, + |_| {}, + |body| { + body.call(start); + }, + ); } } @@ -186,7 +164,7 @@ fn delete_synthetic_global(module: &mut Module, name: &str) -> Result bail!("`{}` must not be an imported global", name), }; match g { - InitExpr::Value(Value::I32(v)) => Ok(v as u32), + ConstExpr::Value(Value::I32(v)) => Ok(v as u32), _ => bail!("`{}` was not an `i32` constant", name), } } @@ -220,11 +198,10 @@ fn allocate_static_data( .exports .iter() .filter(|e| e.name == "__heap_base") - .filter_map(|e| match e.item { + .find_map(|e| match e.item { ExportItem::Global(id) => Some(id), _ => None, - }) - .next(); + }); let heap_base = match heap_base { Some(idx) => idx, None => bail!("failed to find `__heap_base` for injecting thread id"), @@ -243,20 +220,20 @@ fn allocate_static_data( bail!("the `__heap_base` global is unexpectedly mutable"); } let offset = match &mut global.kind { - GlobalKind::Local(InitExpr::Value(Value::I32(n))) => n, + GlobalKind::Local(ConstExpr::Value(Value::I32(n))) => n, _ => bail!("`__heap_base` not a locally defined `i32`"), }; let address = (*offset as u32 + (align - 1)) & !(align - 1); // align up let base = *offset; - *offset = *offset + (pages * PAGE_SIZE) as i32; + *offset += (pages * PAGE_SIZE) as i32; (base, address) }; let memory = module.memories.get_mut(memory); - memory.initial += pages; + memory.initial += u64::from(pages); memory.maximum = memory.maximum.map(|m| cmp::max(m, memory.initial)); Ok((base as u32, address)) @@ -279,7 +256,7 @@ struct Stack { /// A global to store allocated stack alloc: GlobalId, /// The size of the stack - size: u32, + size: GlobalId, } fn inject_start( @@ -288,23 +265,23 @@ fn inject_start( stack: &Stack, thread_counter_addr: i32, memory: MemoryId, -) -> Result<(), Error> { +) -> Result { use walrus::ir::*; - assert!(stack.size % PAGE_SIZE == 0); - let mut builder = walrus::FunctionBuilder::new(&mut module.types, &[], &[]); let local = module.locals.add(ValType::I32); + let thread_count = module.locals.add(ValType::I32); + let stack_size = module.locals.add(ValType::I32); - let mut body = builder.func_body(); + let malloc = find_function(module, "__wbindgen_malloc")?; + + let prev_start = wasm_bindgen_wasm_conventions::get_start(module); + let mut builder = FunctionBuilder::new(&mut module.types, &[ValType::I32], &[]); - // Call previous start function if one is available. Currently this is - // always true because LLVM injects a call to `__wasm_init_memory` as the - // start function which, well, initializes memory. - if let Some(prev) = module.start.take() { - body.call(prev); + if let Ok(prev_start) | Err(Some(prev_start)) = prev_start { + builder.func_body().call(prev_start); } - let malloc = find_function(module, "__wbindgen_malloc")?; + let mut body = builder.func_body(); // Perform an if/else based on whether we're the first thread or not. Our // thread ID will be zero if we're the first thread, otherwise it'll be @@ -312,15 +289,25 @@ fn inject_start( body.i32_const(thread_counter_addr) .i32_const(1) .atomic_rmw(memory, AtomicOp::Add, AtomicWidth::I32, ATOMIC_MEM_ARG) + .local_tee(thread_count) .if_else( None, // If our thread id is nonzero then we're the second or greater thread, so // we give ourselves a stack and we update our stack // pointer as the default stack pointer is surely wrong for us. |body| { - // local = malloc(stack.size) [aka base] - with_temp_stack(body, memory, &stack, |body| { - body.i32_const(stack.size as i32) + body.local_get(stack_size).if_else( + None, + |body| { + body.local_get(stack_size).global_set(stack.size); + }, + |_| (), + ); + + // local = malloc(stack.size, align) [aka base] + with_temp_stack(body, memory, stack, |body| { + body.global_get(stack.size) + .i32_const(16) .call(malloc) .local_tee(local); }); @@ -330,7 +317,7 @@ fn inject_start( // stack_pointer = base + stack.size body.global_get(stack.alloc) - .i32_const(stack.size as i32) + .global_get(stack.size) .binop(BinaryOp::I32Add) .global_set(stack.pointer); }, @@ -342,19 +329,15 @@ fn inject_start( // Afterwards we need to initialize our thread-local state. body.i32_const(tls.size as i32) .i32_const(tls.align as i32) - .drop() // TODO: need to actually respect alignment .call(malloc) .global_set(tls.base) .global_get(tls.base) .call(tls.init); - // Finish off our newly generated function. - let start_id = builder.finish(Vec::new(), &mut module.funcs); - - // ... and finally flag it as the new start function - module.start = Some(start_id); + let id = builder.finish(vec![stack_size], &mut module.funcs); + module.start = Some(id); - Ok(()) + Ok(ThreadCount(thread_count)) } fn inject_destroy( @@ -365,37 +348,74 @@ fn inject_destroy( ) -> Result<(), Error> { let free = find_function(module, "__wbindgen_free")?; - let mut builder = walrus::FunctionBuilder::new(&mut module.types, &[], &[]); + let mut builder = FunctionBuilder::new( + &mut module.types, + &[ValType::I32, ValType::I32, ValType::I32], + &[], + ); builder.name("__wbindgen_thread_destroy".into()); let mut body = builder.func_body(); + // if no explicit parameters are passed (i.e. their value is 0) then we assume + // we're being called from the agent that must be destroyed and rely on its globals + let tls_base = module.locals.add(ValType::I32); + let stack_alloc = module.locals.add(ValType::I32); + let stack_size = module.locals.add(ValType::I32); + // Ideally, at this point, we would destroy the values stored in TLS. // We can't really do that without help from the standard library. // See https://github.com/rustwasm/wasm-bindgen/pull/2769#issuecomment-1015775467. - // free the TLS space - body.global_get(tls.base) - .i32_const(tls.size as i32) - .call(free); - - // set tls.base = i32::MIN to trigger invalid memory - body.i32_const(i32::MIN).global_set(tls.base); - - // free the stack callin `__wbindgen_free(stack.alloc, stack.size)` - with_temp_stack(&mut body, memory, stack, |body| { - body.global_get(stack.alloc) - .i32_const(stack.size as i32) - .call(free); - }); + body.local_get(tls_base).if_else( + None, + |body| { + body.local_get(tls_base) + .i32_const(tls.size as i32) + .i32_const(tls.align as i32) + .call(free); + }, + |body| { + body.global_get(tls.base) + .i32_const(tls.size as i32) + .i32_const(tls.align as i32) + .call(free); + + // set tls.base = i32::MIN to trigger invalid memory + body.i32_const(i32::MIN).global_set(tls.base); + }, + ); + + // free the stack calling `__wbindgen_free(stack.alloc, stack.size)` + body.local_get(stack_alloc).if_else( + None, + |body| { + // we're destroying somebody else's stack, so we can use our own + body.local_get(stack_alloc) + .local_get(stack_size) + .i32_const(DEFAULT_THREAD_STACK_SIZE as i32) + .local_get(stack_size) + .select(None) + .i32_const(16) + .call(free); + }, + |body| { + with_temp_stack(body, memory, stack, |body| { + body.global_get(stack.alloc) + .global_get(stack.size) + .i32_const(16) + .call(free); + }); - // set stack.alloc = 0 to trigger invalid memory - body.i32_const(0).global_set(stack.alloc); + // set stack.alloc = 0 to trigger invalid memory + body.i32_const(0).global_set(stack.alloc); + }, + ); - let free_id = builder.finish(Vec::new(), &mut module.funcs); + let destroy_id = builder.finish(vec![tls_base, stack_alloc, stack_size], &mut module.funcs); - module.exports.add("__wbindgen_thread_destroy", free_id); + module.exports.add("__wbindgen_thread_destroy", destroy_id); Ok(()) } @@ -408,7 +428,7 @@ fn find_function(module: &Module, name: &str) -> Result { .ok_or_else(|| anyhow!("failed to find `{}`", name))?; match e.item { walrus::ExportItem::Function(f) => Ok(f), - _ => bail!("`{}` wasn't a funtion", name), + _ => bail!("`{}` wasn't a function", name), } } diff --git a/crates/threads-xform/tests/all.rs b/crates/threads-xform/tests/all.rs index 1101ccd2fcb..c52b9625a44 100644 --- a/crates/threads-xform/tests/all.rs +++ b/crates/threads-xform/tests/all.rs @@ -11,6 +11,7 @@ use rayon::prelude::*; use std::env; use std::fs; use std::path::{Path, PathBuf}; +use walrus::ModuleConfig; fn main() { run("tests".as_ref(), runtest); @@ -18,24 +19,18 @@ fn main() { fn runtest(test: &Test) -> Result { let wasm = wat::parse_file(&test.file)?; - let mut module = walrus::Module::from_buffer(&wasm)?; + let mut module = ModuleConfig::new() + .generate_producers_section(false) + .parse(&wasm)?; - let config = wasm_bindgen_threads_xform::Config::new(); - - config.run(&mut module)?; + wasm_bindgen_threads_xform::run(&mut module)?; walrus::passes::gc::run(&mut module); - let features = { - let mut features = wasmparser::WasmFeatures::default(); - features.threads = true; - features - }; + let features = wasmparser::WasmFeatures::default() | wasmparser::WasmFeatures::THREADS; - wasmparser::Validator::new() - .wasm_features(features) - .validate_all(&module.emit_wasm())?; + wasmparser::Validator::new_with_features(features).validate_all(&module.emit_wasm())?; - let printed = wasmprinter::print_bytes(&module.emit_wasm())?; + let printed = wasmprinter::print_bytes(module.emit_wasm())?; Ok(printed) } @@ -117,15 +112,12 @@ impl Test { while let Some(line) = iter.next() { if line.starts_with("(; CHECK-ALL:") { let mut pattern = String::new(); - while let Some(line) = iter.next() { + for line in iter.by_ref() { if line == ";)" { break; } pattern.push_str(line); - pattern.push_str("\n"); - } - while pattern.ends_with("\n") { - pattern.pop(); + pattern.push('\n'); } if iter.next().is_some() { bail!("CHECK-ALL must be at the end of the file"); @@ -153,8 +145,8 @@ impl Test { } bail!( "expected\n {}\n\nactual\n {}", - pattern.replace("\n", "\n "), - output.replace("\n", "\n ") + pattern.replace('\n', "\n "), + output.replace('\n', "\n ") ); } else { bail!( @@ -173,7 +165,7 @@ fn update_output(path: &Path, output: &str) -> Result<()> { let mut new_output = String::new(); for line in output.lines() { new_output.push_str(line); - new_output.push_str("\n"); + new_output.push('\n'); } let new = format!( "{}\n\n(; CHECK-ALL:\n{}\n;)\n", diff --git a/crates/threads-xform/tests/basic.wat b/crates/threads-xform/tests/basic.wat index 2c0b03aeee9..5f22078d8fc 100644 --- a/crates/threads-xform/tests/basic.wat +++ b/crates/threads-xform/tests/basic.wat @@ -76,41 +76,56 @@ global.set 1 global.get 1 call $__wasm_init_tls) - (func $__wbindgen_thread_destroy (type 0) - global.get 1 - i32.const 128 - call $__wbindgen_free - i32.const -2147483648 - global.set 1 - i32.const 393216 - global.set 2 - loop ;; label = @1 - i32.const 327684 - i32.const 0 - i32.const 1 - i32.atomic.rmw.cmpxchg - if ;; label = @2 + (func $__wbindgen_thread_destroy (type 3) (param i32 i32) + (local i32 i32) + local.get 0 + if ;; label = @1 + local.get 0 + i32.const 128 + call $__wbindgen_free + else + global.get 1 + i32.const 128 + call $__wbindgen_free + i32.const -2147483648 + global.set 1 + end + local.get 1 + if ;; label = @1 + local.get 1 + i32.const 1048576 + call $__wbindgen_free + else + i32.const 393216 + global.set 2 + loop ;; label = @2 i32.const 327684 + i32.const 0 i32.const 1 - i64.const -1 - memory.atomic.wait32 - drop - br 1 (;@1;) - else + i32.atomic.rmw.cmpxchg + if ;; label = @3 + i32.const 327684 + i32.const 1 + i64.const -1 + memory.atomic.wait32 + drop + br 1 (;@2;) + else + end end - end - global.get 3 - i32.const 1048576 - call $__wbindgen_free - i32.const 327684 - i32.const 0 - i32.atomic.store - i32.const 327684 - i32.const 1 - memory.atomic.notify - drop - i32.const 0 - global.set 3) + global.get 3 + i32.const 1048576 + call $__wbindgen_free + i32.const 327684 + i32.const 0 + i32.atomic.store + i32.const 327684 + i32.const 1 + memory.atomic.notify + drop + i32.const 0 + global.set 3 + end) (func $__wasm_init_tls (type 1) (param i32) i32.const 232323 drop) @@ -120,14 +135,15 @@ (func $__wbindgen_malloc (type 2) (param i32) (result i32) i32.const 999999) (func $__wbindgen_free (type 3) (param i32 i32)) - (global (;0;) i32 (i32.const 393216)) - (global (;1;) (mut i32) (i32.const 0)) - (global (;2;) (mut i32) (i32.const 65536)) - (global (;3;) (mut i32) (i32.const 0)) + (global (;0;) i32 i32.const 393216) + (global (;1;) (mut i32) i32.const 0) + (global (;2;) (mut i32) i32.const 65536) + (global (;3;) (mut i32) i32.const 0) (export "__wbindgen_malloc" (func $__wbindgen_malloc)) (export "__wbindgen_free" (func $__wbindgen_free)) (export "__heap_base" (global 0)) (export "__tls_base" (global 1)) + (export "__stack_alloc" (global 3)) (export "__wbindgen_thread_destroy" (func $__wbindgen_thread_destroy)) (start 0)) ;) diff --git a/crates/threads-xform/tests/unaligned.wat b/crates/threads-xform/tests/unaligned.wat index 241f7ce05d4..816868946e4 100644 --- a/crates/threads-xform/tests/unaligned.wat +++ b/crates/threads-xform/tests/unaligned.wat @@ -76,41 +76,56 @@ global.set 1 global.get 1 call $__wasm_init_tls) - (func $__wbindgen_thread_destroy (type 0) - global.get 1 - i32.const 128 - call $__wbindgen_free - i32.const -2147483648 - global.set 1 - i32.const 393216 - global.set 2 - loop ;; label = @1 - i32.const 327688 - i32.const 0 - i32.const 1 - i32.atomic.rmw.cmpxchg - if ;; label = @2 + (func $__wbindgen_thread_destroy (type 3) (param i32 i32) + (local i32 i32) + local.get 0 + if ;; label = @1 + local.get 0 + i32.const 128 + call $__wbindgen_free + else + global.get 1 + i32.const 128 + call $__wbindgen_free + i32.const -2147483648 + global.set 1 + end + local.get 1 + if ;; label = @1 + local.get 1 + i32.const 1048576 + call $__wbindgen_free + else + i32.const 393216 + global.set 2 + loop ;; label = @2 i32.const 327688 + i32.const 0 i32.const 1 - i64.const -1 - memory.atomic.wait32 - drop - br 1 (;@1;) - else + i32.atomic.rmw.cmpxchg + if ;; label = @3 + i32.const 327688 + i32.const 1 + i64.const -1 + memory.atomic.wait32 + drop + br 1 (;@2;) + else + end end - end - global.get 3 - i32.const 1048576 - call $__wbindgen_free - i32.const 327688 - i32.const 0 - i32.atomic.store - i32.const 327688 - i32.const 1 - memory.atomic.notify - drop - i32.const 0 - global.set 3) + global.get 3 + i32.const 1048576 + call $__wbindgen_free + i32.const 327688 + i32.const 0 + i32.atomic.store + i32.const 327688 + i32.const 1 + memory.atomic.notify + drop + i32.const 0 + global.set 3 + end) (func $__wasm_init_tls (type 1) (param i32) i32.const 232323 drop) @@ -120,14 +135,15 @@ (func $__wbindgen_malloc (type 2) (param i32) (result i32) i32.const 999999) (func $__wbindgen_free (type 3) (param i32 i32)) - (global (;0;) i32 (i32.const 393219)) - (global (;1;) (mut i32) (i32.const 0)) - (global (;2;) (mut i32) (i32.const 65536)) - (global (;3;) (mut i32) (i32.const 0)) + (global (;0;) i32 i32.const 393219) + (global (;1;) (mut i32) i32.const 0) + (global (;2;) (mut i32) i32.const 65536) + (global (;3;) (mut i32) i32.const 0) (export "__wbindgen_malloc" (func $__wbindgen_malloc)) (export "__wbindgen_free" (func $__wbindgen_free)) (export "__heap_base" (global 0)) (export "__tls_base" (global 1)) + (export "__stack_alloc" (global 3)) (export "__wbindgen_thread_destroy" (func $__wbindgen_thread_destroy)) (start 0)) ;) diff --git a/crates/typescript-tests/Cargo.toml b/crates/typescript-tests/Cargo.toml index e3afb5a7fca..1bd464ffb71 100644 --- a/crates/typescript-tests/Cargo.toml +++ b/crates/typescript-tests/Cargo.toml @@ -1,14 +1,20 @@ [package] -name = "typescript-tests" -version = "0.1.0" authors = ["The wasm-bindgen Developers"] -edition = "2018" +edition = "2021" +name = "typescript-tests" +publish = false +version = "0.0.0" [dependencies] +js-sys = { path = '../js-sys' } +serde = { version = "1.0", features = ["derive"] } +serde-wasm-bindgen = "0.6" wasm-bindgen = { path = '../..' } wasm-bindgen-futures = { path = '../futures' } -web-sys = { path = '../web-sys', features = [ 'HtmlElement', 'Node', 'Document' ] } -js-sys = { path = '../js-sys' } +web-sys = { path = '../web-sys', features = ['HtmlElement', 'Node', 'Document'] } [lib] crate-type = ['cdylib'] + +[lints] +workspace = true diff --git a/crates/typescript-tests/jest.config.cjs b/crates/typescript-tests/jest.config.cjs new file mode 100644 index 00000000000..490df9f0a7e --- /dev/null +++ b/crates/typescript-tests/jest.config.cjs @@ -0,0 +1,30 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: "ts-jest/presets/default-esm", + testEnvironment: 'node', + extensionsToTreatAsEsm: [".ts"], + verbose: true, + testMatch: ['**/src/*.ts', '!**/src/*.d.ts'], + // TODO: migrate all test files and remove this + testPathIgnorePatterns: [ + ".*/src/custom_section.ts$", + ".*/src/getters_setters.ts$", + ".*/src/inspectable.ts$", + ".*/src/memory.ts$", + ".*/src/omit_definition.ts$", + ".*/src/optional_fields.ts$", + ".*/src/opt_args_and_ret.ts$", + ".*/src/simple_async_fn.ts$", + ".*/src/simple_fn.ts$", + ".*/src/web_sys.ts$", + ".*/src/usize.ts$" + ], + injectGlobals: false, + transform: { + '^.+.tsx?$': ['ts-jest', + { + useESM: true, + isolatedModules: true + }] + } +}; diff --git a/crates/typescript-tests/no_modules.tsconfig.json b/crates/typescript-tests/no_modules.tsconfig.json index e3688b7d156..9e2cc53e7ec 100644 --- a/crates/typescript-tests/no_modules.tsconfig.json +++ b/crates/typescript-tests/no_modules.tsconfig.json @@ -4,6 +4,7 @@ "noImplicitAny": true, "sourceMap": true, "outDir": "dist_no_modules", + "moduleResolution":"node" }, "include": [ "pkg/no_modules/*.d.ts", diff --git a/crates/typescript-tests/package.json b/crates/typescript-tests/package.json index a1fb1297991..21effd76575 100644 --- a/crates/typescript-tests/package.json +++ b/crates/typescript-tests/package.json @@ -1,8 +1,12 @@ { "scripts": { - "tsc": "tsc" + "tsc": "tsc", + "test": "NODE_OPTIONS=--experimental-vm-modules jest --config ./jest.config.cjs" }, "devDependencies": { - "typescript": "^3.3.3333" - } + "@types/jest": "^29.5.8", + "ts-jest": "=29.2.0", + "typescript": "^5.2.2" + }, + "type": "module" } diff --git a/crates/typescript-tests/run.sh b/crates/typescript-tests/run.sh index f971f251bf2..5a3605e8300 100755 --- a/crates/typescript-tests/run.sh +++ b/crates/typescript-tests/run.sh @@ -57,3 +57,5 @@ cd .. # Then try to build the typescript in the src_no_modules folder against the pkg/no_modules build. npm run tsc -- -p no_modules.tsconfig.json + +npm test diff --git a/crates/typescript-tests/src/custom_section.rs b/crates/typescript-tests/src/custom_section.rs index d4b602677f7..294cc9f5b25 100644 --- a/crates/typescript-tests/src/custom_section.rs +++ b/crates/typescript-tests/src/custom_section.rs @@ -5,7 +5,23 @@ const TS_INTERFACE_EXPORT: &'static str = r" interface Height { height: number; } "; +#[wasm_bindgen(typescript_custom_section)] +const TS_INTERFACE_EXPORT1: &'static str = include_str!("./custom_section_types.d.ts"); + +#[allow(dead_code)] +const TS_INTERFACE_EXPORT2: &str = "interface Person2 { height: number; }"; +#[wasm_bindgen(typescript_custom_section)] +const _: &str = TS_INTERFACE_EXPORT2; + #[wasm_bindgen] pub struct Person { pub height: u32, } + +#[wasm_bindgen] +impl Person { + #[wasm_bindgen(constructor)] + pub fn new() -> Self { + Self { height: 170 } + } +} diff --git a/crates/typescript-tests/src/custom_section.ts b/crates/typescript-tests/src/custom_section.ts index 6420ea6dd59..cb3c826a80d 100644 --- a/crates/typescript-tests/src/custom_section.ts +++ b/crates/typescript-tests/src/custom_section.ts @@ -1,3 +1,7 @@ -import * as wbg from '../pkg/typescript_tests'; +import * as wbg from "../pkg/typescript_tests" -const height: wbg.Height = new wbg.Person(); \ No newline at end of file +const height: wbg.Height = new wbg.Person() + +const height1: wbg.Person1 = new wbg.Person() + +const height2: wbg.Person2 = new wbg.Person() diff --git a/crates/typescript-tests/src/custom_section_types.d.ts b/crates/typescript-tests/src/custom_section_types.d.ts new file mode 100644 index 00000000000..b3552d07ce1 --- /dev/null +++ b/crates/typescript-tests/src/custom_section_types.d.ts @@ -0,0 +1,3 @@ +interface Person1 { + height: number +} diff --git a/crates/typescript-tests/src/enums.rs b/crates/typescript-tests/src/enums.rs new file mode 100644 index 00000000000..7a4ebe5122e --- /dev/null +++ b/crates/typescript-tests/src/enums.rs @@ -0,0 +1,23 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub enum Foo { + A = 1, + B = 3, +} + +#[wasm_bindgen] +pub fn fn_expects_enum(_: Foo) {} + +#[wasm_bindgen] +pub fn fn_returns_enum() -> Foo { + Foo::A +} + +#[wasm_bindgen] +pub fn fn_expects_option_enum(_: Option) {} + +#[wasm_bindgen] +pub fn fn_returns_option_enum() -> Option { + Some(Foo::A) +} diff --git a/crates/typescript-tests/src/enums.ts b/crates/typescript-tests/src/enums.ts new file mode 100644 index 00000000000..595586bee95 --- /dev/null +++ b/crates/typescript-tests/src/enums.ts @@ -0,0 +1,28 @@ +import * as wbg from "../pkg/typescript_tests"; +import { expect, jest, test } from "@jest/globals"; + +test("construction", () => { + const a1: wbg.Foo = wbg.Foo.A; + const a2: wbg.Foo.A = wbg.Foo.A; + expect(a1).toStrictEqual(a2); + const a3: wbg.Foo.A = 1; + expect(a1).toStrictEqual(a3); + + const b1: wbg.Foo = wbg.Foo.B; + const b2: wbg.Foo.B = wbg.Foo.B; + expect(b1).toStrictEqual(b2); + const b3: wbg.Foo.B = 3; + expect(b1).toStrictEqual(b3); + expect(a1).not.toStrictEqual(b1); +}); + +test("function calls", () => { + const fn_expects_enum: (_: wbg.Foo) => void = wbg.fn_expects_enum; + const fn_returns_enum: () => wbg.Foo = wbg.fn_returns_enum; + const fn_expects_option_enum: (_?: wbg.Foo) => void = wbg.fn_expects_option_enum; + const fn_returns_option_enum: () => wbg.Foo | undefined = wbg.fn_returns_option_enum; + + fn_expects_enum(wbg.Foo.B); + expect(fn_returns_enum()).toStrictEqual(wbg.Foo.A); + expect(fn_returns_option_enum()).toStrictEqual(wbg.Foo.A); +}); diff --git a/crates/typescript-tests/src/function_attrs.rs b/crates/typescript-tests/src/function_attrs.rs new file mode 100644 index 00000000000..824954f8cc5 --- /dev/null +++ b/crates/typescript-tests/src/function_attrs.rs @@ -0,0 +1,71 @@ +use wasm_bindgen::prelude::*; + +/// Description for fn_with_attr +#[wasm_bindgen( + unchecked_return_type = "number", + return_description = "returns 1 if arg2 is true, or arg1 if arg2 is undefined or false" +)] +pub async fn fn_with_attr( + #[wasm_bindgen(js_name = "firstArg", param_description = "some number")] arg1: u32, + #[wasm_bindgen(js_name = "secondArg", unchecked_param_type = "boolean | undefined")] + arg2: JsValue, +) -> Result { + if arg2.is_undefined() { + Ok(arg1.into()) + } else if arg2.is_truthy() { + Ok(1u32.into()) + } else { + Ok(arg1.into()) + } +} + +/// Description for HoldsNumber +#[wasm_bindgen] +pub struct HoldsNumber { + inner: JsValue, +} + +#[wasm_bindgen] +impl HoldsNumber { + /// Inner value + #[wasm_bindgen(getter = "inner", unchecked_return_type = "number")] + pub fn get_inner(&self) -> JsValue { + self.inner.clone() + } + + /// Description for static_fn_with_attr + #[wasm_bindgen( + return_description = "returns an instance of HoldsNumber, holding arg1 if arg2 is undefined and holding arg2 if not" + )] + pub fn static_fn_with_attr( + #[wasm_bindgen(js_name = "firstArg", param_description = "some number")] arg1: u32, + #[wasm_bindgen(js_name = "secondArg", unchecked_param_type = "number | undefined")] + arg2: JsValue, + ) -> HoldsNumber { + if arg2.is_undefined() { + HoldsNumber { inner: arg1.into() } + } else { + HoldsNumber { inner: arg2 } + } + } + + /// Description for method_with_attr + #[wasm_bindgen( + unchecked_return_type = "number", + return_description = "returns arg1 if arg2 is true, or holding value of self if arg2 is undefined or false" + )] + pub fn method_with_attr( + &self, + #[wasm_bindgen(js_name = "firstArg", param_description = "some number")] arg1: u32, + #[wasm_bindgen(js_name = "secondArg", unchecked_param_type = "boolean | undefined")] + arg2: JsValue, + ) -> JsValue { + if arg2.is_undefined() { + self.inner.clone() + } else if arg2.is_truthy() { + arg1.into() + } else { + self.inner.clone() + } + } +} diff --git a/crates/typescript-tests/src/function_attrs.ts b/crates/typescript-tests/src/function_attrs.ts new file mode 100644 index 00000000000..287edd2fbf7 --- /dev/null +++ b/crates/typescript-tests/src/function_attrs.ts @@ -0,0 +1,37 @@ +import * as wbg from '../pkg/typescript_tests'; +import * as wasm from '../pkg/typescript_tests_bg.wasm'; +import { expect, test } from "@jest/globals"; + +const wasm_fn_with_attr: (a: number, b: number) => number = wasm.fn_with_attr; +const wbg_fn_with_attr: (a: number, b: boolean) => Promise = wbg.fn_with_attr; +const wasm_holdsnumber_static_fn_with_attr: (a: number, b: number) => number = wasm.holdsnumber_static_fn_with_attr; +const wbg_holdsnumber_static_fn_with_attr: (a1: number, b: number) => wbg.HoldsNumber = wbg.HoldsNumber.static_fn_with_attr; +const wasm_holdsnumber_method_with_attr: (a: number, b: number, c: number) => number = wasm.holdsnumber_method_with_attr; +const wbg_holdsnumber_method_with_attr: (a: number, b: boolean) => number = wbg.HoldsNumber.static_fn_with_attr(1, undefined).method_with_attr; + +test("async function fn_with_attr", async () => { + let result = await wbg.fn_with_attr(4, undefined); + expect(result).toEqual(4); + + result = await wbg.fn_with_attr(5, false); + expect(result).toEqual(5); + + result = await wbg.fn_with_attr(6, true); + expect(result).toEqual(1); +}); + +test("HoldsNumber methods", () => { + const num1 = wbg.HoldsNumber.static_fn_with_attr(4, undefined).inner; + const num2 = wbg.HoldsNumber.static_fn_with_attr(3, 4).inner; + expect(num1).toEqual(num2); + + const holdsNumber = wbg.HoldsNumber.static_fn_with_attr(8, undefined); + let result = holdsNumber.method_with_attr(4, undefined); + expect(result).toEqual(8); + + result = holdsNumber.method_with_attr(5, false); + expect(result).toEqual(8); + + result = holdsNumber.method_with_attr(6, true); + expect(result).toEqual(6); +}); \ No newline at end of file diff --git a/crates/typescript-tests/src/getters_setters.rs b/crates/typescript-tests/src/getters_setters.rs index f2206ab3ce0..7bc14119199 100644 --- a/crates/typescript-tests/src/getters_setters.rs +++ b/crates/typescript-tests/src/getters_setters.rs @@ -1,7 +1,7 @@ use wasm_bindgen::prelude::*; #[wasm_bindgen] -pub struct ColorWithGetter { +pub struct ColorWithGetters { r: f64, _g: f64, _b: f64, @@ -9,15 +9,30 @@ pub struct ColorWithGetter { } #[wasm_bindgen] -impl ColorWithGetter { +impl ColorWithGetters { + #[wasm_bindgen(constructor)] + pub fn new() -> Self { + Self { + r: 0.0, + _g: 0.0, + _b: 0.0, + _a: 0, + } + } + #[wasm_bindgen(getter)] pub fn r(&self) -> f64 { self.r } + + #[wasm_bindgen(getter)] + pub fn color_space() -> String { + "sRGB".to_owned() + } } #[wasm_bindgen] -pub struct ColorWithSetter { +pub struct ColorWithSetters { r: f64, _g: f64, _b: f64, @@ -25,7 +40,17 @@ pub struct ColorWithSetter { } #[wasm_bindgen] -impl ColorWithSetter { +impl ColorWithSetters { + #[wasm_bindgen(constructor)] + pub fn new() -> Self { + Self { + r: 0.0, + _g: 0.0, + _b: 0.0, + a: 0, + } + } + #[wasm_bindgen(setter)] pub fn set_r(&mut self, r: f64) { self.r = r; @@ -37,6 +62,9 @@ impl ColorWithSetter { (self.r * 255.0) as u8 }; } + + #[wasm_bindgen(setter)] + pub fn set_color_space(_: String) {} } #[wasm_bindgen] @@ -49,6 +77,16 @@ pub struct ColorWithGetterAndSetter { #[wasm_bindgen] impl ColorWithGetterAndSetter { + #[wasm_bindgen(constructor)] + pub fn new() -> Self { + Self { + r: 0.0, + _g: 0.0, + _b: 0.0, + a: 0, + } + } + #[wasm_bindgen(getter)] pub fn r(&self) -> f64 { self.r @@ -66,3 +104,22 @@ impl ColorWithGetterAndSetter { }; } } + +#[wasm_bindgen] +pub struct ColorWithReadonly { + #[wasm_bindgen(readonly)] + pub r: f64, + #[wasm_bindgen(readonly)] + pub g: f64, + #[wasm_bindgen(readonly)] + pub b: f64, + pub a: u8, +} + +#[wasm_bindgen] +impl ColorWithReadonly { + #[wasm_bindgen(constructor)] + pub fn new(r: f64, g: f64, b: f64) -> ColorWithReadonly { + Self { r, b, g, a: 0 } + } +} diff --git a/crates/typescript-tests/src/getters_setters.ts b/crates/typescript-tests/src/getters_setters.ts index 1c1a59783b4..20b257ac6ab 100644 --- a/crates/typescript-tests/src/getters_setters.ts +++ b/crates/typescript-tests/src/getters_setters.ts @@ -1,11 +1,17 @@ import * as wbg from '../pkg/typescript_tests'; -const colorWithGetter: wbg.ColorWithGetter = new wbg.ColorWithGetter; -const _a = colorWithGetter.r; +const colorWithGetters: wbg.ColorWithGetters = new wbg.ColorWithGetters; +const _a = colorWithGetters.r; +const _b = wbg.ColorWithGetters.color_space; -const colorWithSetter: wbg.ColorWithSetter = new wbg.ColorWithSetter; -colorWithSetter.r = 1; +const colorWithSetters: wbg.ColorWithSetters = new wbg.ColorWithSetters; +colorWithSetters.r = 1; +wbg.ColorWithSetters.color_space = "Linear sRGB"; const colorWithGetterAndSetter: wbg.ColorWithGetterAndSetter = new wbg.ColorWithGetterAndSetter; colorWithGetterAndSetter.r = 1; -const _b = colorWithGetterAndSetter.r; +const _c = colorWithGetterAndSetter.r; + +const colorWithReadonly: wbg.ColorWithReadonly = new wbg.ColorWithReadonly(1, 2, 3); +const _r: number = colorWithReadonly.r; +colorWithReadonly.a = 4; diff --git a/crates/typescript-tests/src/inspectable.rs b/crates/typescript-tests/src/inspectable.rs new file mode 100644 index 00000000000..cfab5babe34 --- /dev/null +++ b/crates/typescript-tests/src/inspectable.rs @@ -0,0 +1,15 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen(inspectable)] +pub struct Bar { + pub foo: i32, + _private: i32, +} + +#[wasm_bindgen] +impl Bar { + #[wasm_bindgen(constructor)] + pub fn new(foo: i32) -> Self { + Self { foo, _private: 13 } + } +} diff --git a/crates/typescript-tests/src/inspectable.ts b/crates/typescript-tests/src/inspectable.ts new file mode 100644 index 00000000000..762ddbe2f5e --- /dev/null +++ b/crates/typescript-tests/src/inspectable.ts @@ -0,0 +1,6 @@ +import * as wbg from "../pkg/typescript_tests"; + +const bar: wbg.Bar = new wbg.Bar(1); +const barAsJson: Object = bar.toJSON(); +const barAsString: string = bar.toString(); +const _ = bar.foo; diff --git a/crates/typescript-tests/src/lib.rs b/crates/typescript-tests/src/lib.rs index ad8a1c3fbf8..b4edbadb4aa 100644 --- a/crates/typescript-tests/src/lib.rs +++ b/crates/typescript-tests/src/lib.rs @@ -1,5 +1,11 @@ +// > `disallowed_names` lint should not be triggered inside of the test code. +#![allow(clippy::disallowed_names)] + pub mod custom_section; +pub mod enums; +pub mod function_attrs; pub mod getters_setters; +pub mod inspectable; pub mod omit_definition; pub mod opt_args_and_ret; pub mod optional_fields; @@ -7,4 +13,5 @@ pub mod simple_async_fn; pub mod simple_fn; pub mod simple_struct; pub mod typescript_type; +pub mod usize; pub mod web_sys; diff --git a/crates/typescript-tests/src/omit_definition.rs b/crates/typescript-tests/src/omit_definition.rs index c83cdc040a3..c74613519e6 100644 --- a/crates/typescript-tests/src/omit_definition.rs +++ b/crates/typescript-tests/src/omit_definition.rs @@ -33,6 +33,11 @@ pub enum MyEnum { Three, } +#[wasm_bindgen(skip_typescript)] +pub struct MyStruct { + pub field: i32, +} + macro_rules! generate_ts { ($lit:literal) => { #[wasm_bindgen(typescript_custom_section)] diff --git a/crates/typescript-tests/src/optional_fields.ts b/crates/typescript-tests/src/optional_fields.ts index 61e1fc05b1b..8d1cf90c64c 100644 --- a/crates/typescript-tests/src/optional_fields.ts +++ b/crates/typescript-tests/src/optional_fields.ts @@ -1,3 +1,10 @@ import * as wbg from '../pkg/typescript_tests'; -const fields: wbg.Fields = { spaceboy: true, free: () => { } }; +const fields: wbg.Fields = null as unknown as wbg.Fields; + +// optional fields read T | undefined +const _hallo: boolean | undefined = fields.hallo; + +// and allow writing T | null | undefined +fields.hallo = undefined; +fields.hallo = null; diff --git a/crates/typescript-tests/src/simple_fn.rs b/crates/typescript-tests/src/simple_fn.rs index fe99aced910..2449886f5cc 100644 --- a/crates/typescript-tests/src/simple_fn.rs +++ b/crates/typescript-tests/src/simple_fn.rs @@ -7,3 +7,8 @@ pub fn greet(_: &str) {} pub fn take_and_return_bool(_: bool) -> bool { true } + +#[wasm_bindgen(variadic)] +pub fn variadic_function(arr: &JsValue) -> JsValue { + arr.into() +} diff --git a/crates/typescript-tests/src/simple_fn.ts b/crates/typescript-tests/src/simple_fn.ts index b25a31431f2..d7d454b70f7 100644 --- a/crates/typescript-tests/src/simple_fn.ts +++ b/crates/typescript-tests/src/simple_fn.ts @@ -4,3 +4,5 @@ import * as wasm from '../pkg/typescript_tests_bg.wasm'; const wbg_greet: (a: string) => void = wbg.greet; const wasm_greet: (a: number, b: number) => void = wasm.greet; const take_and_return_bool: (a: boolean) => boolean = wbg.take_and_return_bool; +const wbg_variadic_function: (...arr: any) => any = wbg.variadic_function; +const wasm_variadic_function: (arr: number) => number = wasm.variadic_function; diff --git a/crates/typescript-tests/src/simple_struct.ts b/crates/typescript-tests/src/simple_struct.ts index 4927cd1a4a4..d7a4c9deb82 100644 --- a/crates/typescript-tests/src/simple_struct.ts +++ b/crates/typescript-tests/src/simple_struct.ts @@ -1,9 +1,20 @@ -import * as wbg from '../pkg/typescript_tests'; +import * as wbg from "../pkg/typescript_tests"; +import { expect, jest, test } from "@jest/globals"; -const a = new wbg.A(); -wbg.A.other(); -a.foo(); -a.free(); -const b: boolean = a.ret_bool() -a.take_bool(b); -a.take_many(b, 1, 2); +test("member function (void) -> void", () => { + const a = new wbg.A(); + wbg.A.other(); + a.foo(); + a.free(); + expect(() => { + a.ret_bool(); + }).toThrow(/null pointer passed to rust/); +}); + +test("function with parameters", () => { + const a = new wbg.A(); + const b: boolean = a.ret_bool(); + expect(b).toStrictEqual(true); + a.take_bool(b); + a.take_many(b, 1, 2); +}); diff --git a/crates/typescript-tests/src/typescript_type.rs b/crates/typescript-tests/src/typescript_type.rs index 5bd7dc541b3..9ddc9d86890 100644 --- a/crates/typescript-tests/src/typescript_type.rs +++ b/crates/typescript-tests/src/typescript_type.rs @@ -1,3 +1,4 @@ +use serde::{Deserialize, Serialize}; use wasm_bindgen::prelude::*; #[wasm_bindgen(typescript_custom_section)] @@ -16,7 +17,7 @@ extern "C" { } #[wasm_bindgen] -#[derive(Default)] +#[derive(Default, Serialize, Deserialize)] pub struct TextStyle { pub bold: bool, pub italic: bool, @@ -26,13 +27,12 @@ pub struct TextStyle { #[wasm_bindgen] impl TextStyle { #[wasm_bindgen(constructor)] - pub fn new(_i: ITextStyle) -> TextStyle { - // parse JsValue - TextStyle::default() + pub fn new(i: ITextStyle) -> TextStyle { + let js_value: JsValue = i.into(); + serde_wasm_bindgen::from_value(js_value).unwrap() } - pub fn optional_new(_i: Option) -> TextStyle { - // parse JsValue - TextStyle::default() + pub fn optional_new(i: Option) -> TextStyle { + i.map(Self::new).unwrap_or_default() } } diff --git a/crates/typescript-tests/src/typescript_type.ts b/crates/typescript-tests/src/typescript_type.ts index a05ada63bd9..9d9bb0339f0 100644 --- a/crates/typescript-tests/src/typescript_type.ts +++ b/crates/typescript-tests/src/typescript_type.ts @@ -1,9 +1,30 @@ -import * as wbg from '../pkg/typescript_tests'; +import * as wbg from "../pkg/typescript_tests"; +import { expect, jest, test } from "@jest/globals"; -const style: wbg.TextStyle = new wbg.TextStyle({ - bold: true, - italic: true, - size: 42, +test("constructor", () => { + const style: wbg.TextStyle = new wbg.TextStyle({ + bold: true, + italic: false, + size: 42, + }); + + expect(style.bold).toStrictEqual(true); + expect(style.italic).toStrictEqual(false); + expect(style.size).toStrictEqual(42); }); -const optional_style: wbg.TextStyle = wbg.TextStyle.optional_new(); +test("optional parameter constructor", () => { + const default_constructed: wbg.TextStyle = wbg.TextStyle.optional_new(); + expect(default_constructed.bold).toStrictEqual(false); + expect(default_constructed.italic).toStrictEqual(false); + expect(default_constructed.size).toStrictEqual(0); + + const optional_style: wbg.TextStyle = wbg.TextStyle.optional_new({ + italic: true, + bold: false, + size: 0, + }); + expect(optional_style.bold).toStrictEqual(false); + expect(optional_style.italic).toStrictEqual(true); + expect(optional_style.size).toStrictEqual(0); +}); diff --git a/crates/typescript-tests/src/usize.rs b/crates/typescript-tests/src/usize.rs new file mode 100644 index 00000000000..65739c136e4 --- /dev/null +++ b/crates/typescript-tests/src/usize.rs @@ -0,0 +1,21 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn usize_identity(x: usize) -> usize { + x +} + +#[wasm_bindgen] +pub fn isize_identity(x: isize) -> isize { + x +} + +#[wasm_bindgen] +pub async fn async_usize_identity(x: usize) -> usize { + x +} + +#[wasm_bindgen] +pub async fn async_isize_identity(x: isize) -> isize { + x +} diff --git a/crates/typescript-tests/src/usize.ts b/crates/typescript-tests/src/usize.ts new file mode 100644 index 00000000000..0b60bdb185a --- /dev/null +++ b/crates/typescript-tests/src/usize.ts @@ -0,0 +1,6 @@ +import * as wbg from "../pkg/typescript_tests"; + +const _f1: (x: number) => number = wbg.usize_identity; +const _f2: (x: number) => number = wbg.isize_identity; +const _f3: (x: number) => Promise = wbg.async_usize_identity; +const _f4: (x: number) => Promise = wbg.async_isize_identity; diff --git a/crates/typescript-tests/tsconfig.json b/crates/typescript-tests/tsconfig.json index 3032c028f84..5d009f462b6 100644 --- a/crates/typescript-tests/tsconfig.json +++ b/crates/typescript-tests/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "esModuleInterop": true, + "allowSyntheticDefaultImports": true, "target": "es6", "noImplicitAny": true, "sourceMap": true, diff --git a/crates/wasm-conventions/Cargo.toml b/crates/wasm-conventions/Cargo.toml index b1120e5f04a..3554087cbde 100644 --- a/crates/wasm-conventions/Cargo.toml +++ b/crates/wasm-conventions/Cargo.toml @@ -1,14 +1,23 @@ [package] -name = "wasm-bindgen-wasm-conventions" -version = "0.2.80" authors = ["The wasm-bindgen developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/wasm-conventions" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen-wasm-conventions" description = "Utilities for working with Wasm codegen conventions (usually established by LLVM/lld)" -edition = "2018" +documentation = "https://docs.rs/wasm-bindgen-wasm-conventions" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-wasm-conventions" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/wasm-conventions" +rust-version = "1.76" +version = "0.2.100" [dependencies] -walrus = "0.19.0" +leb128 = "0.2" +walrus = "0.23" +# Matching the version `walrus` depends on. anyhow = "1.0" +log = "0.4" +wasmparser = "0.214" + +[lints] +workspace = true diff --git a/crates/wasm-conventions/src/lib.rs b/crates/wasm-conventions/src/lib.rs index 19b706f83a1..beb0fe9da09 100755 --- a/crates/wasm-conventions/src/lib.rs +++ b/crates/wasm-conventions/src/lib.rs @@ -3,13 +3,17 @@ //! //! Examples conventions include: //! -//! * The shadow stack pointer -//! * The canonical linear memory that contains the shadow stack +//! * The stack pointer +//! * The canonical linear memory that contains the stack -use anyhow::{anyhow, bail, Result}; +use std::io::Cursor; + +use anyhow::{anyhow, bail, Context, Result}; use walrus::{ - ir::Value, ElementId, FunctionId, GlobalId, GlobalKind, InitExpr, MemoryId, Module, ValType, + ir::Value, ConstExpr, ElementId, ElementItems, FunctionBuilder, FunctionId, FunctionKind, + GlobalId, GlobalKind, MemoryId, Module, RawCustomSection, ValType, }; +use wasmparser::{BinaryReader, WasmFeatures}; /// Get a Wasm module's canonical linear memory. pub fn get_memory(module: &Module) -> Result { @@ -29,8 +33,16 @@ pub fn get_memory(module: &Module) -> Result { }) } -/// Get the `__shadow_stack_pointer`. -pub fn get_shadow_stack_pointer(module: &Module) -> Option { +/// Get the `__stack_pointer`. +pub fn get_stack_pointer(module: &Module) -> Option { + if let Some(g) = module + .globals + .iter() + .find(|g| matches!(g.name.as_deref(), Some("__stack_pointer"))) + { + return Some(g.id()); + } + let candidates = module .globals .iter() @@ -40,15 +52,18 @@ pub fn get_shadow_stack_pointer(module: &Module) -> Option { // guaranteed to have an i32 initializer, so find globals which are // locally defined, are an i32, and have a nonzero initializer .filter(|g| match g.kind { - GlobalKind::Local(InitExpr::Value(Value::I32(n))) => n != 0, + GlobalKind::Local(ConstExpr::Value(Value::I32(n))) => n != 0, _ => false, }) .collect::>(); match candidates.len() { 0 => None, - // TODO: have an actual check here. 1 => Some(candidates[0].id()), + 2 => { + log::warn!("Unable to accurately determine the location of `__stack_pointer`"); + Some(candidates[0].id()) + } _ => None, } } @@ -93,18 +108,30 @@ pub fn get_function_table_entry(module: &Module, idx: u32) -> Result *n as u32, _ => continue, }; let idx = (idx - offset) as usize; - match segment.members.get(idx) { + + let slot = match &segment.items { + ElementItems::Functions(items) => items.get(idx).map(Some), + ElementItems::Expressions(_, items) => items.get(idx).map(|item| { + if let ConstExpr::RefFunc(target) = item { + Some(target) + } else { + None + } + }), + }; + + match slot { Some(slot) => { return Ok(FunctionTableEntry { element: segment.id(), idx, - func: slot.clone(), + func: slot.cloned(), }) } None => continue, @@ -112,3 +139,153 @@ pub fn get_function_table_entry(module: &Module, idx: u32) -> Result Result> { + match module.start { + Some(start) => match module.funcs.get_mut(start).kind { + FunctionKind::Import(_) => Err(Some(start)), + FunctionKind::Local(_) => Ok(start), + FunctionKind::Uninitialized(_) => unimplemented!(), + }, + None => Err(None), + } +} + +pub fn get_or_insert_start_builder(module: &mut Module) -> &mut FunctionBuilder { + let prev_start = get_start(module); + + let id = match prev_start { + Ok(id) => id, + Err(prev_start) => { + let mut builder = FunctionBuilder::new(&mut module.types, &[], &[]); + + if let Some(prev_start) = prev_start { + builder.func_body().call(prev_start); + } + + let id = builder.finish(Vec::new(), &mut module.funcs); + module.start = Some(id); + id + } + }; + + module + .funcs + .get_mut(id) + .kind + .unwrap_local_mut() + .builder_mut() +} + +pub fn target_feature(module: &Module, feature: &str) -> Result { + // Taken from . + anyhow::ensure!(feature.len() <= 100_000, "feature name too long"); + + // Try to find an existing section. + let section = module + .customs + .iter() + .find(|(_, custom)| custom.name() == "target_features"); + + if let Some((_, section)) = section { + let section: &RawCustomSection = section + .as_any() + .downcast_ref() + .context("failed to read section")?; + let mut reader = BinaryReader::new(§ion.data, 0, WasmFeatures::default()); + // The first integer contains the target feature count. + let count = reader.read_var_u32()?; + + // Try to find if the target feature is already present. + for _ in 0..count { + // First byte is the prefix. + let prefix = reader.read_u8()?; + // Read the feature. + let length = reader.read_var_u32()?; + let this_feature = reader.read_bytes(length as usize)?; + + // If we found the target feature, we are done here. + if this_feature == feature.as_bytes() { + // Make sure we set any existing prefix to "enabled". + if prefix == b'-' { + return Ok(false); + } + + return Ok(true); + } + } + + Ok(false) + } else { + Ok(false) + } +} + +pub fn insert_target_feature(module: &mut Module, new_feature: &str) -> Result<()> { + // Taken from . + anyhow::ensure!(new_feature.len() <= 100_000, "feature name too long"); + + // Try to find an existing section. + let section = module + .customs + .iter_mut() + .find(|(_, custom)| custom.name() == "target_features"); + + // If one exists, check if the target feature is already present. + let section = if let Some((_, section)) = section { + let section: &mut RawCustomSection = section + .as_any_mut() + .downcast_mut() + .context("failed to read section")?; + let mut reader = BinaryReader::new(§ion.data, 0, WasmFeatures::default()); + // The first integer contains the target feature count. + let count = reader.read_var_u32()?; + + // Try to find if the target feature is already present. + for _ in 0..count { + // First byte is the prefix. + let prefix_index = reader.current_position(); + let prefix = reader.read_u8()?; + // Read the feature. + let length = reader.read_var_u32()?; + let feature = reader.read_bytes(length as usize)?; + + // If we found the target feature, we are done here. + if feature == new_feature.as_bytes() { + // Make sure we set any existing prefix to "enabled". + if prefix == b'-' { + section.data[prefix_index] = b'+'; + } + + return Ok(()); + } + } + + section + } else { + let mut data = Vec::new(); + leb128::write::unsigned(&mut data, 0).unwrap(); + let id = module.customs.add(RawCustomSection { + name: String::from("target_features"), + data, + }); + module.customs.get_mut(id).unwrap() + }; + + // If we couldn't find the target feature, insert it. + + // The first byte contains an integer describing the target feature count, which we increase by one. + let mut data = Cursor::new(§ion.data); + let count = leb128::read::unsigned(&mut data).unwrap(); + let mut new_count = Vec::new(); + leb128::write::unsigned(&mut new_count, count + 1).unwrap(); + section.data.splice(0..data.position() as usize, new_count); + // Then we insert the "enabled" prefix at the end. + section.data.push(b'+'); + // The next byte contains the length of the target feature string. + leb128::write::unsigned(&mut section.data, new_feature.len() as u64).unwrap(); + // Lastly the target feature string is inserted. + section.data.extend(new_feature.as_bytes()); + + Ok(()) +} diff --git a/crates/wasm-interpreter/Cargo.toml b/crates/wasm-interpreter/Cargo.toml index c68b7493dbc..3f21fcc1eb2 100644 --- a/crates/wasm-interpreter/Cargo.toml +++ b/crates/wasm-interpreter/Cargo.toml @@ -1,22 +1,27 @@ [package] -name = "wasm-bindgen-wasm-interpreter" -version = "0.2.80" authors = ["The wasm-bindgen Developers"] -license = "MIT/Apache-2.0" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/wasm-interpreter" -homepage = "https://rustwasm.github.io/wasm-bindgen/" -documentation = "https://docs.rs/wasm-bindgen-wasm-interpreter" description = """ Micro-interpreter optimized for wasm-bindgen's use case """ -edition = '2018' +documentation = "https://docs.rs/wasm-bindgen-wasm-interpreter" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "wasm-bindgen-wasm-interpreter" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/main/crates/wasm-interpreter" +rust-version = "1.76" +version = "0.2.100" [dependencies] anyhow = "1.0" log = "0.4" -walrus = "0.19.0" -wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "0.2.80" } +walrus = "0.23" +wasm-bindgen-wasm-conventions = { path = "../wasm-conventions", version = "0.2.100" } [dev-dependencies] tempfile = "3" wat = "1.0" + +[lints] +workspace = true diff --git a/crates/wasm-interpreter/src/lib.rs b/crates/wasm-interpreter/src/lib.rs index 1b875492d77..a45772ad5a0 100644 --- a/crates/wasm-interpreter/src/lib.rs +++ b/crates/wasm-interpreter/src/lib.rs @@ -1,8 +1,8 @@ -//! A tiny and incomplete wasm interpreter +//! A tiny and incomplete Wasm interpreter //! -//! This module contains a tiny and incomplete wasm interpreter built on top of +//! This module contains a tiny and incomplete Wasm interpreter built on top of //! `walrus`'s module structure. Each `Interpreter` contains some state -//! about the execution of a wasm instance. The "incomplete" part here is +//! about the execution of a Wasm instance. The "incomplete" part here is //! related to the fact that this is *only* used to execute the various //! descriptor functions for wasm-bindgen. //! @@ -18,15 +18,16 @@ #![deny(missing_docs)] -use std::collections::{BTreeMap, HashMap, HashSet}; +use anyhow::{bail, ensure}; +use std::collections::{BTreeMap, BTreeSet, HashMap}; use walrus::ir::Instr; use walrus::{ElementId, FunctionId, LocalId, Module, TableId}; -/// A ready-to-go interpreter of a wasm module. +/// A ready-to-go interpreter of a Wasm module. /// /// An interpreter currently represents effectively cached state. It is reused /// between calls to `interpret` and is precomputed from a `Module`. It houses -/// state like the wasm stack, wasm memory, etc. +/// state like the Wasm stack, Wasm memory, etc. #[derive(Default)] pub struct Interpreter { // Function index of the `__wbindgen_describe` and @@ -42,7 +43,7 @@ pub struct Interpreter { // functions. name_map: HashMap, - // The current stack pointer (global 0) and wasm memory (the stack). Only + // The current stack pointer (global 0) and Wasm memory (the stack). Only // used in a limited capacity. sp: i32, mem: Vec, @@ -68,11 +69,9 @@ impl Interpreter { pub fn new(module: &Module) -> Result { let mut ret = Interpreter::default(); - // The descriptor functions shouldn't really use all that much memory - // (the LLVM call stack, now the wasm stack). To handle that let's give - // our selves a little bit of memory and set the stack pointer (global - // 0) to the top. - ret.mem = vec![0; 0x100]; + // Give ourselves some memory and set the stack pointer + // (the LLVM call stack, now the Wasm stack, global 0) to the top. + ret.mem = vec![0; 0x8000]; ret.sp = ret.mem.len() as i32; // Figure out where the `__wbindgen_describe` imported function is, if @@ -105,7 +104,7 @@ impl Interpreter { ret.functions = module.tables.main_function_table()?; - return Ok(ret); + Ok(ret) } /// Interprets the execution of the descriptor function `func`. @@ -131,7 +130,7 @@ impl Interpreter { pub fn interpret_descriptor(&mut self, id: FunctionId, module: &Module) -> Option<&[u32]> { self.descriptor.truncate(0); - // We should have a blank wasm and LLVM stack at both the start and end + // We should have a blank Wasm and LLVM stack at both the start and end // of the call. assert_eq!(self.sp, self.mem.len() as i32); self.call(id, module, &[]); @@ -159,7 +158,7 @@ impl Interpreter { &mut self, id: FunctionId, module: &Module, - entry_removal_list: &mut HashSet<(ElementId, usize)>, + entry_removal_list: &mut HashMap>, ) -> Option<&[u32]> { // Call the `id` function. This is an internal `#[inline(never)]` // whose code is completely controlled by the `wasm-bindgen` crate, so @@ -196,7 +195,10 @@ impl Interpreter { wasm_bindgen_wasm_conventions::get_function_table_entry(module, descriptor_table_idx) .expect("failed to find entry in function table"); let descriptor_id = entry.func.expect("element segment slot wasn't set"); - entry_removal_list.insert((entry.element, entry.idx)); + entry_removal_list + .entry(entry.element) + .or_default() + .insert(entry.idx); // And now execute the descriptor! self.interpret_descriptor(descriptor_id, module) @@ -238,7 +240,14 @@ impl Interpreter { } for (instr, _) in block.instrs.iter() { - frame.eval(instr); + if let Err(err) = frame.eval(instr) { + if let Some(name) = &module.funcs.get(id).name { + panic!("{name}: {err}") + } else { + panic!("{err}") + } + } + if frame.done { break; } @@ -255,7 +264,7 @@ struct Frame<'a> { } impl Frame<'_> { - fn eval(&mut self, instr: &Instr) { + fn eval(&mut self, instr: &Instr) -> anyhow::Result<()> { use walrus::ir::*; let stack = &mut self.interp.scratch; @@ -263,13 +272,17 @@ impl Frame<'_> { match instr { Instr::Const(c) => match c.value { Value::I32(n) => stack.push(n), - _ => panic!("non-i32 constant"), + _ => bail!("non-i32 constant"), }, Instr::LocalGet(e) => stack.push(self.locals.get(&e.local).cloned().unwrap_or(0)), Instr::LocalSet(e) => { let val = stack.pop().unwrap(); self.locals.insert(e.local, val); } + Instr::LocalTee(e) => { + let val = *stack.last().unwrap(); + self.locals.insert(e.local, val); + } // Blindly assume all globals are the stack pointer Instr::GlobalGet(_) => stack.push(self.interp.sp), @@ -286,7 +299,7 @@ impl Frame<'_> { stack.push(match e.op { BinaryOp::I32Sub => lhs - rhs, BinaryOp::I32Add => lhs + rhs, - op => panic!("invalid binary op {:?}", op), + op => bail!("invalid binary op {:?}", op), }); } @@ -295,15 +308,23 @@ impl Frame<'_> { // theory there doesn't need to be. Instr::Load(e) => { let address = stack.pop().unwrap(); + ensure!( + address > 0, + "Read a negative address value from the stack. Did we run out of memory?" + ); let address = address as u32 + e.arg.offset; - assert!(address % 4 == 0); + ensure!(address % 4 == 0); stack.push(self.interp.mem[address as usize / 4]) } Instr::Store(e) => { let value = stack.pop().unwrap(); let address = stack.pop().unwrap(); + ensure!( + address > 0, + "Read a negative address value from the stack. Did we run out of memory?" + ); let address = address as u32 + e.arg.offset; - assert!(address % 4 == 0); + ensure!(address % 4 == 0); self.interp.mem[address as usize / 4] = value; } @@ -317,13 +338,14 @@ impl Frame<'_> { stack.pop().unwrap(); } - Instr::Call(e) => { + Instr::Call(Call { func }) | Instr::ReturnCall(ReturnCall { func }) => { + let func = *func; // If this function is calling the `__wbindgen_describe` // function, which we've precomputed the id for, then // it's telling us about the next `u32` element in the // descriptor to return. We "call" the imported function // here by directly inlining it. - if Some(e.func) == self.interp.describe_id { + if Some(func) == self.interp.describe_id { let val = stack.pop().unwrap(); log::debug!("__wbindgen_describe({})", val); self.interp.descriptor.push(val as u32); @@ -333,21 +355,43 @@ impl Frame<'_> { // slightly different signature. Note that we don't eval the // previous arguments because they shouldn't have any side // effects we're interested in. - } else if Some(e.func) == self.interp.describe_closure_id { + } else if Some(func) == self.interp.describe_closure_id { let val = stack.pop().unwrap(); - drop(stack.pop()); - drop(stack.pop()); + stack.pop(); + stack.pop(); log::debug!("__wbindgen_describe_closure({})", val); self.interp.descriptor_table_idx = Some(val as u32); stack.push(0) // ... otherwise this is a normal call so we recurse. } else { - let ty = self.module.types.get(self.module.funcs.get(e.func).ty()); + // Skip profiling related functions which we don't want to interpret. + if self + .module + .funcs + .get(func) + .name + .as_ref() + .is_some_and(|name| { + name.starts_with("__llvm_profile_init") + || name.starts_with("__llvm_profile_register_function") + || name.starts_with("__llvm_profile_register_function") + }) + { + return Ok(()); + } + + let ty = self.module.types.get(self.module.funcs.get(func).ty()); let args = (0..ty.params().len()) .map(|_| stack.pop().unwrap()) .collect::>(); - self.interp.call(e.func, self.module, &args); + + self.interp.call(func, self.module, &args); + } + + if let Instr::ReturnCall(_) = instr { + log::debug!("return_call"); + self.done = true; } } @@ -360,7 +404,9 @@ impl Frame<'_> { // Note that LLVM may change over time to generate new // instructions in debug mode, and we'll have to react to those // sorts of changes as they arise. - s => panic!("unknown instruction {:?}", s), + s => bail!("unknown instruction {:?}", s), } + + Ok(()) } } diff --git a/crates/wasm-interpreter/tests/smoke.rs b/crates/wasm-interpreter/tests/smoke.rs index 33b2575e420..71fd3b51380 100644 --- a/crates/wasm-interpreter/tests/smoke.rs +++ b/crates/wasm-interpreter/tests/smoke.rs @@ -1,18 +1,21 @@ +use walrus::ModuleConfig; use wasm_bindgen_wasm_interpreter::Interpreter; fn interpret(wat: &str, name: &str, result: Option<&[u32]>) { let wasm = wat::parse_str(wat).unwrap(); - let module = walrus::Module::from_buffer(&wasm).unwrap(); + let module = ModuleConfig::new() + .generate_producers_section(false) + .parse(&wasm) + .unwrap(); let mut i = Interpreter::new(&module).unwrap(); let id = module .exports .iter() .filter(|e| e.name == name) - .filter_map(|e| match e.item { + .find_map(|e| match e.item { walrus::ExportItem::Function(f) => Some(f), _ => None, }) - .next() .unwrap(); assert_eq!(i.interpret_descriptor(id, &module), result); } @@ -87,7 +90,8 @@ fn globals() { (export "foo" (func $foo)) ) "#; - interpret(wat, "foo", Some(&[256])); + // __wbindgen_describe is called with a global - in Frame.eval we assume all access to globals is the stack pointer + interpret(wat, "foo", Some(&[32768])); } #[test] diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index 19f804a017d..c3a73eaa363 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -1,16 +1,18 @@ [package] -name = "web-sys" -version = "0.3.57" authors = ["The wasm-bindgen Developers"] -readme = "./README.md" -homepage = "https://rustwasm.github.io/wasm-bindgen/web-sys/index.html" -documentation = "https://rustwasm.github.io/wasm-bindgen/api/web_sys/" -repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys" description = """ Bindings for all Web APIs, a procedurally generated crate from WebIDL """ -license = "MIT/Apache-2.0" -edition = "2018" +documentation = "https://rustwasm.github.io/wasm-bindgen/api/web_sys/" +edition = "2021" +homepage = "https://rustwasm.github.io/wasm-bindgen/web-sys/index.html" +include = ["/LICENSE-*", "/src"] +license = "MIT OR Apache-2.0" +name = "web-sys" +readme = "./README.md" +repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys" +rust-version = "1.57" +version = "0.3.77" [package.metadata.docs.rs] all-features = true @@ -21,15 +23,28 @@ doctest = false test = false [dependencies] -wasm-bindgen = { path = "../..", version = "0.2.80" } -js-sys = { path = '../js-sys', version = '0.3.57' } +js-sys = { path = '../js-sys', version = '=0.3.77', default-features = false } +wasm-bindgen = { path = "../..", version = "=0.2.100", default-features = false } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test = { path = '../test', version = '0.3.30' } -wasm-bindgen-futures = { path = '../futures', version = '0.4.30' } +futures = "0.3" +wasm-bindgen-futures = { path = '../futures', features = ["futures-core-03-stream"] } +wasm-bindgen-test = { path = '../test' } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(web_sys_unstable_apis)'] } + +[lints.clippy] +large_enum_variant = "allow" +new_without_default = "allow" +overly_complex_bool_expr = "allow" +too_many_arguments = "allow" +type_complexity = "allow" # This list is auto-generated by the wasm-bindgen-webidl program [features] +default = ["std"] +std = ["wasm-bindgen/std", "js-sys/std"] AbortController = [] AbortSignal = ["EventTarget"] AddEventListenerOptions = [] @@ -67,6 +82,7 @@ AudioBufferSourceNode = ["AudioNode", "AudioScheduledSourceNode", "EventTarget"] AudioBufferSourceOptions = [] AudioConfiguration = [] AudioContext = ["BaseAudioContext", "EventTarget"] +AudioContextLatencyCategory = [] AudioContextOptions = [] AudioContextState = [] AudioData = [] @@ -89,6 +105,9 @@ AudioParamMap = [] AudioProcessingEvent = ["Event"] AudioSampleFormat = [] AudioScheduledSourceNode = ["AudioNode", "EventTarget"] +AudioSinkInfo = [] +AudioSinkOptions = [] +AudioSinkType = [] AudioStreamTrack = ["EventTarget", "MediaStreamTrack"] AudioTrack = [] AudioTrackList = ["EventTarget"] @@ -98,10 +117,22 @@ AudioWorkletNode = ["AudioNode", "EventTarget"] AudioWorkletNodeOptions = [] AudioWorkletProcessor = [] AuthenticationExtensionsClientInputs = [] +AuthenticationExtensionsClientInputsJson = [] AuthenticationExtensionsClientOutputs = [] +AuthenticationExtensionsClientOutputsJson = [] +AuthenticationExtensionsDevicePublicKeyInputs = [] +AuthenticationExtensionsDevicePublicKeyOutputs = [] +AuthenticationExtensionsLargeBlobInputs = [] +AuthenticationExtensionsLargeBlobOutputs = [] +AuthenticationExtensionsPrfInputs = [] +AuthenticationExtensionsPrfOutputs = [] +AuthenticationExtensionsPrfValues = [] +AuthenticationResponseJson = [] AuthenticatorAssertionResponse = ["AuthenticatorResponse"] +AuthenticatorAssertionResponseJson = [] AuthenticatorAttachment = [] AuthenticatorAttestationResponse = ["AuthenticatorResponse"] +AuthenticatorAttestationResponseJson = [] AuthenticatorResponse = [] AuthenticatorSelectionCriteria = [] AuthenticatorTransport = [] @@ -150,12 +181,14 @@ BrowserElementExecuteScriptOptions = [] BrowserFeedWriter = [] BrowserFindCaseSensitivity = [] BrowserFindDirection = [] +ByteLengthQueuingStrategy = [] Cache = [] CacheBatchOperation = [] CacheQueryOptions = [] CacheStorage = [] CacheStorageNamespace = [] CanvasCaptureMediaStream = ["EventTarget", "MediaStream"] +CanvasCaptureMediaStreamTrack = ["EventTarget", "MediaStreamTrack"] CanvasGradient = [] CanvasPattern = [] CanvasRenderingContext2d = [] @@ -168,8 +201,6 @@ ChannelCountMode = [] ChannelInterpretation = [] ChannelMergerNode = ["AudioNode", "EventTarget"] ChannelMergerOptions = [] -ChannelPixelLayout = [] -ChannelPixelLayoutDataType = [] ChannelSplitterNode = ["AudioNode", "EventTarget"] ChannelSplitterOptions = [] CharacterData = ["EventTarget", "Node"] @@ -189,14 +220,18 @@ ClipboardEventInit = [] ClipboardItem = [] ClipboardItemOptions = [] ClipboardPermissionDescriptor = [] +ClipboardUnsanitizedFormats = [] CloseEvent = ["Event"] CloseEventInit = [] CodecState = [] CollectedClientData = [] +ColorSpaceConversion = [] Comment = ["CharacterData", "EventTarget", "Node"] CompositeOperation = [] CompositionEvent = ["Event", "UiEvent"] CompositionEventInit = [] +CompressionFormat = [] +CompressionStream = [] ComputedEffectTiming = [] ConnStatusDict = [] ConnectionType = [] @@ -223,17 +258,15 @@ ConvertCoordinateOptions = [] ConvolverNode = ["AudioNode", "EventTarget"] ConvolverOptions = [] Coordinates = [] +CountQueuingStrategy = [] Credential = [] CredentialCreationOptions = [] +CredentialPropertiesOutput = [] CredentialRequestOptions = [] CredentialsContainer = [] Crypto = [] CryptoKey = [] CryptoKeyPair = [] -Csp = [] -CspPolicies = [] -CspReport = [] -CspReportProperties = [] CssAnimation = ["Animation", "EventTarget"] CssBoxType = [] CssConditionRule = ["CssGroupingRule", "CssRule"] @@ -265,6 +298,7 @@ DataTransferItemList = [] DateTimeValue = [] DecoderDoctorNotification = [] DecoderDoctorNotificationType = [] +DecompressionStream = [] DedicatedWorkerGlobalScope = ["EventTarget", "WorkerGlobalScope"] DelayNode = ["AudioNode", "EventTarget"] DelayOptions = [] @@ -283,6 +317,7 @@ DeviceRotationRateInit = [] DhKeyDeriveParams = [] DirectionSetting = [] Directory = [] +DirectoryPickerOptions = [] DisplayMediaStreamConstraints = [] DisplayNameOptions = [] DisplayNameResult = [] @@ -299,6 +334,8 @@ DomError = [] DomException = [] DomImplementation = [] DomMatrix = ["DomMatrixReadOnly"] +DomMatrix2dInit = [] +DomMatrixInit = [] DomMatrixReadOnly = [] DomParser = [] DomPoint = ["DomPointReadOnly"] @@ -317,6 +354,7 @@ DomStringList = [] DomStringMap = [] DomTokenList = [] DomWindowResizeEventDetail = [] +DoubleRange = [] DragEvent = ["Event", "MouseEvent", "UiEvent"] DragEventInit = [] DynamicsCompressorNode = ["AudioNode", "EventTarget"] @@ -359,6 +397,7 @@ ExtFragDepth = [] ExtSRgb = [] ExtShaderTextureLod = [] ExtTextureFilterAnisotropic = [] +ExtTextureNorm16 = [] ExtendableEvent = ["Event"] ExtendableEventInit = [] ExtendableMessageEvent = ["Event", "ExtendableEvent"] @@ -375,22 +414,40 @@ FetchState = [] File = ["Blob"] FileCallback = [] FileList = [] +FilePickerAcceptType = [] +FilePickerOptions = [] FilePropertyBag = [] FileReader = ["EventTarget"] FileReaderSync = [] FileSystem = [] +FileSystemCreateWritableOptions = [] FileSystemDirectoryEntry = ["FileSystemEntry"] +FileSystemDirectoryHandle = ["FileSystemHandle"] FileSystemDirectoryReader = [] FileSystemEntriesCallback = [] FileSystemEntry = [] FileSystemEntryCallback = [] FileSystemFileEntry = ["FileSystemEntry"] +FileSystemFileHandle = ["FileSystemHandle"] FileSystemFlags = [] +FileSystemGetDirectoryOptions = [] +FileSystemGetFileOptions = [] +FileSystemHandle = [] +FileSystemHandleKind = [] +FileSystemHandlePermissionDescriptor = [] +FileSystemPermissionDescriptor = [] +FileSystemPermissionMode = [] +FileSystemReadWriteOptions = [] +FileSystemRemoveOptions = [] +FileSystemSyncAccessHandle = [] +FileSystemWritableFileStream = ["WritableStream"] FillMode = [] FlashClassification = [] -FlexLineGrowthState = [] +FlowControlType = [] FocusEvent = ["Event", "UiEvent"] FocusEventInit = [] +FocusOptions = [] +FontData = [] FontFace = [] FontFaceDescriptors = [] FontFaceLoadStatus = [] @@ -406,26 +463,27 @@ FuzzingFunctions = [] GainNode = ["AudioNode", "EventTarget"] GainOptions = [] Gamepad = [] -GamepadAxisMoveEvent = ["Event", "GamepadEvent"] -GamepadAxisMoveEventInit = [] GamepadButton = [] -GamepadButtonEvent = ["Event", "GamepadEvent"] -GamepadButtonEventInit = [] +GamepadEffectParameters = [] GamepadEvent = ["Event"] GamepadEventInit = [] GamepadHand = [] GamepadHapticActuator = [] GamepadHapticActuatorType = [] +GamepadHapticEffectType = [] +GamepadHapticsResult = [] GamepadMappingType = [] GamepadPose = [] -GamepadServiceTest = [] +GamepadTouch = [] Geolocation = [] -GetNotificationOptions = [] +GetAnimationsOptions = [] GetRootNodeOptions = [] GetUserMediaRequest = [] Gpu = [] GpuAdapter = [] +GpuAdapterInfo = [] GpuAddressMode = [] +GpuAutoLayoutMode = [] GpuBindGroup = [] GpuBindGroupDescriptor = [] GpuBindGroupEntry = [] @@ -441,13 +499,14 @@ GpuBufferBinding = [] GpuBufferBindingLayout = [] GpuBufferBindingType = [] GpuBufferDescriptor = [] -GpuBufferUsage = [] -GpuCanvasCompositingAlphaMode = [] +GpuBufferMapState = [] +GpuCanvasAlphaMode = [] GpuCanvasConfiguration = [] GpuCanvasContext = [] +GpuCanvasToneMapping = [] +GpuCanvasToneMappingMode = [] GpuColorDict = [] GpuColorTargetState = [] -GpuColorWrite = [] GpuCommandBuffer = [] GpuCommandBufferDescriptor = [] GpuCommandEncoder = [] @@ -458,14 +517,18 @@ GpuCompilationMessage = [] GpuCompilationMessageType = [] GpuComputePassDescriptor = [] GpuComputePassEncoder = [] +GpuComputePassTimestampWrites = [] GpuComputePipeline = [] GpuComputePipelineDescriptor = [] +GpuCopyExternalImageDestInfo = [] +GpuCopyExternalImageSourceInfo = [] GpuCullMode = [] GpuDepthStencilState = [] GpuDevice = ["EventTarget"] GpuDeviceDescriptor = [] GpuDeviceLostInfo = [] GpuDeviceLostReason = [] +GpuError = [] GpuErrorFilter = [] GpuExtent3dDict = [] GpuExternalTexture = [] @@ -475,25 +538,22 @@ GpuFeatureName = [] GpuFilterMode = [] GpuFragmentState = [] GpuFrontFace = [] -GpuImageCopyBuffer = [] -GpuImageCopyExternalImage = [] -GpuImageCopyTexture = [] -GpuImageCopyTextureTagged = [] -GpuImageDataLayout = [] GpuIndexFormat = [] +GpuInternalError = ["GpuError"] GpuLoadOp = [] -GpuMapMode = [] +GpuMipmapFilterMode = [] GpuMultisampleState = [] GpuObjectDescriptorBase = [] GpuOrigin2dDict = [] GpuOrigin3dDict = [] -GpuOutOfMemoryError = [] +GpuOutOfMemoryError = ["GpuError"] GpuPipelineDescriptorBase = [] +GpuPipelineError = ["DomException"] +GpuPipelineErrorInit = [] +GpuPipelineErrorReason = [] GpuPipelineLayout = [] GpuPipelineLayoutDescriptor = [] -GpuPipelineStatisticName = [] GpuPowerPreference = [] -GpuPredefinedColorSpace = [] GpuPrimitiveState = [] GpuPrimitiveTopology = [] GpuProgrammableStage = [] @@ -501,6 +561,7 @@ GpuQuerySet = [] GpuQuerySetDescriptor = [] GpuQueryType = [] GpuQueue = [] +GpuQueueDescriptor = [] GpuRenderBundle = [] GpuRenderBundleDescriptor = [] GpuRenderBundleEncoder = [] @@ -510,6 +571,7 @@ GpuRenderPassDepthStencilAttachment = [] GpuRenderPassDescriptor = [] GpuRenderPassEncoder = [] GpuRenderPassLayout = [] +GpuRenderPassTimestampWrites = [] GpuRenderPipeline = [] GpuRenderPipelineDescriptor = [] GpuRequestAdapterOptions = [] @@ -518,8 +580,8 @@ GpuSamplerBindingLayout = [] GpuSamplerBindingType = [] GpuSamplerDescriptor = [] GpuShaderModule = [] +GpuShaderModuleCompilationHint = [] GpuShaderModuleDescriptor = [] -GpuShaderStage = [] GpuStencilFaceState = [] GpuStencilOperation = [] GpuStorageTextureAccess = [] @@ -527,6 +589,9 @@ GpuStorageTextureBindingLayout = [] GpuStoreOp = [] GpuSupportedFeatures = [] GpuSupportedLimits = [] +GpuTexelCopyBufferInfo = [] +GpuTexelCopyBufferLayout = [] +GpuTexelCopyTextureInfo = [] GpuTexture = [] GpuTextureAspect = [] GpuTextureBindingLayout = [] @@ -534,20 +599,17 @@ GpuTextureDescriptor = [] GpuTextureDimension = [] GpuTextureFormat = [] GpuTextureSampleType = [] -GpuTextureUsage = [] GpuTextureView = [] GpuTextureViewDescriptor = [] GpuTextureViewDimension = [] GpuUncapturedErrorEvent = ["Event"] GpuUncapturedErrorEventInit = [] -GpuValidationError = [] +GpuValidationError = ["GpuError"] GpuVertexAttribute = [] GpuVertexBufferLayout = [] GpuVertexFormat = [] GpuVertexState = [] GpuVertexStepMode = [] -GridDeclaration = [] -GridTrackState = [] GroupedHistoryEventInit = [] HalfOpenInfoDict = [] HardwareAcceleration = [] @@ -674,7 +736,9 @@ IdbOpenDbRequest = ["EventTarget", "IdbRequest"] IdbRequest = ["EventTarget"] IdbRequestReadyState = [] IdbTransaction = ["EventTarget"] +IdbTransactionDurability = [] IdbTransactionMode = [] +IdbTransactionOptions = [] IdbVersionChangeEvent = ["Event"] IdbVersionChangeEventInit = [] IdleDeadline = [] @@ -682,7 +746,7 @@ IdleRequestOptions = [] IirFilterNode = ["AudioNode", "EventTarget"] IirFilterOptions = [] ImageBitmap = [] -ImageBitmapFormat = [] +ImageBitmapOptions = [] ImageBitmapRenderingContext = [] ImageCapture = [] ImageCaptureError = [] @@ -693,29 +757,35 @@ ImageDecodeOptions = [] ImageDecodeResult = [] ImageDecoder = [] ImageDecoderInit = [] +ImageEncodeOptions = [] +ImageOrientation = [] ImageTrack = ["EventTarget"] ImageTrackList = [] +InputDeviceInfo = ["MediaDeviceInfo"] InputEvent = ["Event", "UiEvent"] InputEventInit = [] -InstallTriggerData = [] IntersectionObserver = [] IntersectionObserverEntry = [] IntersectionObserverEntryInit = [] IntersectionObserverInit = [] IntlUtils = [] +IsInputPendingOptions = [] IterableKeyAndValueResult = [] IterableKeyOrValueResult = [] IterationCompositeOperation = [] JsonWebKey = [] KeyAlgorithm = [] KeyEvent = [] +KeyFrameRequestEvent = ["Event"] KeyIdsInitData = [] KeyboardEvent = ["Event", "UiEvent"] KeyboardEventInit = [] +KeyframeAnimationOptions = [] KeyframeEffect = ["AnimationEffect"] KeyframeEffectOptions = [] L10nElement = [] L10nValue = [] +LargeBlobSupport = [] LatencyMode = [] LifecycleCallbacks = [] LineAlignSetting = [] @@ -723,6 +793,13 @@ ListBoxObject = [] LocalMediaStream = ["EventTarget", "MediaStream"] LocaleInfo = [] Location = [] +Lock = [] +LockInfo = [] +LockManager = [] +LockManagerSnapshot = [] +LockMode = [] +LockOptions = [] +MathMlElement = ["Element", "EventTarget", "Node"] MediaCapabilities = [] MediaCapabilitiesInfo = [] MediaConfiguration = [] @@ -737,6 +814,7 @@ MediaEncodingConfiguration = [] MediaEncodingType = [] MediaEncryptedEvent = ["Event"] MediaError = [] +MediaImage = [] MediaKeyError = ["Event"] MediaKeyMessageEvent = ["Event"] MediaKeyMessageEventInit = [] @@ -754,6 +832,9 @@ MediaKeys = [] MediaKeysPolicy = [] MediaKeysRequirement = [] MediaList = [] +MediaMetadata = [] +MediaMetadataInit = [] +MediaPositionState = [] MediaQueryList = ["EventTarget"] MediaQueryListEvent = ["Event"] MediaQueryListEventInit = [] @@ -761,6 +842,10 @@ MediaRecorder = ["EventTarget"] MediaRecorderErrorEvent = ["Event"] MediaRecorderErrorEventInit = [] MediaRecorderOptions = [] +MediaSession = [] +MediaSessionAction = [] +MediaSessionActionDetails = [] +MediaSessionPlaybackState = [] MediaSource = ["EventTarget"] MediaSourceEndOfStreamError = [] MediaSourceEnum = [] @@ -776,11 +861,20 @@ MediaStreamEventInit = [] MediaStreamTrack = ["EventTarget"] MediaStreamTrackEvent = ["Event"] MediaStreamTrackEventInit = [] +MediaStreamTrackGenerator = ["EventTarget", "MediaStreamTrack"] +MediaStreamTrackGeneratorInit = [] +MediaStreamTrackProcessor = [] +MediaStreamTrackProcessorInit = [] MediaStreamTrackState = [] +MediaTrackCapabilities = [] MediaTrackConstraintSet = [] MediaTrackConstraints = [] MediaTrackSettings = [] MediaTrackSupportedConstraints = [] +MemoryAttribution = [] +MemoryAttributionContainer = [] +MemoryBreakdownEntry = [] +MemoryMeasurement = [] MessageChannel = [] MessageEvent = ["Event"] MessageEventInit = [] @@ -816,6 +910,8 @@ NativeOsFileWriteAtomicOptions = [] NavigationType = [] Navigator = [] NavigatorAutomationInformation = [] +NavigatorUaBrandVersion = [] +NavigatorUaData = [] NetworkCommandOptions = [] NetworkInformation = ["EventTarget"] NetworkResultOptions = [] @@ -824,7 +920,7 @@ NodeFilter = [] NodeIterator = [] NodeList = [] Notification = ["EventTarget"] -NotificationBehavior = [] +NotificationAction = [] NotificationDirection = [] NotificationEvent = ["Event", "ExtendableEvent"] NotificationEventInit = [] @@ -844,6 +940,8 @@ OfflineAudioContext = ["BaseAudioContext", "EventTarget"] OfflineAudioContextOptions = [] OfflineResourceList = ["EventTarget"] OffscreenCanvas = ["EventTarget"] +OffscreenCanvasRenderingContext2d = [] +OpenFilePickerOptions = [] OpenWindowEventDetail = [] OptionalEffectTiming = [] OrientationLockType = [] @@ -852,6 +950,7 @@ OscillatorNode = ["AudioNode", "AudioScheduledSourceNode", "EventTarget"] OscillatorOptions = [] OscillatorType = [] OverSampleType = [] +OvrMultiview2 = [] PageTransitionEvent = ["Event"] PageTransitionEventInit = [] PaintRequest = [] @@ -860,6 +959,7 @@ PaintWorkletGlobalScope = ["WorkletGlobalScope"] PannerNode = ["AudioNode", "EventTarget"] PannerOptions = [] PanningModelType = [] +ParityType = [] Path2d = [] PaymentAddress = [] PaymentComplete = [] @@ -910,6 +1010,7 @@ Position = [] PositionAlignSetting = [] PositionError = [] PositionOptions = [] +PremultiplyAlpha = [] Presentation = [] PresentationAvailability = ["EventTarget"] PresentationConnection = ["EventTarget"] @@ -937,13 +1038,18 @@ PromiseRejectionEvent = ["Event"] PromiseRejectionEventInit = [] PublicKeyCredential = ["Credential"] PublicKeyCredentialCreationOptions = [] +PublicKeyCredentialCreationOptionsJson = [] PublicKeyCredentialDescriptor = [] +PublicKeyCredentialDescriptorJson = [] PublicKeyCredentialEntity = [] +PublicKeyCredentialHints = [] PublicKeyCredentialParameters = [] PublicKeyCredentialRequestOptions = [] +PublicKeyCredentialRequestOptionsJson = [] PublicKeyCredentialRpEntity = [] PublicKeyCredentialType = [] PublicKeyCredentialUserEntity = [] +PublicKeyCredentialUserEntityJson = [] PushEncryptionKeyName = [] PushEvent = ["Event", "ExtendableEvent"] PushEventInit = [] @@ -956,19 +1062,24 @@ PushSubscriptionJson = [] PushSubscriptionKeys = [] PushSubscriptionOptions = [] PushSubscriptionOptionsInit = [] +QueryOptions = [] QueuingStrategy = [] +QueuingStrategyInit = [] RadioNodeList = ["NodeList"] Range = [] RcwnPerfStats = [] RcwnStatus = [] +ReadableByteStreamController = [] ReadableStream = [] -ReadableStreamByobReadResult = [] ReadableStreamByobReader = [] -ReadableStreamDefaultReadResult = [] +ReadableStreamByobRequest = [] +ReadableStreamDefaultController = [] ReadableStreamDefaultReader = [] ReadableStreamGetReaderOptions = [] ReadableStreamIteratorOptions = [] +ReadableStreamReadResult = [] ReadableStreamReaderMode = [] +ReadableStreamType = [] ReadableWritablePair = [] RecordingState = [] ReferrerPolicy = [] @@ -976,6 +1087,7 @@ RegisterRequest = [] RegisterResponse = [] RegisteredKey = [] RegistrationOptions = [] +RegistrationResponseJson = [] Request = [] RequestCache = [] RequestCredentials = [] @@ -985,11 +1097,13 @@ RequestInit = [] RequestMediaKeySystemAccessNotification = [] RequestMode = [] RequestRedirect = [] +ResidentKeyRequirement = [] ResizeObserver = [] ResizeObserverBoxOptions = [] ResizeObserverEntry = [] ResizeObserverOptions = [] ResizeObserverSize = [] +ResizeQuality = [] Response = [] ResponseInit = [] ResponseType = [] @@ -1010,6 +1124,13 @@ RtcDataChannelInit = [] RtcDataChannelState = [] RtcDataChannelType = [] RtcDegradationPreference = [] +RtcEncodedAudioFrame = [] +RtcEncodedAudioFrameMetadata = [] +RtcEncodedAudioFrameOptions = [] +RtcEncodedVideoFrame = [] +RtcEncodedVideoFrameMetadata = [] +RtcEncodedVideoFrameOptions = [] +RtcEncodedVideoFrameType = [] RtcFecParameters = [] RtcIceCandidate = [] RtcIceCandidateInit = [] @@ -1029,23 +1150,29 @@ RtcIdentityProviderOptions = [] RtcIdentityProviderRegistrar = [] RtcIdentityValidationResult = [] RtcInboundRtpStreamStats = [] -RtcLifecycleEvent = [] RtcMediaStreamStats = [] RtcMediaStreamTrackStats = [] RtcOfferAnswerOptions = [] RtcOfferOptions = [] RtcOutboundRtpStreamStats = [] RtcPeerConnection = ["EventTarget"] +RtcPeerConnectionIceErrorEvent = ["Event"] RtcPeerConnectionIceEvent = ["Event"] RtcPeerConnectionIceEventInit = [] +RtcPeerConnectionState = [] RtcPriorityType = [] RtcRtcpParameters = [] +RtcRtpCapabilities = [] +RtcRtpCodecCapability = [] RtcRtpCodecParameters = [] RtcRtpContributingSource = [] RtcRtpEncodingParameters = [] +RtcRtpHeaderExtensionCapability = [] RtcRtpHeaderExtensionParameters = [] RtcRtpParameters = [] RtcRtpReceiver = [] +RtcRtpScriptTransform = [] +RtcRtpScriptTransformer = ["EventTarget"] RtcRtpSender = [] RtcRtpSourceEntry = [] RtcRtpSourceEntryType = [] @@ -1066,12 +1193,23 @@ RtcStatsReportInternal = [] RtcStatsType = [] RtcTrackEvent = ["Event"] RtcTrackEventInit = [] +RtcTransformEvent = ["Event"] RtcTransportStats = [] RtcdtmfSender = ["EventTarget"] RtcdtmfToneChangeEvent = ["Event"] RtcdtmfToneChangeEventInit = [] RtcrtpContributingSourceStats = [] RtcrtpStreamStats = [] +SFrameTransform = ["EventTarget"] +SFrameTransformErrorEvent = ["Event"] +SFrameTransformErrorEventInit = [] +SFrameTransformErrorEventType = [] +SFrameTransformOptions = [] +SFrameTransformRole = [] +SaveFilePickerOptions = [] +Scheduler = [] +SchedulerPostTaskOptions = [] +Scheduling = [] Screen = ["EventTarget"] ScreenColorGamut = [] ScreenLuminance = [] @@ -1092,6 +1230,15 @@ SecurityPolicyViolationEvent = ["Event"] SecurityPolicyViolationEventDisposition = [] SecurityPolicyViolationEventInit = [] Selection = [] +SelectionMode = [] +Serial = ["EventTarget"] +SerialInputSignals = [] +SerialOptions = [] +SerialOutputSignals = [] +SerialPort = ["EventTarget"] +SerialPortFilter = [] +SerialPortInfo = [] +SerialPortRequestOptions = [] ServerSocketOptions = [] ServiceWorker = ["EventTarget"] ServiceWorkerContainer = ["EventTarget"] @@ -1146,6 +1293,8 @@ StyleSheet = [] StyleSheetApplicableStateChangeEventInit = [] StyleSheetChangeEventInit = [] StyleSheetList = [] +SubmitEvent = ["Event"] +SubmitEventInit = [] SubtleCrypto = [] SupportedType = [] SvcOutputMetadata = [] @@ -1269,6 +1418,13 @@ SvggElement = ["Element", "EventTarget", "Node", "SvgElement", "SvgGraphicsEleme SvgmPathElement = ["Element", "EventTarget", "Node", "SvgElement"] SvgsvgElement = ["Element", "EventTarget", "Node", "SvgElement", "SvgGraphicsElement"] SvgtSpanElement = ["Element", "EventTarget", "Node", "SvgElement", "SvgGraphicsElement", "SvgTextContentElement", "SvgTextPositioningElement"] +TaskController = ["AbortController"] +TaskControllerInit = [] +TaskPriority = [] +TaskPriorityChangeEvent = ["Event"] +TaskPriorityChangeEventInit = [] +TaskSignal = ["AbortSignal", "EventTarget"] +TaskSignalAnyInit = [] TcpReadyState = [] TcpServerSocket = ["EventTarget"] TcpServerSocketEvent = ["Event"] @@ -1293,6 +1449,10 @@ TextTrackList = ["EventTarget"] TextTrackMode = [] TimeEvent = ["Event"] TimeRanges = [] +ToggleEvent = ["Event"] +ToggleEventInit = [] +TokenBinding = [] +TokenBindingStatus = [] Touch = [] TouchEvent = ["Event", "UiEvent"] TouchEventInit = [] @@ -1301,6 +1461,8 @@ TouchList = [] TrackEvent = ["Event"] TrackEventInit = [] TransformStream = [] +TransformStreamDefaultController = [] +Transformer = [] TransitionEvent = ["Event"] TransitionEventInit = [] Transport = [] @@ -1310,10 +1472,15 @@ TreeView = [] TreeWalker = [] U2f = [] U2fClientData = [] +ULongRange = [] +UaDataValues = [] +UaLowEntropyJson = [] UdpMessageEventInit = [] UdpOptions = [] UiEvent = ["Event"] UiEventInit = [] +UnderlyingSink = [] +UnderlyingSource = [] Url = [] UrlSearchParams = [] Usb = ["EventTarget"] @@ -1341,6 +1508,7 @@ UsbPermissionStorage = [] UsbRecipient = [] UsbRequestType = [] UsbTransferStatus = [] +UserActivation = [] UserProximityEvent = ["Event"] UserProximityEventInit = [] UserVerificationRequirement = [] @@ -1372,7 +1540,9 @@ VideoStreamTrack = ["EventTarget", "MediaStreamTrack"] VideoTrack = [] VideoTrackList = ["EventTarget"] VideoTransferCharacteristics = [] +ViewTransition = [] VisibilityState = [] +VisualViewport = ["EventTarget"] VoidCallback = [] VrDisplay = ["EventTarget"] VrDisplayCapabilities = [] @@ -1419,6 +1589,24 @@ WebKitCssMatrix = ["DomMatrix", "DomMatrixReadOnly"] WebSocket = ["EventTarget"] WebSocketDict = [] WebSocketElement = [] +WebTransport = [] +WebTransportBidirectionalStream = [] +WebTransportCloseInfo = [] +WebTransportCongestionControl = [] +WebTransportDatagramDuplexStream = [] +WebTransportDatagramStats = [] +WebTransportError = ["DomException"] +WebTransportErrorOptions = [] +WebTransportErrorSource = [] +WebTransportHash = [] +WebTransportOptions = [] +WebTransportReceiveStream = ["ReadableStream"] +WebTransportReceiveStreamStats = [] +WebTransportReliabilityMode = [] +WebTransportSendStream = ["WritableStream"] +WebTransportSendStreamOptions = [] +WebTransportSendStreamStats = [] +WebTransportStats = [] WebglColorBufferFloat = [] WebglCompressedTextureAstc = [] WebglCompressedTextureAtc = [] @@ -1432,7 +1620,9 @@ WebglDebugShaders = [] WebglDepthTexture = [] WebglDrawBuffers = [] WebglLoseContext = [] -WebrtcGlobalStatisticsReport = [] +WebglMultiDraw = [] +WellKnownDirectory = [] +WgslLanguageFeatures = [] WheelEvent = ["Event", "MouseEvent", "UiEvent"] WheelEventInit = [] WidevineCdmManifest = [] @@ -1449,7 +1639,10 @@ Worklet = [] WorkletGlobalScope = [] WorkletOptions = [] WritableStream = [] +WritableStreamDefaultController = [] WritableStreamDefaultWriter = [] +WriteCommandType = [] +WriteParams = [] XPathExpression = [] XPathNsResolver = [] XPathResult = [] @@ -1459,10 +1652,11 @@ XmlHttpRequestEventTarget = ["EventTarget"] XmlHttpRequestResponseType = [] XmlHttpRequestUpload = ["EventTarget", "XmlHttpRequestEventTarget"] XmlSerializer = [] -Xr = ["EventTarget"] XrBoundedReferenceSpace = ["EventTarget", "XrReferenceSpace", "XrSpace"] XrEye = [] XrFrame = [] +XrHand = [] +XrHandJoint = [] XrHandedness = [] XrInputSource = [] XrInputSourceArray = [] @@ -1470,6 +1664,11 @@ XrInputSourceEvent = ["Event"] XrInputSourceEventInit = [] XrInputSourcesChangeEvent = ["Event"] XrInputSourcesChangeEventInit = [] +XrJointPose = ["XrPose"] +XrJointSpace = ["EventTarget", "XrSpace"] +XrLayer = ["EventTarget"] +XrPermissionDescriptor = [] +XrPermissionStatus = ["EventTarget", "PermissionStatus"] XrPose = [] XrReferenceSpace = ["EventTarget", "XrSpace"] XrReferenceSpaceEvent = ["Event"] @@ -1483,14 +1682,21 @@ XrSessionEvent = ["Event"] XrSessionEventInit = [] XrSessionInit = [] XrSessionMode = [] +XrSessionSupportedPermissionDescriptor = [] XrSpace = ["EventTarget"] +XrSystem = ["EventTarget"] XrTargetRayMode = [] XrView = [] XrViewerPose = ["XrPose"] XrViewport = [] XrVisibilityState = [] -XrWebGlLayer = [] +XrWebGlLayer = ["EventTarget", "XrLayer"] XrWebGlLayerInit = [] XsltProcessor = [] console = [] css = [] +gpu_buffer_usage = [] +gpu_color_write = [] +gpu_map_mode = [] +gpu_shader_stage = [] +gpu_texture_usage = [] diff --git a/crates/web-sys/README.md b/crates/web-sys/README.md index ed6892e6604..53753673564 100644 --- a/crates/web-sys/README.md +++ b/crates/web-sys/README.md @@ -2,9 +2,9 @@ Raw bindings to Web APIs for projects using `wasm-bindgen`. -* [The `web-sys` section of the `wasm-bindgen` +- [The `web-sys` section of the `wasm-bindgen` guide](https://rustwasm.github.io/wasm-bindgen/web-sys/index.html) -* [API Documentation](https://rustwasm.github.io/wasm-bindgen/api/web_sys/) +- [API Documentation](https://rustwasm.github.io/wasm-bindgen/api/web_sys/) ## Crate features @@ -14,3 +14,36 @@ found in `crates/web-sys/Cargo.toml`, but the rule of thumb for `web-sys` is that each type has its own cargo feature (named after the type). Using an API requires enabling the features for all types used in the API, and APIs should mention in the documentation what features they require. + +## How to add an interface + +If you don't see a particular web API in `web-sys`, here is how to add it. + +1. Copy the WebIDL specification of the API and place it in a new file in the + `webidls/unstable` folder. You can often find the IDL by going to the MDN + docs page for the API, scrolling to the bottom, clicking the + "Specifications" link, and scrolling to the bottom of the specification + page. For example, the bottom of the [MDN + docs](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession) on the + MediaSession API takes you to the + [spec](https://w3c.github.io/mediasession/#the-mediasession-interface). The + [very bottom](https://w3c.github.io/mediasession/#idl-index) of _that_ page + is the IDL. +2. Annotate the functions that can throw with `[Throws]` +3. `cd crates/web-sys` +4. Run `cargo run --release --package wasm-bindgen-webidl -- webidls src/features ./Cargo.toml` +5. Run `git add .` to add all the generated files into git. +6. Add an entry in CHANGELOG.md like the following + + ```md + ... + + ## Unreleased + + ### Added + + ... + + * Added + [#1234](https://github.com/rustwasm/wasm-bindgen/pull/1234) # <- link to your PR + ``` diff --git a/crates/web-sys/src/features/gen_AbortController.rs b/crates/web-sys/src/features/gen_AbortController.rs index 95776f74a67..df2aa0b021a 100644 --- a/crates/web-sys/src/features/gen_AbortController.rs +++ b/crates/web-sys/src/features/gen_AbortController.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -33,4 +34,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbortController`*"] pub fn abort(this: &AbortController); + # [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_with_reason(this: &AbortController, reason: &::wasm_bindgen::JsValue); } diff --git a/crates/web-sys/src/features/gen_AbortSignal.rs b/crates/web-sys/src/features/gen_AbortSignal.rs index 081fa5c4969..bc0b69718e6 100644 --- a/crates/web-sys/src/features/gen_AbortSignal.rs +++ b/crates/web-sys/src/features/gen_AbortSignal.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -18,6 +19,13 @@ extern "C" { #[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 = reason)] + #[doc = "Getter for the `reason` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/reason)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"] + pub fn reason(this: &AbortSignal) -> ::wasm_bindgen::JsValue; # [wasm_bindgen (structural , method , getter , js_class = "AbortSignal" , js_name = onabort)] #[doc = "Getter for the `onabort` field of this object."] #[doc = ""] @@ -32,4 +40,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"] pub fn set_onabort(this: &AbortSignal, value: Option<&::js_sys::Function>); + # [wasm_bindgen (static_method_of = AbortSignal , js_class = "AbortSignal" , js_name = abort)] + #[doc = "The `abort()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"] + pub fn abort() -> AbortSignal; + # [wasm_bindgen (static_method_of = AbortSignal , js_class = "AbortSignal" , js_name = abort)] + #[doc = "The `abort()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"] + pub fn abort_with_reason(reason: &::wasm_bindgen::JsValue) -> AbortSignal; + # [wasm_bindgen (static_method_of = AbortSignal , js_class = "AbortSignal" , js_name = any)] + #[doc = "The `any()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"] + pub fn any(signals: &::wasm_bindgen::JsValue) -> AbortSignal; + # [wasm_bindgen (method , structural , js_class = "AbortSignal" , js_name = throwIfAborted)] + #[doc = "The `throwIfAborted()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"] + pub fn throw_if_aborted(this: &AbortSignal); + # [wasm_bindgen (static_method_of = AbortSignal , js_class = "AbortSignal" , js_name = timeout)] + #[doc = "The `timeout()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"] + pub fn timeout_with_u32(milliseconds: u32) -> AbortSignal; + # [wasm_bindgen (static_method_of = AbortSignal , js_class = "AbortSignal" , js_name = timeout)] + #[doc = "The `timeout()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"] + pub fn timeout_with_f64(milliseconds: f64) -> AbortSignal; } diff --git a/crates/web-sys/src/features/gen_AddEventListenerOptions.rs b/crates/web-sys/src/features/gen_AddEventListenerOptions.rs index c2de0cad6d1..d34654d22ee 100644 --- a/crates/web-sys/src/features/gen_AddEventListenerOptions.rs +++ b/crates/web-sys/src/features/gen_AddEventListenerOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] pub type AddEventListenerOptions; + #[doc = "Get the `capture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] + #[wasm_bindgen(method, getter = "capture")] + pub fn get_capture(this: &AddEventListenerOptions) -> Option; + #[doc = "Change the `capture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] + #[wasm_bindgen(method, setter = "capture")] + pub fn set_capture(this: &AddEventListenerOptions, val: bool); + #[doc = "Get the `once` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] + #[wasm_bindgen(method, getter = "once")] + pub fn get_once(this: &AddEventListenerOptions) -> Option; + #[doc = "Change the `once` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] + #[wasm_bindgen(method, setter = "once")] + pub fn set_once(this: &AddEventListenerOptions, val: bool); + #[doc = "Get the `passive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] + #[wasm_bindgen(method, getter = "passive")] + pub fn get_passive(this: &AddEventListenerOptions) -> Option; + #[doc = "Change the `passive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] + #[wasm_bindgen(method, setter = "passive")] + pub fn set_passive(this: &AddEventListenerOptions, val: bool); + #[cfg(feature = "AbortSignal")] + #[doc = "Get the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `AddEventListenerOptions`*"] + #[wasm_bindgen(method, getter = "signal")] + pub fn get_signal(this: &AddEventListenerOptions) -> Option; + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `AddEventListenerOptions`*"] + #[wasm_bindgen(method, setter = "signal")] + pub fn set_signal(this: &AddEventListenerOptions, val: &AbortSignal); } impl AddEventListenerOptions { #[doc = "Construct a new `AddEventListenerOptions`."] @@ -19,51 +62,25 @@ impl AddEventListenerOptions { 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`*"] + #[deprecated = "Use `set_capture()` instead."] 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.set_capture(val); self } - #[doc = "Change the `once` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] + #[deprecated = "Use `set_once()` instead."] 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.set_once(val); self } - #[doc = "Change the `passive` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"] + #[deprecated = "Use `set_passive()` instead."] 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.set_passive(val); + self + } + #[cfg(feature = "AbortSignal")] + #[deprecated = "Use `set_signal()` instead."] + pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { + self.set_signal(val); self } } diff --git a/crates/web-sys/src/features/gen_AesCbcParams.rs b/crates/web-sys/src/features/gen_AesCbcParams.rs index 475d94981ab..b439aa882e0 100644 --- a/crates/web-sys/src/features/gen_AesCbcParams.rs +++ b/crates/web-sys/src/features/gen_AesCbcParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] pub type AesCbcParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &AesCbcParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &AesCbcParams, val: &str); + #[doc = "Get the `iv` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] + #[wasm_bindgen(method, getter = "iv")] + pub fn get_iv(this: &AesCbcParams) -> ::js_sys::Object; + #[doc = "Change the `iv` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] + #[wasm_bindgen(method, setter = "iv")] + pub fn set_iv(this: &AesCbcParams, val: &::js_sys::Object); } impl AesCbcParams { #[doc = "Construct a new `AesCbcParams`."] @@ -17,34 +38,18 @@ impl 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.set_name(name); + ret.set_iv(iv); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `iv` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"] + #[deprecated = "Use `set_iv()` instead."] 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.set_iv(val); self } } diff --git a/crates/web-sys/src/features/gen_AesCtrParams.rs b/crates/web-sys/src/features/gen_AesCtrParams.rs index ec60d3fd440..c3b84245e2e 100644 --- a/crates/web-sys/src/features/gen_AesCtrParams.rs +++ b/crates/web-sys/src/features/gen_AesCtrParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] pub type AesCtrParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &AesCtrParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &AesCtrParams, val: &str); + #[doc = "Get the `counter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[wasm_bindgen(method, getter = "counter")] + pub fn get_counter(this: &AesCtrParams) -> ::js_sys::Object; + #[doc = "Change the `counter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[wasm_bindgen(method, setter = "counter")] + pub fn set_counter(this: &AesCtrParams, val: &::js_sys::Object); + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &AesCtrParams) -> u8; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &AesCtrParams, val: u8); } impl AesCtrParams { #[doc = "Construct a new `AesCtrParams`."] @@ -17,53 +48,24 @@ impl 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.set_name(name); + ret.set_counter(counter); + ret.set_length(length); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `counter` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[deprecated = "Use `set_counter()` instead."] 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.set_counter(val); self } - #[doc = "Change the `length` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } } diff --git a/crates/web-sys/src/features/gen_AesDerivedKeyParams.rs b/crates/web-sys/src/features/gen_AesDerivedKeyParams.rs index 46bcc59a4cc..ccebb265d2d 100644 --- a/crates/web-sys/src/features/gen_AesDerivedKeyParams.rs +++ b/crates/web-sys/src/features/gen_AesDerivedKeyParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] pub type AesDerivedKeyParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &AesDerivedKeyParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &AesDerivedKeyParams, val: &str); + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &AesDerivedKeyParams) -> u32; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &AesDerivedKeyParams, val: u32); } impl AesDerivedKeyParams { #[doc = "Construct a new `AesDerivedKeyParams`."] @@ -17,35 +38,18 @@ impl 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.set_name(name); + ret.set_length(length); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `length` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } } diff --git a/crates/web-sys/src/features/gen_AesGcmParams.rs b/crates/web-sys/src/features/gen_AesGcmParams.rs index 8f361d1f5af..b7a913ee1e8 100644 --- a/crates/web-sys/src/features/gen_AesGcmParams.rs +++ b/crates/web-sys/src/features/gen_AesGcmParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] pub type AesGcmParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &AesGcmParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &AesGcmParams, val: &str); + #[doc = "Get the `additionalData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[wasm_bindgen(method, getter = "additionalData")] + pub fn get_additional_data(this: &AesGcmParams) -> Option<::js_sys::Object>; + #[doc = "Change the `additionalData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[wasm_bindgen(method, setter = "additionalData")] + pub fn set_additional_data(this: &AesGcmParams, val: &::js_sys::Object); + #[doc = "Get the `iv` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[wasm_bindgen(method, getter = "iv")] + pub fn get_iv(this: &AesGcmParams) -> ::js_sys::Object; + #[doc = "Change the `iv` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[wasm_bindgen(method, setter = "iv")] + pub fn set_iv(this: &AesGcmParams, val: &::js_sys::Object); + #[doc = "Get the `tagLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[wasm_bindgen(method, getter = "tagLength")] + pub fn get_tag_length(this: &AesGcmParams) -> Option; + #[doc = "Change the `tagLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[wasm_bindgen(method, setter = "tagLength")] + pub fn set_tag_length(this: &AesGcmParams, val: u8); } impl AesGcmParams { #[doc = "Construct a new `AesGcmParams`."] @@ -17,68 +58,28 @@ impl 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.set_name(name); + ret.set_iv(iv); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `additionalData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[deprecated = "Use `set_additional_data()` instead."] 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.set_additional_data(val); self } - #[doc = "Change the `iv` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[deprecated = "Use `set_iv()` instead."] 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.set_iv(val); self } - #[doc = "Change the `tagLength` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"] + #[deprecated = "Use `set_tag_length()` instead."] 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.set_tag_length(val); self } } diff --git a/crates/web-sys/src/features/gen_AesKeyAlgorithm.rs b/crates/web-sys/src/features/gen_AesKeyAlgorithm.rs index 380782f05ff..a4f34afb3eb 100644 --- a/crates/web-sys/src/features/gen_AesKeyAlgorithm.rs +++ b/crates/web-sys/src/features/gen_AesKeyAlgorithm.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] pub type AesKeyAlgorithm; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &AesKeyAlgorithm) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &AesKeyAlgorithm, val: &str); + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &AesKeyAlgorithm) -> u16; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &AesKeyAlgorithm, val: u16); } impl AesKeyAlgorithm { #[doc = "Construct a new `AesKeyAlgorithm`."] @@ -17,35 +38,18 @@ impl 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.set_name(name); + ret.set_length(length); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `length` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } } diff --git a/crates/web-sys/src/features/gen_AesKeyGenParams.rs b/crates/web-sys/src/features/gen_AesKeyGenParams.rs index 016d2b88fd8..2f699303ee4 100644 --- a/crates/web-sys/src/features/gen_AesKeyGenParams.rs +++ b/crates/web-sys/src/features/gen_AesKeyGenParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] pub type AesKeyGenParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &AesKeyGenParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &AesKeyGenParams, val: &str); + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &AesKeyGenParams) -> u16; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &AesKeyGenParams, val: u16); } impl AesKeyGenParams { #[doc = "Construct a new `AesKeyGenParams`."] @@ -17,35 +38,18 @@ impl 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.set_name(name); + ret.set_length(length); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `length` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } } diff --git a/crates/web-sys/src/features/gen_Algorithm.rs b/crates/web-sys/src/features/gen_Algorithm.rs index d0263e74f73..32103689b95 100644 --- a/crates/web-sys/src/features/gen_Algorithm.rs +++ b/crates/web-sys/src/features/gen_Algorithm.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Algorithm`*"] pub type Algorithm; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Algorithm`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &Algorithm) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Algorithm`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &Algorithm, val: &str); } impl Algorithm { #[doc = "Construct a new `Algorithm`."] @@ -17,20 +28,12 @@ impl 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.set_name(name); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Algorithm`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_AlignSetting.rs b/crates/web-sys/src/features/gen_AlignSetting.rs index b80070997fe..e47fce5f02f 100644 --- a/crates/web-sys/src/features/gen_AlignSetting.rs +++ b/crates/web-sys/src/features/gen_AlignSetting.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `AlignSetting` enum."] diff --git a/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs b/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs index 82f734e998d..2c39cdfc01f 100644 --- a/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs +++ b/crates/web-sys/src/features/gen_AllowedBluetoothDevice.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,60 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AllowedBluetoothDevice; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `allowedServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "allowedServices")] + pub fn get_allowed_services(this: &AllowedBluetoothDevice) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `allowedServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "allowedServices")] + pub fn set_allowed_services(this: &AllowedBluetoothDevice, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "deviceId")] + pub fn get_device_id(this: &AllowedBluetoothDevice) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "deviceId")] + pub fn set_device_id(this: &AllowedBluetoothDevice, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mayUseGATT` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mayUseGATT")] + pub fn get_may_use_gatt(this: &AllowedBluetoothDevice) -> bool; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mayUseGATT` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mayUseGATT")] + pub fn set_may_use_gatt(this: &AllowedBluetoothDevice, val: bool); } #[cfg(web_sys_unstable_apis)] impl AllowedBluetoothDevice { @@ -29,72 +84,27 @@ impl AllowedBluetoothDevice { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.allowed_services(allowed_services); - ret.device_id(device_id); - ret.may_use_gatt(may_use_gatt); + ret.set_allowed_services(allowed_services); + ret.set_device_id(device_id); + ret.set_may_use_gatt(may_use_gatt); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `allowedServices` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_allowed_services()` instead."] pub fn allowed_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowedServices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_allowed_services(val); self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `deviceId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_device_id()` instead."] pub fn device_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_device_id(val); self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `mayUseGATT` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AllowedBluetoothDevice`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_may_use_gatt()` instead."] pub fn may_use_gatt(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mayUseGATT"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_may_use_gatt(val); self } } diff --git a/crates/web-sys/src/features/gen_AllowedUsbDevice.rs b/crates/web-sys/src/features/gen_AllowedUsbDevice.rs index b4b082f13f8..b1fa5b8f6e4 100644 --- a/crates/web-sys/src/features/gen_AllowedUsbDevice.rs +++ b/crates/web-sys/src/features/gen_AllowedUsbDevice.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AllowedUsbDevice; -} -#[cfg(web_sys_unstable_apis)] -impl AllowedUsbDevice { - #[doc = "Construct a new `AllowedUsbDevice`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `productId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AllowedUsbDevice`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(product_id: u8, vendor_id: u8) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.product_id(product_id); - ret.vendor_id(vendor_id); - ret - } + #[wasm_bindgen(method, getter = "productId")] + pub fn get_product_id(this: &AllowedUsbDevice) -> u8; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `productId` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl AllowedUsbDevice { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn product_id(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("productId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "productId")] + pub fn set_product_id(this: &AllowedUsbDevice, val: u8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `serialNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedUsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "serialNumber")] + pub fn get_serial_number(this: &AllowedUsbDevice) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `serialNumber` field of this object."] #[doc = ""] @@ -57,20 +48,17 @@ impl AllowedUsbDevice { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn serial_number(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serialNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "serialNumber")] + pub fn set_serial_number(this: &AllowedUsbDevice, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `vendorId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedUsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "vendorId")] + pub fn get_vendor_id(this: &AllowedUsbDevice) -> u8; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `vendorId` field of this object."] #[doc = ""] @@ -78,18 +66,40 @@ impl AllowedUsbDevice { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "vendorId")] + pub fn set_vendor_id(this: &AllowedUsbDevice, val: u8); +} +#[cfg(web_sys_unstable_apis)] +impl AllowedUsbDevice { + #[doc = "Construct a new `AllowedUsbDevice`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AllowedUsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(product_id: u8, vendor_id: u8) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_product_id(product_id); + ret.set_vendor_id(vendor_id); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_product_id()` instead."] + pub fn product_id(&mut self, val: u8) -> &mut Self { + self.set_product_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_serial_number()` instead."] + pub fn serial_number(&mut self, val: &str) -> &mut Self { + self.set_serial_number(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_vendor_id()` instead."] pub fn vendor_id(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vendorId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_vendor_id(val); self } } diff --git a/crates/web-sys/src/features/gen_AlphaOption.rs b/crates/web-sys/src/features/gen_AlphaOption.rs index 1984e555e11..82dbef2c1c1 100644 --- a/crates/web-sys/src/features/gen_AlphaOption.rs +++ b/crates/web-sys/src/features/gen_AlphaOption.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AnalyserNode.rs b/crates/web-sys/src/features/gen_AnalyserNode.rs index a659b628c9e..6db762035de 100644 --- a/crates/web-sys/src/features/gen_AnalyserNode.rs +++ b/crates/web-sys/src/features/gen_AnalyserNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -100,6 +101,13 @@ extern "C" { #[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 = 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_with_u8_array(this: &AnalyserNode, array: &::js_sys::Uint8Array); # [wasm_bindgen (method , structural , js_class = "AnalyserNode" , js_name = getByteTimeDomainData)] #[doc = "The `getByteTimeDomainData()` method."] #[doc = ""] @@ -107,6 +115,16 @@ extern "C" { #[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 = 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_with_u8_array( + this: &AnalyserNode, + array: &::js_sys::Uint8Array, + ); # [wasm_bindgen (method , structural , js_class = "AnalyserNode" , js_name = getFloatFrequencyData)] #[doc = "The `getFloatFrequencyData()` method."] #[doc = ""] @@ -114,6 +132,16 @@ extern "C" { #[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 = 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_with_f32_array( + this: &AnalyserNode, + array: &::js_sys::Float32Array, + ); # [wasm_bindgen (method , structural , js_class = "AnalyserNode" , js_name = getFloatTimeDomainData)] #[doc = "The `getFloatTimeDomainData()` method."] #[doc = ""] @@ -121,4 +149,14 @@ extern "C" { #[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]); + # [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_with_f32_array( + this: &AnalyserNode, + array: &::js_sys::Float32Array, + ); } diff --git a/crates/web-sys/src/features/gen_AnalyserOptions.rs b/crates/web-sys/src/features/gen_AnalyserOptions.rs index a5a73c278b7..e5ff28832c3 100644 --- a/crates/web-sys/src/features/gen_AnalyserOptions.rs +++ b/crates/web-sys/src/features/gen_AnalyserOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,80 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] pub type AnalyserOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &AnalyserOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &AnalyserOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`, `ChannelCountMode`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &AnalyserOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &AnalyserOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`, `ChannelInterpretation`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &AnalyserOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &AnalyserOptions, val: ChannelInterpretation); + #[doc = "Get the `fftSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, getter = "fftSize")] + pub fn get_fft_size(this: &AnalyserOptions) -> Option; + #[doc = "Change the `fftSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, setter = "fftSize")] + pub fn set_fft_size(this: &AnalyserOptions, val: u32); + #[doc = "Get the `maxDecibels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, getter = "maxDecibels")] + pub fn get_max_decibels(this: &AnalyserOptions) -> Option; + #[doc = "Change the `maxDecibels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, setter = "maxDecibels")] + pub fn set_max_decibels(this: &AnalyserOptions, val: f64); + #[doc = "Get the `minDecibels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, getter = "minDecibels")] + pub fn get_min_decibels(this: &AnalyserOptions) -> Option; + #[doc = "Change the `minDecibels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, setter = "minDecibels")] + pub fn set_min_decibels(this: &AnalyserOptions, val: f64); + #[doc = "Get the `smoothingTimeConstant` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, getter = "smoothingTimeConstant")] + pub fn get_smoothing_time_constant(this: &AnalyserOptions) -> Option; + #[doc = "Change the `smoothingTimeConstant` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[wasm_bindgen(method, setter = "smoothingTimeConstant")] + pub fn set_smoothing_time_constant(this: &AnalyserOptions, val: f64); } impl AnalyserOptions { #[doc = "Construct a new `AnalyserOptions`."] @@ -19,125 +94,41 @@ impl AnalyserOptions { 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`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); 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`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); 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`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `fftSize` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[deprecated = "Use `set_fft_size()` instead."] 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.set_fft_size(val); self } - #[doc = "Change the `maxDecibels` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[deprecated = "Use `set_max_decibels()` instead."] 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.set_max_decibels(val); self } - #[doc = "Change the `minDecibels` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[deprecated = "Use `set_min_decibels()` instead."] 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.set_min_decibels(val); self } - #[doc = "Change the `smoothingTimeConstant` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"] + #[deprecated = "Use `set_smoothing_time_constant()` instead."] 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.set_smoothing_time_constant(val); self } } diff --git a/crates/web-sys/src/features/gen_AngleInstancedArrays.rs b/crates/web-sys/src/features/gen_AngleInstancedArrays.rs index 2fd99e72391..930bdaa2c6b 100644 --- a/crates/web-sys/src/features/gen_AngleInstancedArrays.rs +++ b/crates/web-sys/src/features/gen_AngleInstancedArrays.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_Animation.rs b/crates/web-sys/src/features/gen_Animation.rs index 9862eab321f..02df2ead1ec 100644 --- a/crates/web-sys/src/features/gen_Animation.rs +++ b/crates/web-sys/src/features/gen_Animation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[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; + pub fn id(this: &Animation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Animation" , js_name = id)] #[doc = "Setter for the `id` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_AnimationEffect.rs b/crates/web-sys/src/features/gen_AnimationEffect.rs index b57dc8ba42f..d631907efb3 100644 --- a/crates/web-sys/src/features/gen_AnimationEffect.rs +++ b/crates/web-sys/src/features/gen_AnimationEffect.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AnimationEvent.rs b/crates/web-sys/src/features/gen_AnimationEvent.rs index b18d8f91a67..199d4297ee1 100644 --- a/crates/web-sys/src/features/gen_AnimationEvent.rs +++ b/crates/web-sys/src/features/gen_AnimationEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[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; + pub fn animation_name(this: &AnimationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "AnimationEvent" , js_name = elapsedTime)] #[doc = "Getter for the `elapsedTime` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[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; + pub fn pseudo_element(this: &AnimationEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "AnimationEvent")] #[doc = "The `new AnimationEvent(..)` constructor, creating a new instance of `AnimationEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_AnimationEventInit.rs b/crates/web-sys/src/features/gen_AnimationEventInit.rs index 163a55b4306..fcb7f97b1b8 100644 --- a/crates/web-sys/src/features/gen_AnimationEventInit.rs +++ b/crates/web-sys/src/features/gen_AnimationEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] pub type AnimationEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &AnimationEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &AnimationEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &AnimationEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &AnimationEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &AnimationEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &AnimationEventInit, val: bool); + #[doc = "Get the `animationName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, getter = "animationName")] + pub fn get_animation_name(this: &AnimationEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `animationName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, setter = "animationName")] + pub fn set_animation_name(this: &AnimationEventInit, val: &str); + #[doc = "Get the `elapsedTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, getter = "elapsedTime")] + pub fn get_elapsed_time(this: &AnimationEventInit) -> Option; + #[doc = "Change the `elapsedTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, setter = "elapsedTime")] + pub fn set_elapsed_time(this: &AnimationEventInit, val: f32); + #[doc = "Get the `pseudoElement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, getter = "pseudoElement")] + pub fn get_pseudo_element(this: &AnimationEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `pseudoElement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[wasm_bindgen(method, setter = "pseudoElement")] + pub fn set_pseudo_element(this: &AnimationEventInit, val: &str); } impl AnimationEventInit { #[doc = "Construct a new `AnimationEventInit`."] @@ -19,106 +80,34 @@ impl AnimationEventInit { 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`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `animationName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[deprecated = "Use `set_animation_name()` instead."] 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.set_animation_name(val); self } - #[doc = "Change the `elapsedTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[deprecated = "Use `set_elapsed_time()` instead."] 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.set_elapsed_time(val); self } - #[doc = "Change the `pseudoElement` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"] + #[deprecated = "Use `set_pseudo_element()` instead."] 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.set_pseudo_element(val); self } } diff --git a/crates/web-sys/src/features/gen_AnimationPlayState.rs b/crates/web-sys/src/features/gen_AnimationPlayState.rs index 690e5eee324..70fc25c40cf 100644 --- a/crates/web-sys/src/features/gen_AnimationPlayState.rs +++ b/crates/web-sys/src/features/gen_AnimationPlayState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `AnimationPlayState` enum."] diff --git a/crates/web-sys/src/features/gen_AnimationPlaybackEvent.rs b/crates/web-sys/src/features/gen_AnimationPlaybackEvent.rs index 336e49a0686..4aa31d123d4 100644 --- a/crates/web-sys/src/features/gen_AnimationPlaybackEvent.rs +++ b/crates/web-sys/src/features/gen_AnimationPlaybackEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AnimationPlaybackEventInit.rs b/crates/web-sys/src/features/gen_AnimationPlaybackEventInit.rs index 2cdaf070286..921cefc6136 100644 --- a/crates/web-sys/src/features/gen_AnimationPlaybackEventInit.rs +++ b/crates/web-sys/src/features/gen_AnimationPlaybackEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] pub type AnimationPlaybackEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &AnimationPlaybackEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &AnimationPlaybackEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &AnimationPlaybackEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &AnimationPlaybackEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &AnimationPlaybackEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &AnimationPlaybackEventInit, val: bool); + #[doc = "Get the `currentTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, getter = "currentTime")] + pub fn get_current_time(this: &AnimationPlaybackEventInit) -> Option; + #[doc = "Change the `currentTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, setter = "currentTime")] + pub fn set_current_time(this: &AnimationPlaybackEventInit, val: Option); + #[doc = "Get the `timelineTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, getter = "timelineTime")] + pub fn get_timeline_time(this: &AnimationPlaybackEventInit) -> Option; + #[doc = "Change the `timelineTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[wasm_bindgen(method, setter = "timelineTime")] + pub fn set_timeline_time(this: &AnimationPlaybackEventInit, val: Option); } impl AnimationPlaybackEventInit { #[doc = "Construct a new `AnimationPlaybackEventInit`."] @@ -19,89 +70,29 @@ impl AnimationPlaybackEventInit { 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`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `currentTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[deprecated = "Use `set_current_time()` instead."] pub fn current_time(&mut self, val: Option) -> &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.set_current_time(val); self } - #[doc = "Change the `timelineTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"] + #[deprecated = "Use `set_timeline_time()` instead."] pub fn timeline_time(&mut self, val: Option) -> &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.set_timeline_time(val); self } } diff --git a/crates/web-sys/src/features/gen_AnimationPropertyDetails.rs b/crates/web-sys/src/features/gen_AnimationPropertyDetails.rs index 7cf81edd992..d8560f13c17 100644 --- a/crates/web-sys/src/features/gen_AnimationPropertyDetails.rs +++ b/crates/web-sys/src/features/gen_AnimationPropertyDetails.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] pub type AnimationPropertyDetails; + #[doc = "Get the `property` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[wasm_bindgen(method, getter = "property")] + pub fn get_property(this: &AnimationPropertyDetails) -> ::alloc::string::String; + #[doc = "Change the `property` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[wasm_bindgen(method, setter = "property")] + pub fn set_property(this: &AnimationPropertyDetails, val: &str); + #[doc = "Get the `runningOnCompositor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[wasm_bindgen(method, getter = "runningOnCompositor")] + pub fn get_running_on_compositor(this: &AnimationPropertyDetails) -> bool; + #[doc = "Change the `runningOnCompositor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[wasm_bindgen(method, setter = "runningOnCompositor")] + pub fn set_running_on_compositor(this: &AnimationPropertyDetails, val: bool); + #[doc = "Get the `values` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[wasm_bindgen(method, getter = "values")] + pub fn get_values(this: &AnimationPropertyDetails) -> ::js_sys::Array; + #[doc = "Change the `values` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[wasm_bindgen(method, setter = "values")] + pub fn set_values(this: &AnimationPropertyDetails, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `warning` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[wasm_bindgen(method, getter = "warning")] + pub fn get_warning(this: &AnimationPropertyDetails) -> Option<::alloc::string::String>; + #[doc = "Change the `warning` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[wasm_bindgen(method, setter = "warning")] + pub fn set_warning(this: &AnimationPropertyDetails, val: &str); } impl AnimationPropertyDetails { #[doc = "Construct a new `AnimationPropertyDetails`."] @@ -21,74 +62,29 @@ impl AnimationPropertyDetails { ) -> 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.set_property(property); + ret.set_running_on_compositor(running_on_compositor); + ret.set_values(values); ret } - #[doc = "Change the `property` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[deprecated = "Use `set_property()` instead."] 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.set_property(val); self } - #[doc = "Change the `runningOnCompositor` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[deprecated = "Use `set_running_on_compositor()` instead."] 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.set_running_on_compositor(val); self } - #[doc = "Change the `values` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[deprecated = "Use `set_values()` instead."] 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.set_values(val); self } - #[doc = "Change the `warning` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"] + #[deprecated = "Use `set_warning()` instead."] 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.set_warning(val); self } } diff --git a/crates/web-sys/src/features/gen_AnimationPropertyValueDetails.rs b/crates/web-sys/src/features/gen_AnimationPropertyValueDetails.rs index 71b218c377a..197af6d09ec 100644 --- a/crates/web-sys/src/features/gen_AnimationPropertyValueDetails.rs +++ b/crates/web-sys/src/features/gen_AnimationPropertyValueDetails.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] pub type AnimationPropertyValueDetails; + #[cfg(feature = "CompositeOperation")] + #[doc = "Get the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`, `CompositeOperation`*"] + #[wasm_bindgen(method, getter = "composite")] + pub fn get_composite(this: &AnimationPropertyValueDetails) -> CompositeOperation; + #[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`*"] + #[wasm_bindgen(method, setter = "composite")] + pub fn set_composite(this: &AnimationPropertyValueDetails, val: CompositeOperation); + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &AnimationPropertyValueDetails) -> Option<::alloc::string::String>; + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &AnimationPropertyValueDetails, val: &str); + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &AnimationPropertyValueDetails) -> f64; + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &AnimationPropertyValueDetails, val: f64); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &AnimationPropertyValueDetails) -> Option<::alloc::string::String>; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &AnimationPropertyValueDetails, val: &str); } impl AnimationPropertyValueDetails { #[cfg(feature = "CompositeOperation")] @@ -18,67 +61,29 @@ impl AnimationPropertyValueDetails { 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.set_composite(composite); + ret.set_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`*"] + #[deprecated = "Use `set_composite()` instead."] 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.set_composite(val); self } - #[doc = "Change the `easing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[deprecated = "Use `set_easing()` instead."] 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.set_easing(val); self } - #[doc = "Change the `offset` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[deprecated = "Use `set_offset()` instead."] 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.set_offset(val); self } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"] + #[deprecated = "Use `set_value()` instead."] 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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_AnimationTimeline.rs b/crates/web-sys/src/features/gen_AnimationTimeline.rs index 33c3fed39c5..33933346507 100644 --- a/crates/web-sys/src/features/gen_AnimationTimeline.rs +++ b/crates/web-sys/src/features/gen_AnimationTimeline.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AssignedNodesOptions.rs b/crates/web-sys/src/features/gen_AssignedNodesOptions.rs index 69471ffaa92..c09dbaeefc1 100644 --- a/crates/web-sys/src/features/gen_AssignedNodesOptions.rs +++ b/crates/web-sys/src/features/gen_AssignedNodesOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AssignedNodesOptions`*"] pub type AssignedNodesOptions; + #[doc = "Get the `flatten` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AssignedNodesOptions`*"] + #[wasm_bindgen(method, getter = "flatten")] + pub fn get_flatten(this: &AssignedNodesOptions) -> Option; + #[doc = "Change the `flatten` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AssignedNodesOptions`*"] + #[wasm_bindgen(method, setter = "flatten")] + pub fn set_flatten(this: &AssignedNodesOptions, val: bool); } impl AssignedNodesOptions { #[doc = "Construct a new `AssignedNodesOptions`."] @@ -19,21 +30,9 @@ impl AssignedNodesOptions { 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`*"] + #[deprecated = "Use `set_flatten()` instead."] 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.set_flatten(val); self } } diff --git a/crates/web-sys/src/features/gen_AttestationConveyancePreference.rs b/crates/web-sys/src/features/gen_AttestationConveyancePreference.rs index 28ea13c4694..c98cb125c86 100644 --- a/crates/web-sys/src/features/gen_AttestationConveyancePreference.rs +++ b/crates/web-sys/src/features/gen_AttestationConveyancePreference.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `AttestationConveyancePreference` enum."] @@ -9,4 +10,5 @@ pub enum AttestationConveyancePreference { None = "none", Indirect = "indirect", Direct = "direct", + Enterprise = "enterprise", } diff --git a/crates/web-sys/src/features/gen_Attr.rs b/crates/web-sys/src/features/gen_Attr.rs index 6948e24279d..752f6d76513 100644 --- a/crates/web-sys/src/features/gen_Attr.rs +++ b/crates/web-sys/src/features/gen_Attr.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[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; + pub fn local_name(this: &Attr) -> ::alloc::string::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; + pub fn value(this: &Attr) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Attr" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -38,21 +39,21 @@ extern "C" { #[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; + pub fn name(this: &Attr) -> ::alloc::string::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; + pub fn namespace_uri(this: &Attr) -> Option<::alloc::string::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; + pub fn prefix(this: &Attr) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "Attr" , js_name = specified)] #[doc = "Getter for the `specified` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_AttributeNameValue.rs b/crates/web-sys/src/features/gen_AttributeNameValue.rs index d2088a9edd4..490d0a3cc5c 100644 --- a/crates/web-sys/src/features/gen_AttributeNameValue.rs +++ b/crates/web-sys/src/features/gen_AttributeNameValue.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] pub type AttributeNameValue; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &AttributeNameValue) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &AttributeNameValue, val: &str); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &AttributeNameValue) -> ::alloc::string::String; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &AttributeNameValue, val: &str); } impl AttributeNameValue { #[doc = "Construct a new `AttributeNameValue`."] @@ -17,34 +38,18 @@ impl 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.set_name(name); + ret.set_value(value); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"] + #[deprecated = "Use `set_value()` instead."] 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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioBuffer.rs b/crates/web-sys/src/features/gen_AudioBuffer.rs index 5f350bc6f64..38bf0b0d404 100644 --- a/crates/web-sys/src/features/gen_AudioBuffer.rs +++ b/crates/web-sys/src/features/gen_AudioBuffer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -64,12 +65,35 @@ extern "C" { #[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_f32_array( + this: &AudioBuffer, + destination: &::js_sys::Float32Array, + 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 = 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_f32_array_and_start_in_channel( + this: &AudioBuffer, + destination: &::js_sys::Float32Array, + 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 = ""] @@ -87,17 +111,43 @@ extern "C" { #[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_f32_array( + this: &AudioBuffer, + source: &::js_sys::Float32Array, + 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: &[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_with_f32_array_and_start_in_channel( + this: &AudioBuffer, + source: &::js_sys::Float32Array, + 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, JsValue>; + pub fn get_channel_data( + this: &AudioBuffer, + channel: u32, + ) -> Result<::alloc::vec::Vec, JsValue>; } diff --git a/crates/web-sys/src/features/gen_AudioBufferOptions.rs b/crates/web-sys/src/features/gen_AudioBufferOptions.rs index dfa7f46eda2..c05257fe91b 100644 --- a/crates/web-sys/src/features/gen_AudioBufferOptions.rs +++ b/crates/web-sys/src/features/gen_AudioBufferOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] pub type AudioBufferOptions; + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &AudioBufferOptions) -> u32; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &AudioBufferOptions, val: u32); + #[doc = "Get the `numberOfChannels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] + #[wasm_bindgen(method, getter = "numberOfChannels")] + pub fn get_number_of_channels(this: &AudioBufferOptions) -> Option; + #[doc = "Change the `numberOfChannels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] + #[wasm_bindgen(method, setter = "numberOfChannels")] + pub fn set_number_of_channels(this: &AudioBufferOptions, val: u32); + #[doc = "Get the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] + #[wasm_bindgen(method, getter = "sampleRate")] + pub fn get_sample_rate(this: &AudioBufferOptions) -> f32; + #[doc = "Change the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] + #[wasm_bindgen(method, setter = "sampleRate")] + pub fn set_sample_rate(this: &AudioBufferOptions, val: f32); } impl AudioBufferOptions { #[doc = "Construct a new `AudioBufferOptions`."] @@ -17,56 +48,23 @@ impl 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.set_length(length); + ret.set_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`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } - #[doc = "Change the `numberOfChannels` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] + #[deprecated = "Use `set_number_of_channels()` instead."] 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.set_number_of_channels(val); self } - #[doc = "Change the `sampleRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"] + #[deprecated = "Use `set_sample_rate()` instead."] 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.set_sample_rate(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioBufferSourceNode.rs b/crates/web-sys/src/features/gen_AudioBufferSourceNode.rs index e6cd32e1a96..5b3d41f1425 100644 --- a/crates/web-sys/src/features/gen_AudioBufferSourceNode.rs +++ b/crates/web-sys/src/features/gen_AudioBufferSourceNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -91,6 +92,7 @@ extern "C" { #[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`*"] + #[deprecated] 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."] @@ -98,6 +100,7 @@ extern "C" { #[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`*"] + #[deprecated] pub fn set_onended(this: &AudioBufferSourceNode, value: Option<&::js_sys::Function>); #[cfg(feature = "BaseAudioContext")] #[wasm_bindgen(catch, constructor, js_class = "AudioBufferSourceNode")] @@ -141,7 +144,7 @@ extern "C" { pub fn start_with_when_and_grain_offset( this: &AudioBufferSourceNode, when: f64, - grain_offset: f64, + offset: f64, ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start)] #[doc = "The `start()` method."] @@ -152,8 +155,8 @@ extern "C" { pub fn start_with_when_and_grain_offset_and_grain_duration( this: &AudioBufferSourceNode, when: f64, - grain_offset: f64, - grain_duration: f64, + offset: f64, + duration: f64, ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = stop)] #[doc = "The `stop()` method."] @@ -161,6 +164,7 @@ extern "C" { #[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`*"] + #[deprecated] pub fn stop(this: &AudioBufferSourceNode) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = stop)] #[doc = "The `stop()` method."] @@ -168,5 +172,6 @@ extern "C" { #[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`*"] + #[deprecated] pub fn stop_with_when(this: &AudioBufferSourceNode, when: f64) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_AudioBufferSourceOptions.rs b/crates/web-sys/src/features/gen_AudioBufferSourceOptions.rs index e8a0f2f83a4..7c470f0b5de 100644 --- a/crates/web-sys/src/features/gen_AudioBufferSourceOptions.rs +++ b/crates/web-sys/src/features/gen_AudioBufferSourceOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,68 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] pub type AudioBufferSourceOptions; + #[cfg(feature = "AudioBuffer")] + #[doc = "Get the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, getter = "buffer")] + pub fn get_buffer(this: &AudioBufferSourceOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "buffer")] + pub fn set_buffer(this: &AudioBufferSourceOptions, val: Option<&AudioBuffer>); + #[doc = "Get the `detune` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, getter = "detune")] + pub fn get_detune(this: &AudioBufferSourceOptions) -> Option; + #[doc = "Change the `detune` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, setter = "detune")] + pub fn set_detune(this: &AudioBufferSourceOptions, val: f32); + #[doc = "Get the `loop` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, getter = "loop")] + pub fn get_loop(this: &AudioBufferSourceOptions) -> Option; + #[doc = "Change the `loop` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, setter = "loop")] + pub fn set_loop(this: &AudioBufferSourceOptions, val: bool); + #[doc = "Get the `loopEnd` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, getter = "loopEnd")] + pub fn get_loop_end(this: &AudioBufferSourceOptions) -> Option; + #[doc = "Change the `loopEnd` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, setter = "loopEnd")] + pub fn set_loop_end(this: &AudioBufferSourceOptions, val: f64); + #[doc = "Get the `loopStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, getter = "loopStart")] + pub fn get_loop_start(this: &AudioBufferSourceOptions) -> Option; + #[doc = "Change the `loopStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, setter = "loopStart")] + pub fn set_loop_start(this: &AudioBufferSourceOptions, val: f64); + #[doc = "Get the `playbackRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, getter = "playbackRate")] + pub fn get_playback_rate(this: &AudioBufferSourceOptions) -> Option; + #[doc = "Change the `playbackRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[wasm_bindgen(method, setter = "playbackRate")] + pub fn set_playback_rate(this: &AudioBufferSourceOptions, val: f32); } impl AudioBufferSourceOptions { #[doc = "Construct a new `AudioBufferSourceOptions`."] @@ -20,96 +83,34 @@ impl AudioBufferSourceOptions { 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`*"] + #[deprecated = "Use `set_buffer()` instead."] 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.set_buffer(val); self } - #[doc = "Change the `detune` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[deprecated = "Use `set_detune()` instead."] 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.set_detune(val); self } - #[doc = "Change the `loop` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[deprecated = "Use `set_loop()` instead."] 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.set_loop(val); self } - #[doc = "Change the `loopEnd` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[deprecated = "Use `set_loop_end()` instead."] 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.set_loop_end(val); self } - #[doc = "Change the `loopStart` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[deprecated = "Use `set_loop_start()` instead."] 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.set_loop_start(val); self } - #[doc = "Change the `playbackRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"] + #[deprecated = "Use `set_playback_rate()` instead."] 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.set_playback_rate(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioConfiguration.rs b/crates/web-sys/src/features/gen_AudioConfiguration.rs index 600464d9bc7..fa0af991c4a 100644 --- a/crates/web-sys/src/features/gen_AudioConfiguration.rs +++ b/crates/web-sys/src/features/gen_AudioConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] pub type AudioConfiguration; + #[doc = "Get the `bitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[wasm_bindgen(method, getter = "bitrate")] + pub fn get_bitrate(this: &AudioConfiguration) -> Option; + #[doc = "Change the `bitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[wasm_bindgen(method, setter = "bitrate")] + pub fn set_bitrate(this: &AudioConfiguration, val: f64); + #[doc = "Get the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[wasm_bindgen(method, getter = "channels")] + pub fn get_channels(this: &AudioConfiguration) -> Option<::alloc::string::String>; + #[doc = "Change the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[wasm_bindgen(method, setter = "channels")] + pub fn set_channels(this: &AudioConfiguration, val: &str); + #[doc = "Get the `contentType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[wasm_bindgen(method, getter = "contentType")] + pub fn get_content_type(this: &AudioConfiguration) -> Option<::alloc::string::String>; + #[doc = "Change the `contentType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[wasm_bindgen(method, setter = "contentType")] + pub fn set_content_type(this: &AudioConfiguration, val: &str); + #[doc = "Get the `samplerate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[wasm_bindgen(method, getter = "samplerate")] + pub fn get_samplerate(this: &AudioConfiguration) -> Option; + #[doc = "Change the `samplerate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[wasm_bindgen(method, setter = "samplerate")] + pub fn set_samplerate(this: &AudioConfiguration, val: u32); } impl AudioConfiguration { #[doc = "Construct a new `AudioConfiguration`."] @@ -19,72 +60,24 @@ impl AudioConfiguration { 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`*"] + #[deprecated = "Use `set_bitrate()` instead."] 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.set_bitrate(val); self } - #[doc = "Change the `channels` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[deprecated = "Use `set_channels()` instead."] 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.set_channels(val); self } - #[doc = "Change the `contentType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[deprecated = "Use `set_content_type()` instead."] 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.set_content_type(val); self } - #[doc = "Change the `samplerate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"] + #[deprecated = "Use `set_samplerate()` instead."] 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.set_samplerate(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioContext.rs b/crates/web-sys/src/features/gen_AudioContext.rs index 2fc35092c65..95d16bfa8e9 100644 --- a/crates/web-sys/src/features/gen_AudioContext.rs +++ b/crates/web-sys/src/features/gen_AudioContext.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -11,6 +12,39 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"] pub type AudioContext; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "AudioContext" , js_name = sinkId)] + #[doc = "Getter for the `sinkId` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/sinkId)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn sink_id(this: &AudioContext) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "AudioContext" , js_name = onsinkchange)] + #[doc = "Getter for the `onsinkchange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onsinkchange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onsinkchange(this: &AudioContext) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "AudioContext" , js_name = onsinkchange)] + #[doc = "Setter for the `onsinkchange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onsinkchange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onsinkchange(this: &AudioContext, value: Option<&::js_sys::Function>); #[cfg(feature = "AudioDestinationNode")] # [wasm_bindgen (structural , method , getter , js_class = "AudioContext" , js_name = destination)] #[doc = "Getter for the `destination` field of this object."] @@ -127,6 +161,32 @@ extern "C" { this: &AudioContext, media_stream: &MediaStream, ) -> Result; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "AudioContext" , js_name = setSinkId)] + #[doc = "The `setSinkId()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_sink_id_with_str(this: &AudioContext, sink_id: &str) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSinkOptions")] + # [wasm_bindgen (method , structural , js_class = "AudioContext" , js_name = setSinkId)] + #[doc = "The `setSinkId()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioSinkOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_sink_id_with_audio_sink_options( + this: &AudioContext, + sink_id: &AudioSinkOptions, + ) -> ::js_sys::Promise; # [wasm_bindgen (catch , method , structural , js_class = "AudioContext" , js_name = suspend)] #[doc = "The `suspend()` method."] #[doc = ""] @@ -302,6 +362,42 @@ extern "C" { real: &mut [f32], imag: &mut [f32], ) -> Result; + #[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_with_f32_array_and_f32_slice( + this: &AudioContext, + real: &::js_sys::Float32Array, + imag: &mut [f32], + ) -> Result; + #[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_with_f32_slice_and_f32_array( + this: &AudioContext, + real: &mut [f32], + imag: &::js_sys::Float32Array, + ) -> Result; + #[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_with_f32_array_and_f32_array( + this: &AudioContext, + real: &::js_sys::Float32Array, + imag: &::js_sys::Float32Array, + ) -> Result; #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))] # [wasm_bindgen (catch , method , structural , js_class = "AudioContext" , js_name = createPeriodicWave)] #[doc = "The `createPeriodicWave()` method."] @@ -315,6 +411,45 @@ extern "C" { imag: &mut [f32], constraints: &PeriodicWaveConstraints, ) -> Result; + #[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_f32_array_and_f32_slice_and_constraints( + this: &AudioContext, + real: &::js_sys::Float32Array, + imag: &mut [f32], + constraints: &PeriodicWaveConstraints, + ) -> Result; + #[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_f32_slice_and_f32_array_and_constraints( + this: &AudioContext, + real: &mut [f32], + imag: &::js_sys::Float32Array, + constraints: &PeriodicWaveConstraints, + ) -> Result; + #[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_f32_array_and_f32_array_and_constraints( + this: &AudioContext, + real: &::js_sys::Float32Array, + imag: &::js_sys::Float32Array, + constraints: &PeriodicWaveConstraints, + ) -> Result; #[cfg(feature = "ScriptProcessorNode")] # [wasm_bindgen (catch , method , structural , js_class = "AudioContext" , js_name = createScriptProcessor)] #[doc = "The `createScriptProcessor()` method."] diff --git a/crates/web-sys/src/features/gen_AudioContextLatencyCategory.rs b/crates/web-sys/src/features/gen_AudioContextLatencyCategory.rs new file mode 100644 index 00000000000..c0842efa94a --- /dev/null +++ b/crates/web-sys/src/features/gen_AudioContextLatencyCategory.rs @@ -0,0 +1,13 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `AudioContextLatencyCategory` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `AudioContextLatencyCategory`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum AudioContextLatencyCategory { + Balanced = "balanced", + Interactive = "interactive", + Playback = "playback", +} diff --git a/crates/web-sys/src/features/gen_AudioContextOptions.rs b/crates/web-sys/src/features/gen_AudioContextOptions.rs index 6583853de29..1ca0ae1e9f8 100644 --- a/crates/web-sys/src/features/gen_AudioContextOptions.rs +++ b/crates/web-sys/src/features/gen_AudioContextOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,44 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] pub type AudioContextOptions; + #[doc = "Get the `latencyHint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] + #[wasm_bindgen(method, getter = "latencyHint")] + pub fn get_latency_hint(this: &AudioContextOptions) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `latencyHint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] + #[wasm_bindgen(method, setter = "latencyHint")] + pub fn set_latency_hint(this: &AudioContextOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] + #[wasm_bindgen(method, getter = "sampleRate")] + pub fn get_sample_rate(this: &AudioContextOptions) -> Option; + #[doc = "Change the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] + #[wasm_bindgen(method, setter = "sampleRate")] + pub fn set_sample_rate(this: &AudioContextOptions, val: f32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sinkId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sinkId")] + pub fn get_sink_id(this: &AudioContextOptions) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `sinkId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sinkId")] + pub fn set_sink_id(this: &AudioContextOptions, val: &::wasm_bindgen::JsValue); } impl AudioContextOptions { #[doc = "Construct a new `AudioContextOptions`."] @@ -19,21 +58,20 @@ impl AudioContextOptions { 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`*"] + #[deprecated = "Use `set_latency_hint()` instead."] + pub fn latency_hint(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_latency_hint(val); + self + } + #[deprecated = "Use `set_sample_rate()` instead."] 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.set_sample_rate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sink_id()` instead."] + pub fn sink_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_sink_id(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioContextState.rs b/crates/web-sys/src/features/gen_AudioContextState.rs index 95ab2ca1a5b..4d15fd86aec 100644 --- a/crates/web-sys/src/features/gen_AudioContextState.rs +++ b/crates/web-sys/src/features/gen_AudioContextState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `AudioContextState` enum."] diff --git a/crates/web-sys/src/features/gen_AudioData.rs b/crates/web-sys/src/features/gen_AudioData.rs index 0bd91f4a938..3cc08dd7e70 100644 --- a/crates/web-sys/src/features/gen_AudioData.rs +++ b/crates/web-sys/src/features/gen_AudioData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -96,7 +97,7 @@ extern "C" { pub fn new(init: &AudioDataInit) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioDataCopyToOptions")] - # [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = allocationSize)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = allocationSize)] #[doc = "The `allocationSize()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/allocationSize)"] @@ -105,9 +106,12 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn allocation_size(this: &AudioData, options: &AudioDataCopyToOptions) -> u32; + pub fn allocation_size( + this: &AudioData, + options: &AudioDataCopyToOptions, + ) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = clone)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = clone)] #[doc = "The `clone()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/clone)"] @@ -116,7 +120,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn clone(this: &AudioData) -> AudioData; + pub fn clone(this: &AudioData) -> Result; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = close)] #[doc = "The `close()` method."] @@ -130,7 +134,7 @@ extern "C" { pub fn close(this: &AudioData); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioDataCopyToOptions")] - # [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = copyTo)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = copyTo)] #[doc = "The `copyTo()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/copyTo)"] @@ -143,10 +147,10 @@ extern "C" { this: &AudioData, destination: &::js_sys::Object, options: &AudioDataCopyToOptions, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioDataCopyToOptions")] - # [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = copyTo)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = copyTo)] #[doc = "The `copyTo()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/copyTo)"] @@ -155,9 +159,25 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn copy_to_with_u8_array( + pub fn copy_to_with_u8_slice( this: &AudioData, destination: &mut [u8], options: &AudioDataCopyToOptions, - ); + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioDataCopyToOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "AudioData" , js_name = copyTo)] + #[doc = "The `copyTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/copyTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioData`, `AudioDataCopyToOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_to_with_u8_array( + this: &AudioData, + destination: &::js_sys::Uint8Array, + options: &AudioDataCopyToOptions, + ) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs b/crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs index b1d3d8fbd44..d83c1b47760 100644 --- a/crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs +++ b/crates/web-sys/src/features/gen_AudioDataCopyToOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AudioDataCopyToOptions; -} -#[cfg(web_sys_unstable_apis)] -impl AudioDataCopyToOptions { - #[doc = "Construct a new `AudioDataCopyToOptions`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSampleFormat")] + #[doc = "Get the `format` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioDataCopyToOptions`*"] + #[doc = "*This API requires the following crate features to be activated: `AudioDataCopyToOptions`, `AudioSampleFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(plane_index: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.plane_index(plane_index); - ret - } + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &AudioDataCopyToOptions) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioSampleFormat")] #[doc = "Change the `format` field of this object."] @@ -36,17 +32,17 @@ impl AudioDataCopyToOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: AudioSampleFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &AudioDataCopyToOptions, val: AudioSampleFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `frameCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataCopyToOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "frameCount")] + pub fn get_frame_count(this: &AudioDataCopyToOptions) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `frameCount` field of this object."] #[doc = ""] @@ -54,20 +50,17 @@ impl AudioDataCopyToOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn frame_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "frameCount")] + pub fn set_frame_count(this: &AudioDataCopyToOptions, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `frameOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataCopyToOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "frameOffset")] + pub fn get_frame_offset(this: &AudioDataCopyToOptions) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `frameOffset` field of this object."] #[doc = ""] @@ -75,20 +68,17 @@ impl AudioDataCopyToOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn frame_offset(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameOffset"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "frameOffset")] + pub fn set_frame_offset(this: &AudioDataCopyToOptions, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `planeIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataCopyToOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "planeIndex")] + pub fn get_plane_index(this: &AudioDataCopyToOptions) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `planeIndex` field of this object."] #[doc = ""] @@ -96,18 +86,46 @@ impl AudioDataCopyToOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "planeIndex")] + pub fn set_plane_index(this: &AudioDataCopyToOptions, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl AudioDataCopyToOptions { + #[doc = "Construct a new `AudioDataCopyToOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataCopyToOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(plane_index: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_plane_index(plane_index); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSampleFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: AudioSampleFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_frame_count()` instead."] + pub fn frame_count(&mut self, val: u32) -> &mut Self { + self.set_frame_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_frame_offset()` instead."] + pub fn frame_offset(&mut self, val: u32) -> &mut Self { + self.set_frame_offset(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_plane_index()` instead."] pub fn plane_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("planeIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_plane_index(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDataInit.rs b/crates/web-sys/src/features/gen_AudioDataInit.rs index 8a7dc94225e..251b10110e6 100644 --- a/crates/web-sys/src/features/gen_AudioDataInit.rs +++ b/crates/web-sys/src/features/gen_AudioDataInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,34 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AudioDataInit; -} -#[cfg(web_sys_unstable_apis)] -impl AudioDataInit { - #[cfg(feature = "AudioSampleFormat")] - #[doc = "Construct a new `AudioDataInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `data` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`, `AudioSampleFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new( - data: &::js_sys::Object, - format: AudioSampleFormat, - number_of_channels: u32, - number_of_frames: u32, - sample_rate: f32, - timestamp: f64, - ) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.data(data); - ret.format(format); - ret.number_of_channels(number_of_channels); - ret.number_of_frames(number_of_frames); - ret.sample_rate(sample_rate); - ret.timestamp(timestamp); - ret - } + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &AudioDataInit) -> ::js_sys::Object; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `data` field of this object."] #[doc = ""] @@ -48,16 +30,18 @@ impl AudioDataInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn data(&mut self, val: &::js_sys::Object) -> &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 - } + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &AudioDataInit, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSampleFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`, `AudioSampleFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &AudioDataInit) -> AudioSampleFormat; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioSampleFormat")] #[doc = "Change the `format` field of this object."] @@ -66,17 +50,17 @@ impl AudioDataInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: AudioSampleFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &AudioDataInit, val: AudioSampleFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `numberOfChannels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "numberOfChannels")] + pub fn get_number_of_channels(this: &AudioDataInit) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `numberOfChannels` field of this object."] #[doc = ""] @@ -84,20 +68,17 @@ impl AudioDataInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "numberOfChannels")] + pub fn set_number_of_channels(this: &AudioDataInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `numberOfFrames` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "numberOfFrames")] + pub fn get_number_of_frames(this: &AudioDataInit) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `numberOfFrames` field of this object."] #[doc = ""] @@ -105,20 +86,17 @@ impl AudioDataInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn number_of_frames(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("numberOfFrames"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "numberOfFrames")] + pub fn set_number_of_frames(this: &AudioDataInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleRate")] + pub fn get_sample_rate(this: &AudioDataInit) -> f32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `sampleRate` field of this object."] #[doc = ""] @@ -126,20 +104,17 @@ impl AudioDataInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "sampleRate")] + pub fn set_sample_rate(this: &AudioDataInit, val: f32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &AudioDataInit) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `timestamp` field of this object."] #[doc = ""] @@ -147,18 +122,71 @@ impl AudioDataInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &AudioDataInit, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl AudioDataInit { + #[cfg(feature = "AudioSampleFormat")] + #[doc = "Construct a new `AudioDataInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDataInit`, `AudioSampleFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + data: &::js_sys::Object, + format: AudioSampleFormat, + number_of_channels: u32, + number_of_frames: u32, + sample_rate: f32, + timestamp: f64, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_data(data); + ret.set_format(format); + ret.set_number_of_channels(number_of_channels); + ret.set_number_of_frames(number_of_frames); + ret.set_sample_rate(sample_rate); + ret.set_timestamp(timestamp); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data()` instead."] + pub fn data(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSampleFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: AudioSampleFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_number_of_channels()` instead."] + pub fn number_of_channels(&mut self, val: u32) -> &mut Self { + self.set_number_of_channels(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_number_of_frames()` instead."] + pub fn number_of_frames(&mut self, val: u32) -> &mut Self { + self.set_number_of_frames(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sample_rate()` instead."] + pub fn sample_rate(&mut self, val: f32) -> &mut Self { + self.set_sample_rate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDecoder.rs b/crates/web-sys/src/features/gen_AudioDecoder.rs index b448dc2f139..5482b063269 100644 --- a/crates/web-sys/src/features/gen_AudioDecoder.rs +++ b/crates/web-sys/src/features/gen_AudioDecoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -51,7 +52,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(init: &AudioDecoderInit) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = close)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioDecoder" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/close)"] @@ -60,10 +61,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn close(this: &AudioDecoder); + pub fn close(this: &AudioDecoder) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioDecoderConfig")] - # [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = configure)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioDecoder" , js_name = configure)] #[doc = "The `configure()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/configure)"] @@ -72,10 +73,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn configure(this: &AudioDecoder, config: &AudioDecoderConfig); + pub fn configure(this: &AudioDecoder, config: &AudioDecoderConfig) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "EncodedAudioChunk")] - # [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = decode)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioDecoder" , js_name = decode)] #[doc = "The `decode()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/decode)"] @@ -84,7 +85,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn decode(this: &AudioDecoder, chunk: &EncodedAudioChunk); + pub fn decode(this: &AudioDecoder, chunk: &EncodedAudioChunk) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = flush)] #[doc = "The `flush()` method."] @@ -101,7 +102,7 @@ extern "C" { # [wasm_bindgen (static_method_of = AudioDecoder , js_class = "AudioDecoder" , js_name = isConfigSupported)] #[doc = "The `isConfigSupported()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/isConfigSupported)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/isConfigSupported_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioDecoder`, `AudioDecoderConfig`*"] #[doc = ""] @@ -109,7 +110,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn is_config_supported(config: &AudioDecoderConfig) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = reset)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioDecoder" , js_name = reset)] #[doc = "The `reset()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/reset)"] @@ -118,5 +119,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn reset(this: &AudioDecoder); + pub fn reset(this: &AudioDecoder) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_AudioDecoderConfig.rs b/crates/web-sys/src/features/gen_AudioDecoderConfig.rs index 2ba30966fee..fb0931e3cfc 100644 --- a/crates/web-sys/src/features/gen_AudioDecoderConfig.rs +++ b/crates/web-sys/src/features/gen_AudioDecoderConfig.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,23 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AudioDecoderConfig; -} -#[cfg(web_sys_unstable_apis)] -impl AudioDecoderConfig { - #[doc = "Construct a new `AudioDecoderConfig`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `codec` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(codec: &str, number_of_channels: u32, sample_rate: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.codec(codec); - ret.number_of_channels(number_of_channels); - ret.sample_rate(sample_rate); - ret - } + #[wasm_bindgen(method, getter = "codec")] + pub fn get_codec(this: &AudioDecoderConfig) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `codec` field of this object."] #[doc = ""] @@ -37,16 +30,17 @@ impl AudioDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "codec")] + pub fn set_codec(this: &AudioDecoderConfig, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "description")] + pub fn get_description(this: &AudioDecoderConfig) -> Option<::js_sys::Object>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `description` field of this object."] #[doc = ""] @@ -54,20 +48,17 @@ impl AudioDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn description(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "description")] + pub fn set_description(this: &AudioDecoderConfig, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `numberOfChannels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "numberOfChannels")] + pub fn get_number_of_channels(this: &AudioDecoderConfig) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `numberOfChannels` field of this object."] #[doc = ""] @@ -75,20 +66,17 @@ impl AudioDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "numberOfChannels")] + pub fn set_number_of_channels(this: &AudioDecoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleRate")] + pub fn get_sample_rate(this: &AudioDecoderConfig) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `sampleRate` field of this object."] #[doc = ""] @@ -96,18 +84,47 @@ impl AudioDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sampleRate")] + pub fn set_sample_rate(this: &AudioDecoderConfig, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl AudioDecoderConfig { + #[doc = "Construct a new `AudioDecoderConfig`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(codec: &str, number_of_channels: u32, sample_rate: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_codec(codec); + ret.set_number_of_channels(number_of_channels); + ret.set_sample_rate(sample_rate); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_codec()` instead."] + pub fn codec(&mut self, val: &str) -> &mut Self { + self.set_codec(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_description()` instead."] + pub fn description(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_description(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_number_of_channels()` instead."] + pub fn number_of_channels(&mut self, val: u32) -> &mut Self { + self.set_number_of_channels(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sample_rate()` instead."] pub fn sample_rate(&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.set_sample_rate(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDecoderInit.rs b/crates/web-sys/src/features/gen_AudioDecoderInit.rs index d5149efd7a1..efdd030a82a 100644 --- a/crates/web-sys/src/features/gen_AudioDecoderInit.rs +++ b/crates/web-sys/src/features/gen_AudioDecoderInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AudioDecoderInit; -} -#[cfg(web_sys_unstable_apis)] -impl AudioDecoderInit { - #[doc = "Construct a new `AudioDecoderInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `error` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioDecoderInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(error: &::js_sys::Function, output: &::js_sys::Function) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.error(error); - ret.output(output); - ret - } + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &AudioDecoderInit) -> ::js_sys::Function; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `error` field of this object."] #[doc = ""] @@ -36,16 +30,17 @@ impl AudioDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn error(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &AudioDecoderInit, val: &::js_sys::Function); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `output` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "output")] + pub fn get_output(this: &AudioDecoderInit) -> ::js_sys::Function; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `output` field of this object."] #[doc = ""] @@ -53,15 +48,34 @@ impl AudioDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "output")] + pub fn set_output(this: &AudioDecoderInit, val: &::js_sys::Function); +} +#[cfg(web_sys_unstable_apis)] +impl AudioDecoderInit { + #[doc = "Construct a new `AudioDecoderInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(error: &::js_sys::Function, output: &::js_sys::Function) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_error(error); + ret.set_output(output); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_error()` instead."] + pub fn error(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_error(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_output()` instead."] pub fn output(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("output"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_output(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDecoderSupport.rs b/crates/web-sys/src/features/gen_AudioDecoderSupport.rs index 3640403e1df..eb1a3fa72cc 100644 --- a/crates/web-sys/src/features/gen_AudioDecoderSupport.rs +++ b/crates/web-sys/src/features/gen_AudioDecoderSupport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,44 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AudioDecoderSupport; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioDecoderConfig")] + #[doc = "Get the `config` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`, `AudioDecoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "config")] + pub fn get_config(this: &AudioDecoderSupport) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioDecoderConfig")] + #[doc = "Change the `config` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`, `AudioDecoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "config")] + pub fn set_config(this: &AudioDecoderSupport, val: &AudioDecoderConfig); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "supported")] + pub fn get_supported(this: &AudioDecoderSupport) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "supported")] + pub fn set_supported(this: &AudioDecoderSupport, val: bool); } #[cfg(web_sys_unstable_apis)] impl AudioDecoderSupport { @@ -29,42 +68,15 @@ impl AudioDecoderSupport { } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioDecoderConfig")] - #[doc = "Change the `config` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`, `AudioDecoderSupport`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_config()` instead."] pub fn config(&mut self, val: &AudioDecoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("config"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_config(val); self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `supported` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioDecoderSupport`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_supported()` instead."] pub fn supported(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supported"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_supported(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioDestinationNode.rs b/crates/web-sys/src/features/gen_AudioDestinationNode.rs index a6f79cffcdf..ad06d3e42bb 100644 --- a/crates/web-sys/src/features/gen_AudioDestinationNode.rs +++ b/crates/web-sys/src/features/gen_AudioDestinationNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioEncoder.rs b/crates/web-sys/src/features/gen_AudioEncoder.rs index 244e997070c..5d00c15abab 100644 --- a/crates/web-sys/src/features/gen_AudioEncoder.rs +++ b/crates/web-sys/src/features/gen_AudioEncoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -51,7 +52,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(init: &AudioEncoderInit) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = close)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioEncoder" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/close)"] @@ -60,10 +61,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn close(this: &AudioEncoder); + pub fn close(this: &AudioEncoder) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioEncoderConfig")] - # [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = configure)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioEncoder" , js_name = configure)] #[doc = "The `configure()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/configure)"] @@ -72,10 +73,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn configure(this: &AudioEncoder, config: &AudioEncoderConfig); + pub fn configure(this: &AudioEncoder, config: &AudioEncoderConfig) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioData")] - # [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = encode)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioEncoder" , js_name = encode)] #[doc = "The `encode()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/encode)"] @@ -84,7 +85,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn encode(this: &AudioEncoder, data: &AudioData); + pub fn encode(this: &AudioEncoder, data: &AudioData) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = flush)] #[doc = "The `flush()` method."] @@ -101,7 +102,7 @@ extern "C" { # [wasm_bindgen (static_method_of = AudioEncoder , js_class = "AudioEncoder" , js_name = isConfigSupported)] #[doc = "The `isConfigSupported()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/isConfigSupported)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/isConfigSupported_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioEncoder`, `AudioEncoderConfig`*"] #[doc = ""] @@ -109,7 +110,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn is_config_supported(config: &AudioEncoderConfig) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = reset)] + # [wasm_bindgen (catch , method , structural , js_class = "AudioEncoder" , js_name = reset)] #[doc = "The `reset()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/reset)"] @@ -118,5 +119,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn reset(this: &AudioEncoder); + pub fn reset(this: &AudioEncoder) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_AudioEncoderConfig.rs b/crates/web-sys/src/features/gen_AudioEncoderConfig.rs index 49194678c0f..4553ce74ec4 100644 --- a/crates/web-sys/src/features/gen_AudioEncoderConfig.rs +++ b/crates/web-sys/src/features/gen_AudioEncoderConfig.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AudioEncoderConfig; -} -#[cfg(web_sys_unstable_apis)] -impl AudioEncoderConfig { - #[doc = "Construct a new `AudioEncoderConfig`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bitrate` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(codec: &str) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.codec(codec); - ret - } + #[wasm_bindgen(method, getter = "bitrate")] + pub fn get_bitrate(this: &AudioEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bitrate` field of this object."] #[doc = ""] @@ -35,20 +30,17 @@ impl AudioEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bitrate")] + pub fn set_bitrate(this: &AudioEncoderConfig, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `codec` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "codec")] + pub fn get_codec(this: &AudioEncoderConfig) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `codec` field of this object."] #[doc = ""] @@ -56,16 +48,17 @@ impl AudioEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "codec")] + pub fn set_codec(this: &AudioEncoderConfig, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `numberOfChannels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "numberOfChannels")] + pub fn get_number_of_channels(this: &AudioEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `numberOfChannels` field of this object."] #[doc = ""] @@ -73,20 +66,17 @@ impl AudioEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "numberOfChannels")] + pub fn set_number_of_channels(this: &AudioEncoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleRate")] + pub fn get_sample_rate(this: &AudioEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `sampleRate` field of this object."] #[doc = ""] @@ -94,18 +84,45 @@ impl AudioEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sampleRate")] + pub fn set_sample_rate(this: &AudioEncoderConfig, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl AudioEncoderConfig { + #[doc = "Construct a new `AudioEncoderConfig`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(codec: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_codec(codec); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bitrate()` instead."] + pub fn bitrate(&mut self, val: f64) -> &mut Self { + self.set_bitrate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_codec()` instead."] + pub fn codec(&mut self, val: &str) -> &mut Self { + self.set_codec(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_number_of_channels()` instead."] + pub fn number_of_channels(&mut self, val: u32) -> &mut Self { + self.set_number_of_channels(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sample_rate()` instead."] pub fn sample_rate(&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.set_sample_rate(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioEncoderInit.rs b/crates/web-sys/src/features/gen_AudioEncoderInit.rs index dba313bb419..7aa036edcda 100644 --- a/crates/web-sys/src/features/gen_AudioEncoderInit.rs +++ b/crates/web-sys/src/features/gen_AudioEncoderInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AudioEncoderInit; -} -#[cfg(web_sys_unstable_apis)] -impl AudioEncoderInit { - #[doc = "Construct a new `AudioEncoderInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `error` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioEncoderInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(error: &::js_sys::Function, output: &::js_sys::Function) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.error(error); - ret.output(output); - ret - } + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &AudioEncoderInit) -> ::js_sys::Function; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `error` field of this object."] #[doc = ""] @@ -36,16 +30,17 @@ impl AudioEncoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn error(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &AudioEncoderInit, val: &::js_sys::Function); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `output` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "output")] + pub fn get_output(this: &AudioEncoderInit) -> ::js_sys::Function; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `output` field of this object."] #[doc = ""] @@ -53,15 +48,34 @@ impl AudioEncoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "output")] + pub fn set_output(this: &AudioEncoderInit, val: &::js_sys::Function); +} +#[cfg(web_sys_unstable_apis)] +impl AudioEncoderInit { + #[doc = "Construct a new `AudioEncoderInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(error: &::js_sys::Function, output: &::js_sys::Function) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_error(error); + ret.set_output(output); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_error()` instead."] + pub fn error(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_error(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_output()` instead."] pub fn output(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("output"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_output(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioEncoderSupport.rs b/crates/web-sys/src/features/gen_AudioEncoderSupport.rs index 0c7987bc6ce..20399d86524 100644 --- a/crates/web-sys/src/features/gen_AudioEncoderSupport.rs +++ b/crates/web-sys/src/features/gen_AudioEncoderSupport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,44 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type AudioEncoderSupport; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioEncoderConfig")] + #[doc = "Get the `config` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`, `AudioEncoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "config")] + pub fn get_config(this: &AudioEncoderSupport) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioEncoderConfig")] + #[doc = "Change the `config` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`, `AudioEncoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "config")] + pub fn set_config(this: &AudioEncoderSupport, val: &AudioEncoderConfig); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "supported")] + pub fn get_supported(this: &AudioEncoderSupport) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioEncoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "supported")] + pub fn set_supported(this: &AudioEncoderSupport, val: bool); } #[cfg(web_sys_unstable_apis)] impl AudioEncoderSupport { @@ -29,42 +68,15 @@ impl AudioEncoderSupport { } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioEncoderConfig")] - #[doc = "Change the `config` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`, `AudioEncoderSupport`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_config()` instead."] pub fn config(&mut self, val: &AudioEncoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("config"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_config(val); self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `supported` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioEncoderSupport`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_supported()` instead."] pub fn supported(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supported"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_supported(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioListener.rs b/crates/web-sys/src/features/gen_AudioListener.rs index 1dfdfbeea01..baaa72c9c9f 100644 --- a/crates/web-sys/src/features/gen_AudioListener.rs +++ b/crates/web-sys/src/features/gen_AudioListener.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioNode.rs b/crates/web-sys/src/features/gen_AudioNode.rs index bec7aa9393e..9d1ee99cabf 100644 --- a/crates/web-sys/src/features/gen_AudioNode.rs +++ b/crates/web-sys/src/features/gen_AudioNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioNodeOptions.rs b/crates/web-sys/src/features/gen_AudioNodeOptions.rs index b898ea3feee..84c6ab32872 100644 --- a/crates/web-sys/src/features/gen_AudioNodeOptions.rs +++ b/crates/web-sys/src/features/gen_AudioNodeOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,40 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`*"] pub type AudioNodeOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &AudioNodeOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &AudioNodeOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`, `ChannelCountMode`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &AudioNodeOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &AudioNodeOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`, `ChannelInterpretation`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &AudioNodeOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &AudioNodeOptions, val: ChannelInterpretation); } impl AudioNodeOptions { #[doc = "Construct a new `AudioNodeOptions`."] @@ -19,57 +54,21 @@ impl AudioNodeOptions { 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`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); 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`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); 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`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioParam.rs b/crates/web-sys/src/features/gen_AudioParam.rs index 6cd0e1cd6b7..8c5e9f94b99 100644 --- a/crates/web-sys/src/features/gen_AudioParam.rs +++ b/crates/web-sys/src/features/gen_AudioParam.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -113,4 +114,16 @@ extern "C" { start_time: f64, duration: f64, ) -> Result; + # [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_with_f32_array( + this: &AudioParam, + values: &::js_sys::Float32Array, + start_time: f64, + duration: f64, + ) -> Result; } diff --git a/crates/web-sys/src/features/gen_AudioParamMap.rs b/crates/web-sys/src/features/gen_AudioParamMap.rs index 02c3953081d..9b7119878e0 100644 --- a/crates/web-sys/src/features/gen_AudioParamMap.rs +++ b/crates/web-sys/src/features/gen_AudioParamMap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -11,4 +12,54 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioParamMap`*"] pub type AudioParamMap; + # [wasm_bindgen (structural , method , getter , js_class = "AudioParamMap" , 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/AudioParamMap/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioParamMap`*"] + pub fn size(this: &AudioParamMap) -> u32; + # [wasm_bindgen (method , structural , js_class = "AudioParamMap" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParamMap/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioParamMap`*"] + pub fn entries(this: &AudioParamMap) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "AudioParamMap" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParamMap/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioParamMap`*"] + pub fn for_each(this: &AudioParamMap, callback: &::js_sys::Function) -> Result<(), JsValue>; + #[cfg(feature = "AudioParam")] + # [wasm_bindgen (method , structural , js_class = "AudioParamMap" , js_name = get)] + #[doc = "The `get()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParamMap/get)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioParam`, `AudioParamMap`*"] + pub fn get(this: &AudioParamMap, key: &str) -> Option; + # [wasm_bindgen (method , structural , js_class = "AudioParamMap" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParamMap/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioParamMap`*"] + pub fn has(this: &AudioParamMap, key: &str) -> bool; + # [wasm_bindgen (method , structural , js_class = "AudioParamMap" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParamMap/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioParamMap`*"] + pub fn keys(this: &AudioParamMap) -> ::js_sys::Iterator; + # [wasm_bindgen (method , structural , js_class = "AudioParamMap" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParamMap/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioParamMap`*"] + pub fn values(this: &AudioParamMap) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_AudioProcessingEvent.rs b/crates/web-sys/src/features/gen_AudioProcessingEvent.rs index e1ed4bb018c..d9492d2b227 100644 --- a/crates/web-sys/src/features/gen_AudioProcessingEvent.rs +++ b/crates/web-sys/src/features/gen_AudioProcessingEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioSampleFormat.rs b/crates/web-sys/src/features/gen_AudioSampleFormat.rs index 54499890495..6c9c0d34ff8 100644 --- a/crates/web-sys/src/features/gen_AudioSampleFormat.rs +++ b/crates/web-sys/src/features/gen_AudioSampleFormat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioScheduledSourceNode.rs b/crates/web-sys/src/features/gen_AudioScheduledSourceNode.rs index 5c18efeed31..949c5853bb3 100644 --- a/crates/web-sys/src/features/gen_AudioScheduledSourceNode.rs +++ b/crates/web-sys/src/features/gen_AudioScheduledSourceNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -10,9 +11,7 @@ extern "C" { #[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 = ""] @@ -20,7 +19,6 @@ extern "C" { #[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 = ""] @@ -28,7 +26,6 @@ extern "C" { #[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 = ""] @@ -36,7 +33,6 @@ extern "C" { #[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 = ""] @@ -44,7 +40,6 @@ extern "C" { #[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 = ""] @@ -52,7 +47,6 @@ extern "C" { #[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 = ""] diff --git a/crates/web-sys/src/features/gen_AudioSinkInfo.rs b/crates/web-sys/src/features/gen_AudioSinkInfo.rs new file mode 100644 index 00000000000..fd539be1d81 --- /dev/null +++ b/crates/web-sys/src/features/gen_AudioSinkInfo.rs @@ -0,0 +1,31 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioSinkInfo , typescript_type = "AudioSinkInfo")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AudioSinkInfo` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioSinkInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioSinkInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AudioSinkInfo; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSinkType")] + # [wasm_bindgen (structural , method , getter , js_class = "AudioSinkInfo" , 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/AudioSinkInfo/type)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioSinkInfo`, `AudioSinkType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(this: &AudioSinkInfo) -> AudioSinkType; +} diff --git a/crates/web-sys/src/features/gen_AudioSinkOptions.rs b/crates/web-sys/src/features/gen_AudioSinkOptions.rs new file mode 100644 index 00000000000..a9fbff66f7d --- /dev/null +++ b/crates/web-sys/src/features/gen_AudioSinkOptions.rs @@ -0,0 +1,60 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioSinkOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AudioSinkOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioSinkOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AudioSinkOptions; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSinkType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioSinkOptions`, `AudioSinkType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &AudioSinkOptions) -> AudioSinkType; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSinkType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioSinkOptions`, `AudioSinkType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &AudioSinkOptions, val: AudioSinkType); +} +#[cfg(web_sys_unstable_apis)] +impl AudioSinkOptions { + #[cfg(feature = "AudioSinkType")] + #[doc = "Construct a new `AudioSinkOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioSinkOptions`, `AudioSinkType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(type_: AudioSinkType) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_type(type_); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioSinkType")] + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: AudioSinkType) -> &mut Self { + self.set_type(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuPredefinedColorSpace.rs b/crates/web-sys/src/features/gen_AudioSinkType.rs similarity index 76% rename from crates/web-sys/src/features/gen_GpuPredefinedColorSpace.rs rename to crates/web-sys/src/features/gen_AudioSinkType.rs index 2f48cc51bc0..5e1abf9562c 100644 --- a/crates/web-sys/src/features/gen_GpuPredefinedColorSpace.rs +++ b/crates/web-sys/src/features/gen_AudioSinkType.rs @@ -1,14 +1,15 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] -#[doc = "The `GpuPredefinedColorSpace` enum."] +#[doc = "The `AudioSinkType` enum."] #[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `GpuPredefinedColorSpace`*"] +#[doc = "*This API requires the following crate features to be activated: `AudioSinkType`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GpuPredefinedColorSpace { - Srgb = "srgb", +pub enum AudioSinkType { + None = "none", } diff --git a/crates/web-sys/src/features/gen_AudioStreamTrack.rs b/crates/web-sys/src/features/gen_AudioStreamTrack.rs index 3c6eed63102..20308c8c71f 100644 --- a/crates/web-sys/src/features/gen_AudioStreamTrack.rs +++ b/crates/web-sys/src/features/gen_AudioStreamTrack.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioTrack.rs b/crates/web-sys/src/features/gen_AudioTrack.rs index 7e1c9600dc2..391abe9ba88 100644 --- a/crates/web-sys/src/features/gen_AudioTrack.rs +++ b/crates/web-sys/src/features/gen_AudioTrack.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,28 +18,28 @@ extern "C" { #[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; + pub fn id(this: &AudioTrack) -> ::alloc::string::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; + pub fn kind(this: &AudioTrack) -> ::alloc::string::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; + pub fn label(this: &AudioTrack) -> ::alloc::string::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; + pub fn language(this: &AudioTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "AudioTrack" , js_name = enabled)] #[doc = "Getter for the `enabled` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_AudioTrackList.rs b/crates/web-sys/src/features/gen_AudioTrackList.rs index 44632432c6c..4a17b463f79 100644 --- a/crates/web-sys/src/features/gen_AudioTrackList.rs +++ b/crates/web-sys/src/features/gen_AudioTrackList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -70,7 +71,7 @@ extern "C" { pub fn get_track_by_id(this: &AudioTrackList, id: &str) -> Option; #[cfg(feature = "AudioTrack")] #[wasm_bindgen(method, structural, js_class = "AudioTrackList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_AudioWorklet.rs b/crates/web-sys/src/features/gen_AudioWorklet.rs index c160c5004a2..42816b3e9ae 100644 --- a/crates/web-sys/src/features/gen_AudioWorklet.rs +++ b/crates/web-sys/src/features/gen_AudioWorklet.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioWorkletGlobalScope.rs b/crates/web-sys/src/features/gen_AudioWorkletGlobalScope.rs index 4057aeaa10a..4e899fd298b 100644 --- a/crates/web-sys/src/features/gen_AudioWorkletGlobalScope.rs +++ b/crates/web-sys/src/features/gen_AudioWorkletGlobalScope.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioWorkletNode.rs b/crates/web-sys/src/features/gen_AudioWorkletNode.rs index 989bab54453..48182892932 100644 --- a/crates/web-sys/src/features/gen_AudioWorkletNode.rs +++ b/crates/web-sys/src/features/gen_AudioWorkletNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AudioWorkletNodeOptions.rs b/crates/web-sys/src/features/gen_AudioWorkletNodeOptions.rs index e97330a3628..d6bd95e150d 100644 --- a/crates/web-sys/src/features/gen_AudioWorkletNodeOptions.rs +++ b/crates/web-sys/src/features/gen_AudioWorkletNodeOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,92 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] pub type AudioWorkletNodeOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &AudioWorkletNodeOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &AudioWorkletNodeOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`, `ChannelCountMode`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &AudioWorkletNodeOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &AudioWorkletNodeOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`, `ChannelInterpretation`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation( + this: &AudioWorkletNodeOptions, + ) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &AudioWorkletNodeOptions, val: ChannelInterpretation); + #[doc = "Get the `numberOfInputs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, getter = "numberOfInputs")] + pub fn get_number_of_inputs(this: &AudioWorkletNodeOptions) -> Option; + #[doc = "Change the `numberOfInputs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, setter = "numberOfInputs")] + pub fn set_number_of_inputs(this: &AudioWorkletNodeOptions, val: u32); + #[doc = "Get the `numberOfOutputs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, getter = "numberOfOutputs")] + pub fn get_number_of_outputs(this: &AudioWorkletNodeOptions) -> Option; + #[doc = "Change the `numberOfOutputs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, setter = "numberOfOutputs")] + pub fn set_number_of_outputs(this: &AudioWorkletNodeOptions, val: u32); + #[doc = "Get the `outputChannelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, getter = "outputChannelCount")] + pub fn get_output_channel_count(this: &AudioWorkletNodeOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `outputChannelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, setter = "outputChannelCount")] + pub fn set_output_channel_count(this: &AudioWorkletNodeOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `parameterData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, getter = "parameterData")] + pub fn get_parameter_data(this: &AudioWorkletNodeOptions) -> Option<::js_sys::Object>; + #[doc = "Change the `parameterData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, setter = "parameterData")] + pub fn set_parameter_data(this: &AudioWorkletNodeOptions, val: &::js_sys::Object); + #[doc = "Get the `processorOptions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, getter = "processorOptions")] + pub fn get_processor_options(this: &AudioWorkletNodeOptions) -> Option<::js_sys::Object>; + #[doc = "Change the `processorOptions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[wasm_bindgen(method, setter = "processorOptions")] + pub fn set_processor_options(this: &AudioWorkletNodeOptions, val: Option<&::js_sys::Object>); } impl AudioWorkletNodeOptions { #[doc = "Construct a new `AudioWorkletNodeOptions`."] @@ -19,125 +106,46 @@ impl AudioWorkletNodeOptions { 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`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); 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`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); 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`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `numberOfInputs` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[deprecated = "Use `set_number_of_inputs()` instead."] 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.set_number_of_inputs(val); self } - #[doc = "Change the `numberOfOutputs` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[deprecated = "Use `set_number_of_outputs()` instead."] 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.set_number_of_outputs(val); self } - #[doc = "Change the `outputChannelCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[deprecated = "Use `set_output_channel_count()` instead."] 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.set_output_channel_count(val); self } - #[doc = "Change the `processorOptions` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"] + #[deprecated = "Use `set_parameter_data()` instead."] + pub fn parameter_data(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_parameter_data(val); + self + } + #[deprecated = "Use `set_processor_options()` instead."] 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.set_processor_options(val); self } } diff --git a/crates/web-sys/src/features/gen_AudioWorkletProcessor.rs b/crates/web-sys/src/features/gen_AudioWorkletProcessor.rs index 8a537cd1acb..eb5d971c8df 100644 --- a/crates/web-sys/src/features/gen_AudioWorkletProcessor.rs +++ b/crates/web-sys/src/features/gen_AudioWorkletProcessor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputs.rs index cde43d20c47..e0a6ad252f6 100644 --- a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputs.rs +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,117 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] pub type AuthenticationExtensionsClientInputs; + #[doc = "Get the `appid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] + #[wasm_bindgen(method, getter = "appid")] + pub fn get_appid( + this: &AuthenticationExtensionsClientInputs, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `appid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] + #[wasm_bindgen(method, setter = "appid")] + pub fn set_appid(this: &AuthenticationExtensionsClientInputs, val: &str); + #[doc = "Get the `appidExclude` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] + #[wasm_bindgen(method, getter = "appidExclude")] + pub fn get_appid_exclude( + this: &AuthenticationExtensionsClientInputs, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `appidExclude` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] + #[wasm_bindgen(method, setter = "appidExclude")] + pub fn set_appid_exclude(this: &AuthenticationExtensionsClientInputs, val: &str); + #[doc = "Get the `credProps` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] + #[wasm_bindgen(method, getter = "credProps")] + pub fn get_cred_props(this: &AuthenticationExtensionsClientInputs) -> Option; + #[doc = "Change the `credProps` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] + #[wasm_bindgen(method, setter = "credProps")] + pub fn set_cred_props(this: &AuthenticationExtensionsClientInputs, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsDevicePublicKeyInputs")] + #[doc = "Get the `devicePubKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsDevicePublicKeyInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "devicePubKey")] + pub fn get_device_pub_key( + this: &AuthenticationExtensionsClientInputs, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsDevicePublicKeyInputs")] + #[doc = "Change the `devicePubKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsDevicePublicKeyInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "devicePubKey")] + pub fn set_device_pub_key( + this: &AuthenticationExtensionsClientInputs, + val: &AuthenticationExtensionsDevicePublicKeyInputs, + ); + #[cfg(feature = "AuthenticationExtensionsLargeBlobInputs")] + #[doc = "Get the `largeBlob` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsLargeBlobInputs`*"] + #[wasm_bindgen(method, getter = "largeBlob")] + pub fn get_large_blob( + this: &AuthenticationExtensionsClientInputs, + ) -> Option; + #[cfg(feature = "AuthenticationExtensionsLargeBlobInputs")] + #[doc = "Change the `largeBlob` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsLargeBlobInputs`*"] + #[wasm_bindgen(method, setter = "largeBlob")] + pub fn set_large_blob( + this: &AuthenticationExtensionsClientInputs, + val: &AuthenticationExtensionsLargeBlobInputs, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfInputs")] + #[doc = "Get the `prf` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsPrfInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "prf")] + pub fn get_prf( + this: &AuthenticationExtensionsClientInputs, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfInputs")] + #[doc = "Change the `prf` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `AuthenticationExtensionsPrfInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "prf")] + pub fn set_prf( + this: &AuthenticationExtensionsClientInputs, + val: &AuthenticationExtensionsPrfInputs, + ); + #[doc = "Get the `uvm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] + #[wasm_bindgen(method, getter = "uvm")] + pub fn get_uvm(this: &AuthenticationExtensionsClientInputs) -> Option; + #[doc = "Change the `uvm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"] + #[wasm_bindgen(method, setter = "uvm")] + pub fn set_uvm(this: &AuthenticationExtensionsClientInputs, val: bool); } impl AuthenticationExtensionsClientInputs { #[doc = "Construct a new `AuthenticationExtensionsClientInputs`."] @@ -19,17 +131,47 @@ impl AuthenticationExtensionsClientInputs { 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`*"] + #[deprecated = "Use `set_appid()` instead."] 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.set_appid(val); + self + } + #[deprecated = "Use `set_appid_exclude()` instead."] + pub fn appid_exclude(&mut self, val: &str) -> &mut Self { + self.set_appid_exclude(val); + self + } + #[deprecated = "Use `set_cred_props()` instead."] + pub fn cred_props(&mut self, val: bool) -> &mut Self { + self.set_cred_props(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsDevicePublicKeyInputs")] + #[deprecated = "Use `set_device_pub_key()` instead."] + pub fn device_pub_key( + &mut self, + val: &AuthenticationExtensionsDevicePublicKeyInputs, + ) -> &mut Self { + self.set_device_pub_key(val); + self + } + #[cfg(feature = "AuthenticationExtensionsLargeBlobInputs")] + #[deprecated = "Use `set_large_blob()` instead."] + pub fn large_blob(&mut self, val: &AuthenticationExtensionsLargeBlobInputs) -> &mut Self { + self.set_large_blob(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfInputs")] + #[deprecated = "Use `set_prf()` instead."] + pub fn prf(&mut self, val: &AuthenticationExtensionsPrfInputs) -> &mut Self { + self.set_prf(val); + self + } + #[deprecated = "Use `set_uvm()` instead."] + pub fn uvm(&mut self, val: bool) -> &mut Self { + self.set_uvm(val); self } } diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputsJson.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputsJson.rs new file mode 100644 index 00000000000..29d560c0bd3 --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientInputsJson.rs @@ -0,0 +1,37 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsClientInputsJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsClientInputsJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticationExtensionsClientInputsJson; +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticationExtensionsClientInputsJson { + #[doc = "Construct a new `AuthenticationExtensionsClientInputsJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for AuthenticationExtensionsClientInputsJson { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputs.rs index 4b59b32141d..76772e7d31c 100644 --- a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputs.rs +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,120 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] pub type AuthenticationExtensionsClientOutputs; + #[doc = "Get the `appid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] + #[wasm_bindgen(method, getter = "appid")] + pub fn get_appid(this: &AuthenticationExtensionsClientOutputs) -> Option; + #[doc = "Change the `appid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] + #[wasm_bindgen(method, setter = "appid")] + pub fn set_appid(this: &AuthenticationExtensionsClientOutputs, val: bool); + #[doc = "Get the `appidExclude` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] + #[wasm_bindgen(method, getter = "appidExclude")] + pub fn get_appid_exclude(this: &AuthenticationExtensionsClientOutputs) -> Option; + #[doc = "Change the `appidExclude` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] + #[wasm_bindgen(method, setter = "appidExclude")] + pub fn set_appid_exclude(this: &AuthenticationExtensionsClientOutputs, val: bool); + #[cfg(feature = "CredentialPropertiesOutput")] + #[doc = "Get the `credProps` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `CredentialPropertiesOutput`*"] + #[wasm_bindgen(method, getter = "credProps")] + pub fn get_cred_props( + this: &AuthenticationExtensionsClientOutputs, + ) -> Option; + #[cfg(feature = "CredentialPropertiesOutput")] + #[doc = "Change the `credProps` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `CredentialPropertiesOutput`*"] + #[wasm_bindgen(method, setter = "credProps")] + pub fn set_cred_props( + this: &AuthenticationExtensionsClientOutputs, + val: &CredentialPropertiesOutput, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsDevicePublicKeyOutputs")] + #[doc = "Get the `devicePubKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `AuthenticationExtensionsDevicePublicKeyOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "devicePubKey")] + pub fn get_device_pub_key( + this: &AuthenticationExtensionsClientOutputs, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsDevicePublicKeyOutputs")] + #[doc = "Change the `devicePubKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `AuthenticationExtensionsDevicePublicKeyOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "devicePubKey")] + pub fn set_device_pub_key( + this: &AuthenticationExtensionsClientOutputs, + val: &AuthenticationExtensionsDevicePublicKeyOutputs, + ); + #[cfg(feature = "AuthenticationExtensionsLargeBlobOutputs")] + #[doc = "Get the `largeBlob` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `AuthenticationExtensionsLargeBlobOutputs`*"] + #[wasm_bindgen(method, getter = "largeBlob")] + pub fn get_large_blob( + this: &AuthenticationExtensionsClientOutputs, + ) -> Option; + #[cfg(feature = "AuthenticationExtensionsLargeBlobOutputs")] + #[doc = "Change the `largeBlob` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `AuthenticationExtensionsLargeBlobOutputs`*"] + #[wasm_bindgen(method, setter = "largeBlob")] + pub fn set_large_blob( + this: &AuthenticationExtensionsClientOutputs, + val: &AuthenticationExtensionsLargeBlobOutputs, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfOutputs")] + #[doc = "Get the `prf` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `AuthenticationExtensionsPrfOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "prf")] + pub fn get_prf( + this: &AuthenticationExtensionsClientOutputs, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfOutputs")] + #[doc = "Change the `prf` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`, `AuthenticationExtensionsPrfOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "prf")] + pub fn set_prf( + this: &AuthenticationExtensionsClientOutputs, + val: &AuthenticationExtensionsPrfOutputs, + ); + #[doc = "Get the `uvm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] + #[wasm_bindgen(method, getter = "uvm")] + pub fn get_uvm(this: &AuthenticationExtensionsClientOutputs) -> Option<::js_sys::Array>; + #[doc = "Change the `uvm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"] + #[wasm_bindgen(method, setter = "uvm")] + pub fn set_uvm(this: &AuthenticationExtensionsClientOutputs, val: &::wasm_bindgen::JsValue); } impl AuthenticationExtensionsClientOutputs { #[doc = "Construct a new `AuthenticationExtensionsClientOutputs`."] @@ -19,17 +134,48 @@ impl AuthenticationExtensionsClientOutputs { 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`*"] + #[deprecated = "Use `set_appid()` instead."] 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.set_appid(val); + self + } + #[deprecated = "Use `set_appid_exclude()` instead."] + pub fn appid_exclude(&mut self, val: bool) -> &mut Self { + self.set_appid_exclude(val); + self + } + #[cfg(feature = "CredentialPropertiesOutput")] + #[deprecated = "Use `set_cred_props()` instead."] + pub fn cred_props(&mut self, val: &CredentialPropertiesOutput) -> &mut Self { + self.set_cred_props(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsDevicePublicKeyOutputs")] + #[deprecated = "Use `set_device_pub_key()` instead."] + pub fn device_pub_key( + &mut self, + val: &AuthenticationExtensionsDevicePublicKeyOutputs, + ) -> &mut Self { + self.set_device_pub_key(val); + self + } + #[cfg(feature = "AuthenticationExtensionsLargeBlobOutputs")] + #[deprecated = "Use `set_large_blob()` instead."] + pub fn large_blob(&mut self, val: &AuthenticationExtensionsLargeBlobOutputs) -> &mut Self { + self.set_large_blob(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfOutputs")] + #[deprecated = "Use `set_prf()` instead."] + pub fn prf(&mut self, val: &AuthenticationExtensionsPrfOutputs) -> &mut Self { + self.set_prf(val); + self + } + #[deprecated = "Use `set_uvm()` instead."] + pub fn uvm(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_uvm(val); self } } diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputsJson.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputsJson.rs new file mode 100644 index 00000000000..f2b7a553189 --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsClientOutputsJson.rs @@ -0,0 +1,37 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsClientOutputsJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsClientOutputsJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticationExtensionsClientOutputsJson; +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticationExtensionsClientOutputsJson { + #[doc = "Construct a new `AuthenticationExtensionsClientOutputsJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for AuthenticationExtensionsClientOutputsJson { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsDevicePublicKeyInputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsDevicePublicKeyInputs.rs new file mode 100644 index 00000000000..ac5ee5c72da --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsDevicePublicKeyInputs.rs @@ -0,0 +1,92 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsDevicePublicKeyInputs)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsDevicePublicKeyInputs` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticationExtensionsDevicePublicKeyInputs; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestation")] + pub fn get_attestation( + this: &AuthenticationExtensionsDevicePublicKeyInputs, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestation")] + pub fn set_attestation(this: &AuthenticationExtensionsDevicePublicKeyInputs, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestationFormats")] + pub fn get_attestation_formats( + this: &AuthenticationExtensionsDevicePublicKeyInputs, + ) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestationFormats")] + pub fn set_attestation_formats( + this: &AuthenticationExtensionsDevicePublicKeyInputs, + val: &::wasm_bindgen::JsValue, + ); +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticationExtensionsDevicePublicKeyInputs { + #[doc = "Construct a new `AuthenticationExtensionsDevicePublicKeyInputs`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation()` instead."] + pub fn attestation(&mut self, val: &str) -> &mut Self { + self.set_attestation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation_formats()` instead."] + pub fn attestation_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_attestation_formats(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for AuthenticationExtensionsDevicePublicKeyInputs { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsDevicePublicKeyOutputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsDevicePublicKeyOutputs.rs new file mode 100644 index 00000000000..eec053201d6 --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsDevicePublicKeyOutputs.rs @@ -0,0 +1,66 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsDevicePublicKeyOutputs)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsDevicePublicKeyOutputs` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticationExtensionsDevicePublicKeyOutputs; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `signature` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "signature")] + pub fn get_signature( + this: &AuthenticationExtensionsDevicePublicKeyOutputs, + ) -> Option<::js_sys::ArrayBuffer>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `signature` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "signature")] + pub fn set_signature( + this: &AuthenticationExtensionsDevicePublicKeyOutputs, + val: &::js_sys::ArrayBuffer, + ); +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticationExtensionsDevicePublicKeyOutputs { + #[doc = "Construct a new `AuthenticationExtensionsDevicePublicKeyOutputs`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsDevicePublicKeyOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_signature()` instead."] + pub fn signature(&mut self, val: &::js_sys::ArrayBuffer) -> &mut Self { + self.set_signature(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for AuthenticationExtensionsDevicePublicKeyOutputs { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsLargeBlobInputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsLargeBlobInputs.rs new file mode 100644 index 00000000000..b08ad745dff --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsLargeBlobInputs.rs @@ -0,0 +1,75 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsLargeBlobInputs)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsLargeBlobInputs` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"] + pub type AuthenticationExtensionsLargeBlobInputs; + #[doc = "Get the `read` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"] + #[wasm_bindgen(method, getter = "read")] + pub fn get_read(this: &AuthenticationExtensionsLargeBlobInputs) -> Option; + #[doc = "Change the `read` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"] + #[wasm_bindgen(method, setter = "read")] + pub fn set_read(this: &AuthenticationExtensionsLargeBlobInputs, val: bool); + #[doc = "Get the `support` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"] + #[wasm_bindgen(method, getter = "support")] + pub fn get_support( + this: &AuthenticationExtensionsLargeBlobInputs, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `support` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"] + #[wasm_bindgen(method, setter = "support")] + pub fn set_support(this: &AuthenticationExtensionsLargeBlobInputs, val: &str); + #[doc = "Get the `write` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"] + #[wasm_bindgen(method, getter = "write")] + pub fn get_write(this: &AuthenticationExtensionsLargeBlobInputs) -> Option<::js_sys::Object>; + #[doc = "Change the `write` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"] + #[wasm_bindgen(method, setter = "write")] + pub fn set_write(this: &AuthenticationExtensionsLargeBlobInputs, val: &::js_sys::Object); +} +impl AuthenticationExtensionsLargeBlobInputs { + #[doc = "Construct a new `AuthenticationExtensionsLargeBlobInputs`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobInputs`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_read()` instead."] + pub fn read(&mut self, val: bool) -> &mut Self { + self.set_read(val); + self + } + #[deprecated = "Use `set_support()` instead."] + pub fn support(&mut self, val: &str) -> &mut Self { + self.set_support(val); + self + } + #[deprecated = "Use `set_write()` instead."] + pub fn write(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_write(val); + self + } +} +impl Default for AuthenticationExtensionsLargeBlobInputs { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsLargeBlobOutputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsLargeBlobOutputs.rs new file mode 100644 index 00000000000..bf6bc50c046 --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsLargeBlobOutputs.rs @@ -0,0 +1,75 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsLargeBlobOutputs)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsLargeBlobOutputs` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobOutputs`*"] + pub type AuthenticationExtensionsLargeBlobOutputs; + #[doc = "Get the `blob` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobOutputs`*"] + #[wasm_bindgen(method, getter = "blob")] + pub fn get_blob( + this: &AuthenticationExtensionsLargeBlobOutputs, + ) -> Option<::js_sys::ArrayBuffer>; + #[doc = "Change the `blob` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobOutputs`*"] + #[wasm_bindgen(method, setter = "blob")] + pub fn set_blob(this: &AuthenticationExtensionsLargeBlobOutputs, val: &::js_sys::ArrayBuffer); + #[doc = "Get the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobOutputs`*"] + #[wasm_bindgen(method, getter = "supported")] + pub fn get_supported(this: &AuthenticationExtensionsLargeBlobOutputs) -> Option; + #[doc = "Change the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobOutputs`*"] + #[wasm_bindgen(method, setter = "supported")] + pub fn set_supported(this: &AuthenticationExtensionsLargeBlobOutputs, val: bool); + #[doc = "Get the `written` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobOutputs`*"] + #[wasm_bindgen(method, getter = "written")] + pub fn get_written(this: &AuthenticationExtensionsLargeBlobOutputs) -> Option; + #[doc = "Change the `written` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobOutputs`*"] + #[wasm_bindgen(method, setter = "written")] + pub fn set_written(this: &AuthenticationExtensionsLargeBlobOutputs, val: bool); +} +impl AuthenticationExtensionsLargeBlobOutputs { + #[doc = "Construct a new `AuthenticationExtensionsLargeBlobOutputs`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsLargeBlobOutputs`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_blob()` instead."] + pub fn blob(&mut self, val: &::js_sys::ArrayBuffer) -> &mut Self { + self.set_blob(val); + self + } + #[deprecated = "Use `set_supported()` instead."] + pub fn supported(&mut self, val: bool) -> &mut Self { + self.set_supported(val); + self + } + #[deprecated = "Use `set_written()` instead."] + pub fn written(&mut self, val: bool) -> &mut Self { + self.set_written(val); + self + } +} +impl Default for AuthenticationExtensionsLargeBlobOutputs { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfInputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfInputs.rs new file mode 100644 index 00000000000..a2f2e32c54a --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfInputs.rs @@ -0,0 +1,95 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsPRFInputs)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsPrfInputs` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticationExtensionsPrfInputs; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfValues")] + #[doc = "Get the `eval` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfInputs`, `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "eval")] + pub fn get_eval( + this: &AuthenticationExtensionsPrfInputs, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfValues")] + #[doc = "Change the `eval` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfInputs`, `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "eval")] + pub fn set_eval( + this: &AuthenticationExtensionsPrfInputs, + val: &AuthenticationExtensionsPrfValues, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `evalByCredential` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "evalByCredential")] + pub fn get_eval_by_credential( + this: &AuthenticationExtensionsPrfInputs, + ) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `evalByCredential` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "evalByCredential")] + pub fn set_eval_by_credential(this: &AuthenticationExtensionsPrfInputs, val: &::js_sys::Object); +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticationExtensionsPrfInputs { + #[doc = "Construct a new `AuthenticationExtensionsPrfInputs`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfInputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfValues")] + #[deprecated = "Use `set_eval()` instead."] + pub fn eval(&mut self, val: &AuthenticationExtensionsPrfValues) -> &mut Self { + self.set_eval(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_eval_by_credential()` instead."] + pub fn eval_by_credential(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_eval_by_credential(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for AuthenticationExtensionsPrfInputs { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfOutputs.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfOutputs.rs new file mode 100644 index 00000000000..296c8cabeb8 --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfOutputs.rs @@ -0,0 +1,93 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsPRFOutputs)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsPrfOutputs` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticationExtensionsPrfOutputs; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `enabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "enabled")] + pub fn get_enabled(this: &AuthenticationExtensionsPrfOutputs) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `enabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "enabled")] + pub fn set_enabled(this: &AuthenticationExtensionsPrfOutputs, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfValues")] + #[doc = "Get the `results` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfOutputs`, `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "results")] + pub fn get_results( + this: &AuthenticationExtensionsPrfOutputs, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfValues")] + #[doc = "Change the `results` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfOutputs`, `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "results")] + pub fn set_results( + this: &AuthenticationExtensionsPrfOutputs, + val: &AuthenticationExtensionsPrfValues, + ); +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticationExtensionsPrfOutputs { + #[doc = "Construct a new `AuthenticationExtensionsPrfOutputs`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfOutputs`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_enabled()` instead."] + pub fn enabled(&mut self, val: bool) -> &mut Self { + self.set_enabled(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsPrfValues")] + #[deprecated = "Use `set_results()` instead."] + pub fn results(&mut self, val: &AuthenticationExtensionsPrfValues) -> &mut Self { + self.set_results(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for AuthenticationExtensionsPrfOutputs { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfValues.rs b/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfValues.rs new file mode 100644 index 00000000000..0888dc5de9b --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationExtensionsPrfValues.rs @@ -0,0 +1,80 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationExtensionsPRFValues)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationExtensionsPrfValues` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticationExtensionsPrfValues; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `first` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "first")] + pub fn get_first(this: &AuthenticationExtensionsPrfValues) -> ::js_sys::Object; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `first` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "first")] + pub fn set_first(this: &AuthenticationExtensionsPrfValues, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `second` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "second")] + pub fn get_second(this: &AuthenticationExtensionsPrfValues) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `second` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "second")] + pub fn set_second(this: &AuthenticationExtensionsPrfValues, val: &::js_sys::Object); +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticationExtensionsPrfValues { + #[doc = "Construct a new `AuthenticationExtensionsPrfValues`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsPrfValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(first: &::js_sys::Object) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_first(first); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_first()` instead."] + pub fn first(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_first(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_second()` instead."] + pub fn second(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_second(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticationResponseJson.rs b/crates/web-sys/src/features/gen_AuthenticationResponseJson.rs new file mode 100644 index 00000000000..cbec2e44320 --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticationResponseJson.rs @@ -0,0 +1,209 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticationResponseJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticationResponseJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticationResponseJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `authenticatorAttachment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "authenticatorAttachment")] + pub fn get_authenticator_attachment( + this: &AuthenticationResponseJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `authenticatorAttachment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "authenticatorAttachment")] + pub fn set_authenticator_attachment(this: &AuthenticationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientOutputsJson")] + #[doc = "Get the `clientExtensionResults` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputsJson`, `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "clientExtensionResults")] + pub fn get_client_extension_results( + this: &AuthenticationResponseJson, + ) -> AuthenticationExtensionsClientOutputsJson; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientOutputsJson")] + #[doc = "Change the `clientExtensionResults` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputsJson`, `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "clientExtensionResults")] + pub fn set_client_extension_results( + this: &AuthenticationResponseJson, + val: &AuthenticationExtensionsClientOutputsJson, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &AuthenticationResponseJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &AuthenticationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rawId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rawId")] + pub fn get_raw_id(this: &AuthenticationResponseJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rawId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rawId")] + pub fn set_raw_id(this: &AuthenticationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorAssertionResponseJson")] + #[doc = "Get the `response` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`, `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "response")] + pub fn get_response(this: &AuthenticationResponseJson) -> AuthenticatorAssertionResponseJson; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorAssertionResponseJson")] + #[doc = "Change the `response` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`, `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "response")] + pub fn set_response( + this: &AuthenticationResponseJson, + val: &AuthenticatorAssertionResponseJson, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &AuthenticationResponseJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &AuthenticationResponseJson, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticationResponseJson { + #[cfg(all( + feature = "AuthenticationExtensionsClientOutputsJson", + feature = "AuthenticatorAssertionResponseJson", + ))] + #[doc = "Construct a new `AuthenticationResponseJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputsJson`, `AuthenticationResponseJson`, `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + client_extension_results: &AuthenticationExtensionsClientOutputsJson, + id: &str, + raw_id: &str, + response: &AuthenticatorAssertionResponseJson, + type_: &str, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_client_extension_results(client_extension_results); + ret.set_id(id); + ret.set_raw_id(raw_id); + ret.set_response(response); + ret.set_type(type_); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_authenticator_attachment()` instead."] + pub fn authenticator_attachment(&mut self, val: &str) -> &mut Self { + self.set_authenticator_attachment(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientOutputsJson")] + #[deprecated = "Use `set_client_extension_results()` instead."] + pub fn client_extension_results( + &mut self, + val: &AuthenticationExtensionsClientOutputsJson, + ) -> &mut Self { + self.set_client_extension_results(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_raw_id()` instead."] + pub fn raw_id(&mut self, val: &str) -> &mut Self { + self.set_raw_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorAssertionResponseJson")] + #[deprecated = "Use `set_response()` instead."] + pub fn response(&mut self, val: &AuthenticatorAssertionResponseJson) -> &mut Self { + self.set_response(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: &str) -> &mut Self { + self.set_type(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticatorAssertionResponse.rs b/crates/web-sys/src/features/gen_AuthenticatorAssertionResponse.rs index dd6e10e7f5f..f7e2fc913fd 100644 --- a/crates/web-sys/src/features/gen_AuthenticatorAssertionResponse.rs +++ b/crates/web-sys/src/features/gen_AuthenticatorAssertionResponse.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -32,4 +33,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponse`*"] pub fn user_handle(this: &AuthenticatorAssertionResponse) -> Option<::js_sys::ArrayBuffer>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "AuthenticatorAssertionResponse" , 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/AuthenticatorAssertionResponse/attestationObject)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponse`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn attestation_object( + this: &AuthenticatorAssertionResponse, + ) -> Option<::js_sys::ArrayBuffer>; } diff --git a/crates/web-sys/src/features/gen_AuthenticatorAssertionResponseJson.rs b/crates/web-sys/src/features/gen_AuthenticatorAssertionResponseJson.rs new file mode 100644 index 00000000000..26051b9688f --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticatorAssertionResponseJson.rs @@ -0,0 +1,162 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticatorAssertionResponseJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticatorAssertionResponseJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticatorAssertionResponseJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestationObject` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestationObject")] + pub fn get_attestation_object( + this: &AuthenticatorAssertionResponseJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestationObject` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestationObject")] + pub fn set_attestation_object(this: &AuthenticatorAssertionResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `authenticatorData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "authenticatorData")] + pub fn get_authenticator_data( + this: &AuthenticatorAssertionResponseJson, + ) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `authenticatorData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "authenticatorData")] + pub fn set_authenticator_data(this: &AuthenticatorAssertionResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `clientDataJSON` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "clientDataJSON")] + pub fn get_client_data_json( + this: &AuthenticatorAssertionResponseJson, + ) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `clientDataJSON` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "clientDataJSON")] + pub fn set_client_data_json(this: &AuthenticatorAssertionResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `signature` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "signature")] + pub fn get_signature(this: &AuthenticatorAssertionResponseJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `signature` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "signature")] + pub fn set_signature(this: &AuthenticatorAssertionResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `userHandle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "userHandle")] + pub fn get_user_handle( + this: &AuthenticatorAssertionResponseJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `userHandle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "userHandle")] + pub fn set_user_handle(this: &AuthenticatorAssertionResponseJson, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticatorAssertionResponseJson { + #[doc = "Construct a new `AuthenticatorAssertionResponseJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(authenticator_data: &str, client_data_json: &str, signature: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_authenticator_data(authenticator_data); + ret.set_client_data_json(client_data_json); + ret.set_signature(signature); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation_object()` instead."] + pub fn attestation_object(&mut self, val: &str) -> &mut Self { + self.set_attestation_object(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_authenticator_data()` instead."] + pub fn authenticator_data(&mut self, val: &str) -> &mut Self { + self.set_authenticator_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_client_data_json()` instead."] + pub fn client_data_json(&mut self, val: &str) -> &mut Self { + self.set_client_data_json(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_signature()` instead."] + pub fn signature(&mut self, val: &str) -> &mut Self { + self.set_signature(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_user_handle()` instead."] + pub fn user_handle(&mut self, val: &str) -> &mut Self { + self.set_user_handle(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticatorAttachment.rs b/crates/web-sys/src/features/gen_AuthenticatorAttachment.rs index f0776410d90..1ba36251e4a 100644 --- a/crates/web-sys/src/features/gen_AuthenticatorAttachment.rs +++ b/crates/web-sys/src/features/gen_AuthenticatorAttachment.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `AuthenticatorAttachment` enum."] diff --git a/crates/web-sys/src/features/gen_AuthenticatorAttestationResponse.rs b/crates/web-sys/src/features/gen_AuthenticatorAttestationResponse.rs index 364ebc23bd5..290aff69105 100644 --- a/crates/web-sys/src/features/gen_AuthenticatorAttestationResponse.rs +++ b/crates/web-sys/src/features/gen_AuthenticatorAttestationResponse.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -18,4 +19,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponse`*"] pub fn attestation_object(this: &AuthenticatorAttestationResponse) -> ::js_sys::ArrayBuffer; + # [wasm_bindgen (catch , method , structural , js_class = "AuthenticatorAttestationResponse" , js_name = getAuthenticatorData)] + #[doc = "The `getAuthenticatorData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponse`*"] + pub fn get_authenticator_data( + this: &AuthenticatorAttestationResponse, + ) -> Result<::js_sys::ArrayBuffer, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "AuthenticatorAttestationResponse" , js_name = getPublicKey)] + #[doc = "The `getPublicKey()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponse`*"] + pub fn get_public_key( + this: &AuthenticatorAttestationResponse, + ) -> Result, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "AuthenticatorAttestationResponse" , js_name = getPublicKeyAlgorithm)] + #[doc = "The `getPublicKeyAlgorithm()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponse`*"] + pub fn get_public_key_algorithm( + this: &AuthenticatorAttestationResponse, + ) -> Result; + # [wasm_bindgen (method , structural , js_class = "AuthenticatorAttestationResponse" , js_name = getTransports)] + #[doc = "The `getTransports()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse/getTransports)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponse`*"] + pub fn get_transports(this: &AuthenticatorAttestationResponse) -> ::js_sys::Array; } diff --git a/crates/web-sys/src/features/gen_AuthenticatorAttestationResponseJson.rs b/crates/web-sys/src/features/gen_AuthenticatorAttestationResponseJson.rs new file mode 100644 index 00000000000..304316e66ca --- /dev/null +++ b/crates/web-sys/src/features/gen_AuthenticatorAttestationResponseJson.rs @@ -0,0 +1,197 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AuthenticatorAttestationResponseJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AuthenticatorAttestationResponseJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type AuthenticatorAttestationResponseJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestationObject` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestationObject")] + pub fn get_attestation_object( + this: &AuthenticatorAttestationResponseJson, + ) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestationObject` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestationObject")] + pub fn set_attestation_object(this: &AuthenticatorAttestationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `authenticatorData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "authenticatorData")] + pub fn get_authenticator_data( + this: &AuthenticatorAttestationResponseJson, + ) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `authenticatorData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "authenticatorData")] + pub fn set_authenticator_data(this: &AuthenticatorAttestationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `clientDataJSON` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "clientDataJSON")] + pub fn get_client_data_json( + this: &AuthenticatorAttestationResponseJson, + ) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `clientDataJSON` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "clientDataJSON")] + pub fn set_client_data_json(this: &AuthenticatorAttestationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `publicKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "publicKey")] + pub fn get_public_key( + this: &AuthenticatorAttestationResponseJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `publicKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "publicKey")] + pub fn set_public_key(this: &AuthenticatorAttestationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `publicKeyAlgorithm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "publicKeyAlgorithm")] + pub fn get_public_key_algorithm(this: &AuthenticatorAttestationResponseJson) -> f64; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `publicKeyAlgorithm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "publicKeyAlgorithm")] + pub fn set_public_key_algorithm(this: &AuthenticatorAttestationResponseJson, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `transports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "transports")] + pub fn get_transports(this: &AuthenticatorAttestationResponseJson) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `transports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "transports")] + pub fn set_transports( + this: &AuthenticatorAttestationResponseJson, + val: &::wasm_bindgen::JsValue, + ); +} +#[cfg(web_sys_unstable_apis)] +impl AuthenticatorAttestationResponseJson { + #[doc = "Construct a new `AuthenticatorAttestationResponseJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + attestation_object: &str, + authenticator_data: &str, + client_data_json: &str, + public_key_algorithm: f64, + transports: &::wasm_bindgen::JsValue, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_attestation_object(attestation_object); + ret.set_authenticator_data(authenticator_data); + ret.set_client_data_json(client_data_json); + ret.set_public_key_algorithm(public_key_algorithm); + ret.set_transports(transports); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation_object()` instead."] + pub fn attestation_object(&mut self, val: &str) -> &mut Self { + self.set_attestation_object(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_authenticator_data()` instead."] + pub fn authenticator_data(&mut self, val: &str) -> &mut Self { + self.set_authenticator_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_client_data_json()` instead."] + pub fn client_data_json(&mut self, val: &str) -> &mut Self { + self.set_client_data_json(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_public_key()` instead."] + pub fn public_key(&mut self, val: &str) -> &mut Self { + self.set_public_key(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_public_key_algorithm()` instead."] + pub fn public_key_algorithm(&mut self, val: f64) -> &mut Self { + self.set_public_key_algorithm(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_transports()` instead."] + pub fn transports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_transports(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_AuthenticatorResponse.rs b/crates/web-sys/src/features/gen_AuthenticatorResponse.rs index 2aa5468b2d8..0144e6d965c 100644 --- a/crates/web-sys/src/features/gen_AuthenticatorResponse.rs +++ b/crates/web-sys/src/features/gen_AuthenticatorResponse.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_AuthenticatorSelectionCriteria.rs b/crates/web-sys/src/features/gen_AuthenticatorSelectionCriteria.rs index 1e4b5e90088..c3188c86d43 100644 --- a/crates/web-sys/src/features/gen_AuthenticatorSelectionCriteria.rs +++ b/crates/web-sys/src/features/gen_AuthenticatorSelectionCriteria.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,62 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"] pub type AuthenticatorSelectionCriteria; + #[cfg(feature = "AuthenticatorAttachment")] + #[doc = "Get the `authenticatorAttachment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttachment`, `AuthenticatorSelectionCriteria`*"] + #[wasm_bindgen(method, getter = "authenticatorAttachment")] + pub fn get_authenticator_attachment( + this: &AuthenticatorSelectionCriteria, + ) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "authenticatorAttachment")] + pub fn set_authenticator_attachment( + this: &AuthenticatorSelectionCriteria, + val: AuthenticatorAttachment, + ); + #[doc = "Get the `requireResidentKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"] + #[wasm_bindgen(method, getter = "requireResidentKey")] + pub fn get_require_resident_key(this: &AuthenticatorSelectionCriteria) -> Option; + #[doc = "Change the `requireResidentKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"] + #[wasm_bindgen(method, setter = "requireResidentKey")] + pub fn set_require_resident_key(this: &AuthenticatorSelectionCriteria, val: bool); + #[doc = "Get the `residentKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"] + #[wasm_bindgen(method, getter = "residentKey")] + pub fn get_resident_key( + this: &AuthenticatorSelectionCriteria, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `residentKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"] + #[wasm_bindgen(method, setter = "residentKey")] + pub fn set_resident_key(this: &AuthenticatorSelectionCriteria, val: &str); + #[cfg(feature = "UserVerificationRequirement")] + #[doc = "Get the `userVerification` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `UserVerificationRequirement`*"] + #[wasm_bindgen(method, getter = "userVerification")] + pub fn get_user_verification( + this: &AuthenticatorSelectionCriteria, + ) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "userVerification")] + pub fn set_user_verification( + this: &AuthenticatorSelectionCriteria, + val: UserVerificationRequirement, + ); } impl AuthenticatorSelectionCriteria { #[doc = "Construct a new `AuthenticatorSelectionCriteria`."] @@ -20,56 +77,25 @@ impl AuthenticatorSelectionCriteria { 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`*"] + #[deprecated = "Use `set_authenticator_attachment()` instead."] 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.set_authenticator_attachment(val); self } - #[doc = "Change the `requireResidentKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"] + #[deprecated = "Use `set_require_resident_key()` instead."] 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.set_require_resident_key(val); + self + } + #[deprecated = "Use `set_resident_key()` instead."] + pub fn resident_key(&mut self, val: &str) -> &mut Self { + self.set_resident_key(val); 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`*"] + #[deprecated = "Use `set_user_verification()` instead."] 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.set_user_verification(val); self } } diff --git a/crates/web-sys/src/features/gen_AuthenticatorTransport.rs b/crates/web-sys/src/features/gen_AuthenticatorTransport.rs index edafe5e11bf..9b43b08b139 100644 --- a/crates/web-sys/src/features/gen_AuthenticatorTransport.rs +++ b/crates/web-sys/src/features/gen_AuthenticatorTransport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `AuthenticatorTransport` enum."] @@ -9,4 +10,5 @@ pub enum AuthenticatorTransport { Usb = "usb", Nfc = "nfc", Ble = "ble", + Internal = "internal", } diff --git a/crates/web-sys/src/features/gen_AutoKeyword.rs b/crates/web-sys/src/features/gen_AutoKeyword.rs index d45de7a41a1..3ee39ad3351 100644 --- a/crates/web-sys/src/features/gen_AutoKeyword.rs +++ b/crates/web-sys/src/features/gen_AutoKeyword.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `AutoKeyword` enum."] diff --git a/crates/web-sys/src/features/gen_AutocompleteInfo.rs b/crates/web-sys/src/features/gen_AutocompleteInfo.rs index 42150b51bd2..d10e1094aa2 100644 --- a/crates/web-sys/src/features/gen_AutocompleteInfo.rs +++ b/crates/web-sys/src/features/gen_AutocompleteInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] pub type AutocompleteInfo; + #[doc = "Get the `addressType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[wasm_bindgen(method, getter = "addressType")] + pub fn get_address_type(this: &AutocompleteInfo) -> Option<::alloc::string::String>; + #[doc = "Change the `addressType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[wasm_bindgen(method, setter = "addressType")] + pub fn set_address_type(this: &AutocompleteInfo, val: &str); + #[doc = "Get the `contactType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[wasm_bindgen(method, getter = "contactType")] + pub fn get_contact_type(this: &AutocompleteInfo) -> Option<::alloc::string::String>; + #[doc = "Change the `contactType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[wasm_bindgen(method, setter = "contactType")] + pub fn set_contact_type(this: &AutocompleteInfo, val: &str); + #[doc = "Get the `fieldName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[wasm_bindgen(method, getter = "fieldName")] + pub fn get_field_name(this: &AutocompleteInfo) -> Option<::alloc::string::String>; + #[doc = "Change the `fieldName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[wasm_bindgen(method, setter = "fieldName")] + pub fn set_field_name(this: &AutocompleteInfo, val: &str); + #[doc = "Get the `section` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[wasm_bindgen(method, getter = "section")] + pub fn get_section(this: &AutocompleteInfo) -> Option<::alloc::string::String>; + #[doc = "Change the `section` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[wasm_bindgen(method, setter = "section")] + pub fn set_section(this: &AutocompleteInfo, val: &str); } impl AutocompleteInfo { #[doc = "Construct a new `AutocompleteInfo`."] @@ -19,72 +60,24 @@ impl AutocompleteInfo { 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`*"] + #[deprecated = "Use `set_address_type()` instead."] 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.set_address_type(val); self } - #[doc = "Change the `contactType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[deprecated = "Use `set_contact_type()` instead."] 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.set_contact_type(val); self } - #[doc = "Change the `fieldName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[deprecated = "Use `set_field_name()` instead."] 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.set_field_name(val); self } - #[doc = "Change the `section` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"] + #[deprecated = "Use `set_section()` instead."] 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.set_section(val); self } } diff --git a/crates/web-sys/src/features/gen_BarProp.rs b/crates/web-sys/src/features/gen_BarProp.rs index de029dcbcff..4917e7e08c8 100644 --- a/crates/web-sys/src/features/gen_BarProp.rs +++ b/crates/web-sys/src/features/gen_BarProp.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_BaseAudioContext.rs b/crates/web-sys/src/features/gen_BaseAudioContext.rs index 4fa90216942..3d3b6c95a69 100644 --- a/crates/web-sys/src/features/gen_BaseAudioContext.rs +++ b/crates/web-sys/src/features/gen_BaseAudioContext.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -10,9 +11,7 @@ extern "C" { #[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."] @@ -21,7 +20,6 @@ extern "C" { #[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 = ""] @@ -29,7 +27,6 @@ extern "C" { #[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 = ""] @@ -37,7 +34,6 @@ extern "C" { #[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."] @@ -46,7 +42,6 @@ extern "C" { #[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."] @@ -55,7 +50,6 @@ extern "C" { #[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."] @@ -64,7 +58,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioWorklet`, `BaseAudioContext`*"] pub fn audio_worklet(this: &BaseAudioContext) -> Result; - #[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 = ""] @@ -72,7 +65,6 @@ extern "C" { #[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 = ""] @@ -80,7 +72,6 @@ extern "C" { #[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."] @@ -89,7 +80,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AnalyserNode`, `BaseAudioContext`*"] pub fn create_analyser(this: &BaseAudioContext) -> Result; - #[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."] @@ -98,7 +88,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `BiquadFilterNode`*"] pub fn create_biquad_filter(this: &BaseAudioContext) -> Result; - #[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."] @@ -112,7 +101,6 @@ extern "C" { length: u32, sample_rate: f32, ) -> Result; - #[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."] @@ -121,7 +109,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `BaseAudioContext`*"] pub fn create_buffer_source(this: &BaseAudioContext) -> Result; - #[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."] @@ -130,7 +117,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ChannelMergerNode`*"] pub fn create_channel_merger(this: &BaseAudioContext) -> Result; - #[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."] @@ -142,7 +128,6 @@ extern "C" { this: &BaseAudioContext, number_of_inputs: u32, ) -> Result; - #[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."] @@ -152,7 +137,6 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ChannelSplitterNode`*"] pub fn create_channel_splitter(this: &BaseAudioContext) -> Result; - #[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."] @@ -164,7 +148,6 @@ extern "C" { this: &BaseAudioContext, number_of_outputs: u32, ) -> Result; - #[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."] @@ -173,7 +156,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ConstantSourceNode`*"] pub fn create_constant_source(this: &BaseAudioContext) -> Result; - #[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."] @@ -182,7 +164,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ConvolverNode`*"] pub fn create_convolver(this: &BaseAudioContext) -> Result; - #[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."] @@ -191,7 +172,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `DelayNode`*"] pub fn create_delay(this: &BaseAudioContext) -> Result; - #[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."] @@ -203,7 +183,6 @@ extern "C" { this: &BaseAudioContext, max_delay_time: f64, ) -> Result; - #[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."] @@ -214,7 +193,6 @@ extern "C" { pub fn create_dynamics_compressor( this: &BaseAudioContext, ) -> Result; - #[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."] @@ -223,7 +201,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `GainNode`*"] pub fn create_gain(this: &BaseAudioContext) -> Result; - #[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."] @@ -236,7 +213,6 @@ extern "C" { feedforward: &::wasm_bindgen::JsValue, feedback: &::wasm_bindgen::JsValue, ) -> Result; - #[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."] @@ -245,7 +221,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `OscillatorNode`*"] pub fn create_oscillator(this: &BaseAudioContext) -> Result; - #[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."] @@ -254,7 +229,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `PannerNode`*"] pub fn create_panner(this: &BaseAudioContext) -> Result; - #[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."] @@ -267,7 +241,42 @@ extern "C" { real: &mut [f32], imag: &mut [f32], ) -> Result; - #[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_with_f32_array_and_f32_slice( + this: &BaseAudioContext, + real: &::js_sys::Float32Array, + imag: &mut [f32], + ) -> Result; + #[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_with_f32_slice_and_f32_array( + this: &BaseAudioContext, + real: &mut [f32], + imag: &::js_sys::Float32Array, + ) -> Result; + #[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_with_f32_array_and_f32_array( + this: &BaseAudioContext, + real: &::js_sys::Float32Array, + imag: &::js_sys::Float32Array, + ) -> Result; #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))] # [wasm_bindgen (catch , method , structural , js_class = "BaseAudioContext" , js_name = createPeriodicWave)] #[doc = "The `createPeriodicWave()` method."] @@ -281,7 +290,45 @@ extern "C" { imag: &mut [f32], constraints: &PeriodicWaveConstraints, ) -> Result; - #[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_f32_array_and_f32_slice_and_constraints( + this: &BaseAudioContext, + real: &::js_sys::Float32Array, + imag: &mut [f32], + constraints: &PeriodicWaveConstraints, + ) -> Result; + #[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_f32_slice_and_f32_array_and_constraints( + this: &BaseAudioContext, + real: &mut [f32], + imag: &::js_sys::Float32Array, + constraints: &PeriodicWaveConstraints, + ) -> Result; + #[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_f32_array_and_f32_array_and_constraints( + this: &BaseAudioContext, + real: &::js_sys::Float32Array, + imag: &::js_sys::Float32Array, + constraints: &PeriodicWaveConstraints, + ) -> Result; #[cfg(feature = "ScriptProcessorNode")] # [wasm_bindgen (catch , method , structural , js_class = "BaseAudioContext" , js_name = createScriptProcessor)] #[doc = "The `createScriptProcessor()` method."] @@ -291,7 +338,6 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ScriptProcessorNode`*"] pub fn create_script_processor(this: &BaseAudioContext) -> Result; - #[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."] @@ -303,7 +349,6 @@ extern "C" { this: &BaseAudioContext, buffer_size: u32, ) -> Result; - #[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."] @@ -316,7 +361,6 @@ extern "C" { buffer_size: u32, number_of_input_channels: u32, ) -> Result; - #[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."] @@ -330,7 +374,6 @@ extern "C" { number_of_input_channels: u32, number_of_output_channels: u32, ) -> Result; - #[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."] @@ -339,7 +382,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `StereoPannerNode`*"] pub fn create_stereo_panner(this: &BaseAudioContext) -> Result; - #[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."] @@ -348,7 +390,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `WaveShaperNode`*"] pub fn create_wave_shaper(this: &BaseAudioContext) -> Result; - #[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 = ""] @@ -359,7 +400,6 @@ extern "C" { 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 = ""] @@ -371,7 +411,6 @@ extern "C" { 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 = ""] @@ -384,7 +423,6 @@ extern "C" { 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 = ""] diff --git a/crates/web-sys/src/features/gen_BaseComputedKeyframe.rs b/crates/web-sys/src/features/gen_BaseComputedKeyframe.rs index eba64eee23b..57fa7006021 100644 --- a/crates/web-sys/src/features/gen_BaseComputedKeyframe.rs +++ b/crates/web-sys/src/features/gen_BaseComputedKeyframe.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] pub type BaseComputedKeyframe; + #[cfg(feature = "CompositeOperation")] + #[doc = "Get the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`, `CompositeOperation`*"] + #[wasm_bindgen(method, getter = "composite")] + pub fn get_composite(this: &BaseComputedKeyframe) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "composite")] + pub fn set_composite(this: &BaseComputedKeyframe, val: Option); + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &BaseComputedKeyframe) -> Option<::alloc::string::String>; + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &BaseComputedKeyframe, val: &str); + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &BaseComputedKeyframe) -> Option; + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &BaseComputedKeyframe, val: Option); + #[doc = "Get the `simulateComputeValuesFailure` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[wasm_bindgen(method, getter = "simulateComputeValuesFailure")] + pub fn get_simulate_compute_values_failure(this: &BaseComputedKeyframe) -> Option; + #[doc = "Change the `simulateComputeValuesFailure` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[wasm_bindgen(method, setter = "simulateComputeValuesFailure")] + pub fn set_simulate_compute_values_failure(this: &BaseComputedKeyframe, val: bool); + #[doc = "Get the `computedOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[wasm_bindgen(method, getter = "computedOffset")] + pub fn get_computed_offset(this: &BaseComputedKeyframe) -> Option; + #[doc = "Change the `computedOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[wasm_bindgen(method, setter = "computedOffset")] + pub fn set_computed_offset(this: &BaseComputedKeyframe, val: f64); } impl BaseComputedKeyframe { #[doc = "Construct a new `BaseComputedKeyframe`."] @@ -20,83 +73,29 @@ impl BaseComputedKeyframe { 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`*"] + #[deprecated = "Use `set_composite()` instead."] pub fn composite(&mut self, val: Option) -> &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.set_composite(val); self } - #[doc = "Change the `easing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[deprecated = "Use `set_easing()` instead."] 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.set_easing(val); self } - #[doc = "Change the `offset` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[deprecated = "Use `set_offset()` instead."] pub fn offset(&mut self, val: Option) -> &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.set_offset(val); self } - #[doc = "Change the `simulateComputeValuesFailure` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[deprecated = "Use `set_simulate_compute_values_failure()` instead."] 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.set_simulate_compute_values_failure(val); self } - #[doc = "Change the `computedOffset` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"] + #[deprecated = "Use `set_computed_offset()` instead."] 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.set_computed_offset(val); self } } diff --git a/crates/web-sys/src/features/gen_BaseKeyframe.rs b/crates/web-sys/src/features/gen_BaseKeyframe.rs index aef90128463..e7aa2583119 100644 --- a/crates/web-sys/src/features/gen_BaseKeyframe.rs +++ b/crates/web-sys/src/features/gen_BaseKeyframe.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] pub type BaseKeyframe; + #[cfg(feature = "CompositeOperation")] + #[doc = "Get the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`, `CompositeOperation`*"] + #[wasm_bindgen(method, getter = "composite")] + pub fn get_composite(this: &BaseKeyframe) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "composite")] + pub fn set_composite(this: &BaseKeyframe, val: Option); + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &BaseKeyframe) -> Option<::alloc::string::String>; + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &BaseKeyframe, val: &str); + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &BaseKeyframe) -> Option; + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &BaseKeyframe, val: Option); + #[doc = "Get the `simulateComputeValuesFailure` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[wasm_bindgen(method, getter = "simulateComputeValuesFailure")] + pub fn get_simulate_compute_values_failure(this: &BaseKeyframe) -> Option; + #[doc = "Change the `simulateComputeValuesFailure` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[wasm_bindgen(method, setter = "simulateComputeValuesFailure")] + pub fn set_simulate_compute_values_failure(this: &BaseKeyframe, val: bool); } impl BaseKeyframe { #[doc = "Construct a new `BaseKeyframe`."] @@ -20,66 +63,24 @@ impl BaseKeyframe { 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`*"] + #[deprecated = "Use `set_composite()` instead."] pub fn composite(&mut self, val: Option) -> &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.set_composite(val); self } - #[doc = "Change the `easing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[deprecated = "Use `set_easing()` instead."] 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.set_easing(val); self } - #[doc = "Change the `offset` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[deprecated = "Use `set_offset()` instead."] pub fn offset(&mut self, val: Option) -> &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.set_offset(val); self } - #[doc = "Change the `simulateComputeValuesFailure` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"] + #[deprecated = "Use `set_simulate_compute_values_failure()` instead."] 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.set_simulate_compute_values_failure(val); self } } diff --git a/crates/web-sys/src/features/gen_BasePropertyIndexedKeyframe.rs b/crates/web-sys/src/features/gen_BasePropertyIndexedKeyframe.rs index b6dbdf025e1..fa9aa466833 100644 --- a/crates/web-sys/src/features/gen_BasePropertyIndexedKeyframe.rs +++ b/crates/web-sys/src/features/gen_BasePropertyIndexedKeyframe.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] pub type BasePropertyIndexedKeyframe; + #[doc = "Get the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] + #[wasm_bindgen(method, getter = "composite")] + pub fn get_composite(this: &BasePropertyIndexedKeyframe) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] + #[wasm_bindgen(method, setter = "composite")] + pub fn set_composite(this: &BasePropertyIndexedKeyframe, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &BasePropertyIndexedKeyframe) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &BasePropertyIndexedKeyframe, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &BasePropertyIndexedKeyframe) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &BasePropertyIndexedKeyframe, val: &::wasm_bindgen::JsValue); } impl BasePropertyIndexedKeyframe { #[doc = "Construct a new `BasePropertyIndexedKeyframe`."] @@ -19,49 +50,19 @@ impl BasePropertyIndexedKeyframe { 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`*"] + #[deprecated = "Use `set_composite()` instead."] 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.set_composite(val); self } - #[doc = "Change the `easing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] + #[deprecated = "Use `set_easing()` instead."] 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.set_easing(val); self } - #[doc = "Change the `offset` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"] + #[deprecated = "Use `set_offset()` instead."] 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.set_offset(val); self } } diff --git a/crates/web-sys/src/features/gen_BasicCardRequest.rs b/crates/web-sys/src/features/gen_BasicCardRequest.rs index a0e60aa8c74..ad2ad22c758 100644 --- a/crates/web-sys/src/features/gen_BasicCardRequest.rs +++ b/crates/web-sys/src/features/gen_BasicCardRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] pub type BasicCardRequest; + #[doc = "Get the `supportedNetworks` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] + #[wasm_bindgen(method, getter = "supportedNetworks")] + pub fn get_supported_networks(this: &BasicCardRequest) -> Option<::js_sys::Array>; + #[doc = "Change the `supportedNetworks` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] + #[wasm_bindgen(method, setter = "supportedNetworks")] + pub fn set_supported_networks(this: &BasicCardRequest, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `supportedTypes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] + #[wasm_bindgen(method, getter = "supportedTypes")] + pub fn get_supported_types(this: &BasicCardRequest) -> Option<::js_sys::Array>; + #[doc = "Change the `supportedTypes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] + #[wasm_bindgen(method, setter = "supportedTypes")] + pub fn set_supported_types(this: &BasicCardRequest, val: &::wasm_bindgen::JsValue); } impl BasicCardRequest { #[doc = "Construct a new `BasicCardRequest`."] @@ -19,38 +40,14 @@ impl BasicCardRequest { 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`*"] + #[deprecated = "Use `set_supported_networks()` instead."] 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.set_supported_networks(val); self } - #[doc = "Change the `supportedTypes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"] + #[deprecated = "Use `set_supported_types()` instead."] 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.set_supported_types(val); self } } diff --git a/crates/web-sys/src/features/gen_BasicCardResponse.rs b/crates/web-sys/src/features/gen_BasicCardResponse.rs index b005d718c06..d312a238ef4 100644 --- a/crates/web-sys/src/features/gen_BasicCardResponse.rs +++ b/crates/web-sys/src/features/gen_BasicCardResponse.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,68 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] pub type BasicCardResponse; + #[cfg(feature = "PaymentAddress")] + #[doc = "Get the `billingAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`, `PaymentAddress`*"] + #[wasm_bindgen(method, getter = "billingAddress")] + pub fn get_billing_address(this: &BasicCardResponse) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "billingAddress")] + pub fn set_billing_address(this: &BasicCardResponse, val: Option<&PaymentAddress>); + #[doc = "Get the `cardNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, getter = "cardNumber")] + pub fn get_card_number(this: &BasicCardResponse) -> ::alloc::string::String; + #[doc = "Change the `cardNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, setter = "cardNumber")] + pub fn set_card_number(this: &BasicCardResponse, val: &str); + #[doc = "Get the `cardSecurityCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, getter = "cardSecurityCode")] + pub fn get_card_security_code(this: &BasicCardResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `cardSecurityCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, setter = "cardSecurityCode")] + pub fn set_card_security_code(this: &BasicCardResponse, val: &str); + #[doc = "Get the `cardholderName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, getter = "cardholderName")] + pub fn get_cardholder_name(this: &BasicCardResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `cardholderName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, setter = "cardholderName")] + pub fn set_cardholder_name(this: &BasicCardResponse, val: &str); + #[doc = "Get the `expiryMonth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, getter = "expiryMonth")] + pub fn get_expiry_month(this: &BasicCardResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `expiryMonth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, setter = "expiryMonth")] + pub fn set_expiry_month(this: &BasicCardResponse, val: &str); + #[doc = "Get the `expiryYear` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, getter = "expiryYear")] + pub fn get_expiry_year(this: &BasicCardResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `expiryYear` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[wasm_bindgen(method, setter = "expiryYear")] + pub fn set_expiry_year(this: &BasicCardResponse, val: &str); } impl BasicCardResponse { #[doc = "Construct a new `BasicCardResponse`."] @@ -17,110 +80,38 @@ impl 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.set_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`*"] + #[deprecated = "Use `set_billing_address()` instead."] 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.set_billing_address(val); self } - #[doc = "Change the `cardNumber` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[deprecated = "Use `set_card_number()` instead."] 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.set_card_number(val); self } - #[doc = "Change the `cardSecurityCode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[deprecated = "Use `set_card_security_code()` instead."] 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.set_card_security_code(val); self } - #[doc = "Change the `cardholderName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[deprecated = "Use `set_cardholder_name()` instead."] 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.set_cardholder_name(val); self } - #[doc = "Change the `expiryMonth` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[deprecated = "Use `set_expiry_month()` instead."] 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.set_expiry_month(val); self } - #[doc = "Change the `expiryYear` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"] + #[deprecated = "Use `set_expiry_year()` instead."] 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.set_expiry_year(val); self } } diff --git a/crates/web-sys/src/features/gen_BasicCardType.rs b/crates/web-sys/src/features/gen_BasicCardType.rs index 2a7b1c7be3e..87d45224e9c 100644 --- a/crates/web-sys/src/features/gen_BasicCardType.rs +++ b/crates/web-sys/src/features/gen_BasicCardType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `BasicCardType` enum."] diff --git a/crates/web-sys/src/features/gen_BatteryManager.rs b/crates/web-sys/src/features/gen_BatteryManager.rs index 1098d5c1ff4..2185efb5170 100644 --- a/crates/web-sys/src/features/gen_BatteryManager.rs +++ b/crates/web-sys/src/features/gen_BatteryManager.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_BeforeUnloadEvent.rs b/crates/web-sys/src/features/gen_BeforeUnloadEvent.rs index 981323ed0ae..0a8069a20d6 100644 --- a/crates/web-sys/src/features/gen_BeforeUnloadEvent.rs +++ b/crates/web-sys/src/features/gen_BeforeUnloadEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[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; + pub fn return_value(this: &BeforeUnloadEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "BeforeUnloadEvent" , js_name = returnValue)] #[doc = "Setter for the `returnValue` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_BinaryType.rs b/crates/web-sys/src/features/gen_BinaryType.rs index d7ee13bafe1..aa7ab231dc5 100644 --- a/crates/web-sys/src/features/gen_BinaryType.rs +++ b/crates/web-sys/src/features/gen_BinaryType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `BinaryType` enum."] diff --git a/crates/web-sys/src/features/gen_BiquadFilterNode.rs b/crates/web-sys/src/features/gen_BiquadFilterNode.rs index 5c0dd01b70c..5ffe71836ad 100644 --- a/crates/web-sys/src/features/gen_BiquadFilterNode.rs +++ b/crates/web-sys/src/features/gen_BiquadFilterNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -90,4 +91,88 @@ extern "C" { mag_response: &mut [f32], phase_response: &mut [f32], ); + # [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_with_f32_array_and_f32_slice_and_f32_slice( + this: &BiquadFilterNode, + frequency_hz: &::js_sys::Float32Array, + mag_response: &mut [f32], + phase_response: &mut [f32], + ); + # [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_with_f32_slice_and_f32_array_and_f32_slice( + this: &BiquadFilterNode, + frequency_hz: &mut [f32], + mag_response: &::js_sys::Float32Array, + phase_response: &mut [f32], + ); + # [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_with_f32_array_and_f32_array_and_f32_slice( + this: &BiquadFilterNode, + frequency_hz: &::js_sys::Float32Array, + mag_response: &::js_sys::Float32Array, + phase_response: &mut [f32], + ); + # [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_with_f32_slice_and_f32_slice_and_f32_array( + this: &BiquadFilterNode, + frequency_hz: &mut [f32], + mag_response: &mut [f32], + phase_response: &::js_sys::Float32Array, + ); + # [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_with_f32_array_and_f32_slice_and_f32_array( + this: &BiquadFilterNode, + frequency_hz: &::js_sys::Float32Array, + mag_response: &mut [f32], + phase_response: &::js_sys::Float32Array, + ); + # [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_with_f32_slice_and_f32_array_and_f32_array( + this: &BiquadFilterNode, + frequency_hz: &mut [f32], + mag_response: &::js_sys::Float32Array, + phase_response: &::js_sys::Float32Array, + ); + # [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_with_f32_array_and_f32_array_and_f32_array( + this: &BiquadFilterNode, + frequency_hz: &::js_sys::Float32Array, + mag_response: &::js_sys::Float32Array, + phase_response: &::js_sys::Float32Array, + ); } diff --git a/crates/web-sys/src/features/gen_BiquadFilterOptions.rs b/crates/web-sys/src/features/gen_BiquadFilterOptions.rs index af051cb2cf1..a1dedd02340 100644 --- a/crates/web-sys/src/features/gen_BiquadFilterOptions.rs +++ b/crates/web-sys/src/features/gen_BiquadFilterOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,92 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] pub type BiquadFilterOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &BiquadFilterOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &BiquadFilterOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `ChannelCountMode`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &BiquadFilterOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &BiquadFilterOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `ChannelInterpretation`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &BiquadFilterOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &BiquadFilterOptions, val: ChannelInterpretation); + #[doc = "Get the `Q` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, getter = "Q")] + pub fn get_q(this: &BiquadFilterOptions) -> Option; + #[doc = "Change the `Q` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, setter = "Q")] + pub fn set_q(this: &BiquadFilterOptions, val: f32); + #[doc = "Get the `detune` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, getter = "detune")] + pub fn get_detune(this: &BiquadFilterOptions) -> Option; + #[doc = "Change the `detune` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, setter = "detune")] + pub fn set_detune(this: &BiquadFilterOptions, val: f32); + #[doc = "Get the `frequency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, getter = "frequency")] + pub fn get_frequency(this: &BiquadFilterOptions) -> Option; + #[doc = "Change the `frequency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, setter = "frequency")] + pub fn set_frequency(this: &BiquadFilterOptions, val: f32); + #[doc = "Get the `gain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, getter = "gain")] + pub fn get_gain(this: &BiquadFilterOptions) -> Option; + #[doc = "Change the `gain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[wasm_bindgen(method, setter = "gain")] + pub fn set_gain(this: &BiquadFilterOptions, val: f32); + #[cfg(feature = "BiquadFilterType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `BiquadFilterType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &BiquadFilterOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &BiquadFilterOptions, val: BiquadFilterType); } impl BiquadFilterOptions { #[doc = "Construct a new `BiquadFilterOptions`."] @@ -19,128 +106,47 @@ impl BiquadFilterOptions { 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`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); 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`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); 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`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `Q` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[deprecated = "Use `set_q()` instead."] 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.set_q(val); self } - #[doc = "Change the `detune` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[deprecated = "Use `set_detune()` instead."] 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.set_detune(val); self } - #[doc = "Change the `frequency` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[deprecated = "Use `set_frequency()` instead."] 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.set_frequency(val); self } - #[doc = "Change the `gain` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"] + #[deprecated = "Use `set_gain()` instead."] 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.set_gain(val); 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`*"] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_BiquadFilterType.rs b/crates/web-sys/src/features/gen_BiquadFilterType.rs index 21743d5f96a..fbd455d2619 100644 --- a/crates/web-sys/src/features/gen_BiquadFilterType.rs +++ b/crates/web-sys/src/features/gen_BiquadFilterType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `BiquadFilterType` enum."] diff --git a/crates/web-sys/src/features/gen_Blob.rs b/crates/web-sys/src/features/gen_Blob.rs index 3300b57d67c..6cad214b381 100644 --- a/crates/web-sys/src/features/gen_Blob.rs +++ b/crates/web-sys/src/features/gen_Blob.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { #[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; + pub fn type_(this: &Blob) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "Blob")] #[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."] #[doc = ""] @@ -47,6 +48,15 @@ extern "C" { #[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_slice_sequence( + blob_parts: &::wasm_bindgen::JsValue, + ) -> Result; + #[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; @@ -82,6 +92,17 @@ extern "C" { #[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_slice_sequence_and_options( + blob_parts: &::wasm_bindgen::JsValue, + options: &BlobPropertyBag, + ) -> Result; + #[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, diff --git a/crates/web-sys/src/features/gen_BlobEvent.rs b/crates/web-sys/src/features/gen_BlobEvent.rs index 2274dde0eb4..5fc56d5d9e2 100644 --- a/crates/web-sys/src/features/gen_BlobEvent.rs +++ b/crates/web-sys/src/features/gen_BlobEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_BlobEventInit.rs b/crates/web-sys/src/features/gen_BlobEventInit.rs index 10d38101338..fea2a8ed6a5 100644 --- a/crates/web-sys/src/features/gen_BlobEventInit.rs +++ b/crates/web-sys/src/features/gen_BlobEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] pub type BlobEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &BlobEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &BlobEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &BlobEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &BlobEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &BlobEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &BlobEventInit, val: bool); + #[cfg(feature = "Blob")] + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &BlobEventInit) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &BlobEventInit, val: Option<&Blob>); } impl BlobEventInit { #[doc = "Construct a new `BlobEventInit`."] @@ -19,69 +62,25 @@ impl BlobEventInit { 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`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); 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`*"] + #[deprecated = "Use `set_data()` instead."] 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.set_data(val); self } } diff --git a/crates/web-sys/src/features/gen_BlobPropertyBag.rs b/crates/web-sys/src/features/gen_BlobPropertyBag.rs index e7d1f6f5a51..c1e3196c82f 100644 --- a/crates/web-sys/src/features/gen_BlobPropertyBag.rs +++ b/crates/web-sys/src/features/gen_BlobPropertyBag.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"] pub type BlobPropertyBag; + #[cfg(feature = "EndingTypes")] + #[doc = "Get the `endings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`, `EndingTypes`*"] + #[wasm_bindgen(method, getter = "endings")] + pub fn get_endings(this: &BlobPropertyBag) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "endings")] + pub fn set_endings(this: &BlobPropertyBag, val: EndingTypes); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &BlobPropertyBag) -> Option<::alloc::string::String>; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &BlobPropertyBag, val: &str); } impl BlobPropertyBag { #[doc = "Construct a new `BlobPropertyBag`."] @@ -20,34 +43,14 @@ impl BlobPropertyBag { 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`*"] + #[deprecated = "Use `set_endings()` instead."] 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.set_endings(val); self } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_BlockParsingOptions.rs b/crates/web-sys/src/features/gen_BlockParsingOptions.rs index 9e0e4dbee5a..6990d64bded 100644 --- a/crates/web-sys/src/features/gen_BlockParsingOptions.rs +++ b/crates/web-sys/src/features/gen_BlockParsingOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BlockParsingOptions`*"] pub type BlockParsingOptions; + #[doc = "Get the `blockScriptCreated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlockParsingOptions`*"] + #[wasm_bindgen(method, getter = "blockScriptCreated")] + pub fn get_block_script_created(this: &BlockParsingOptions) -> Option; + #[doc = "Change the `blockScriptCreated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BlockParsingOptions`*"] + #[wasm_bindgen(method, setter = "blockScriptCreated")] + pub fn set_block_script_created(this: &BlockParsingOptions, val: bool); } impl BlockParsingOptions { #[doc = "Construct a new `BlockParsingOptions`."] @@ -19,21 +30,9 @@ impl BlockParsingOptions { 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`*"] + #[deprecated = "Use `set_block_script_created()` instead."] 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.set_block_script_created(val); self } } diff --git a/crates/web-sys/src/features/gen_Bluetooth.rs b/crates/web-sys/src/features/gen_Bluetooth.rs index 826ee01af10..4bd36b23e6b 100644 --- a/crates/web-sys/src/features/gen_Bluetooth.rs +++ b/crates/web-sys/src/features/gen_Bluetooth.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs b/crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs index 5919467c2d9..528dc366590 100644 --- a/crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs +++ b/crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -48,7 +49,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn name(this: &BluetoothAdvertisingEvent) -> Option; + pub fn name(this: &BluetoothAdvertisingEvent) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "BluetoothAdvertisingEvent" , js_name = appearance)] #[doc = "Getter for the `appearance` field of this object."] diff --git a/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs b/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs index cee141adc21..de40f5a3828 100644 --- a/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs +++ b/crates/web-sys/src/features/gen_BluetoothAdvertisingEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type BluetoothAdvertisingEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl BluetoothAdvertisingEventInit { - #[cfg(feature = "BluetoothDevice")] - #[doc = "Construct a new `BluetoothAdvertisingEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(device: &BluetoothDevice) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.device(device); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &BluetoothAdvertisingEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &BluetoothAdvertisingEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &BluetoothAdvertisingEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -57,20 +48,17 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &BluetoothAdvertisingEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &BluetoothAdvertisingEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -78,20 +66,17 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &BluetoothAdvertisingEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `appearance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "appearance")] + pub fn get_appearance(this: &BluetoothAdvertisingEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `appearance` field of this object."] #[doc = ""] @@ -99,20 +84,18 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn appearance(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("appearance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "appearance")] + pub fn set_appearance(this: &BluetoothAdvertisingEventInit, val: u16); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothDevice")] + #[doc = "Get the `device` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "device")] + pub fn get_device(this: &BluetoothAdvertisingEventInit) -> BluetoothDevice; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "BluetoothDevice")] #[doc = "Change the `device` field of this object."] @@ -121,17 +104,20 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn device(&mut self, val: &BluetoothDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "device")] + pub fn set_device(this: &BluetoothAdvertisingEventInit, val: &BluetoothDevice); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothManufacturerDataMap")] + #[doc = "Get the `manufacturerData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "manufacturerData")] + pub fn get_manufacturer_data( + this: &BluetoothAdvertisingEventInit, + ) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "BluetoothManufacturerDataMap")] #[doc = "Change the `manufacturerData` field of this object."] @@ -140,20 +126,20 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn manufacturer_data(&mut self, val: &BluetoothManufacturerDataMap) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("manufacturerData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "manufacturerData")] + pub fn set_manufacturer_data( + this: &BluetoothAdvertisingEventInit, + val: &BluetoothManufacturerDataMap, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &BluetoothAdvertisingEventInit) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `name` field of this object."] #[doc = ""] @@ -161,16 +147,17 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &BluetoothAdvertisingEventInit, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rssi` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rssi")] + pub fn get_rssi(this: &BluetoothAdvertisingEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `rssi` field of this object."] #[doc = ""] @@ -178,16 +165,20 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn rssi(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rssi"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "rssi")] + pub fn set_rssi(this: &BluetoothAdvertisingEventInit, val: i8); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothServiceDataMap")] + #[doc = "Get the `serviceData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "serviceData")] + pub fn get_service_data( + this: &BluetoothAdvertisingEventInit, + ) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "BluetoothServiceDataMap")] #[doc = "Change the `serviceData` field of this object."] @@ -196,20 +187,17 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn service_data(&mut self, val: &BluetoothServiceDataMap) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serviceData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "serviceData")] + pub fn set_service_data(this: &BluetoothAdvertisingEventInit, val: &BluetoothServiceDataMap); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `txPower` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "txPower")] + pub fn get_tx_power(this: &BluetoothAdvertisingEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `txPower` field of this object."] #[doc = ""] @@ -217,20 +205,17 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn tx_power(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("txPower"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "txPower")] + pub fn set_tx_power(this: &BluetoothAdvertisingEventInit, val: i8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `uuids` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "uuids")] + pub fn get_uuids(this: &BluetoothAdvertisingEventInit) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `uuids` field of this object."] #[doc = ""] @@ -238,14 +223,91 @@ impl BluetoothAdvertisingEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "uuids")] + pub fn set_uuids(this: &BluetoothAdvertisingEventInit, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothAdvertisingEventInit { + #[cfg(feature = "BluetoothDevice")] + #[doc = "Construct a new `BluetoothAdvertisingEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEventInit`, `BluetoothDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(device: &BluetoothDevice) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_device(device); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_appearance()` instead."] + pub fn appearance(&mut self, val: u16) -> &mut Self { + self.set_appearance(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothDevice")] + #[deprecated = "Use `set_device()` instead."] + pub fn device(&mut self, val: &BluetoothDevice) -> &mut Self { + self.set_device(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothManufacturerDataMap")] + #[deprecated = "Use `set_manufacturer_data()` instead."] + pub fn manufacturer_data(&mut self, val: &BluetoothManufacturerDataMap) -> &mut Self { + self.set_manufacturer_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: &str) -> &mut Self { + self.set_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rssi()` instead."] + pub fn rssi(&mut self, val: i8) -> &mut Self { + self.set_rssi(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "BluetoothServiceDataMap")] + #[deprecated = "Use `set_service_data()` instead."] + pub fn service_data(&mut self, val: &BluetoothServiceDataMap) -> &mut Self { + self.set_service_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_tx_power()` instead."] + pub fn tx_power(&mut self, val: i8) -> &mut Self { + self.set_tx_power(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_uuids()` instead."] pub fn uuids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("uuids"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_uuids(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothCharacteristicProperties.rs b/crates/web-sys/src/features/gen_BluetoothCharacteristicProperties.rs index 0c301b0309a..3105c439942 100644 --- a/crates/web-sys/src/features/gen_BluetoothCharacteristicProperties.rs +++ b/crates/web-sys/src/features/gen_BluetoothCharacteristicProperties.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs b/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs index e8908b1c6aa..d7ec6784356 100644 --- a/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs +++ b/crates/web-sys/src/features/gen_BluetoothDataFilterInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type BluetoothDataFilterInit; -} -#[cfg(web_sys_unstable_apis)] -impl BluetoothDataFilterInit { - #[doc = "Construct a new `BluetoothDataFilterInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `dataPrefix` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "dataPrefix")] + pub fn get_data_prefix(this: &BluetoothDataFilterInit) -> Option<::js_sys::Object>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `dataPrefix` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl BluetoothDataFilterInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn data_prefix(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataPrefix"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "dataPrefix")] + pub fn set_data_prefix(this: &BluetoothDataFilterInit, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mask")] + pub fn get_mask(this: &BluetoothDataFilterInit) -> Option<::js_sys::Object>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `mask` field of this object."] #[doc = ""] @@ -55,14 +48,32 @@ impl BluetoothDataFilterInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mask")] + pub fn set_mask(this: &BluetoothDataFilterInit, val: &::js_sys::Object); +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothDataFilterInit { + #[doc = "Construct a new `BluetoothDataFilterInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothDataFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data_prefix()` instead."] + pub fn data_prefix(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_data_prefix(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mask()` instead."] pub fn mask(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mask(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothDevice.rs b/crates/web-sys/src/features/gen_BluetoothDevice.rs index 95dfae1a0e9..f764a96d54e 100644 --- a/crates/web-sys/src/features/gen_BluetoothDevice.rs +++ b/crates/web-sys/src/features/gen_BluetoothDevice.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn id(this: &BluetoothDevice) -> String; + pub fn id(this: &BluetoothDevice) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = name)] #[doc = "Getter for the `name` field of this object."] @@ -36,7 +37,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn name(this: &BluetoothDevice) -> Option; + pub fn name(this: &BluetoothDevice) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "BluetoothRemoteGattServer")] # [wasm_bindgen (structural , method , getter , js_class = "BluetoothDevice" , js_name = gatt)] diff --git a/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs b/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs index 4e8a4cb2617..7ed69962541 100644 --- a/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs +++ b/crates/web-sys/src/features/gen_BluetoothLeScanFilterInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type BluetoothLeScanFilterInit; -} -#[cfg(web_sys_unstable_apis)] -impl BluetoothLeScanFilterInit { - #[doc = "Construct a new `BluetoothLeScanFilterInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `manufacturerData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "manufacturerData")] + pub fn get_manufacturer_data(this: &BluetoothLeScanFilterInit) -> Option<::js_sys::Object>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `manufacturerData` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl BluetoothLeScanFilterInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn manufacturer_data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("manufacturerData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "manufacturerData")] + pub fn set_manufacturer_data(this: &BluetoothLeScanFilterInit, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &BluetoothLeScanFilterInit) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `name` field of this object."] #[doc = ""] @@ -55,16 +48,17 @@ impl BluetoothLeScanFilterInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &BluetoothLeScanFilterInit, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `namePrefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "namePrefix")] + pub fn get_name_prefix(this: &BluetoothLeScanFilterInit) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `namePrefix` field of this object."] #[doc = ""] @@ -72,20 +66,17 @@ impl BluetoothLeScanFilterInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn name_prefix(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namePrefix"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "namePrefix")] + pub fn set_name_prefix(this: &BluetoothLeScanFilterInit, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `serviceData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "serviceData")] + pub fn get_service_data(this: &BluetoothLeScanFilterInit) -> Option<::js_sys::Object>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `serviceData` field of this object."] #[doc = ""] @@ -93,20 +84,17 @@ impl BluetoothLeScanFilterInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn service_data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serviceData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "serviceData")] + pub fn set_service_data(this: &BluetoothLeScanFilterInit, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `services` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "services")] + pub fn get_services(this: &BluetoothLeScanFilterInit) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `services` field of this object."] #[doc = ""] @@ -114,18 +102,50 @@ impl BluetoothLeScanFilterInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "services")] + pub fn set_services(this: &BluetoothLeScanFilterInit, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothLeScanFilterInit { + #[doc = "Construct a new `BluetoothLeScanFilterInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothLeScanFilterInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_manufacturer_data()` instead."] + pub fn manufacturer_data(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_manufacturer_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: &str) -> &mut Self { + self.set_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_name_prefix()` instead."] + pub fn name_prefix(&mut self, val: &str) -> &mut Self { + self.set_name_prefix(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_service_data()` instead."] + pub fn service_data(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_service_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_services()` instead."] pub fn services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("services"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_services(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothManufacturerDataMap.rs b/crates/web-sys/src/features/gen_BluetoothManufacturerDataMap.rs index db317c7dc75..4019b015ca7 100644 --- a/crates/web-sys/src/features/gen_BluetoothManufacturerDataMap.rs +++ b/crates/web-sys/src/features/gen_BluetoothManufacturerDataMap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -15,4 +16,84 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type BluetoothManufacturerDataMap; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothManufacturerDataMap" , 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/BluetoothManufacturerDataMap/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &BluetoothManufacturerDataMap) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothManufacturerDataMap" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothManufacturerDataMap/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(this: &BluetoothManufacturerDataMap) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothManufacturerDataMap" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothManufacturerDataMap/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn for_each( + this: &BluetoothManufacturerDataMap, + callback: &::js_sys::Function, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothManufacturerDataMap" , js_name = get)] + #[doc = "The `get()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothManufacturerDataMap/get)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get(this: &BluetoothManufacturerDataMap, key: u16) -> Option<::js_sys::DataView>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothManufacturerDataMap" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothManufacturerDataMap/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn has(this: &BluetoothManufacturerDataMap, key: u16) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothManufacturerDataMap" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothManufacturerDataMap/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn keys(this: &BluetoothManufacturerDataMap) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothManufacturerDataMap" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothManufacturerDataMap/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothManufacturerDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn values(this: &BluetoothManufacturerDataMap) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs b/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs index 9f5f22af99c..525ca9a7ab3 100644 --- a/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_BluetoothPermissionDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type BluetoothPermissionDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl BluetoothPermissionDescriptor { + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "PermissionName")] - #[doc = "Construct a new `BluetoothPermissionDescriptor`."] + #[doc = "Get the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(name: PermissionName) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret - } + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &BluetoothPermissionDescriptor) -> PermissionName; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "PermissionName")] #[doc = "Change the `name` field of this object."] @@ -37,16 +32,17 @@ impl BluetoothPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn name(&mut self, val: PermissionName) -> &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 - } + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &BluetoothPermissionDescriptor, val: PermissionName); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `acceptAllDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "acceptAllDevices")] + pub fn get_accept_all_devices(this: &BluetoothPermissionDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `acceptAllDevices` field of this object."] #[doc = ""] @@ -54,20 +50,17 @@ impl BluetoothPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn accept_all_devices(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("acceptAllDevices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "acceptAllDevices")] + pub fn set_accept_all_devices(this: &BluetoothPermissionDescriptor, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "deviceId")] + pub fn get_device_id(this: &BluetoothPermissionDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `deviceId` field of this object."] #[doc = ""] @@ -75,20 +68,17 @@ impl BluetoothPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn device_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "deviceId")] + pub fn set_device_id(this: &BluetoothPermissionDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "filters")] + pub fn get_filters(this: &BluetoothPermissionDescriptor) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `filters` field of this object."] #[doc = ""] @@ -96,20 +86,17 @@ impl BluetoothPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "filters")] + pub fn set_filters(this: &BluetoothPermissionDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `optionalServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "optionalServices")] + pub fn get_optional_services(this: &BluetoothPermissionDescriptor) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `optionalServices` field of this object."] #[doc = ""] @@ -117,18 +104,56 @@ impl BluetoothPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "optionalServices")] + pub fn set_optional_services( + this: &BluetoothPermissionDescriptor, + val: &::wasm_bindgen::JsValue, + ); +} +#[cfg(web_sys_unstable_apis)] +impl BluetoothPermissionDescriptor { + #[cfg(feature = "PermissionName")] + #[doc = "Construct a new `BluetoothPermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionDescriptor`, `PermissionName`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(name: PermissionName) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_name(name); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: PermissionName) -> &mut Self { + self.set_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_accept_all_devices()` instead."] + pub fn accept_all_devices(&mut self, val: bool) -> &mut Self { + self.set_accept_all_devices(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_device_id()` instead."] + pub fn device_id(&mut self, val: &str) -> &mut Self { + self.set_device_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_filters()` instead."] + pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_filters(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_optional_services()` instead."] pub fn optional_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optionalServices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_optional_services(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothPermissionResult.rs b/crates/web-sys/src/features/gen_BluetoothPermissionResult.rs index 68bc1a244ae..036735a5383 100644 --- a/crates/web-sys/src/features/gen_BluetoothPermissionResult.rs +++ b/crates/web-sys/src/features/gen_BluetoothPermissionResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs b/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs index 28aab60d28a..fc4c06813ae 100644 --- a/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs +++ b/crates/web-sys/src/features/gen_BluetoothPermissionStorage.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type BluetoothPermissionStorage; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `allowedDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "allowedDevices")] + pub fn get_allowed_devices(this: &BluetoothPermissionStorage) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `allowedDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "allowedDevices")] + pub fn set_allowed_devices(this: &BluetoothPermissionStorage, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl BluetoothPermissionStorage { @@ -25,28 +44,13 @@ impl BluetoothPermissionStorage { pub fn new(allowed_devices: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.allowed_devices(allowed_devices); + ret.set_allowed_devices(allowed_devices); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `allowedDevices` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BluetoothPermissionStorage`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_allowed_devices()` instead."] pub fn allowed_devices(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowedDevices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_allowed_devices(val); self } } diff --git a/crates/web-sys/src/features/gen_BluetoothRemoteGattCharacteristic.rs b/crates/web-sys/src/features/gen_BluetoothRemoteGattCharacteristic.rs index 7858ac35a37..558acf559ec 100644 --- a/crates/web-sys/src/features/gen_BluetoothRemoteGattCharacteristic.rs +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattCharacteristic.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -37,7 +38,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn uuid(this: &BluetoothRemoteGattCharacteristic) -> String; + pub fn uuid(this: &BluetoothRemoteGattCharacteristic) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "BluetoothCharacteristicProperties")] # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = properties)] @@ -191,7 +192,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn stop_notifications(this: &BluetoothRemoteGattCharacteristic) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValue)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValue)] #[doc = "The `writeValue()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValue)"] @@ -203,9 +204,9 @@ extern "C" { pub fn write_value_with_buffer_source( this: &BluetoothRemoteGattCharacteristic, value: &::js_sys::Object, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValue)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValue)] #[doc = "The `writeValue()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValue)"] @@ -214,12 +215,26 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_value_with_u8_array( + pub fn write_value_with_u8_slice( this: &BluetoothRemoteGattCharacteristic, value: &mut [u8], - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithResponse)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValue)] + #[doc = "The `writeValue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_u8_array( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithResponse)] #[doc = "The `writeValueWithResponse()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithResponse)"] @@ -231,9 +246,9 @@ extern "C" { pub fn write_value_with_response_with_buffer_source( this: &BluetoothRemoteGattCharacteristic, value: &::js_sys::Object, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithResponse)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithResponse)] #[doc = "The `writeValueWithResponse()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithResponse)"] @@ -242,12 +257,26 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_value_with_response_with_u8_array( + pub fn write_value_with_response_with_u8_slice( this: &BluetoothRemoteGattCharacteristic, value: &mut [u8], - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithResponse)] + #[doc = "The `writeValueWithResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_response_with_u8_array( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithoutResponse)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithoutResponse)] #[doc = "The `writeValueWithoutResponse()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse)"] @@ -259,9 +288,9 @@ extern "C" { pub fn write_value_without_response_with_buffer_source( this: &BluetoothRemoteGattCharacteristic, value: &::js_sys::Object, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithoutResponse)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithoutResponse)] #[doc = "The `writeValueWithoutResponse()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse)"] @@ -270,8 +299,22 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_value_without_response_with_u8_array( + pub fn write_value_without_response_with_u8_slice( this: &BluetoothRemoteGattCharacteristic, value: &mut [u8], - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTCharacteristic" , js_name = writeValueWithoutResponse)] + #[doc = "The `writeValueWithoutResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTCharacteristic/writeValueWithoutResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattCharacteristic`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_without_response_with_u8_array( + this: &BluetoothRemoteGattCharacteristic, + value: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; } diff --git a/crates/web-sys/src/features/gen_BluetoothRemoteGattDescriptor.rs b/crates/web-sys/src/features/gen_BluetoothRemoteGattDescriptor.rs index 14375523a85..3bcaa2710d6 100644 --- a/crates/web-sys/src/features/gen_BluetoothRemoteGattDescriptor.rs +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -39,7 +40,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn uuid(this: &BluetoothRemoteGattDescriptor) -> String; + pub fn uuid(this: &BluetoothRemoteGattDescriptor) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTDescriptor" , js_name = value)] #[doc = "Getter for the `value` field of this object."] @@ -63,7 +64,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_value(this: &BluetoothRemoteGattDescriptor) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTDescriptor" , js_name = writeValue)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTDescriptor" , js_name = writeValue)] #[doc = "The `writeValue()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/writeValue)"] @@ -75,9 +76,9 @@ extern "C" { pub fn write_value_with_buffer_source( this: &BluetoothRemoteGattDescriptor, value: &::js_sys::Object, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "BluetoothRemoteGATTDescriptor" , js_name = writeValue)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTDescriptor" , js_name = writeValue)] #[doc = "The `writeValue()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/writeValue)"] @@ -86,8 +87,22 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_value_with_u8_array( + pub fn write_value_with_u8_slice( this: &BluetoothRemoteGattDescriptor, value: &mut [u8], - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothRemoteGATTDescriptor" , js_name = writeValue)] + #[doc = "The `writeValue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTDescriptor/writeValue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothRemoteGattDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_value_with_u8_array( + this: &BluetoothRemoteGattDescriptor, + value: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; } diff --git a/crates/web-sys/src/features/gen_BluetoothRemoteGattServer.rs b/crates/web-sys/src/features/gen_BluetoothRemoteGattServer.rs index 76e8d833d61..20c8dd60457 100644 --- a/crates/web-sys/src/features/gen_BluetoothRemoteGattServer.rs +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattServer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_BluetoothRemoteGattService.rs b/crates/web-sys/src/features/gen_BluetoothRemoteGattService.rs index 852c88b1c9e..5e98ade8f1c 100644 --- a/crates/web-sys/src/features/gen_BluetoothRemoteGattService.rs +++ b/crates/web-sys/src/features/gen_BluetoothRemoteGattService.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -37,7 +38,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn uuid(this: &BluetoothRemoteGattService) -> String; + pub fn uuid(this: &BluetoothRemoteGattService) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "BluetoothRemoteGATTService" , js_name = isPrimary)] #[doc = "Getter for the `isPrimary` field of this object."] diff --git a/crates/web-sys/src/features/gen_BluetoothServiceDataMap.rs b/crates/web-sys/src/features/gen_BluetoothServiceDataMap.rs index cb089efcc6a..ebb91877822 100644 --- a/crates/web-sys/src/features/gen_BluetoothServiceDataMap.rs +++ b/crates/web-sys/src/features/gen_BluetoothServiceDataMap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -15,4 +16,84 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type BluetoothServiceDataMap; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "BluetoothServiceDataMap" , 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/BluetoothServiceDataMap/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &BluetoothServiceDataMap) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothServiceDataMap" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothServiceDataMap/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(this: &BluetoothServiceDataMap) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "BluetoothServiceDataMap" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothServiceDataMap/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn for_each( + this: &BluetoothServiceDataMap, + callback: &::js_sys::Function, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothServiceDataMap" , js_name = get)] + #[doc = "The `get()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothServiceDataMap/get)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get(this: &BluetoothServiceDataMap, key: &str) -> Option<::js_sys::DataView>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothServiceDataMap" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothServiceDataMap/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn has(this: &BluetoothServiceDataMap, key: &str) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothServiceDataMap" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothServiceDataMap/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn keys(this: &BluetoothServiceDataMap) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "BluetoothServiceDataMap" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothServiceDataMap/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BluetoothServiceDataMap`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn values(this: &BluetoothServiceDataMap) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_BluetoothUuid.rs b/crates/web-sys/src/features/gen_BluetoothUuid.rs index 65e1505356d..722f9cc6a1a 100644 --- a/crates/web-sys/src/features/gen_BluetoothUuid.rs +++ b/crates/web-sys/src/features/gen_BluetoothUuid.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -19,77 +20,77 @@ extern "C" { # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = canonicalUUID)] #[doc = "The `canonicalUUID()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/canonicalUUID)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/canonicalUUID_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn canonical_uuid(alias: u32) -> String; + pub fn canonical_uuid(alias: u32) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getCharacteristic)] #[doc = "The `getCharacteristic()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getCharacteristic)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getCharacteristic_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_characteristic_with_str(name: &str) -> String; + pub fn get_characteristic_with_str(name: &str) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getCharacteristic)] #[doc = "The `getCharacteristic()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getCharacteristic)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getCharacteristic_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_characteristic_with_u32(name: u32) -> String; + pub fn get_characteristic_with_u32(name: u32) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getDescriptor)] #[doc = "The `getDescriptor()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getDescriptor)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getDescriptor_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_descriptor_with_str(name: &str) -> String; + pub fn get_descriptor_with_str(name: &str) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getDescriptor)] #[doc = "The `getDescriptor()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getDescriptor)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getDescriptor_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_descriptor_with_u32(name: u32) -> String; + pub fn get_descriptor_with_u32(name: u32) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getService)] #[doc = "The `getService()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getService)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getService_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_service_with_str(name: &str) -> String; + pub fn get_service_with_str(name: &str) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (static_method_of = BluetoothUuid , js_class = "BluetoothUUID" , js_name = getService)] #[doc = "The `getService()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getService)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID/getService_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BluetoothUuid`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_service_with_u32(name: u32) -> String; + pub fn get_service_with_u32(name: u32) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_BoxQuadOptions.rs b/crates/web-sys/src/features/gen_BoxQuadOptions.rs index ce23e22fb75..0a117e15c03 100644 --- a/crates/web-sys/src/features/gen_BoxQuadOptions.rs +++ b/crates/web-sys/src/features/gen_BoxQuadOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"] pub type BoxQuadOptions; + #[cfg(feature = "CssBoxType")] + #[doc = "Get the `box` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`, `CssBoxType`*"] + #[wasm_bindgen(method, getter = "box")] + pub fn get_box(this: &BoxQuadOptions) -> Option; + #[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`*"] + #[wasm_bindgen(method, setter = "box")] + pub fn set_box(this: &BoxQuadOptions, val: CssBoxType); + #[doc = "Get the `relativeTo` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"] + #[wasm_bindgen(method, getter = "relativeTo")] + pub fn get_relative_to(this: &BoxQuadOptions) -> Option<::js_sys::Object>; + #[doc = "Change the `relativeTo` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"] + #[wasm_bindgen(method, setter = "relativeTo")] + pub fn set_relative_to(this: &BoxQuadOptions, val: &::js_sys::Object); } impl BoxQuadOptions { #[doc = "Construct a new `BoxQuadOptions`."] @@ -20,34 +43,14 @@ impl BoxQuadOptions { 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`*"] + #[deprecated = "Use `set_box()` instead."] 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.set_box(val); self } - #[doc = "Change the `relativeTo` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"] + #[deprecated = "Use `set_relative_to()` instead."] 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.set_relative_to(val); self } } diff --git a/crates/web-sys/src/features/gen_BroadcastChannel.rs b/crates/web-sys/src/features/gen_BroadcastChannel.rs index 1706b659e40..aa52f8205da 100644 --- a/crates/web-sys/src/features/gen_BroadcastChannel.rs +++ b/crates/web-sys/src/features/gen_BroadcastChannel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BroadcastChannel`*"] - pub fn name(this: &BroadcastChannel) -> String; + pub fn name(this: &BroadcastChannel) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "BroadcastChannel" , js_name = onmessage)] #[doc = "Getter for the `onmessage` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_BrowserElementDownloadOptions.rs b/crates/web-sys/src/features/gen_BrowserElementDownloadOptions.rs index 73882917b5b..2d4fe5e2311 100644 --- a/crates/web-sys/src/features/gen_BrowserElementDownloadOptions.rs +++ b/crates/web-sys/src/features/gen_BrowserElementDownloadOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] pub type BrowserElementDownloadOptions; + #[doc = "Get the `filename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] + #[wasm_bindgen(method, getter = "filename")] + pub fn get_filename(this: &BrowserElementDownloadOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `filename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] + #[wasm_bindgen(method, setter = "filename")] + pub fn set_filename(this: &BrowserElementDownloadOptions, val: Option<&str>); + #[doc = "Get the `referrer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] + #[wasm_bindgen(method, getter = "referrer")] + pub fn get_referrer(this: &BrowserElementDownloadOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `referrer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] + #[wasm_bindgen(method, setter = "referrer")] + pub fn set_referrer(this: &BrowserElementDownloadOptions, val: Option<&str>); } impl BrowserElementDownloadOptions { #[doc = "Construct a new `BrowserElementDownloadOptions`."] @@ -19,38 +40,14 @@ impl BrowserElementDownloadOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `filename` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] + #[deprecated = "Use `set_filename()` instead."] pub fn filename(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_filename(val); self } - #[doc = "Change the `referrer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"] + #[deprecated = "Use `set_referrer()` instead."] pub fn referrer(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_referrer(val); self } } diff --git a/crates/web-sys/src/features/gen_BrowserElementExecuteScriptOptions.rs b/crates/web-sys/src/features/gen_BrowserElementExecuteScriptOptions.rs index 358360ca492..04424595cb3 100644 --- a/crates/web-sys/src/features/gen_BrowserElementExecuteScriptOptions.rs +++ b/crates/web-sys/src/features/gen_BrowserElementExecuteScriptOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,27 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] pub type BrowserElementExecuteScriptOptions; + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &BrowserElementExecuteScriptOptions) + -> Option<::alloc::string::String>; + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &BrowserElementExecuteScriptOptions, val: Option<&str>); + #[doc = "Get the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] + #[wasm_bindgen(method, getter = "url")] + pub fn get_url(this: &BrowserElementExecuteScriptOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] + #[wasm_bindgen(method, setter = "url")] + pub fn set_url(this: &BrowserElementExecuteScriptOptions, val: Option<&str>); } impl BrowserElementExecuteScriptOptions { #[doc = "Construct a new `BrowserElementExecuteScriptOptions`."] @@ -19,31 +41,14 @@ impl BrowserElementExecuteScriptOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `origin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] + #[deprecated = "Use `set_origin()` instead."] pub fn origin(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_origin(val); self } - #[doc = "Change the `url` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `BrowserElementExecuteScriptOptions`*"] + #[deprecated = "Use `set_url()` instead."] pub fn url(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_url(val); self } } diff --git a/crates/web-sys/src/features/gen_BrowserFeedWriter.rs b/crates/web-sys/src/features/gen_BrowserFeedWriter.rs index 8e0ad3646b1..e1fb9ec081b 100644 --- a/crates/web-sys/src/features/gen_BrowserFeedWriter.rs +++ b/crates/web-sys/src/features/gen_BrowserFeedWriter.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_BrowserFindCaseSensitivity.rs b/crates/web-sys/src/features/gen_BrowserFindCaseSensitivity.rs index 8191347df37..7e5ad4fddf1 100644 --- a/crates/web-sys/src/features/gen_BrowserFindCaseSensitivity.rs +++ b/crates/web-sys/src/features/gen_BrowserFindCaseSensitivity.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `BrowserFindCaseSensitivity` enum."] diff --git a/crates/web-sys/src/features/gen_BrowserFindDirection.rs b/crates/web-sys/src/features/gen_BrowserFindDirection.rs index d5b8b4678e9..a45e63cbb91 100644 --- a/crates/web-sys/src/features/gen_BrowserFindDirection.rs +++ b/crates/web-sys/src/features/gen_BrowserFindDirection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `BrowserFindDirection` enum."] diff --git a/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs new file mode 100644 index 00000000000..a35ddad34d5 --- /dev/null +++ b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs @@ -0,0 +1,37 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ByteLengthQueuingStrategy , typescript_type = "ByteLengthQueuingStrategy")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ByteLengthQueuingStrategy` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub type ByteLengthQueuingStrategy; + # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = highWaterMark)] + #[doc = "Getter for the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub fn high_water_mark(this: &ByteLengthQueuingStrategy) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , 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/ByteLengthQueuingStrategy/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub fn size(this: &ByteLengthQueuingStrategy) -> ::js_sys::Function; + #[cfg(feature = "QueuingStrategyInit")] + #[wasm_bindgen(catch, constructor, js_class = "ByteLengthQueuingStrategy")] + #[doc = "The `new ByteLengthQueuingStrategy(..)` constructor, creating a new instance of `ByteLengthQueuingStrategy`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`, `QueuingStrategyInit`*"] + pub fn new(init: &QueuingStrategyInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_Cache.rs b/crates/web-sys/src/features/gen_Cache.rs index 3526097c0f8..b28809a9a93 100644 --- a/crates/web-sys/src/features/gen_Cache.rs +++ b/crates/web-sys/src/features/gen_Cache.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CacheBatchOperation.rs b/crates/web-sys/src/features/gen_CacheBatchOperation.rs index 8caf881124b..4a1f6b009fa 100644 --- a/crates/web-sys/src/features/gen_CacheBatchOperation.rs +++ b/crates/web-sys/src/features/gen_CacheBatchOperation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,52 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"] pub type CacheBatchOperation; + #[cfg(feature = "CacheQueryOptions")] + #[doc = "Get the `options` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `CacheQueryOptions`*"] + #[wasm_bindgen(method, getter = "options")] + pub fn get_options(this: &CacheBatchOperation) -> Option; + #[cfg(feature = "CacheQueryOptions")] + #[doc = "Change the `options` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `CacheQueryOptions`*"] + #[wasm_bindgen(method, setter = "options")] + pub fn set_options(this: &CacheBatchOperation, val: &CacheQueryOptions); + #[cfg(feature = "Request")] + #[doc = "Get the `request` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Request`*"] + #[wasm_bindgen(method, getter = "request")] + pub fn get_request(this: &CacheBatchOperation) -> Option; + #[cfg(feature = "Request")] + #[doc = "Change the `request` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Request`*"] + #[wasm_bindgen(method, setter = "request")] + pub fn set_request(this: &CacheBatchOperation, val: &Request); + #[cfg(feature = "Response")] + #[doc = "Get the `response` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Response`*"] + #[wasm_bindgen(method, getter = "response")] + pub fn get_response(this: &CacheBatchOperation) -> Option; + #[cfg(feature = "Response")] + #[doc = "Change the `response` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Response`*"] + #[wasm_bindgen(method, setter = "response")] + pub fn set_response(this: &CacheBatchOperation, val: &Response); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &CacheBatchOperation) -> Option<::alloc::string::String>; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &CacheBatchOperation, val: &str); } impl CacheBatchOperation { #[doc = "Construct a new `CacheBatchOperation`."] @@ -20,70 +67,26 @@ impl CacheBatchOperation { ret } #[cfg(feature = "CacheQueryOptions")] - #[doc = "Change the `options` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `CacheQueryOptions`*"] + #[deprecated = "Use `set_options()` instead."] pub fn options(&mut self, val: &CacheQueryOptions) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("options"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_options(val); self } #[cfg(feature = "Request")] - #[doc = "Change the `request` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Request`*"] + #[deprecated = "Use `set_request()` instead."] pub fn request(&mut self, val: &Request) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("request"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_request(val); self } #[cfg(feature = "Response")] - #[doc = "Change the `response` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Response`*"] + #[deprecated = "Use `set_response()` instead."] pub fn response(&mut self, val: &Response) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("response"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_response(val); self } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_CacheQueryOptions.rs b/crates/web-sys/src/features/gen_CacheQueryOptions.rs index 061fc496438..18ff89a31c1 100644 --- a/crates/web-sys/src/features/gen_CacheQueryOptions.rs +++ b/crates/web-sys/src/features/gen_CacheQueryOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] pub type CacheQueryOptions; + #[doc = "Get the `cacheName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[wasm_bindgen(method, getter = "cacheName")] + pub fn get_cache_name(this: &CacheQueryOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `cacheName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[wasm_bindgen(method, setter = "cacheName")] + pub fn set_cache_name(this: &CacheQueryOptions, val: &str); + #[doc = "Get the `ignoreMethod` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[wasm_bindgen(method, getter = "ignoreMethod")] + pub fn get_ignore_method(this: &CacheQueryOptions) -> Option; + #[doc = "Change the `ignoreMethod` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[wasm_bindgen(method, setter = "ignoreMethod")] + pub fn set_ignore_method(this: &CacheQueryOptions, val: bool); + #[doc = "Get the `ignoreSearch` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[wasm_bindgen(method, getter = "ignoreSearch")] + pub fn get_ignore_search(this: &CacheQueryOptions) -> Option; + #[doc = "Change the `ignoreSearch` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[wasm_bindgen(method, setter = "ignoreSearch")] + pub fn set_ignore_search(this: &CacheQueryOptions, val: bool); + #[doc = "Get the `ignoreVary` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[wasm_bindgen(method, getter = "ignoreVary")] + pub fn get_ignore_vary(this: &CacheQueryOptions) -> Option; + #[doc = "Change the `ignoreVary` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[wasm_bindgen(method, setter = "ignoreVary")] + pub fn set_ignore_vary(this: &CacheQueryOptions, val: bool); } impl CacheQueryOptions { #[doc = "Construct a new `CacheQueryOptions`."] @@ -19,72 +60,24 @@ impl CacheQueryOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `cacheName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[deprecated = "Use `set_cache_name()` instead."] pub fn cache_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cacheName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cache_name(val); self } - #[doc = "Change the `ignoreMethod` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[deprecated = "Use `set_ignore_method()` instead."] pub fn ignore_method(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ignoreMethod"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ignore_method(val); self } - #[doc = "Change the `ignoreSearch` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[deprecated = "Use `set_ignore_search()` instead."] pub fn ignore_search(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ignoreSearch"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ignore_search(val); self } - #[doc = "Change the `ignoreVary` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CacheQueryOptions`*"] + #[deprecated = "Use `set_ignore_vary()` instead."] pub fn ignore_vary(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ignoreVary"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ignore_vary(val); self } } diff --git a/crates/web-sys/src/features/gen_CacheStorage.rs b/crates/web-sys/src/features/gen_CacheStorage.rs index 46e9a8b572b..14a04d0341c 100644 --- a/crates/web-sys/src/features/gen_CacheStorage.rs +++ b/crates/web-sys/src/features/gen_CacheStorage.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CacheStorageNamespace.rs b/crates/web-sys/src/features/gen_CacheStorageNamespace.rs index ace039c44e8..fd3ee287435 100644 --- a/crates/web-sys/src/features/gen_CacheStorageNamespace.rs +++ b/crates/web-sys/src/features/gen_CacheStorageNamespace.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `CacheStorageNamespace` enum."] diff --git a/crates/web-sys/src/features/gen_CanvasCaptureMediaStream.rs b/crates/web-sys/src/features/gen_CanvasCaptureMediaStream.rs index 050555cdafd..73d0406aa6b 100644 --- a/crates/web-sys/src/features/gen_CanvasCaptureMediaStream.rs +++ b/crates/web-sys/src/features/gen_CanvasCaptureMediaStream.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CanvasCaptureMediaStreamTrack.rs b/crates/web-sys/src/features/gen_CanvasCaptureMediaStreamTrack.rs new file mode 100644 index 00000000000..55eb1652591 --- /dev/null +++ b/crates/web-sys/src/features/gen_CanvasCaptureMediaStreamTrack.rs @@ -0,0 +1,30 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = MediaStreamTrack , extends = EventTarget , extends = :: js_sys :: Object , js_name = CanvasCaptureMediaStreamTrack , typescript_type = "CanvasCaptureMediaStreamTrack")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `CanvasCaptureMediaStreamTrack` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasCaptureMediaStreamTrack)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasCaptureMediaStreamTrack`*"] + pub type CanvasCaptureMediaStreamTrack; + #[cfg(feature = "HtmlCanvasElement")] + # [wasm_bindgen (structural , method , getter , js_class = "CanvasCaptureMediaStreamTrack" , js_name = canvas)] + #[doc = "Getter for the `canvas` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasCaptureMediaStreamTrack/canvas)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasCaptureMediaStreamTrack`, `HtmlCanvasElement`*"] + pub fn canvas(this: &CanvasCaptureMediaStreamTrack) -> HtmlCanvasElement; + # [wasm_bindgen (method , structural , js_class = "CanvasCaptureMediaStreamTrack" , js_name = requestFrame)] + #[doc = "The `requestFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasCaptureMediaStreamTrack/requestFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasCaptureMediaStreamTrack`*"] + pub fn request_frame(this: &CanvasCaptureMediaStreamTrack); +} diff --git a/crates/web-sys/src/features/gen_CanvasGradient.rs b/crates/web-sys/src/features/gen_CanvasGradient.rs index 007a39b71e4..0450067ab46 100644 --- a/crates/web-sys/src/features/gen_CanvasGradient.rs +++ b/crates/web-sys/src/features/gen_CanvasGradient.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CanvasPattern.rs b/crates/web-sys/src/features/gen_CanvasPattern.rs index 5ff06e26051..bc939b0df17 100644 --- a/crates/web-sys/src/features/gen_CanvasPattern.rs +++ b/crates/web-sys/src/features/gen_CanvasPattern.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CanvasRenderingContext2d.rs b/crates/web-sys/src/features/gen_CanvasRenderingContext2d.rs index 3f353b91177..6fcc8018793 100644 --- a/crates/web-sys/src/features/gen_CanvasRenderingContext2d.rs +++ b/crates/web-sys/src/features/gen_CanvasRenderingContext2d.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -39,7 +40,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn global_composite_operation(this: &CanvasRenderingContext2d) -> Result; + pub fn global_composite_operation( + this: &CanvasRenderingContext2d, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "CanvasRenderingContext2D" , js_name = globalCompositeOperation)] #[doc = "Setter for the `globalCompositeOperation` field of this object."] #[doc = ""] @@ -63,7 +66,34 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + #[deprecated] pub fn set_stroke_style(this: &CanvasRenderingContext2d, value: &::wasm_bindgen::JsValue); + # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyle)] + #[doc = "Setter for the `strokeStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn set_stroke_style_str(this: &CanvasRenderingContext2d, value: &str); + #[cfg(feature = "CanvasGradient")] + # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyle)] + #[doc = "Setter for the `strokeStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `CanvasRenderingContext2d`*"] + pub fn set_stroke_style_canvas_gradient( + this: &CanvasRenderingContext2d, + value: &CanvasGradient, + ); + #[cfg(feature = "CanvasPattern")] + # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyle)] + #[doc = "Setter for the `strokeStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`*"] + pub fn set_stroke_style_canvas_pattern(this: &CanvasRenderingContext2d, value: &CanvasPattern); # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)] #[doc = "Getter for the `fillStyle` field of this object."] #[doc = ""] @@ -77,14 +107,38 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + #[deprecated] pub fn set_fill_style(this: &CanvasRenderingContext2d, value: &::wasm_bindgen::JsValue); + # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)] + #[doc = "Setter for the `fillStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn set_fill_style_str(this: &CanvasRenderingContext2d, value: &str); + #[cfg(feature = "CanvasGradient")] + # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)] + #[doc = "Setter for the `fillStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `CanvasRenderingContext2d`*"] + pub fn set_fill_style_canvas_gradient(this: &CanvasRenderingContext2d, value: &CanvasGradient); + #[cfg(feature = "CanvasPattern")] + # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)] + #[doc = "Setter for the `fillStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`*"] + pub fn set_fill_style_canvas_pattern(this: &CanvasRenderingContext2d, value: &CanvasPattern); # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = filter)] #[doc = "Getter for the `filter` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn filter(this: &CanvasRenderingContext2d) -> String; + pub fn filter(this: &CanvasRenderingContext2d) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = filter)] #[doc = "Setter for the `filter` field of this object."] #[doc = ""] @@ -126,7 +180,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn line_cap(this: &CanvasRenderingContext2d) -> String; + pub fn line_cap(this: &CanvasRenderingContext2d) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = lineCap)] #[doc = "Setter for the `lineCap` field of this object."] #[doc = ""] @@ -140,7 +194,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn line_join(this: &CanvasRenderingContext2d) -> String; + pub fn line_join(this: &CanvasRenderingContext2d) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = lineJoin)] #[doc = "Setter for the `lineJoin` field of this object."] #[doc = ""] @@ -224,7 +278,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn shadow_color(this: &CanvasRenderingContext2d) -> String; + pub fn shadow_color(this: &CanvasRenderingContext2d) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = shadowColor)] #[doc = "Setter for the `shadowColor` field of this object."] #[doc = ""] @@ -238,7 +292,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn font(this: &CanvasRenderingContext2d) -> String; + pub fn font(this: &CanvasRenderingContext2d) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = font)] #[doc = "Setter for the `font` field of this object."] #[doc = ""] @@ -252,7 +306,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn text_align(this: &CanvasRenderingContext2d) -> String; + pub fn text_align(this: &CanvasRenderingContext2d) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = textAlign)] #[doc = "Setter for the `textAlign` field of this object."] #[doc = ""] @@ -266,7 +320,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn text_baseline(this: &CanvasRenderingContext2d) -> String; + pub fn text_baseline(this: &CanvasRenderingContext2d) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = textBaseline)] #[doc = "Setter for the `textBaseline` field of this object."] #[doc = ""] @@ -372,6 +426,36 @@ extern "C" { dx: f64, dy: f64, ) -> Result<(), JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `OffscreenCanvas`*"] + pub fn draw_image_with_offscreen_canvas( + this: &CanvasRenderingContext2d, + image: &OffscreenCanvas, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_image_with_video_frame( + this: &CanvasRenderingContext2d, + image: &VideoFrame, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; #[cfg(feature = "HtmlImageElement")] # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] #[doc = "The `drawImage()` method."] @@ -447,6 +531,40 @@ extern "C" { dw: f64, dh: f64, ) -> Result<(), JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `OffscreenCanvas`*"] + pub fn draw_image_with_offscreen_canvas_and_dw_and_dh( + this: &CanvasRenderingContext2d, + image: &OffscreenCanvas, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_image_with_video_frame_and_dw_and_dh( + this: &CanvasRenderingContext2d, + image: &VideoFrame, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; #[cfg(feature = "HtmlImageElement")] # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] #[doc = "The `drawImage()` method."] @@ -542,6 +660,48 @@ extern "C" { dw: f64, dh: f64, ) -> Result<(), JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `OffscreenCanvas`*"] + pub fn draw_image_with_offscreen_canvas_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &CanvasRenderingContext2d, + image: &OffscreenCanvas, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_image_with_video_frame_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &CanvasRenderingContext2d, + image: &VideoFrame, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = beginPath)] #[doc = "The `beginPath()` method."] #[doc = ""] @@ -782,6 +942,34 @@ extern "C" { image: &ImageBitmap, repetition: &str, ) -> Result, JsValue>; + #[cfg(all(feature = "CanvasPattern", feature = "OffscreenCanvas",))] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `OffscreenCanvas`*"] + pub fn create_pattern_with_offscreen_canvas( + this: &CanvasRenderingContext2d, + image: &OffscreenCanvas, + repetition: &str, + ) -> Result, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "CanvasPattern", feature = "VideoFrame",))] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_pattern_with_video_frame( + this: &CanvasRenderingContext2d, + image: &VideoFrame, + repetition: &str, + ) -> Result, JsValue>; #[cfg(feature = "CanvasGradient")] # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createRadialGradient)] #[doc = "The `createRadialGradient()` method."] @@ -897,23 +1085,6 @@ extern "C" { dirty_width: f64, dirty_height: f64, ) -> Result<(), JsValue>; - # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = getLineDash)] - #[doc = "The `getLineDash()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getLineDash)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn get_line_dash(this: &CanvasRenderingContext2d) -> ::js_sys::Array; - # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = setLineDash)] - #[doc = "The `setLineDash()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] - pub fn set_line_dash( - this: &CanvasRenderingContext2d, - segments: &::wasm_bindgen::JsValue, - ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = arc)] #[doc = "The `arc()` method."] #[doc = ""] @@ -1040,6 +1211,93 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] pub fn rect(this: &CanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn round_rect( + this: &CanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn round_rect_with_f64( + this: &CanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "DomPointInit")] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `DomPointInit`*"] + pub fn round_rect_with_dom_point_init( + this: &CanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &DomPointInit, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn round_rect_with_f64_sequence( + this: &CanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn round_rect_with_dom_point_init_sequence( + this: &CanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = getLineDash)] + #[doc = "The `getLineDash()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getLineDash)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn get_line_dash(this: &CanvasRenderingContext2d) -> ::js_sys::Array; + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = setLineDash)] + #[doc = "The `setLineDash()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn set_line_dash( + this: &CanvasRenderingContext2d, + segments: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = clearRect)] #[doc = "The `clearRect()` method."] #[doc = ""] @@ -1061,6 +1319,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] pub fn stroke_rect(this: &CanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); + # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = reset)] + #[doc = "The `reset()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/reset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn reset(this: &CanvasRenderingContext2d); # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = restore)] #[doc = "The `restore()` method."] #[doc = ""] @@ -1180,6 +1445,26 @@ extern "C" { e: f64, f: f64, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = setTransform)] + #[doc = "The `setTransform()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*"] + pub fn set_transform_with_default_dom_matrix_2d_init( + this: &CanvasRenderingContext2d, + ) -> Result<(), JsValue>; + #[cfg(feature = "DomMatrix2dInit")] + # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = setTransform)] + #[doc = "The `setTransform()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `DomMatrix2dInit`*"] + pub fn set_transform_with_dom_matrix_2d_init( + this: &CanvasRenderingContext2d, + transform: &DomMatrix2dInit, + ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = transform)] #[doc = "The `transform()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CanvasWindingRule.rs b/crates/web-sys/src/features/gen_CanvasWindingRule.rs index 35493d4d850..1ee94c14b7e 100644 --- a/crates/web-sys/src/features/gen_CanvasWindingRule.rs +++ b/crates/web-sys/src/features/gen_CanvasWindingRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `CanvasWindingRule` enum."] diff --git a/crates/web-sys/src/features/gen_CaretChangedReason.rs b/crates/web-sys/src/features/gen_CaretChangedReason.rs index 60d24f0d328..1782320d029 100644 --- a/crates/web-sys/src/features/gen_CaretChangedReason.rs +++ b/crates/web-sys/src/features/gen_CaretChangedReason.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `CaretChangedReason` enum."] diff --git a/crates/web-sys/src/features/gen_CaretPosition.rs b/crates/web-sys/src/features/gen_CaretPosition.rs index c6cfba2b4b3..f9e558bf7bc 100644 --- a/crates/web-sys/src/features/gen_CaretPosition.rs +++ b/crates/web-sys/src/features/gen_CaretPosition.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CaretStateChangedEventInit.rs b/crates/web-sys/src/features/gen_CaretStateChangedEventInit.rs index 7a8015b586e..4ae63a8fc6e 100644 --- a/crates/web-sys/src/features/gen_CaretStateChangedEventInit.rs +++ b/crates/web-sys/src/features/gen_CaretStateChangedEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,125 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] pub type CaretStateChangedEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &CaretStateChangedEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &CaretStateChangedEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &CaretStateChangedEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &CaretStateChangedEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &CaretStateChangedEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &CaretStateChangedEventInit, val: bool); + #[cfg(feature = "DomRectReadOnly")] + #[doc = "Get the `boundingClientRect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`, `DomRectReadOnly`*"] + #[wasm_bindgen(method, getter = "boundingClientRect")] + pub fn get_bounding_client_rect(this: &CaretStateChangedEventInit) -> Option; + #[cfg(feature = "DomRectReadOnly")] + #[doc = "Change the `boundingClientRect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`, `DomRectReadOnly`*"] + #[wasm_bindgen(method, setter = "boundingClientRect")] + pub fn set_bounding_client_rect( + this: &CaretStateChangedEventInit, + val: Option<&DomRectReadOnly>, + ); + #[doc = "Get the `caretVisible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "caretVisible")] + pub fn get_caret_visible(this: &CaretStateChangedEventInit) -> Option; + #[doc = "Change the `caretVisible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "caretVisible")] + pub fn set_caret_visible(this: &CaretStateChangedEventInit, val: bool); + #[doc = "Get the `caretVisuallyVisible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "caretVisuallyVisible")] + pub fn get_caret_visually_visible(this: &CaretStateChangedEventInit) -> Option; + #[doc = "Change the `caretVisuallyVisible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "caretVisuallyVisible")] + pub fn set_caret_visually_visible(this: &CaretStateChangedEventInit, val: bool); + #[doc = "Get the `collapsed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "collapsed")] + pub fn get_collapsed(this: &CaretStateChangedEventInit) -> Option; + #[doc = "Change the `collapsed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "collapsed")] + pub fn set_collapsed(this: &CaretStateChangedEventInit, val: bool); + #[cfg(feature = "CaretChangedReason")] + #[doc = "Get the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretChangedReason`, `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "reason")] + pub fn get_reason(this: &CaretStateChangedEventInit) -> Option; + #[cfg(feature = "CaretChangedReason")] + #[doc = "Change the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretChangedReason`, `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "reason")] + pub fn set_reason(this: &CaretStateChangedEventInit, val: CaretChangedReason); + #[doc = "Get the `selectedTextContent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "selectedTextContent")] + pub fn get_selected_text_content( + this: &CaretStateChangedEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `selectedTextContent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "selectedTextContent")] + pub fn set_selected_text_content(this: &CaretStateChangedEventInit, val: &str); + #[doc = "Get the `selectionEditable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "selectionEditable")] + pub fn get_selection_editable(this: &CaretStateChangedEventInit) -> Option; + #[doc = "Change the `selectionEditable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "selectionEditable")] + pub fn set_selection_editable(this: &CaretStateChangedEventInit, val: bool); + #[doc = "Get the `selectionVisible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, getter = "selectionVisible")] + pub fn get_selection_visible(this: &CaretStateChangedEventInit) -> Option; + #[doc = "Change the `selectionVisible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[wasm_bindgen(method, setter = "selectionVisible")] + pub fn set_selection_visible(this: &CaretStateChangedEventInit, val: bool); } impl CaretStateChangedEventInit { #[doc = "Construct a new `CaretStateChangedEventInit`."] @@ -19,190 +139,61 @@ impl CaretStateChangedEventInit { 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: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "DomRectReadOnly")] - #[doc = "Change the `boundingClientRect` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`, `DomRectReadOnly`*"] + #[deprecated = "Use `set_bounding_client_rect()` instead."] pub fn bounding_client_rect(&mut self, val: Option<&DomRectReadOnly>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("boundingClientRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bounding_client_rect(val); self } - #[doc = "Change the `caretVisible` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_caret_visible()` instead."] pub fn caret_visible(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("caretVisible"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_caret_visible(val); self } - #[doc = "Change the `caretVisuallyVisible` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_caret_visually_visible()` instead."] pub fn caret_visually_visible(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("caretVisuallyVisible"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_caret_visually_visible(val); self } - #[doc = "Change the `collapsed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_collapsed()` instead."] pub fn collapsed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("collapsed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_collapsed(val); self } #[cfg(feature = "CaretChangedReason")] - #[doc = "Change the `reason` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretChangedReason`, `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_reason()` instead."] pub fn reason(&mut self, val: CaretChangedReason) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_reason(val); self } - #[doc = "Change the `selectedTextContent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_selected_text_content()` instead."] pub fn selected_text_content(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("selectedTextContent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_selected_text_content(val); self } - #[doc = "Change the `selectionEditable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_selection_editable()` instead."] pub fn selection_editable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("selectionEditable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_selection_editable(val); self } - #[doc = "Change the `selectionVisible` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"] + #[deprecated = "Use `set_selection_visible()` instead."] pub fn selection_visible(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("selectionVisible"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_selection_visible(val); self } } diff --git a/crates/web-sys/src/features/gen_CdataSection.rs b/crates/web-sys/src/features/gen_CdataSection.rs index c4727466832..a9b04ea3e0d 100644 --- a/crates/web-sys/src/features/gen_CdataSection.rs +++ b/crates/web-sys/src/features/gen_CdataSection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ChannelCountMode.rs b/crates/web-sys/src/features/gen_ChannelCountMode.rs index f46463452e9..d801074006d 100644 --- a/crates/web-sys/src/features/gen_ChannelCountMode.rs +++ b/crates/web-sys/src/features/gen_ChannelCountMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ChannelCountMode` enum."] diff --git a/crates/web-sys/src/features/gen_ChannelInterpretation.rs b/crates/web-sys/src/features/gen_ChannelInterpretation.rs index 2fe84632fbf..a45eeca2736 100644 --- a/crates/web-sys/src/features/gen_ChannelInterpretation.rs +++ b/crates/web-sys/src/features/gen_ChannelInterpretation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ChannelInterpretation` enum."] diff --git a/crates/web-sys/src/features/gen_ChannelMergerNode.rs b/crates/web-sys/src/features/gen_ChannelMergerNode.rs index 0ce61ce18b4..3d53cc523cf 100644 --- a/crates/web-sys/src/features/gen_ChannelMergerNode.rs +++ b/crates/web-sys/src/features/gen_ChannelMergerNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ChannelMergerOptions.rs b/crates/web-sys/src/features/gen_ChannelMergerOptions.rs index c259c8a6602..81bdc7379f9 100644 --- a/crates/web-sys/src/features/gen_ChannelMergerOptions.rs +++ b/crates/web-sys/src/features/gen_ChannelMergerOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,51 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] pub type ChannelMergerOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &ChannelMergerOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &ChannelMergerOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ChannelMergerOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &ChannelMergerOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ChannelMergerOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &ChannelMergerOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ChannelMergerOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &ChannelMergerOptions) + -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ChannelMergerOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &ChannelMergerOptions, val: ChannelInterpretation); + #[doc = "Get the `numberOfInputs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] + #[wasm_bindgen(method, getter = "numberOfInputs")] + pub fn get_number_of_inputs(this: &ChannelMergerOptions) -> Option; + #[doc = "Change the `numberOfInputs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] + #[wasm_bindgen(method, setter = "numberOfInputs")] + pub fn set_number_of_inputs(this: &ChannelMergerOptions, val: u32); } impl ChannelMergerOptions { #[doc = "Construct a new `ChannelMergerOptions`."] @@ -19,74 +65,26 @@ impl ChannelMergerOptions { 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: `ChannelMergerOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ChannelMergerOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ChannelMergerOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `numberOfInputs` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelMergerOptions`*"] + #[deprecated = "Use `set_number_of_inputs()` instead."] 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.set_number_of_inputs(val); self } } diff --git a/crates/web-sys/src/features/gen_ChannelPixelLayout.rs b/crates/web-sys/src/features/gen_ChannelPixelLayout.rs deleted file mode 100644 index ac5623667bb..00000000000 --- a/crates/web-sys/src/features/gen_ChannelPixelLayout.rs +++ /dev/null @@ -1,122 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ChannelPixelLayout)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ChannelPixelLayout` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelPixelLayout`*"] - pub type ChannelPixelLayout; -} -impl ChannelPixelLayout { - #[cfg(feature = "ChannelPixelLayoutDataType")] - #[doc = "Construct a new `ChannelPixelLayout`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelPixelLayout`, `ChannelPixelLayoutDataType`*"] - pub fn new( - data_type: ChannelPixelLayoutDataType, - height: u32, - offset: u32, - skip: u32, - stride: u32, - width: u32, - ) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.data_type(data_type); - ret.height(height); - ret.offset(offset); - ret.skip(skip); - ret.stride(stride); - ret.width(width); - ret - } - #[cfg(feature = "ChannelPixelLayoutDataType")] - #[doc = "Change the `dataType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelPixelLayout`, `ChannelPixelLayoutDataType`*"] - pub fn data_type(&mut self, val: ChannelPixelLayoutDataType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelPixelLayout`*"] - pub fn height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &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: `ChannelPixelLayout`*"] - pub fn offset(&mut self, val: u32) -> &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 `skip` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelPixelLayout`*"] - pub fn skip(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("skip"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `stride` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelPixelLayout`*"] - pub fn stride(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stride"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelPixelLayout`*"] - pub fn width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} diff --git a/crates/web-sys/src/features/gen_ChannelPixelLayoutDataType.rs b/crates/web-sys/src/features/gen_ChannelPixelLayoutDataType.rs deleted file mode 100644 index d9ddd58742a..00000000000 --- a/crates/web-sys/src/features/gen_ChannelPixelLayoutDataType.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![allow(unused_imports)] -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -#[doc = "The `ChannelPixelLayoutDataType` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `ChannelPixelLayoutDataType`*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum ChannelPixelLayoutDataType { - Uint8 = "uint8", - Int8 = "int8", - Uint16 = "uint16", - Int16 = "int16", - Uint32 = "uint32", - Int32 = "int32", - Float32 = "float32", - Float64 = "float64", -} diff --git a/crates/web-sys/src/features/gen_ChannelSplitterNode.rs b/crates/web-sys/src/features/gen_ChannelSplitterNode.rs index c094aac417b..21b52d48117 100644 --- a/crates/web-sys/src/features/gen_ChannelSplitterNode.rs +++ b/crates/web-sys/src/features/gen_ChannelSplitterNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ChannelSplitterOptions.rs b/crates/web-sys/src/features/gen_ChannelSplitterOptions.rs index 2c045ef4d0e..582198555b0 100644 --- a/crates/web-sys/src/features/gen_ChannelSplitterOptions.rs +++ b/crates/web-sys/src/features/gen_ChannelSplitterOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,52 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] pub type ChannelSplitterOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &ChannelSplitterOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &ChannelSplitterOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ChannelSplitterOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &ChannelSplitterOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ChannelSplitterOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &ChannelSplitterOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ChannelSplitterOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation( + this: &ChannelSplitterOptions, + ) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ChannelSplitterOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &ChannelSplitterOptions, val: ChannelInterpretation); + #[doc = "Get the `numberOfOutputs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] + #[wasm_bindgen(method, getter = "numberOfOutputs")] + pub fn get_number_of_outputs(this: &ChannelSplitterOptions) -> Option; + #[doc = "Change the `numberOfOutputs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] + #[wasm_bindgen(method, setter = "numberOfOutputs")] + pub fn set_number_of_outputs(this: &ChannelSplitterOptions, val: u32); } impl ChannelSplitterOptions { #[doc = "Construct a new `ChannelSplitterOptions`."] @@ -19,74 +66,26 @@ impl ChannelSplitterOptions { 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: `ChannelSplitterOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ChannelSplitterOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ChannelSplitterOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `numberOfOutputs` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelSplitterOptions`*"] + #[deprecated = "Use `set_number_of_outputs()` instead."] 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.set_number_of_outputs(val); self } } diff --git a/crates/web-sys/src/features/gen_CharacterData.rs b/crates/web-sys/src/features/gen_CharacterData.rs index 133163013ef..39e417042ec 100644 --- a/crates/web-sys/src/features/gen_CharacterData.rs +++ b/crates/web-sys/src/features/gen_CharacterData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CharacterData/data)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CharacterData`*"] - pub fn data(this: &CharacterData) -> String; + pub fn data(this: &CharacterData) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CharacterData" , js_name = data)] #[doc = "Setter for the `data` field of this object."] #[doc = ""] @@ -87,8 +88,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CharacterData/substringData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CharacterData`*"] - pub fn substring_data(this: &CharacterData, offset: u32, count: u32) - -> Result; + pub fn substring_data( + this: &CharacterData, + offset: u32, + count: u32, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , variadic , js_class = "CharacterData" , js_name = after)] #[doc = "The `after()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CheckerboardReason.rs b/crates/web-sys/src/features/gen_CheckerboardReason.rs index a978a6c9859..d8cbc534e4b 100644 --- a/crates/web-sys/src/features/gen_CheckerboardReason.rs +++ b/crates/web-sys/src/features/gen_CheckerboardReason.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `CheckerboardReason` enum."] diff --git a/crates/web-sys/src/features/gen_CheckerboardReport.rs b/crates/web-sys/src/features/gen_CheckerboardReport.rs index a79c8d18bb9..465660a3021 100644 --- a/crates/web-sys/src/features/gen_CheckerboardReport.rs +++ b/crates/web-sys/src/features/gen_CheckerboardReport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] pub type CheckerboardReport; + #[doc = "Get the `log` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[wasm_bindgen(method, getter = "log")] + pub fn get_log(this: &CheckerboardReport) -> Option<::alloc::string::String>; + #[doc = "Change the `log` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[wasm_bindgen(method, setter = "log")] + pub fn set_log(this: &CheckerboardReport, val: &str); + #[cfg(feature = "CheckerboardReason")] + #[doc = "Get the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CheckerboardReason`, `CheckerboardReport`*"] + #[wasm_bindgen(method, getter = "reason")] + pub fn get_reason(this: &CheckerboardReport) -> Option; + #[cfg(feature = "CheckerboardReason")] + #[doc = "Change the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CheckerboardReason`, `CheckerboardReport`*"] + #[wasm_bindgen(method, setter = "reason")] + pub fn set_reason(this: &CheckerboardReport, val: CheckerboardReason); + #[doc = "Get the `severity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[wasm_bindgen(method, getter = "severity")] + pub fn get_severity(this: &CheckerboardReport) -> Option; + #[doc = "Change the `severity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[wasm_bindgen(method, setter = "severity")] + pub fn set_severity(this: &CheckerboardReport, val: u32); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &CheckerboardReport) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &CheckerboardReport, val: f64); } impl CheckerboardReport { #[doc = "Construct a new `CheckerboardReport`."] @@ -19,66 +62,25 @@ impl CheckerboardReport { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `log` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[deprecated = "Use `set_log()` instead."] pub fn log(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("log"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_log(val); self } #[cfg(feature = "CheckerboardReason")] - #[doc = "Change the `reason` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CheckerboardReason`, `CheckerboardReport`*"] + #[deprecated = "Use `set_reason()` instead."] pub fn reason(&mut self, val: CheckerboardReason) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_reason(val); self } - #[doc = "Change the `severity` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[deprecated = "Use `set_severity()` instead."] pub fn severity(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("severity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_severity(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } } diff --git a/crates/web-sys/src/features/gen_CheckerboardReportService.rs b/crates/web-sys/src/features/gen_CheckerboardReportService.rs index d5abcf81c25..984b0999e3a 100644 --- a/crates/web-sys/src/features/gen_CheckerboardReportService.rs +++ b/crates/web-sys/src/features/gen_CheckerboardReportService.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ChromeFilePropertyBag.rs b/crates/web-sys/src/features/gen_ChromeFilePropertyBag.rs index 0461954ca07..822f3d11b90 100644 --- a/crates/web-sys/src/features/gen_ChromeFilePropertyBag.rs +++ b/crates/web-sys/src/features/gen_ChromeFilePropertyBag.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] pub type ChromeFilePropertyBag; + #[doc = "Get the `lastModified` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[wasm_bindgen(method, getter = "lastModified")] + pub fn get_last_modified(this: &ChromeFilePropertyBag) -> Option; + #[doc = "Change the `lastModified` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[wasm_bindgen(method, setter = "lastModified")] + pub fn set_last_modified(this: &ChromeFilePropertyBag, val: f64); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &ChromeFilePropertyBag) -> Option<::alloc::string::String>; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &ChromeFilePropertyBag, val: &str); + #[doc = "Get the `existenceCheck` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[wasm_bindgen(method, getter = "existenceCheck")] + pub fn get_existence_check(this: &ChromeFilePropertyBag) -> Option; + #[doc = "Change the `existenceCheck` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[wasm_bindgen(method, setter = "existenceCheck")] + pub fn set_existence_check(this: &ChromeFilePropertyBag, val: bool); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &ChromeFilePropertyBag) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &ChromeFilePropertyBag, val: &str); } impl ChromeFilePropertyBag { #[doc = "Construct a new `ChromeFilePropertyBag`."] @@ -19,64 +60,24 @@ impl ChromeFilePropertyBag { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `lastModified` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[deprecated = "Use `set_last_modified()` instead."] pub fn last_modified(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastModified"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_last_modified(val); self } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } - #[doc = "Change the `existenceCheck` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[deprecated = "Use `set_existence_check()` instead."] pub fn existence_check(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("existenceCheck"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_existence_check(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChromeFilePropertyBag`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_ChromeWorker.rs b/crates/web-sys/src/features/gen_ChromeWorker.rs index 736f22561c9..f92cebbfa3d 100644 --- a/crates/web-sys/src/features/gen_ChromeWorker.rs +++ b/crates/web-sys/src/features/gen_ChromeWorker.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_Client.rs b/crates/web-sys/src/features/gen_Client.rs index ecf6a2aba3b..081745cf069 100644 --- a/crates/web-sys/src/features/gen_Client.rs +++ b/crates/web-sys/src/features/gen_Client.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Client/url)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Client`*"] - pub fn url(this: &Client) -> String; + pub fn url(this: &Client) -> ::alloc::string::String; #[cfg(feature = "FrameType")] # [wasm_bindgen (structural , method , getter , js_class = "Client" , js_name = frameType)] #[doc = "Getter for the `frameType` field of this object."] @@ -40,7 +41,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Client/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Client`*"] - pub fn id(this: &Client) -> String; + pub fn id(this: &Client) -> ::alloc::string::String; # [wasm_bindgen (catch , method , structural , js_class = "Client" , js_name = postMessage)] #[doc = "The `postMessage()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_ClientQueryOptions.rs b/crates/web-sys/src/features/gen_ClientQueryOptions.rs index 84dbc077fdd..941af010e59 100644 --- a/crates/web-sys/src/features/gen_ClientQueryOptions.rs +++ b/crates/web-sys/src/features/gen_ClientQueryOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`*"] pub type ClientQueryOptions; + #[doc = "Get the `includeUncontrolled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`*"] + #[wasm_bindgen(method, getter = "includeUncontrolled")] + pub fn get_include_uncontrolled(this: &ClientQueryOptions) -> Option; + #[doc = "Change the `includeUncontrolled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`*"] + #[wasm_bindgen(method, setter = "includeUncontrolled")] + pub fn set_include_uncontrolled(this: &ClientQueryOptions, val: bool); + #[cfg(feature = "ClientType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`, `ClientType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &ClientQueryOptions) -> Option; + #[cfg(feature = "ClientType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`, `ClientType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &ClientQueryOptions, val: ClientType); } impl ClientQueryOptions { #[doc = "Construct a new `ClientQueryOptions`."] @@ -19,35 +42,15 @@ impl ClientQueryOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `includeUncontrolled` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`*"] + #[deprecated = "Use `set_include_uncontrolled()` instead."] pub fn include_uncontrolled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("includeUncontrolled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_include_uncontrolled(val); self } #[cfg(feature = "ClientType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClientQueryOptions`, `ClientType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: ClientType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_ClientRectsAndTexts.rs b/crates/web-sys/src/features/gen_ClientRectsAndTexts.rs index e8a8fec00b4..475fc5964fe 100644 --- a/crates/web-sys/src/features/gen_ClientRectsAndTexts.rs +++ b/crates/web-sys/src/features/gen_ClientRectsAndTexts.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`*"] pub type ClientRectsAndTexts; + #[cfg(feature = "DomRectList")] + #[doc = "Get the `rectList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`, `DomRectList`*"] + #[wasm_bindgen(method, getter = "rectList")] + pub fn get_rect_list(this: &ClientRectsAndTexts) -> DomRectList; + #[cfg(feature = "DomRectList")] + #[doc = "Change the `rectList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`, `DomRectList`*"] + #[wasm_bindgen(method, setter = "rectList")] + pub fn set_rect_list(this: &ClientRectsAndTexts, val: &DomRectList); + #[doc = "Get the `textList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`*"] + #[wasm_bindgen(method, getter = "textList")] + pub fn get_text_list(this: &ClientRectsAndTexts) -> ::js_sys::Array; + #[doc = "Change the `textList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`*"] + #[wasm_bindgen(method, setter = "textList")] + pub fn set_text_list(this: &ClientRectsAndTexts, val: &::wasm_bindgen::JsValue); } impl ClientRectsAndTexts { #[cfg(feature = "DomRectList")] @@ -18,43 +41,19 @@ impl ClientRectsAndTexts { pub fn new(rect_list: &DomRectList, text_list: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.rect_list(rect_list); - ret.text_list(text_list); + ret.set_rect_list(rect_list); + ret.set_text_list(text_list); ret } #[cfg(feature = "DomRectList")] - #[doc = "Change the `rectList` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`, `DomRectList`*"] + #[deprecated = "Use `set_rect_list()` instead."] pub fn rect_list(&mut self, val: &DomRectList) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rectList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rect_list(val); self } - #[doc = "Change the `textList` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`*"] + #[deprecated = "Use `set_text_list()` instead."] pub fn text_list(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("textList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_text_list(val); self } } diff --git a/crates/web-sys/src/features/gen_ClientType.rs b/crates/web-sys/src/features/gen_ClientType.rs index fa617a52940..43ea6b93093 100644 --- a/crates/web-sys/src/features/gen_ClientType.rs +++ b/crates/web-sys/src/features/gen_ClientType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ClientType` enum."] diff --git a/crates/web-sys/src/features/gen_Clients.rs b/crates/web-sys/src/features/gen_Clients.rs index a33c001e4f0..30c05f499b5 100644 --- a/crates/web-sys/src/features/gen_Clients.rs +++ b/crates/web-sys/src/features/gen_Clients.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_Clipboard.rs b/crates/web-sys/src/features/gen_Clipboard.rs index b9029e3ad4e..420f5389fc9 100644 --- a/crates/web-sys/src/features/gen_Clipboard.rs +++ b/crates/web-sys/src/features/gen_Clipboard.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = Clipboard , typescript_type = "Clipboard")] @@ -11,52 +11,48 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type Clipboard; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "Clipboard" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"] + pub fn read(this: &Clipboard) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ClipboardUnsanitizedFormats")] + # [wasm_bindgen (method , structural , js_class = "Clipboard" , js_name = read)] + #[doc = "The `read()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/read)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Clipboard`, `ClipboardUnsanitizedFormats`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn read(this: &Clipboard) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] + pub fn read_with_formats( + this: &Clipboard, + formats: &ClipboardUnsanitizedFormats, + ) -> ::js_sys::Promise; # [wasm_bindgen (method , structural , js_class = "Clipboard" , js_name = readText)] #[doc = "The `readText()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_text(this: &Clipboard) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "Clipboard" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write(this: &Clipboard, data: &::wasm_bindgen::JsValue) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "Clipboard" , js_name = writeText)] #[doc = "The `writeText()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Clipboard`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_text(this: &Clipboard, data: &str) -> ::js_sys::Promise; } diff --git a/crates/web-sys/src/features/gen_ClipboardEvent.rs b/crates/web-sys/src/features/gen_ClipboardEvent.rs index 38410d88d1f..f779c28e6de 100644 --- a/crates/web-sys/src/features/gen_ClipboardEvent.rs +++ b/crates/web-sys/src/features/gen_ClipboardEvent.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = ClipboardEvent , typescript_type = "ClipboardEvent")] @@ -11,11 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEvent`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ClipboardEvent; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DataTransfer")] # [wasm_bindgen (structural , method , getter , js_class = "ClipboardEvent" , js_name = clipboardData)] #[doc = "Getter for the `clipboardData` field of this object."] @@ -23,22 +19,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/clipboardData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEvent`, `DataTransfer`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn clipboard_data(this: &ClipboardEvent) -> Option; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "ClipboardEvent")] #[doc = "The `new ClipboardEvent(..)` constructor, creating a new instance of `ClipboardEvent`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/ClipboardEvent)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEvent`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(type_: &str) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ClipboardEventInit")] #[wasm_bindgen(catch, constructor, js_class = "ClipboardEvent")] #[doc = "The `new ClipboardEvent(..)` constructor, creating a new instance of `ClipboardEvent`."] @@ -46,9 +34,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/ClipboardEvent)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEvent`, `ClipboardEventInit`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_event_init_dict( type_: &str, event_init_dict: &ClipboardEventInit, diff --git a/crates/web-sys/src/features/gen_ClipboardEventInit.rs b/crates/web-sys/src/features/gen_ClipboardEventInit.rs index 74290a80f73..c0f0c649583 100644 --- a/crates/web-sys/src/features/gen_ClipboardEventInit.rs +++ b/crates/web-sys/src/features/gen_ClipboardEventInit.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ClipboardEventInit)] @@ -9,111 +9,81 @@ extern "C" { #[doc = "The `ClipboardEventInit` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ClipboardEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ClipboardEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ClipboardEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ClipboardEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ClipboardEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ClipboardEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ClipboardEventInit, val: bool); + #[cfg(feature = "DataTransfer")] + #[doc = "Get the `clipboardData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`, `DataTransfer`*"] + #[wasm_bindgen(method, getter = "clipboardData")] + pub fn get_clipboard_data(this: &ClipboardEventInit) -> Option; + #[cfg(feature = "DataTransfer")] + #[doc = "Change the `clipboardData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`, `DataTransfer`*"] + #[wasm_bindgen(method, setter = "clipboardData")] + pub fn set_clipboard_data(this: &ClipboardEventInit, val: Option<&DataTransfer>); } -#[cfg(web_sys_unstable_apis)] impl ClipboardEventInit { #[doc = "Construct a new `ClipboardEventInit`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DataTransfer")] - #[doc = "Change the `clipboardData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`, `DataTransfer`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_clipboard_data()` instead."] pub fn clipboard_data(&mut self, val: Option<&DataTransfer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clipboardData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_clipboard_data(val); self } } -#[cfg(web_sys_unstable_apis)] impl Default for ClipboardEventInit { fn default() -> Self { Self::new() diff --git a/crates/web-sys/src/features/gen_ClipboardItem.rs b/crates/web-sys/src/features/gen_ClipboardItem.rs index ba376129676..25999c63171 100644 --- a/crates/web-sys/src/features/gen_ClipboardItem.rs +++ b/crates/web-sys/src/features/gen_ClipboardItem.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ClipboardItem , typescript_type = "ClipboardItem")] @@ -11,11 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ClipboardItem; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "PresentationStyle")] # [wasm_bindgen (structural , method , getter , js_class = "ClipboardItem" , js_name = presentationStyle)] #[doc = "Getter for the `presentationStyle` field of this object."] @@ -23,52 +19,66 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/presentationStyle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`, `PresentationStyle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn presentation_style(this: &ClipboardItem) -> PresentationStyle; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "ClipboardItem" , js_name = lastModified)] - #[doc = "Getter for the `lastModified` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "ClipboardItem" , js_name = types)] + #[doc = "Getter for the `types` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/lastModified)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/types)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`*"] + pub fn types(this: &ClipboardItem) -> ::js_sys::Array; + #[wasm_bindgen(catch, constructor, js_class = "ClipboardItem")] + #[doc = "The `new ClipboardItem(..)` constructor, creating a new instance of `ClipboardItem`."] #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn last_modified(this: &ClipboardItem) -> f64; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "ClipboardItem" , js_name = delayed)] - #[doc = "Getter for the `delayed` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/delayed)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/ClipboardItem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`*"] + pub fn new_with_record_from_str_to_str_promise( + items: &::js_sys::Object, + ) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "ClipboardItem")] + #[doc = "The `new ClipboardItem(..)` constructor, creating a new instance of `ClipboardItem`."] #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn delayed(this: &ClipboardItem) -> bool; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "ClipboardItem" , js_name = types)] - #[doc = "Getter for the `types` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/types)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/ClipboardItem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn types(this: &ClipboardItem) -> ::js_sys::Array; - #[cfg(web_sys_unstable_apis)] + pub fn new_with_record_from_str_to_blob_promise( + items: &::js_sys::Object, + ) -> Result; + #[cfg(feature = "ClipboardItemOptions")] + #[wasm_bindgen(catch, constructor, js_class = "ClipboardItem")] + #[doc = "The `new ClipboardItem(..)` constructor, creating a new instance of `ClipboardItem`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/ClipboardItem)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`, `ClipboardItemOptions`*"] + pub fn new_with_record_from_str_to_str_promise_and_options( + items: &::js_sys::Object, + options: &ClipboardItemOptions, + ) -> Result; + #[cfg(feature = "ClipboardItemOptions")] + #[wasm_bindgen(catch, constructor, js_class = "ClipboardItem")] + #[doc = "The `new ClipboardItem(..)` constructor, creating a new instance of `ClipboardItem`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/ClipboardItem)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`, `ClipboardItemOptions`*"] + pub fn new_with_record_from_str_to_blob_promise_and_options( + items: &::js_sys::Object, + options: &ClipboardItemOptions, + ) -> Result; # [wasm_bindgen (method , structural , js_class = "ClipboardItem" , js_name = getType)] #[doc = "The `getType()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/getType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_type(this: &ClipboardItem, type_: &str) -> ::js_sys::Promise; + # [wasm_bindgen (static_method_of = ClipboardItem , js_class = "ClipboardItem" , js_name = supports)] + #[doc = "The `supports()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/supports_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardItem`*"] + pub fn supports(type_: &str) -> bool; } diff --git a/crates/web-sys/src/features/gen_ClipboardItemOptions.rs b/crates/web-sys/src/features/gen_ClipboardItemOptions.rs index 00056db0300..13c368ab976 100644 --- a/crates/web-sys/src/features/gen_ClipboardItemOptions.rs +++ b/crates/web-sys/src/features/gen_ClipboardItemOptions.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ClipboardItemOptions)] @@ -9,48 +9,36 @@ extern "C" { #[doc = "The `ClipboardItemOptions` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardItemOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ClipboardItemOptions; + #[cfg(feature = "PresentationStyle")] + #[doc = "Get the `presentationStyle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardItemOptions`, `PresentationStyle`*"] + #[wasm_bindgen(method, getter = "presentationStyle")] + pub fn get_presentation_style(this: &ClipboardItemOptions) -> Option; + #[cfg(feature = "PresentationStyle")] + #[doc = "Change the `presentationStyle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardItemOptions`, `PresentationStyle`*"] + #[wasm_bindgen(method, setter = "presentationStyle")] + pub fn set_presentation_style(this: &ClipboardItemOptions, val: PresentationStyle); } -#[cfg(web_sys_unstable_apis)] impl ClipboardItemOptions { #[doc = "Construct a new `ClipboardItemOptions`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardItemOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "PresentationStyle")] - #[doc = "Change the `presentationStyle` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ClipboardItemOptions`, `PresentationStyle`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_presentation_style()` instead."] pub fn presentation_style(&mut self, val: PresentationStyle) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("presentationStyle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_presentation_style(val); self } } -#[cfg(web_sys_unstable_apis)] impl Default for ClipboardItemOptions { fn default() -> Self { Self::new() diff --git a/crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs b/crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs index 32568bb889b..8ff2d3b954d 100644 --- a/crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ClipboardPermissionDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl ClipboardPermissionDescriptor { + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "PermissionName")] - #[doc = "Construct a new `ClipboardPermissionDescriptor`."] + #[doc = "Get the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`, `PermissionName`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(name: PermissionName) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret - } + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &ClipboardPermissionDescriptor) -> PermissionName; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "PermissionName")] #[doc = "Change the `name` field of this object."] @@ -37,16 +32,17 @@ impl ClipboardPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn name(&mut self, val: PermissionName) -> &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 - } + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &ClipboardPermissionDescriptor, val: PermissionName); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `allowWithoutGesture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "allowWithoutGesture")] + pub fn get_allow_without_gesture(this: &ClipboardPermissionDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `allowWithoutGesture` field of this object."] #[doc = ""] @@ -54,18 +50,35 @@ impl ClipboardPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "allowWithoutGesture")] + pub fn set_allow_without_gesture(this: &ClipboardPermissionDescriptor, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl ClipboardPermissionDescriptor { + #[cfg(feature = "PermissionName")] + #[doc = "Construct a new `ClipboardPermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`, `PermissionName`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(name: PermissionName) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_name(name); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: PermissionName) -> &mut Self { + self.set_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_allow_without_gesture()` instead."] pub fn allow_without_gesture(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowWithoutGesture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_allow_without_gesture(val); self } } diff --git a/crates/web-sys/src/features/gen_ClipboardUnsanitizedFormats.rs b/crates/web-sys/src/features/gen_ClipboardUnsanitizedFormats.rs new file mode 100644 index 00000000000..f1606f53923 --- /dev/null +++ b/crates/web-sys/src/features/gen_ClipboardUnsanitizedFormats.rs @@ -0,0 +1,61 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ClipboardUnsanitizedFormats)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ClipboardUnsanitizedFormats` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardUnsanitizedFormats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type ClipboardUnsanitizedFormats; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unsanitized` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardUnsanitizedFormats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unsanitized")] + pub fn get_unsanitized(this: &ClipboardUnsanitizedFormats) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `unsanitized` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardUnsanitizedFormats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "unsanitized")] + pub fn set_unsanitized(this: &ClipboardUnsanitizedFormats, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl ClipboardUnsanitizedFormats { + #[doc = "Construct a new `ClipboardUnsanitizedFormats`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ClipboardUnsanitizedFormats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unsanitized()` instead."] + pub fn unsanitized(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_unsanitized(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for ClipboardUnsanitizedFormats { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_CloseEvent.rs b/crates/web-sys/src/features/gen_CloseEvent.rs index 0af95b5fb88..0826d7980f6 100644 --- a/crates/web-sys/src/features/gen_CloseEvent.rs +++ b/crates/web-sys/src/features/gen_CloseEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/reason)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEvent`*"] - pub fn reason(this: &CloseEvent) -> String; + pub fn reason(this: &CloseEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "CloseEvent")] #[doc = "The `new CloseEvent(..)` constructor, creating a new instance of `CloseEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CloseEventInit.rs b/crates/web-sys/src/features/gen_CloseEventInit.rs index c9125973fac..6c6ba233506 100644 --- a/crates/web-sys/src/features/gen_CloseEventInit.rs +++ b/crates/web-sys/src/features/gen_CloseEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] pub type CloseEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &CloseEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &CloseEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &CloseEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &CloseEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &CloseEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &CloseEventInit, val: bool); + #[doc = "Get the `code` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, getter = "code")] + pub fn get_code(this: &CloseEventInit) -> Option; + #[doc = "Change the `code` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, setter = "code")] + pub fn set_code(this: &CloseEventInit, val: u16); + #[doc = "Get the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, getter = "reason")] + pub fn get_reason(this: &CloseEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, setter = "reason")] + pub fn set_reason(this: &CloseEventInit, val: &str); + #[doc = "Get the `wasClean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, getter = "wasClean")] + pub fn get_was_clean(this: &CloseEventInit) -> Option; + #[doc = "Change the `wasClean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[wasm_bindgen(method, setter = "wasClean")] + pub fn set_was_clean(this: &CloseEventInit, val: bool); } impl CloseEventInit { #[doc = "Construct a new `CloseEventInit`."] @@ -19,99 +80,34 @@ impl CloseEventInit { 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: `CloseEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `code` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[deprecated = "Use `set_code()` instead."] pub fn code(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_code(val); self } - #[doc = "Change the `reason` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[deprecated = "Use `set_reason()` instead."] pub fn reason(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_reason(val); self } - #[doc = "Change the `wasClean` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CloseEventInit`*"] + #[deprecated = "Use `set_was_clean()` instead."] pub fn was_clean(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("wasClean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_was_clean(val); self } } diff --git a/crates/web-sys/src/features/gen_CodecState.rs b/crates/web-sys/src/features/gen_CodecState.rs index 76b60e259f1..7648d53d1aa 100644 --- a/crates/web-sys/src/features/gen_CodecState.rs +++ b/crates/web-sys/src/features/gen_CodecState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CollectedClientData.rs b/crates/web-sys/src/features/gen_CollectedClientData.rs index 6c06dfa76fc..44f8b48b8fd 100644 --- a/crates/web-sys/src/features/gen_CollectedClientData.rs +++ b/crates/web-sys/src/features/gen_CollectedClientData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,101 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] pub type CollectedClientData; + #[doc = "Get the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[wasm_bindgen(method, getter = "challenge")] + pub fn get_challenge(this: &CollectedClientData) -> ::alloc::string::String; + #[doc = "Change the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[wasm_bindgen(method, setter = "challenge")] + pub fn set_challenge(this: &CollectedClientData, val: &str); + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[doc = "Get the `clientExtensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `CollectedClientData`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "clientExtensions")] + pub fn get_client_extensions( + this: &CollectedClientData, + ) -> Option; + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[doc = "Change the `clientExtensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `CollectedClientData`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "clientExtensions")] + pub fn set_client_extensions( + this: &CollectedClientData, + val: &AuthenticationExtensionsClientInputs, + ); + #[doc = "Get the `crossOrigin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[wasm_bindgen(method, getter = "crossOrigin")] + pub fn get_cross_origin(this: &CollectedClientData) -> Option; + #[doc = "Change the `crossOrigin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[wasm_bindgen(method, setter = "crossOrigin")] + pub fn set_cross_origin(this: &CollectedClientData, val: bool); + #[doc = "Get the `hashAlgorithm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "hashAlgorithm")] + pub fn get_hash_algorithm(this: &CollectedClientData) -> ::alloc::string::String; + #[doc = "Change the `hashAlgorithm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "hashAlgorithm")] + pub fn set_hash_algorithm(this: &CollectedClientData, val: &str); + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &CollectedClientData) -> ::alloc::string::String; + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &CollectedClientData, val: &str); + #[cfg(feature = "TokenBinding")] + #[doc = "Get the `tokenBinding` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`, `TokenBinding`*"] + #[wasm_bindgen(method, getter = "tokenBinding")] + pub fn get_token_binding(this: &CollectedClientData) -> Option; + #[cfg(feature = "TokenBinding")] + #[doc = "Change the `tokenBinding` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`, `TokenBinding`*"] + #[wasm_bindgen(method, setter = "tokenBinding")] + pub fn set_token_binding(this: &CollectedClientData, val: &TokenBinding); + #[doc = "Get the `tokenBindingId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "tokenBindingId")] + pub fn get_token_binding_id(this: &CollectedClientData) -> Option<::alloc::string::String>; + #[doc = "Change the `tokenBindingId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "tokenBindingId")] + pub fn set_token_binding_id(this: &CollectedClientData, val: &str); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &CollectedClientData) -> ::alloc::string::String; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &CollectedClientData, val: &str); } impl CollectedClientData { #[doc = "Construct a new `CollectedClientData`."] @@ -17,106 +113,52 @@ impl CollectedClientData { pub fn new(challenge: &str, hash_algorithm: &str, origin: &str, type_: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.challenge(challenge); - ret.hash_algorithm(hash_algorithm); - ret.origin(origin); - ret.type_(type_); + ret.set_challenge(challenge); + ret.set_hash_algorithm(hash_algorithm); + ret.set_origin(origin); + ret.set_type(type_); ret } - #[doc = "Change the `challenge` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[deprecated = "Use `set_challenge()` instead."] pub fn challenge(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_challenge(val); self } #[cfg(feature = "AuthenticationExtensionsClientInputs")] - #[doc = "Change the `clientExtensions` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `CollectedClientData`*"] + #[deprecated = "Use `set_client_extensions()` instead."] pub fn client_extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientExtensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_extensions(val); self } - #[doc = "Change the `hashAlgorithm` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[deprecated = "Use `set_cross_origin()` instead."] + pub fn cross_origin(&mut self, val: bool) -> &mut Self { + self.set_cross_origin(val); + self + } + #[deprecated = "Use `set_hash_algorithm()` instead."] pub fn hash_algorithm(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hashAlgorithm"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash_algorithm(val); self } - #[doc = "Change the `origin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[deprecated = "Use `set_origin()` instead."] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_origin(val); self } - #[doc = "Change the `tokenBindingId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[cfg(feature = "TokenBinding")] + #[deprecated = "Use `set_token_binding()` instead."] + pub fn token_binding(&mut self, val: &TokenBinding) -> &mut Self { + self.set_token_binding(val); + self + } + #[deprecated = "Use `set_token_binding_id()` instead."] pub fn token_binding_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("tokenBindingId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_token_binding_id(val); self } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CollectedClientData`*"] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_FlexLineGrowthState.rs b/crates/web-sys/src/features/gen_ColorSpaceConversion.rs similarity index 50% rename from crates/web-sys/src/features/gen_FlexLineGrowthState.rs rename to crates/web-sys/src/features/gen_ColorSpaceConversion.rs index ee937531214..91409cd3cc6 100644 --- a/crates/web-sys/src/features/gen_FlexLineGrowthState.rs +++ b/crates/web-sys/src/features/gen_ColorSpaceConversion.rs @@ -1,12 +1,12 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] -#[doc = "The `FlexLineGrowthState` enum."] +#[doc = "The `ColorSpaceConversion` enum."] #[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `FlexLineGrowthState`*"] +#[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum FlexLineGrowthState { - Unchanged = "unchanged", - Shrinking = "shrinking", - Growing = "growing", +pub enum ColorSpaceConversion { + None = "none", + Default = "default", } diff --git a/crates/web-sys/src/features/gen_Comment.rs b/crates/web-sys/src/features/gen_Comment.rs index d061d996763..405c23fae51 100644 --- a/crates/web-sys/src/features/gen_Comment.rs +++ b/crates/web-sys/src/features/gen_Comment.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CompositeOperation.rs b/crates/web-sys/src/features/gen_CompositeOperation.rs index 97f603f073e..246fc95ce9b 100644 --- a/crates/web-sys/src/features/gen_CompositeOperation.rs +++ b/crates/web-sys/src/features/gen_CompositeOperation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `CompositeOperation` enum."] diff --git a/crates/web-sys/src/features/gen_CompositionEvent.rs b/crates/web-sys/src/features/gen_CompositionEvent.rs index 550211e0317..c9b9b70beb9 100644 --- a/crates/web-sys/src/features/gen_CompositionEvent.rs +++ b/crates/web-sys/src/features/gen_CompositionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/data)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEvent`*"] - pub fn data(this: &CompositionEvent) -> Option; + pub fn data(this: &CompositionEvent) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "CompositionEvent" , js_name = locale)] #[doc = "Getter for the `locale` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/locale)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEvent`*"] - pub fn locale(this: &CompositionEvent) -> String; + pub fn locale(this: &CompositionEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "CompositionEvent")] #[doc = "The `new CompositionEvent(..)` constructor, creating a new instance of `CompositionEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CompositionEventInit.rs b/crates/web-sys/src/features/gen_CompositionEventInit.rs index 2c45e5fb5f7..bfdf96dc739 100644 --- a/crates/web-sys/src/features/gen_CompositionEventInit.rs +++ b/crates/web-sys/src/features/gen_CompositionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,68 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] pub type CompositionEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &CompositionEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &CompositionEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &CompositionEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &CompositionEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &CompositionEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &CompositionEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &CompositionEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &CompositionEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &CompositionEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &CompositionEventInit, val: Option<&Window>); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &CompositionEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &CompositionEventInit, val: &str); } impl CompositionEventInit { #[doc = "Construct a new `CompositionEventInit`."] @@ -19,96 +82,35 @@ impl CompositionEventInit { 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: `CompositionEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `data` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"] + #[deprecated = "Use `set_data()` instead."] pub fn data(&mut self, val: &str) -> &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.set_data(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuPipelineStatisticName.rs b/crates/web-sys/src/features/gen_CompressionFormat.rs similarity index 52% rename from crates/web-sys/src/features/gen_GpuPipelineStatisticName.rs rename to crates/web-sys/src/features/gen_CompressionFormat.rs index 17cf2c90ca2..1ee2070cd19 100644 --- a/crates/web-sys/src/features/gen_GpuPipelineStatisticName.rs +++ b/crates/web-sys/src/features/gen_CompressionFormat.rs @@ -1,18 +1,17 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] -#[doc = "The `GpuPipelineStatisticName` enum."] +#[doc = "The `CompressionFormat` enum."] #[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `GpuPipelineStatisticName`*"] +#[doc = "*This API requires the following crate features to be activated: `CompressionFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GpuPipelineStatisticName { - VertexShaderInvocations = "vertex-shader-invocations", - ClipperInvocations = "clipper-invocations", - ClipperPrimitivesOut = "clipper-primitives-out", - FragmentShaderInvocations = "fragment-shader-invocations", - ComputeShaderInvocations = "compute-shader-invocations", +pub enum CompressionFormat { + Deflate = "deflate", + DeflateRaw = "deflate-raw", + Gzip = "gzip", } diff --git a/crates/web-sys/src/features/gen_CompressionStream.rs b/crates/web-sys/src/features/gen_CompressionStream.rs new file mode 100644 index 00000000000..9db5f808c2f --- /dev/null +++ b/crates/web-sys/src/features/gen_CompressionStream.rs @@ -0,0 +1,55 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CompressionStream , typescript_type = "CompressionStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `CompressionStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type CompressionStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "CompressionStream" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionStream`, `ReadableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &CompressionStream) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "CompressionStream" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionStream`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &CompressionStream) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CompressionFormat")] + #[wasm_bindgen(catch, constructor, js_class = "CompressionStream")] + #[doc = "The `new CompressionStream(..)` constructor, creating a new instance of `CompressionStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream/CompressionStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionFormat`, `CompressionStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: CompressionFormat) -> Result; +} diff --git a/crates/web-sys/src/features/gen_ComputedEffectTiming.rs b/crates/web-sys/src/features/gen_ComputedEffectTiming.rs index 41354056738..fa4e8bb9660 100644 --- a/crates/web-sys/src/features/gen_ComputedEffectTiming.rs +++ b/crates/web-sys/src/features/gen_ComputedEffectTiming.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,140 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] pub type ComputedEffectTiming; + #[doc = "Get the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "delay")] + pub fn get_delay(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "delay")] + pub fn set_delay(this: &ComputedEffectTiming, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[doc = "Get the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`, `PlaybackDirection`*"] + #[wasm_bindgen(method, getter = "direction")] + pub fn get_direction(this: &ComputedEffectTiming) -> Option; + #[cfg(feature = "PlaybackDirection")] + #[doc = "Change the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`, `PlaybackDirection`*"] + #[wasm_bindgen(method, setter = "direction")] + pub fn set_direction(this: &ComputedEffectTiming, val: PlaybackDirection); + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &ComputedEffectTiming) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &ComputedEffectTiming, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &ComputedEffectTiming) -> Option<::alloc::string::String>; + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &ComputedEffectTiming, val: &str); + #[doc = "Get the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "endDelay")] + pub fn get_end_delay(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "endDelay")] + pub fn set_end_delay(this: &ComputedEffectTiming, val: f64); + #[cfg(feature = "FillMode")] + #[doc = "Get the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`, `FillMode`*"] + #[wasm_bindgen(method, getter = "fill")] + pub fn get_fill(this: &ComputedEffectTiming) -> Option; + #[cfg(feature = "FillMode")] + #[doc = "Change the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`, `FillMode`*"] + #[wasm_bindgen(method, setter = "fill")] + pub fn set_fill(this: &ComputedEffectTiming, val: FillMode); + #[doc = "Get the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "iterationStart")] + pub fn get_iteration_start(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "iterationStart")] + pub fn set_iteration_start(this: &ComputedEffectTiming, val: f64); + #[doc = "Get the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "iterations")] + pub fn get_iterations(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "iterations")] + pub fn set_iterations(this: &ComputedEffectTiming, val: f64); + #[doc = "Get the `activeDuration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "activeDuration")] + pub fn get_active_duration(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `activeDuration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "activeDuration")] + pub fn set_active_duration(this: &ComputedEffectTiming, val: f64); + #[doc = "Get the `currentIteration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "currentIteration")] + pub fn get_current_iteration(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `currentIteration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "currentIteration")] + pub fn set_current_iteration(this: &ComputedEffectTiming, val: Option); + #[doc = "Get the `endTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "endTime")] + pub fn get_end_time(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `endTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "endTime")] + pub fn set_end_time(this: &ComputedEffectTiming, val: f64); + #[doc = "Get the `localTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "localTime")] + pub fn get_local_time(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `localTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "localTime")] + pub fn set_local_time(this: &ComputedEffectTiming, val: Option); + #[doc = "Get the `progress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, getter = "progress")] + pub fn get_progress(this: &ComputedEffectTiming) -> Option; + #[doc = "Change the `progress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[wasm_bindgen(method, setter = "progress")] + pub fn set_progress(this: &ComputedEffectTiming, val: Option); } impl ComputedEffectTiming { #[doc = "Construct a new `ComputedEffectTiming`."] @@ -19,216 +154,71 @@ impl ComputedEffectTiming { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `delay` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_delay()` instead."] pub fn delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delay(val); self } #[cfg(feature = "PlaybackDirection")] - #[doc = "Change the `direction` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`, `PlaybackDirection`*"] + #[deprecated = "Use `set_direction()` instead."] pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_direction(val); self } - #[doc = "Change the `duration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_duration()` instead."] pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_duration(val); self } - #[doc = "Change the `easing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_easing()` instead."] 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.set_easing(val); self } - #[doc = "Change the `endDelay` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_end_delay()` instead."] pub fn end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_end_delay(val); self } #[cfg(feature = "FillMode")] - #[doc = "Change the `fill` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`, `FillMode`*"] + #[deprecated = "Use `set_fill()` instead."] pub fn fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fill(val); self } - #[doc = "Change the `iterationStart` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_iteration_start()` instead."] pub fn iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iteration_start(val); self } - #[doc = "Change the `iterations` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_iterations()` instead."] pub fn iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iterations(val); self } - #[doc = "Change the `activeDuration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_active_duration()` instead."] pub fn active_duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("activeDuration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_active_duration(val); self } - #[doc = "Change the `currentIteration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_current_iteration()` instead."] pub fn current_iteration(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("currentIteration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_current_iteration(val); self } - #[doc = "Change the `endTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_end_time()` instead."] pub fn end_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_end_time(val); self } - #[doc = "Change the `localTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_local_time()` instead."] pub fn local_time(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_local_time(val); self } - #[doc = "Change the `progress` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ComputedEffectTiming`*"] + #[deprecated = "Use `set_progress()` instead."] pub fn progress(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("progress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_progress(val); self } } diff --git a/crates/web-sys/src/features/gen_ConnStatusDict.rs b/crates/web-sys/src/features/gen_ConnStatusDict.rs index 64f8522f30f..b17e323e2db 100644 --- a/crates/web-sys/src/features/gen_ConnStatusDict.rs +++ b/crates/web-sys/src/features/gen_ConnStatusDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConnStatusDict`*"] pub type ConnStatusDict; + #[doc = "Get the `status` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConnStatusDict`*"] + #[wasm_bindgen(method, getter = "status")] + pub fn get_status(this: &ConnStatusDict) -> Option<::alloc::string::String>; + #[doc = "Change the `status` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConnStatusDict`*"] + #[wasm_bindgen(method, setter = "status")] + pub fn set_status(this: &ConnStatusDict, val: &str); } impl ConnStatusDict { #[doc = "Construct a new `ConnStatusDict`."] @@ -19,18 +30,9 @@ impl ConnStatusDict { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `status` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConnStatusDict`*"] + #[deprecated = "Use `set_status()` instead."] pub fn status(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("status"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_status(val); self } } diff --git a/crates/web-sys/src/features/gen_ConnectionType.rs b/crates/web-sys/src/features/gen_ConnectionType.rs index 910915f7248..55973494731 100644 --- a/crates/web-sys/src/features/gen_ConnectionType.rs +++ b/crates/web-sys/src/features/gen_ConnectionType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ConnectionType` enum."] diff --git a/crates/web-sys/src/features/gen_ConsoleCounter.rs b/crates/web-sys/src/features/gen_ConsoleCounter.rs index 84afd5df0c4..fba207d2fa0 100644 --- a/crates/web-sys/src/features/gen_ConsoleCounter.rs +++ b/crates/web-sys/src/features/gen_ConsoleCounter.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] pub type ConsoleCounter; + #[doc = "Get the `count` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] + #[wasm_bindgen(method, getter = "count")] + pub fn get_count(this: &ConsoleCounter) -> Option; + #[doc = "Change the `count` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] + #[wasm_bindgen(method, setter = "count")] + pub fn set_count(this: &ConsoleCounter, val: u32); + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &ConsoleCounter) -> Option<::alloc::string::String>; + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &ConsoleCounter, val: &str); } impl ConsoleCounter { #[doc = "Construct a new `ConsoleCounter`."] @@ -19,30 +40,14 @@ impl ConsoleCounter { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `count` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] + #[deprecated = "Use `set_count()` instead."] pub fn count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_count(val); self } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleCounter`*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleCounterError.rs b/crates/web-sys/src/features/gen_ConsoleCounterError.rs index bfa25ad3db0..b4c247d7835 100644 --- a/crates/web-sys/src/features/gen_ConsoleCounterError.rs +++ b/crates/web-sys/src/features/gen_ConsoleCounterError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] pub type ConsoleCounterError; + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &ConsoleCounterError) -> Option<::alloc::string::String>; + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &ConsoleCounterError, val: &str); + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &ConsoleCounterError) -> Option<::alloc::string::String>; + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &ConsoleCounterError, val: &str); } impl ConsoleCounterError { #[doc = "Construct a new `ConsoleCounterError`."] @@ -19,30 +40,14 @@ impl ConsoleCounterError { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `error` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleCounterError`*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleEvent.rs b/crates/web-sys/src/features/gen_ConsoleEvent.rs index a30cd37941a..84437d969a8 100644 --- a/crates/web-sys/src/features/gen_ConsoleEvent.rs +++ b/crates/web-sys/src/features/gen_ConsoleEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,176 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] pub type ConsoleEvent; + #[doc = "Get the `ID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "ID")] + pub fn get_id(this: &ConsoleEvent) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `ID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "ID")] + pub fn set_id(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `addonId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "addonId")] + pub fn get_addon_id(this: &ConsoleEvent) -> Option<::alloc::string::String>; + #[doc = "Change the `addonId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "addonId")] + pub fn set_addon_id(this: &ConsoleEvent, val: &str); + #[doc = "Get the `arguments` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "arguments")] + pub fn get_arguments(this: &ConsoleEvent) -> Option<::js_sys::Array>; + #[doc = "Change the `arguments` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "arguments")] + pub fn set_arguments(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `columnNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "columnNumber")] + pub fn get_column_number(this: &ConsoleEvent) -> Option; + #[doc = "Change the `columnNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "columnNumber")] + pub fn set_column_number(this: &ConsoleEvent, val: u32); + #[doc = "Get the `consoleID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "consoleID")] + pub fn get_console_id(this: &ConsoleEvent) -> Option<::alloc::string::String>; + #[doc = "Change the `consoleID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "consoleID")] + pub fn set_console_id(this: &ConsoleEvent, val: &str); + #[doc = "Get the `counter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "counter")] + pub fn get_counter(this: &ConsoleEvent) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `counter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "counter")] + pub fn set_counter(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `filename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "filename")] + pub fn get_filename(this: &ConsoleEvent) -> Option<::alloc::string::String>; + #[doc = "Change the `filename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "filename")] + pub fn set_filename(this: &ConsoleEvent, val: &str); + #[doc = "Get the `functionName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "functionName")] + pub fn get_function_name(this: &ConsoleEvent) -> Option<::alloc::string::String>; + #[doc = "Change the `functionName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "functionName")] + pub fn set_function_name(this: &ConsoleEvent, val: &str); + #[doc = "Get the `groupName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "groupName")] + pub fn get_group_name(this: &ConsoleEvent) -> Option<::alloc::string::String>; + #[doc = "Change the `groupName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "groupName")] + pub fn set_group_name(this: &ConsoleEvent, val: &str); + #[doc = "Get the `innerID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "innerID")] + pub fn get_inner_id(this: &ConsoleEvent) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `innerID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "innerID")] + pub fn set_inner_id(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `level` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "level")] + pub fn get_level(this: &ConsoleEvent) -> Option<::alloc::string::String>; + #[doc = "Change the `level` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "level")] + pub fn set_level(this: &ConsoleEvent, val: &str); + #[doc = "Get the `lineNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "lineNumber")] + pub fn get_line_number(this: &ConsoleEvent) -> Option; + #[doc = "Change the `lineNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "lineNumber")] + pub fn set_line_number(this: &ConsoleEvent, val: u32); + #[doc = "Get the `prefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "prefix")] + pub fn get_prefix(this: &ConsoleEvent) -> Option<::alloc::string::String>; + #[doc = "Change the `prefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "prefix")] + pub fn set_prefix(this: &ConsoleEvent, val: &str); + #[doc = "Get the `private` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "private")] + pub fn get_private(this: &ConsoleEvent) -> Option; + #[doc = "Change the `private` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "private")] + pub fn set_private(this: &ConsoleEvent, val: bool); + #[doc = "Get the `styles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "styles")] + pub fn get_styles(this: &ConsoleEvent) -> Option<::js_sys::Array>; + #[doc = "Change the `styles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "styles")] + pub fn set_styles(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `timeStamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "timeStamp")] + pub fn get_time_stamp(this: &ConsoleEvent) -> Option; + #[doc = "Change the `timeStamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "timeStamp")] + pub fn set_time_stamp(this: &ConsoleEvent, val: f64); + #[doc = "Get the `timer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, getter = "timer")] + pub fn get_timer(this: &ConsoleEvent) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `timer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[wasm_bindgen(method, setter = "timer")] + pub fn set_timer(this: &ConsoleEvent, val: &::wasm_bindgen::JsValue); } impl ConsoleEvent { #[doc = "Construct a new `ConsoleEvent`."] @@ -19,275 +190,89 @@ impl ConsoleEvent { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `ID` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ID"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `addonId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_addon_id()` instead."] pub fn addon_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addonId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_addon_id(val); self } - #[doc = "Change the `arguments` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_arguments()` instead."] pub fn arguments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arguments"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_arguments(val); self } - #[doc = "Change the `columnNumber` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_column_number()` instead."] pub fn column_number(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("columnNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_column_number(val); self } - #[doc = "Change the `consoleID` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_console_id()` instead."] pub fn console_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("consoleID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_console_id(val); self } - #[doc = "Change the `counter` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_counter()` instead."] pub fn counter(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_counter(val); self } - #[doc = "Change the `filename` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_filename()` instead."] pub fn filename(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_filename(val); self } - #[doc = "Change the `functionName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_function_name()` instead."] pub fn function_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("functionName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_function_name(val); self } - #[doc = "Change the `groupName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_group_name()` instead."] pub fn group_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("groupName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_group_name(val); self } - #[doc = "Change the `innerID` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_inner_id()` instead."] pub fn inner_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("innerID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_inner_id(val); self } - #[doc = "Change the `level` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_level()` instead."] pub fn level(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("level"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_level(val); self } - #[doc = "Change the `lineNumber` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_line_number()` instead."] pub fn line_number(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lineNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_line_number(val); self } - #[doc = "Change the `prefix` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_prefix()` instead."] pub fn prefix(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("prefix"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prefix(val); self } - #[doc = "Change the `private` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_private()` instead."] pub fn private(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("private"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_private(val); self } - #[doc = "Change the `styles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_styles()` instead."] pub fn styles(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("styles"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_styles(val); self } - #[doc = "Change the `timeStamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_time_stamp()` instead."] pub fn time_stamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeStamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_time_stamp(val); self } - #[doc = "Change the `timer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleEvent`*"] + #[deprecated = "Use `set_timer()` instead."] pub fn timer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("timer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timer(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleInstance.rs b/crates/web-sys/src/features/gen_ConsoleInstance.rs index c27a311d820..d50e1af1f67 100644 --- a/crates/web-sys/src/features/gen_ConsoleInstance.rs +++ b/crates/web-sys/src/features/gen_ConsoleInstance.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ConsoleInstanceOptions.rs b/crates/web-sys/src/features/gen_ConsoleInstanceOptions.rs index 6a4f129d860..367bbe939a7 100644 --- a/crates/web-sys/src/features/gen_ConsoleInstanceOptions.rs +++ b/crates/web-sys/src/features/gen_ConsoleInstanceOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,69 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] pub type ConsoleInstanceOptions; + #[doc = "Get the `consoleID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, getter = "consoleID")] + pub fn get_console_id(this: &ConsoleInstanceOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `consoleID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, setter = "consoleID")] + pub fn set_console_id(this: &ConsoleInstanceOptions, val: &str); + #[doc = "Get the `dump` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, getter = "dump")] + pub fn get_dump(this: &ConsoleInstanceOptions) -> Option<::js_sys::Function>; + #[doc = "Change the `dump` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, setter = "dump")] + pub fn set_dump(this: &ConsoleInstanceOptions, val: &::js_sys::Function); + #[doc = "Get the `innerID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, getter = "innerID")] + pub fn get_inner_id(this: &ConsoleInstanceOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `innerID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, setter = "innerID")] + pub fn set_inner_id(this: &ConsoleInstanceOptions, val: &str); + #[cfg(feature = "ConsoleLogLevel")] + #[doc = "Get the `maxLogLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`, `ConsoleLogLevel`*"] + #[wasm_bindgen(method, getter = "maxLogLevel")] + pub fn get_max_log_level(this: &ConsoleInstanceOptions) -> Option; + #[cfg(feature = "ConsoleLogLevel")] + #[doc = "Change the `maxLogLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`, `ConsoleLogLevel`*"] + #[wasm_bindgen(method, setter = "maxLogLevel")] + pub fn set_max_log_level(this: &ConsoleInstanceOptions, val: ConsoleLogLevel); + #[doc = "Get the `maxLogLevelPref` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, getter = "maxLogLevelPref")] + pub fn get_max_log_level_pref(this: &ConsoleInstanceOptions) + -> Option<::alloc::string::String>; + #[doc = "Change the `maxLogLevelPref` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, setter = "maxLogLevelPref")] + pub fn set_max_log_level_pref(this: &ConsoleInstanceOptions, val: &str); + #[doc = "Get the `prefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, getter = "prefix")] + pub fn get_prefix(this: &ConsoleInstanceOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `prefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[wasm_bindgen(method, setter = "prefix")] + pub fn set_prefix(this: &ConsoleInstanceOptions, val: &str); } impl ConsoleInstanceOptions { #[doc = "Construct a new `ConsoleInstanceOptions`."] @@ -19,100 +83,35 @@ impl ConsoleInstanceOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `consoleID` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[deprecated = "Use `set_console_id()` instead."] pub fn console_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("consoleID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_console_id(val); self } - #[doc = "Change the `dump` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[deprecated = "Use `set_dump()` instead."] pub fn dump(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dump"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dump(val); self } - #[doc = "Change the `innerID` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[deprecated = "Use `set_inner_id()` instead."] pub fn inner_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("innerID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_inner_id(val); self } #[cfg(feature = "ConsoleLogLevel")] - #[doc = "Change the `maxLogLevel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`, `ConsoleLogLevel`*"] + #[deprecated = "Use `set_max_log_level()` instead."] pub fn max_log_level(&mut self, val: ConsoleLogLevel) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxLogLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max_log_level(val); self } - #[doc = "Change the `maxLogLevelPref` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[deprecated = "Use `set_max_log_level_pref()` instead."] pub fn max_log_level_pref(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxLogLevelPref"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max_log_level_pref(val); self } - #[doc = "Change the `prefix` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"] + #[deprecated = "Use `set_prefix()` instead."] pub fn prefix(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("prefix"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prefix(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleLevel.rs b/crates/web-sys/src/features/gen_ConsoleLevel.rs index a60bbd0efdd..fb7f6971ca5 100644 --- a/crates/web-sys/src/features/gen_ConsoleLevel.rs +++ b/crates/web-sys/src/features/gen_ConsoleLevel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ConsoleLevel` enum."] diff --git a/crates/web-sys/src/features/gen_ConsoleLogLevel.rs b/crates/web-sys/src/features/gen_ConsoleLogLevel.rs index 6d396e061b8..6946606d6c0 100644 --- a/crates/web-sys/src/features/gen_ConsoleLogLevel.rs +++ b/crates/web-sys/src/features/gen_ConsoleLogLevel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ConsoleLogLevel` enum."] diff --git a/crates/web-sys/src/features/gen_ConsoleProfileEvent.rs b/crates/web-sys/src/features/gen_ConsoleProfileEvent.rs index d1e2674169a..a72113f54eb 100644 --- a/crates/web-sys/src/features/gen_ConsoleProfileEvent.rs +++ b/crates/web-sys/src/features/gen_ConsoleProfileEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] pub type ConsoleProfileEvent; + #[doc = "Get the `action` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] + #[wasm_bindgen(method, getter = "action")] + pub fn get_action(this: &ConsoleProfileEvent) -> Option<::alloc::string::String>; + #[doc = "Change the `action` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] + #[wasm_bindgen(method, setter = "action")] + pub fn set_action(this: &ConsoleProfileEvent, val: &str); + #[doc = "Get the `arguments` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] + #[wasm_bindgen(method, getter = "arguments")] + pub fn get_arguments(this: &ConsoleProfileEvent) -> Option<::js_sys::Array>; + #[doc = "Change the `arguments` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] + #[wasm_bindgen(method, setter = "arguments")] + pub fn set_arguments(this: &ConsoleProfileEvent, val: &::wasm_bindgen::JsValue); } impl ConsoleProfileEvent { #[doc = "Construct a new `ConsoleProfileEvent`."] @@ -19,35 +40,14 @@ impl ConsoleProfileEvent { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `action` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] + #[deprecated = "Use `set_action()` instead."] pub fn action(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("action"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_action(val); self } - #[doc = "Change the `arguments` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleProfileEvent`*"] + #[deprecated = "Use `set_arguments()` instead."] pub fn arguments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arguments"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_arguments(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleStackEntry.rs b/crates/web-sys/src/features/gen_ConsoleStackEntry.rs index b63d60b3c44..17b77e97c40 100644 --- a/crates/web-sys/src/features/gen_ConsoleStackEntry.rs +++ b/crates/web-sys/src/features/gen_ConsoleStackEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] pub type ConsoleStackEntry; + #[doc = "Get the `asyncCause` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, getter = "asyncCause")] + pub fn get_async_cause(this: &ConsoleStackEntry) -> Option<::alloc::string::String>; + #[doc = "Change the `asyncCause` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, setter = "asyncCause")] + pub fn set_async_cause(this: &ConsoleStackEntry, val: Option<&str>); + #[doc = "Get the `columnNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, getter = "columnNumber")] + pub fn get_column_number(this: &ConsoleStackEntry) -> Option; + #[doc = "Change the `columnNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, setter = "columnNumber")] + pub fn set_column_number(this: &ConsoleStackEntry, val: u32); + #[doc = "Get the `filename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, getter = "filename")] + pub fn get_filename(this: &ConsoleStackEntry) -> Option<::alloc::string::String>; + #[doc = "Change the `filename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, setter = "filename")] + pub fn set_filename(this: &ConsoleStackEntry, val: &str); + #[doc = "Get the `functionName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, getter = "functionName")] + pub fn get_function_name(this: &ConsoleStackEntry) -> Option<::alloc::string::String>; + #[doc = "Change the `functionName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, setter = "functionName")] + pub fn set_function_name(this: &ConsoleStackEntry, val: &str); + #[doc = "Get the `lineNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, getter = "lineNumber")] + pub fn get_line_number(this: &ConsoleStackEntry) -> Option; + #[doc = "Change the `lineNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[wasm_bindgen(method, setter = "lineNumber")] + pub fn set_line_number(this: &ConsoleStackEntry, val: u32); } impl ConsoleStackEntry { #[doc = "Construct a new `ConsoleStackEntry`."] @@ -19,89 +70,29 @@ impl ConsoleStackEntry { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `asyncCause` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[deprecated = "Use `set_async_cause()` instead."] pub fn async_cause(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("asyncCause"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_async_cause(val); self } - #[doc = "Change the `columnNumber` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[deprecated = "Use `set_column_number()` instead."] pub fn column_number(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("columnNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_column_number(val); self } - #[doc = "Change the `filename` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[deprecated = "Use `set_filename()` instead."] pub fn filename(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_filename(val); self } - #[doc = "Change the `functionName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[deprecated = "Use `set_function_name()` instead."] pub fn function_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("functionName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_function_name(val); self } - #[doc = "Change the `lineNumber` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleStackEntry`*"] + #[deprecated = "Use `set_line_number()` instead."] pub fn line_number(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lineNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_line_number(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleTimerError.rs b/crates/web-sys/src/features/gen_ConsoleTimerError.rs index dacab00b712..f77827833f8 100644 --- a/crates/web-sys/src/features/gen_ConsoleTimerError.rs +++ b/crates/web-sys/src/features/gen_ConsoleTimerError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] pub type ConsoleTimerError; + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &ConsoleTimerError) -> Option<::alloc::string::String>; + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &ConsoleTimerError, val: &str); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &ConsoleTimerError) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &ConsoleTimerError, val: &str); } impl ConsoleTimerError { #[doc = "Construct a new `ConsoleTimerError`."] @@ -19,30 +40,14 @@ impl ConsoleTimerError { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `error` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerError`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleTimerLogOrEnd.rs b/crates/web-sys/src/features/gen_ConsoleTimerLogOrEnd.rs index 3784b676f2d..dde9cc9ade7 100644 --- a/crates/web-sys/src/features/gen_ConsoleTimerLogOrEnd.rs +++ b/crates/web-sys/src/features/gen_ConsoleTimerLogOrEnd.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] pub type ConsoleTimerLogOrEnd; + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &ConsoleTimerLogOrEnd) -> Option; + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &ConsoleTimerLogOrEnd, val: f64); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &ConsoleTimerLogOrEnd) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &ConsoleTimerLogOrEnd, val: &str); } impl ConsoleTimerLogOrEnd { #[doc = "Construct a new `ConsoleTimerLogOrEnd`."] @@ -19,34 +40,14 @@ impl ConsoleTimerLogOrEnd { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `duration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] + #[deprecated = "Use `set_duration()` instead."] pub fn duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_duration(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerLogOrEnd`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_ConsoleTimerStart.rs b/crates/web-sys/src/features/gen_ConsoleTimerStart.rs index 4e500e41047..a915ed10f00 100644 --- a/crates/web-sys/src/features/gen_ConsoleTimerStart.rs +++ b/crates/web-sys/src/features/gen_ConsoleTimerStart.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerStart`*"] pub type ConsoleTimerStart; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerStart`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &ConsoleTimerStart) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerStart`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &ConsoleTimerStart, val: &str); } impl ConsoleTimerStart { #[doc = "Construct a new `ConsoleTimerStart`."] @@ -19,17 +30,9 @@ impl ConsoleTimerStart { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConsoleTimerStart`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstantSourceNode.rs b/crates/web-sys/src/features/gen_ConstantSourceNode.rs index 5649d044d9f..d4e25d9d140 100644 --- a/crates/web-sys/src/features/gen_ConstantSourceNode.rs +++ b/crates/web-sys/src/features/gen_ConstantSourceNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ConstantSourceOptions.rs b/crates/web-sys/src/features/gen_ConstantSourceOptions.rs index f93dcb84aa1..7b96a490b75 100644 --- a/crates/web-sys/src/features/gen_ConstantSourceOptions.rs +++ b/crates/web-sys/src/features/gen_ConstantSourceOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstantSourceOptions`*"] pub type ConstantSourceOptions; + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstantSourceOptions`*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &ConstantSourceOptions) -> Option; + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstantSourceOptions`*"] + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &ConstantSourceOptions, val: f32); } impl ConstantSourceOptions { #[doc = "Construct a new `ConstantSourceOptions`."] @@ -19,18 +30,9 @@ impl ConstantSourceOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `offset` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstantSourceOptions`*"] + #[deprecated = "Use `set_offset()` instead."] pub fn offset(&mut self, val: f32) -> &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.set_offset(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstrainBooleanParameters.rs b/crates/web-sys/src/features/gen_ConstrainBooleanParameters.rs index 17901cfa900..51b890c87e3 100644 --- a/crates/web-sys/src/features/gen_ConstrainBooleanParameters.rs +++ b/crates/web-sys/src/features/gen_ConstrainBooleanParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] pub type ConstrainBooleanParameters; + #[doc = "Get the `exact` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] + #[wasm_bindgen(method, getter = "exact")] + pub fn get_exact(this: &ConstrainBooleanParameters) -> Option; + #[doc = "Change the `exact` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] + #[wasm_bindgen(method, setter = "exact")] + pub fn set_exact(this: &ConstrainBooleanParameters, val: bool); + #[doc = "Get the `ideal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] + #[wasm_bindgen(method, getter = "ideal")] + pub fn get_ideal(this: &ConstrainBooleanParameters) -> Option; + #[doc = "Change the `ideal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] + #[wasm_bindgen(method, setter = "ideal")] + pub fn set_ideal(this: &ConstrainBooleanParameters, val: bool); } impl ConstrainBooleanParameters { #[doc = "Construct a new `ConstrainBooleanParameters`."] @@ -19,30 +40,14 @@ impl ConstrainBooleanParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `exact` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] + #[deprecated = "Use `set_exact()` instead."] pub fn exact(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("exact"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_exact(val); self } - #[doc = "Change the `ideal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainBooleanParameters`*"] + #[deprecated = "Use `set_ideal()` instead."] pub fn ideal(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ideal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ideal(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstrainDomStringParameters.rs b/crates/web-sys/src/features/gen_ConstrainDomStringParameters.rs index 13b7a173c6a..b2827f2f132 100644 --- a/crates/web-sys/src/features/gen_ConstrainDomStringParameters.rs +++ b/crates/web-sys/src/features/gen_ConstrainDomStringParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] pub type ConstrainDomStringParameters; + #[doc = "Get the `exact` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] + #[wasm_bindgen(method, getter = "exact")] + pub fn get_exact(this: &ConstrainDomStringParameters) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `exact` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] + #[wasm_bindgen(method, setter = "exact")] + pub fn set_exact(this: &ConstrainDomStringParameters, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `ideal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] + #[wasm_bindgen(method, getter = "ideal")] + pub fn get_ideal(this: &ConstrainDomStringParameters) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `ideal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] + #[wasm_bindgen(method, setter = "ideal")] + pub fn set_ideal(this: &ConstrainDomStringParameters, val: &::wasm_bindgen::JsValue); } impl ConstrainDomStringParameters { #[doc = "Construct a new `ConstrainDomStringParameters`."] @@ -19,30 +40,14 @@ impl ConstrainDomStringParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `exact` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] + #[deprecated = "Use `set_exact()` instead."] pub fn exact(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("exact"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_exact(val); self } - #[doc = "Change the `ideal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainDomStringParameters`*"] + #[deprecated = "Use `set_ideal()` instead."] pub fn ideal(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ideal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ideal(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstrainDoubleRange.rs b/crates/web-sys/src/features/gen_ConstrainDoubleRange.rs index 446be61e785..2a543032019 100644 --- a/crates/web-sys/src/features/gen_ConstrainDoubleRange.rs +++ b/crates/web-sys/src/features/gen_ConstrainDoubleRange.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] pub type ConstrainDoubleRange; + #[doc = "Get the `exact` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[wasm_bindgen(method, getter = "exact")] + pub fn get_exact(this: &ConstrainDoubleRange) -> Option; + #[doc = "Change the `exact` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[wasm_bindgen(method, setter = "exact")] + pub fn set_exact(this: &ConstrainDoubleRange, val: f64); + #[doc = "Get the `ideal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[wasm_bindgen(method, getter = "ideal")] + pub fn get_ideal(this: &ConstrainDoubleRange) -> Option; + #[doc = "Change the `ideal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[wasm_bindgen(method, setter = "ideal")] + pub fn set_ideal(this: &ConstrainDoubleRange, val: f64); + #[doc = "Get the `max` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[wasm_bindgen(method, getter = "max")] + pub fn get_max(this: &ConstrainDoubleRange) -> Option; + #[doc = "Change the `max` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[wasm_bindgen(method, setter = "max")] + pub fn set_max(this: &ConstrainDoubleRange, val: f64); + #[doc = "Get the `min` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[wasm_bindgen(method, getter = "min")] + pub fn get_min(this: &ConstrainDoubleRange) -> Option; + #[doc = "Change the `min` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[wasm_bindgen(method, setter = "min")] + pub fn set_min(this: &ConstrainDoubleRange, val: f64); } impl ConstrainDoubleRange { #[doc = "Construct a new `ConstrainDoubleRange`."] @@ -19,56 +60,24 @@ impl ConstrainDoubleRange { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `exact` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[deprecated = "Use `set_exact()` instead."] pub fn exact(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("exact"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_exact(val); self } - #[doc = "Change the `ideal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[deprecated = "Use `set_ideal()` instead."] pub fn ideal(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ideal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ideal(val); self } - #[doc = "Change the `max` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[deprecated = "Use `set_max()` instead."] pub fn max(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("max"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max(val); self } - #[doc = "Change the `min` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainDoubleRange`*"] + #[deprecated = "Use `set_min()` instead."] pub fn min(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("min"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_min(val); self } } diff --git a/crates/web-sys/src/features/gen_ConstrainLongRange.rs b/crates/web-sys/src/features/gen_ConstrainLongRange.rs index 668dbe338bb..9a284100e08 100644 --- a/crates/web-sys/src/features/gen_ConstrainLongRange.rs +++ b/crates/web-sys/src/features/gen_ConstrainLongRange.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] pub type ConstrainLongRange; + #[doc = "Get the `exact` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[wasm_bindgen(method, getter = "exact")] + pub fn get_exact(this: &ConstrainLongRange) -> Option; + #[doc = "Change the `exact` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[wasm_bindgen(method, setter = "exact")] + pub fn set_exact(this: &ConstrainLongRange, val: i32); + #[doc = "Get the `ideal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[wasm_bindgen(method, getter = "ideal")] + pub fn get_ideal(this: &ConstrainLongRange) -> Option; + #[doc = "Change the `ideal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[wasm_bindgen(method, setter = "ideal")] + pub fn set_ideal(this: &ConstrainLongRange, val: i32); + #[doc = "Get the `max` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[wasm_bindgen(method, getter = "max")] + pub fn get_max(this: &ConstrainLongRange) -> Option; + #[doc = "Change the `max` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[wasm_bindgen(method, setter = "max")] + pub fn set_max(this: &ConstrainLongRange, val: i32); + #[doc = "Get the `min` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[wasm_bindgen(method, getter = "min")] + pub fn get_min(this: &ConstrainLongRange) -> Option; + #[doc = "Change the `min` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[wasm_bindgen(method, setter = "min")] + pub fn set_min(this: &ConstrainLongRange, val: i32); } impl ConstrainLongRange { #[doc = "Construct a new `ConstrainLongRange`."] @@ -19,56 +60,24 @@ impl ConstrainLongRange { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `exact` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[deprecated = "Use `set_exact()` instead."] pub fn exact(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("exact"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_exact(val); self } - #[doc = "Change the `ideal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[deprecated = "Use `set_ideal()` instead."] pub fn ideal(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ideal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ideal(val); self } - #[doc = "Change the `max` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[deprecated = "Use `set_max()` instead."] pub fn max(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("max"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max(val); self } - #[doc = "Change the `min` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConstrainLongRange`*"] + #[deprecated = "Use `set_min()` instead."] pub fn min(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("min"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_min(val); self } } diff --git a/crates/web-sys/src/features/gen_ContextAttributes2d.rs b/crates/web-sys/src/features/gen_ContextAttributes2d.rs index fd322265ab4..570c3aca543 100644 --- a/crates/web-sys/src/features/gen_ContextAttributes2d.rs +++ b/crates/web-sys/src/features/gen_ContextAttributes2d.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] pub type ContextAttributes2d; + #[doc = "Get the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &ContextAttributes2d) -> Option; + #[doc = "Change the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &ContextAttributes2d, val: bool); + #[doc = "Get the `willReadFrequently` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] + #[wasm_bindgen(method, getter = "willReadFrequently")] + pub fn get_will_read_frequently(this: &ContextAttributes2d) -> Option; + #[doc = "Change the `willReadFrequently` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] + #[wasm_bindgen(method, setter = "willReadFrequently")] + pub fn set_will_read_frequently(this: &ContextAttributes2d, val: bool); } impl ContextAttributes2d { #[doc = "Construct a new `ContextAttributes2d`."] @@ -19,34 +40,14 @@ impl ContextAttributes2d { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `alpha` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] + #[deprecated = "Use `set_alpha()` instead."] pub fn alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alpha(val); self } - #[doc = "Change the `willReadFrequently` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ContextAttributes2d`*"] + #[deprecated = "Use `set_will_read_frequently()` instead."] pub fn will_read_frequently(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("willReadFrequently"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_will_read_frequently(val); self } } diff --git a/crates/web-sys/src/features/gen_ConvertCoordinateOptions.rs b/crates/web-sys/src/features/gen_ConvertCoordinateOptions.rs index 9578f2b6b27..9d31410e431 100644 --- a/crates/web-sys/src/features/gen_ConvertCoordinateOptions.rs +++ b/crates/web-sys/src/features/gen_ConvertCoordinateOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,30 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`*"] pub type ConvertCoordinateOptions; + #[cfg(feature = "CssBoxType")] + #[doc = "Get the `fromBox` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`, `CssBoxType`*"] + #[wasm_bindgen(method, getter = "fromBox")] + pub fn get_from_box(this: &ConvertCoordinateOptions) -> Option; + #[cfg(feature = "CssBoxType")] + #[doc = "Change the `fromBox` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`, `CssBoxType`*"] + #[wasm_bindgen(method, setter = "fromBox")] + pub fn set_from_box(this: &ConvertCoordinateOptions, val: CssBoxType); + #[cfg(feature = "CssBoxType")] + #[doc = "Get the `toBox` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`, `CssBoxType`*"] + #[wasm_bindgen(method, getter = "toBox")] + pub fn get_to_box(this: &ConvertCoordinateOptions) -> Option; + #[cfg(feature = "CssBoxType")] + #[doc = "Change the `toBox` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`, `CssBoxType`*"] + #[wasm_bindgen(method, setter = "toBox")] + pub fn set_to_box(this: &ConvertCoordinateOptions, val: CssBoxType); } impl ConvertCoordinateOptions { #[doc = "Construct a new `ConvertCoordinateOptions`."] @@ -20,35 +45,15 @@ impl ConvertCoordinateOptions { ret } #[cfg(feature = "CssBoxType")] - #[doc = "Change the `fromBox` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`, `CssBoxType`*"] + #[deprecated = "Use `set_from_box()` instead."] pub fn from_box(&mut self, val: CssBoxType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fromBox"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_from_box(val); self } #[cfg(feature = "CssBoxType")] - #[doc = "Change the `toBox` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConvertCoordinateOptions`, `CssBoxType`*"] + #[deprecated = "Use `set_to_box()` instead."] pub fn to_box(&mut self, val: CssBoxType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("toBox"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_to_box(val); self } } diff --git a/crates/web-sys/src/features/gen_ConvolverNode.rs b/crates/web-sys/src/features/gen_ConvolverNode.rs index 0974b8a6e5d..69e25a42ba3 100644 --- a/crates/web-sys/src/features/gen_ConvolverNode.rs +++ b/crates/web-sys/src/features/gen_ConvolverNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ConvolverOptions.rs b/crates/web-sys/src/features/gen_ConvolverOptions.rs index dc895baf53b..e53480644c4 100644 --- a/crates/web-sys/src/features/gen_ConvolverOptions.rs +++ b/crates/web-sys/src/features/gen_ConvolverOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,62 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] pub type ConvolverOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &ConvolverOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &ConvolverOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ConvolverOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &ConvolverOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ConvolverOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &ConvolverOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ConvolverOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &ConvolverOptions) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ConvolverOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &ConvolverOptions, val: ChannelInterpretation); + #[cfg(feature = "AudioBuffer")] + #[doc = "Get the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `ConvolverOptions`*"] + #[wasm_bindgen(method, getter = "buffer")] + pub fn get_buffer(this: &ConvolverOptions) -> Option; + #[cfg(feature = "AudioBuffer")] + #[doc = "Change the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `ConvolverOptions`*"] + #[wasm_bindgen(method, setter = "buffer")] + pub fn set_buffer(this: &ConvolverOptions, val: Option<&AudioBuffer>); + #[doc = "Get the `disableNormalization` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] + #[wasm_bindgen(method, getter = "disableNormalization")] + pub fn get_disable_normalization(this: &ConvolverOptions) -> Option; + #[doc = "Change the `disableNormalization` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] + #[wasm_bindgen(method, setter = "disableNormalization")] + pub fn set_disable_normalization(this: &ConvolverOptions, val: bool); } impl ConvolverOptions { #[doc = "Construct a new `ConvolverOptions`."] @@ -19,89 +76,32 @@ impl ConvolverOptions { 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: `ConvolverOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ConvolverOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ConvolverOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } #[cfg(feature = "AudioBuffer")] - #[doc = "Change the `buffer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `ConvolverOptions`*"] + #[deprecated = "Use `set_buffer()` instead."] 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.set_buffer(val); self } - #[doc = "Change the `disableNormalization` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"] + #[deprecated = "Use `set_disable_normalization()` instead."] pub fn disable_normalization(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disableNormalization"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_disable_normalization(val); self } } diff --git a/crates/web-sys/src/features/gen_Coordinates.rs b/crates/web-sys/src/features/gen_Coordinates.rs index 10850a2d3ef..ef92e0b0f3c 100644 --- a/crates/web-sys/src/features/gen_Coordinates.rs +++ b/crates/web-sys/src/features/gen_Coordinates.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CountQueuingStrategy.rs b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs new file mode 100644 index 00000000000..2f3373e5b7d --- /dev/null +++ b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs @@ -0,0 +1,37 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CountQueuingStrategy , typescript_type = "CountQueuingStrategy")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `CountQueuingStrategy` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub type CountQueuingStrategy; + # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = highWaterMark)] + #[doc = "Getter for the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/highWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub fn high_water_mark(this: &CountQueuingStrategy) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , 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/CountQueuingStrategy/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub fn size(this: &CountQueuingStrategy) -> ::js_sys::Function; + #[cfg(feature = "QueuingStrategyInit")] + #[wasm_bindgen(catch, constructor, js_class = "CountQueuingStrategy")] + #[doc = "The `new CountQueuingStrategy(..)` constructor, creating a new instance of `CountQueuingStrategy`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/CountQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`, `QueuingStrategyInit`*"] + pub fn new(init: &QueuingStrategyInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_Credential.rs b/crates/web-sys/src/features/gen_Credential.rs index 699f5eeb301..7be4b17fd59 100644 --- a/crates/web-sys/src/features/gen_Credential.rs +++ b/crates/web-sys/src/features/gen_Credential.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,12 +18,12 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Credential/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Credential`*"] - pub fn id(this: &Credential) -> String; + pub fn id(this: &Credential) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Credential" , 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/Credential/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Credential`*"] - pub fn type_(this: &Credential) -> String; + pub fn type_(this: &Credential) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_CredentialCreationOptions.rs b/crates/web-sys/src/features/gen_CredentialCreationOptions.rs index 8c9958c144b..67aadd91e6f 100644 --- a/crates/web-sys/src/features/gen_CredentialCreationOptions.rs +++ b/crates/web-sys/src/features/gen_CredentialCreationOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,35 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CredentialCreationOptions`*"] pub type CredentialCreationOptions; + #[cfg(feature = "PublicKeyCredentialCreationOptions")] + #[doc = "Get the `publicKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CredentialCreationOptions`, `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "publicKey")] + pub fn get_public_key( + this: &CredentialCreationOptions, + ) -> Option; + #[cfg(feature = "PublicKeyCredentialCreationOptions")] + #[doc = "Change the `publicKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CredentialCreationOptions`, `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "publicKey")] + pub fn set_public_key( + this: &CredentialCreationOptions, + val: &PublicKeyCredentialCreationOptions, + ); + #[cfg(feature = "AbortSignal")] + #[doc = "Get the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `CredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "signal")] + pub fn get_signal(this: &CredentialCreationOptions) -> Option; + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `CredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "signal")] + pub fn set_signal(this: &CredentialCreationOptions, val: &AbortSignal); } impl CredentialCreationOptions { #[doc = "Construct a new `CredentialCreationOptions`."] @@ -20,36 +50,15 @@ impl CredentialCreationOptions { ret } #[cfg(feature = "PublicKeyCredentialCreationOptions")] - #[doc = "Change the `publicKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CredentialCreationOptions`, `PublicKeyCredentialCreationOptions`*"] + #[deprecated = "Use `set_public_key()` instead."] pub fn public_key(&mut self, val: &PublicKeyCredentialCreationOptions) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("publicKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_public_key(val); self } #[cfg(feature = "AbortSignal")] - #[doc = "Change the `signal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `CredentialCreationOptions`*"] + #[deprecated = "Use `set_signal()` instead."] pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_signal(val); self } } diff --git a/crates/web-sys/src/features/gen_CredentialPropertiesOutput.rs b/crates/web-sys/src/features/gen_CredentialPropertiesOutput.rs new file mode 100644 index 00000000000..5e44b35990a --- /dev/null +++ b/crates/web-sys/src/features/gen_CredentialPropertiesOutput.rs @@ -0,0 +1,43 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CredentialPropertiesOutput)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `CredentialPropertiesOutput` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CredentialPropertiesOutput`*"] + pub type CredentialPropertiesOutput; + #[doc = "Get the `rk` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CredentialPropertiesOutput`*"] + #[wasm_bindgen(method, getter = "rk")] + pub fn get_rk(this: &CredentialPropertiesOutput) -> Option; + #[doc = "Change the `rk` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CredentialPropertiesOutput`*"] + #[wasm_bindgen(method, setter = "rk")] + pub fn set_rk(this: &CredentialPropertiesOutput, val: bool); +} +impl CredentialPropertiesOutput { + #[doc = "Construct a new `CredentialPropertiesOutput`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CredentialPropertiesOutput`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_rk()` instead."] + pub fn rk(&mut self, val: bool) -> &mut Self { + self.set_rk(val); + self + } +} +impl Default for CredentialPropertiesOutput { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_CredentialRequestOptions.rs b/crates/web-sys/src/features/gen_CredentialRequestOptions.rs index 61537f7b8f7..2d2d0e18711 100644 --- a/crates/web-sys/src/features/gen_CredentialRequestOptions.rs +++ b/crates/web-sys/src/features/gen_CredentialRequestOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,32 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CredentialRequestOptions`*"] pub type CredentialRequestOptions; + #[cfg(feature = "PublicKeyCredentialRequestOptions")] + #[doc = "Get the `publicKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CredentialRequestOptions`, `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, getter = "publicKey")] + pub fn get_public_key( + this: &CredentialRequestOptions, + ) -> Option; + #[cfg(feature = "PublicKeyCredentialRequestOptions")] + #[doc = "Change the `publicKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CredentialRequestOptions`, `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, setter = "publicKey")] + pub fn set_public_key(this: &CredentialRequestOptions, val: &PublicKeyCredentialRequestOptions); + #[cfg(feature = "AbortSignal")] + #[doc = "Get the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `CredentialRequestOptions`*"] + #[wasm_bindgen(method, getter = "signal")] + pub fn get_signal(this: &CredentialRequestOptions) -> Option; + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `CredentialRequestOptions`*"] + #[wasm_bindgen(method, setter = "signal")] + pub fn set_signal(this: &CredentialRequestOptions, val: &AbortSignal); } impl CredentialRequestOptions { #[doc = "Construct a new `CredentialRequestOptions`."] @@ -20,36 +47,15 @@ impl CredentialRequestOptions { ret } #[cfg(feature = "PublicKeyCredentialRequestOptions")] - #[doc = "Change the `publicKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CredentialRequestOptions`, `PublicKeyCredentialRequestOptions`*"] + #[deprecated = "Use `set_public_key()` instead."] pub fn public_key(&mut self, val: &PublicKeyCredentialRequestOptions) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("publicKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_public_key(val); self } #[cfg(feature = "AbortSignal")] - #[doc = "Change the `signal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `CredentialRequestOptions`*"] + #[deprecated = "Use `set_signal()` instead."] pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_signal(val); self } } diff --git a/crates/web-sys/src/features/gen_CredentialsContainer.rs b/crates/web-sys/src/features/gen_CredentialsContainer.rs index fb008e96823..13d70deeeb0 100644 --- a/crates/web-sys/src/features/gen_CredentialsContainer.rs +++ b/crates/web-sys/src/features/gen_CredentialsContainer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_Crypto.rs b/crates/web-sys/src/features/gen_Crypto.rs index 4c46bfd15d2..6cc25458687 100644 --- a/crates/web-sys/src/features/gen_Crypto.rs +++ b/crates/web-sys/src/features/gen_Crypto.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -39,11 +40,21 @@ extern "C" { this: &Crypto, array: &mut [u8], ) -> Result<::js_sys::Object, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "Crypto" , js_name = getRandomValues)] + #[doc = "The `getRandomValues()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Crypto`*"] + pub fn get_random_values_with_js_u8_array( + this: &Crypto, + array: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Object, JsValue>; # [wasm_bindgen (method , structural , js_class = "Crypto" , js_name = randomUUID)] #[doc = "The `randomUUID()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Crypto`*"] - pub fn random_uuid(this: &Crypto) -> String; + pub fn random_uuid(this: &Crypto) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_CryptoKey.rs b/crates/web-sys/src/features/gen_CryptoKey.rs index 7e8773eb127..f538e966c8f 100644 --- a/crates/web-sys/src/features/gen_CryptoKey.rs +++ b/crates/web-sys/src/features/gen_CryptoKey.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CryptoKey`*"] - pub fn type_(this: &CryptoKey) -> String; + pub fn type_(this: &CryptoKey) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "CryptoKey" , js_name = extractable)] #[doc = "Getter for the `extractable` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CryptoKeyPair.rs b/crates/web-sys/src/features/gen_CryptoKeyPair.rs index 5026e6398c6..029f9d2aa96 100644 --- a/crates/web-sys/src/features/gen_CryptoKeyPair.rs +++ b/crates/web-sys/src/features/gen_CryptoKeyPair.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,30 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CryptoKeyPair`*"] pub type CryptoKeyPair; + #[cfg(feature = "CryptoKey")] + #[doc = "Get the `privateKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `CryptoKeyPair`*"] + #[wasm_bindgen(method, getter = "privateKey")] + pub fn get_private_key(this: &CryptoKeyPair) -> CryptoKey; + #[cfg(feature = "CryptoKey")] + #[doc = "Change the `privateKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `CryptoKeyPair`*"] + #[wasm_bindgen(method, setter = "privateKey")] + pub fn set_private_key(this: &CryptoKeyPair, val: &CryptoKey); + #[cfg(feature = "CryptoKey")] + #[doc = "Get the `publicKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `CryptoKeyPair`*"] + #[wasm_bindgen(method, getter = "publicKey")] + pub fn get_public_key(this: &CryptoKeyPair) -> CryptoKey; + #[cfg(feature = "CryptoKey")] + #[doc = "Change the `publicKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `CryptoKeyPair`*"] + #[wasm_bindgen(method, setter = "publicKey")] + pub fn set_public_key(this: &CryptoKeyPair, val: &CryptoKey); } impl CryptoKeyPair { #[cfg(feature = "CryptoKey")] @@ -18,44 +43,20 @@ impl CryptoKeyPair { pub fn new(private_key: &CryptoKey, public_key: &CryptoKey) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.private_key(private_key); - ret.public_key(public_key); + ret.set_private_key(private_key); + ret.set_public_key(public_key); ret } #[cfg(feature = "CryptoKey")] - #[doc = "Change the `privateKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `CryptoKeyPair`*"] + #[deprecated = "Use `set_private_key()` instead."] pub fn private_key(&mut self, val: &CryptoKey) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("privateKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_private_key(val); self } #[cfg(feature = "CryptoKey")] - #[doc = "Change the `publicKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `CryptoKeyPair`*"] + #[deprecated = "Use `set_public_key()` instead."] pub fn public_key(&mut self, val: &CryptoKey) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("publicKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_public_key(val); self } } diff --git a/crates/web-sys/src/features/gen_Csp.rs b/crates/web-sys/src/features/gen_Csp.rs deleted file mode 100644 index 0fbea97c99d..00000000000 --- a/crates/web-sys/src/features/gen_Csp.rs +++ /dev/null @@ -1,401 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSP)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `Csp` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub type Csp; -} -impl Csp { - #[doc = "Construct a new `Csp`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `base-uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn base_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("base-uri"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `block-all-mixed-content` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn block_all_mixed_content(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("block-all-mixed-content"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `child-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn child_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("child-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `connect-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn connect_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("connect-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `default-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn default_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("default-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `font-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn font_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("font-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `form-action` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn form_action(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("form-action"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `frame-ancestors` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn frame_ancestors(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frame-ancestors"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `frame-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn frame_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frame-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `img-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn img_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("img-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `manifest-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn manifest_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("manifest-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `media-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn media_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("media-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `object-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn object_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("object-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `referrer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn referrer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `report-only` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn report_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("report-only"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `report-uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn report_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("report-uri"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `require-sri-for` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn require_sri_for(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("require-sri-for"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `sandbox` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn sandbox(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sandbox"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `script-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn script_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("script-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `style-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn style_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("style-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `upgrade-insecure-requests` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn upgrade_insecure_requests(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("upgrade-insecure-requests"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `worker-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn worker_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("worker-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for Csp { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_CspPolicies.rs b/crates/web-sys/src/features/gen_CspPolicies.rs deleted file mode 100644 index 96d4ad5337b..00000000000 --- a/crates/web-sys/src/features/gen_CspPolicies.rs +++ /dev/null @@ -1,44 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSPPolicies)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `CspPolicies` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspPolicies`*"] - pub type CspPolicies; -} -impl CspPolicies { - #[doc = "Construct a new `CspPolicies`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspPolicies`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `csp-policies` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspPolicies`*"] - pub fn csp_policies(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("csp-policies"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for CspPolicies { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_CspReport.rs b/crates/web-sys/src/features/gen_CspReport.rs deleted file mode 100644 index 6938a2d32fd..00000000000 --- a/crates/web-sys/src/features/gen_CspReport.rs +++ /dev/null @@ -1,45 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSPReport)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `CspReport` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReport`*"] - pub type CspReport; -} -impl CspReport { - #[doc = "Construct a new `CspReport`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReport`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(feature = "CspReportProperties")] - #[doc = "Change the `csp-report` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReport`, `CspReportProperties`*"] - pub fn csp_report(&mut self, val: &CspReportProperties) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("csp-report"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for CspReport { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_CspReportProperties.rs b/crates/web-sys/src/features/gen_CspReportProperties.rs deleted file mode 100644 index c20edf21280..00000000000 --- a/crates/web-sys/src/features/gen_CspReportProperties.rs +++ /dev/null @@ -1,180 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSPReportProperties)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `CspReportProperties` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub type CspReportProperties; -} -impl CspReportProperties { - #[doc = "Construct a new `CspReportProperties`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `blocked-uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn blocked_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("blocked-uri"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `column-number` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn column_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("column-number"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `document-uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn document_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("document-uri"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `line-number` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn line_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("line-number"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `original-policy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn original_policy(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("original-policy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `referrer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn referrer(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `script-sample` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn script_sample(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("script-sample"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `source-file` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn source_file(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("source-file"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `violated-directive` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn violated_directive(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("violated-directive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for CspReportProperties { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_CssAnimation.rs b/crates/web-sys/src/features/gen_CssAnimation.rs index ea0df7c6296..f55ebbdf4ee 100644 --- a/crates/web-sys/src/features/gen_CssAnimation.rs +++ b/crates/web-sys/src/features/gen_CssAnimation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,5 +18,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSAnimation/animationName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssAnimation`*"] - pub fn animation_name(this: &CssAnimation) -> String; + pub fn animation_name(this: &CssAnimation) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_CssBoxType.rs b/crates/web-sys/src/features/gen_CssBoxType.rs index c72b966f21f..68b285f886f 100644 --- a/crates/web-sys/src/features/gen_CssBoxType.rs +++ b/crates/web-sys/src/features/gen_CssBoxType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `CssBoxType` enum."] diff --git a/crates/web-sys/src/features/gen_CssConditionRule.rs b/crates/web-sys/src/features/gen_CssConditionRule.rs index a08a051d6a0..3df4d77159d 100644 --- a/crates/web-sys/src/features/gen_CssConditionRule.rs +++ b/crates/web-sys/src/features/gen_CssConditionRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSConditionRule/conditionText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssConditionRule`*"] - pub fn condition_text(this: &CssConditionRule) -> String; + pub fn condition_text(this: &CssConditionRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSConditionRule" , js_name = conditionText)] #[doc = "Setter for the `conditionText` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CssCounterStyleRule.rs b/crates/web-sys/src/features/gen_CssCounterStyleRule.rs index 99a4e127c6d..79d6e842610 100644 --- a/crates/web-sys/src/features/gen_CssCounterStyleRule.rs +++ b/crates/web-sys/src/features/gen_CssCounterStyleRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn name(this: &CssCounterStyleRule) -> String; + pub fn name(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/system)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn system(this: &CssCounterStyleRule) -> String; + pub fn system(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = system)] #[doc = "Setter for the `system` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/symbols)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn symbols(this: &CssCounterStyleRule) -> String; + pub fn symbols(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = symbols)] #[doc = "Setter for the `symbols` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/additiveSymbols)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn additive_symbols(this: &CssCounterStyleRule) -> String; + pub fn additive_symbols(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = additiveSymbols)] #[doc = "Setter for the `additiveSymbols` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/negative)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn negative(this: &CssCounterStyleRule) -> String; + pub fn negative(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = negative)] #[doc = "Setter for the `negative` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/prefix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn prefix(this: &CssCounterStyleRule) -> String; + pub fn prefix(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = prefix)] #[doc = "Setter for the `prefix` field of this object."] #[doc = ""] @@ -101,7 +102,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/suffix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn suffix(this: &CssCounterStyleRule) -> String; + pub fn suffix(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = suffix)] #[doc = "Setter for the `suffix` field of this object."] #[doc = ""] @@ -115,7 +116,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/range)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn range(this: &CssCounterStyleRule) -> String; + pub fn range(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = range)] #[doc = "Setter for the `range` field of this object."] #[doc = ""] @@ -129,7 +130,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/pad)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn pad(this: &CssCounterStyleRule) -> String; + pub fn pad(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = pad)] #[doc = "Setter for the `pad` field of this object."] #[doc = ""] @@ -143,7 +144,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/speakAs)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn speak_as(this: &CssCounterStyleRule) -> String; + pub fn speak_as(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = speakAs)] #[doc = "Setter for the `speakAs` field of this object."] #[doc = ""] @@ -157,7 +158,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule/fallback)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssCounterStyleRule`*"] - pub fn fallback(this: &CssCounterStyleRule) -> String; + pub fn fallback(this: &CssCounterStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSCounterStyleRule" , js_name = fallback)] #[doc = "Setter for the `fallback` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CssFontFaceRule.rs b/crates/web-sys/src/features/gen_CssFontFaceRule.rs index b92001157e4..0492381d9df 100644 --- a/crates/web-sys/src/features/gen_CssFontFaceRule.rs +++ b/crates/web-sys/src/features/gen_CssFontFaceRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CssFontFeatureValuesRule.rs b/crates/web-sys/src/features/gen_CssFontFeatureValuesRule.rs index 976e1479bb3..73399c5efab 100644 --- a/crates/web-sys/src/features/gen_CssFontFeatureValuesRule.rs +++ b/crates/web-sys/src/features/gen_CssFontFeatureValuesRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFeatureValuesRule/fontFamily)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssFontFeatureValuesRule`*"] - pub fn font_family(this: &CssFontFeatureValuesRule) -> String; + pub fn font_family(this: &CssFontFeatureValuesRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSFontFeatureValuesRule" , js_name = fontFamily)] #[doc = "Setter for the `fontFamily` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFeatureValuesRule/valueText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssFontFeatureValuesRule`*"] - pub fn value_text(this: &CssFontFeatureValuesRule) -> String; + pub fn value_text(this: &CssFontFeatureValuesRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSFontFeatureValuesRule" , js_name = valueText)] #[doc = "Setter for the `valueText` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CssGroupingRule.rs b/crates/web-sys/src/features/gen_CssGroupingRule.rs index 9c0fe854d51..c9a97ca1312 100644 --- a/crates/web-sys/src/features/gen_CssGroupingRule.rs +++ b/crates/web-sys/src/features/gen_CssGroupingRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CssImportRule.rs b/crates/web-sys/src/features/gen_CssImportRule.rs index 11ad6011d5f..335c6ed55f7 100644 --- a/crates/web-sys/src/features/gen_CssImportRule.rs +++ b/crates/web-sys/src/features/gen_CssImportRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSImportRule/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssImportRule`*"] - pub fn href(this: &CssImportRule) -> String; + pub fn href(this: &CssImportRule) -> ::alloc::string::String; #[cfg(feature = "MediaList")] # [wasm_bindgen (structural , method , getter , js_class = "CSSImportRule" , js_name = media)] #[doc = "Getter for the `media` field of this object."] diff --git a/crates/web-sys/src/features/gen_CssKeyframeRule.rs b/crates/web-sys/src/features/gen_CssKeyframeRule.rs index 547d97b90f6..7ca5caacf9f 100644 --- a/crates/web-sys/src/features/gen_CssKeyframeRule.rs +++ b/crates/web-sys/src/features/gen_CssKeyframeRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframeRule/keyText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssKeyframeRule`*"] - pub fn key_text(this: &CssKeyframeRule) -> String; + pub fn key_text(this: &CssKeyframeRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSKeyframeRule" , js_name = keyText)] #[doc = "Setter for the `keyText` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CssKeyframesRule.rs b/crates/web-sys/src/features/gen_CssKeyframesRule.rs index 27c636c8eac..2526fb3e576 100644 --- a/crates/web-sys/src/features/gen_CssKeyframesRule.rs +++ b/crates/web-sys/src/features/gen_CssKeyframesRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframesRule/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssKeyframesRule`*"] - pub fn name(this: &CssKeyframesRule) -> String; + pub fn name(this: &CssKeyframesRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSKeyframesRule" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CssMediaRule.rs b/crates/web-sys/src/features/gen_CssMediaRule.rs index fa3b215f7cc..adbab8f18ef 100644 --- a/crates/web-sys/src/features/gen_CssMediaRule.rs +++ b/crates/web-sys/src/features/gen_CssMediaRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CssNamespaceRule.rs b/crates/web-sys/src/features/gen_CssNamespaceRule.rs index 3fce67660a3..d21e37b678a 100644 --- a/crates/web-sys/src/features/gen_CssNamespaceRule.rs +++ b/crates/web-sys/src/features/gen_CssNamespaceRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,12 +18,12 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSNamespaceRule/namespaceURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssNamespaceRule`*"] - pub fn namespace_uri(this: &CssNamespaceRule) -> String; + pub fn namespace_uri(this: &CssNamespaceRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "CSSNamespaceRule" , 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/CSSNamespaceRule/prefix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssNamespaceRule`*"] - pub fn prefix(this: &CssNamespaceRule) -> String; + pub fn prefix(this: &CssNamespaceRule) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_CssPageRule.rs b/crates/web-sys/src/features/gen_CssPageRule.rs index d9441f51292..eb3a7b5502e 100644 --- a/crates/web-sys/src/features/gen_CssPageRule.rs +++ b/crates/web-sys/src/features/gen_CssPageRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CssPseudoElement.rs b/crates/web-sys/src/features/gen_CssPseudoElement.rs index 63b3f543e6a..7e5fe8f9e47 100644 --- a/crates/web-sys/src/features/gen_CssPseudoElement.rs +++ b/crates/web-sys/src/features/gen_CssPseudoElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSPseudoElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssPseudoElement`*"] - pub fn type_(this: &CssPseudoElement) -> String; + pub fn type_(this: &CssPseudoElement) -> ::alloc::string::String; #[cfg(feature = "Element")] # [wasm_bindgen (structural , method , getter , js_class = "CSSPseudoElement" , js_name = parentElement)] #[doc = "Getter for the `parentElement` field of this object."] @@ -26,4 +27,74 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssPseudoElement`, `Element`*"] pub fn parent_element(this: &CssPseudoElement) -> Element; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Animation")] + # [wasm_bindgen (method , structural , js_class = "CSSPseudoElement" , js_name = animate)] + #[doc = "The `animate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSPseudoElement/animate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Animation`, `CssPseudoElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn animate(this: &CssPseudoElement, keyframes: Option<&::js_sys::Object>) -> Animation; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Animation")] + # [wasm_bindgen (method , structural , js_class = "CSSPseudoElement" , js_name = animate)] + #[doc = "The `animate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSPseudoElement/animate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Animation`, `CssPseudoElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn animate_with_f64( + this: &CssPseudoElement, + keyframes: Option<&::js_sys::Object>, + options: f64, + ) -> Animation; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "Animation", feature = "KeyframeAnimationOptions",))] + # [wasm_bindgen (method , structural , js_class = "CSSPseudoElement" , js_name = animate)] + #[doc = "The `animate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSPseudoElement/animate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Animation`, `CssPseudoElement`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn animate_with_keyframe_animation_options( + this: &CssPseudoElement, + keyframes: Option<&::js_sys::Object>, + options: &KeyframeAnimationOptions, + ) -> Animation; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "CSSPseudoElement" , js_name = getAnimations)] + #[doc = "The `getAnimations()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSPseudoElement/getAnimations)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssPseudoElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_animations(this: &CssPseudoElement) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GetAnimationsOptions")] + # [wasm_bindgen (method , structural , js_class = "CSSPseudoElement" , js_name = getAnimations)] + #[doc = "The `getAnimations()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSPseudoElement/getAnimations)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssPseudoElement`, `GetAnimationsOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_animations_with_options( + this: &CssPseudoElement, + options: &GetAnimationsOptions, + ) -> ::js_sys::Array; } diff --git a/crates/web-sys/src/features/gen_CssRule.rs b/crates/web-sys/src/features/gen_CssRule.rs index 801667eb15e..91c4a8a8505 100644 --- a/crates/web-sys/src/features/gen_CssRule.rs +++ b/crates/web-sys/src/features/gen_CssRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule/cssText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssRule`*"] - pub fn css_text(this: &CssRule) -> String; + pub fn css_text(this: &CssRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSRule" , js_name = cssText)] #[doc = "Setter for the `cssText` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CssRuleList.rs b/crates/web-sys/src/features/gen_CssRuleList.rs index 1dd778fa085..9482667ef58 100644 --- a/crates/web-sys/src/features/gen_CssRuleList.rs +++ b/crates/web-sys/src/features/gen_CssRuleList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -28,7 +29,7 @@ extern "C" { pub fn item(this: &CssRuleList, index: u32) -> Option; #[cfg(feature = "CssRule")] #[wasm_bindgen(method, structural, js_class = "CSSRuleList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CssStyleDeclaration.rs b/crates/web-sys/src/features/gen_CssStyleDeclaration.rs index c22016a031e..dfe0ea7cdce 100644 --- a/crates/web-sys/src/features/gen_CssStyleDeclaration.rs +++ b/crates/web-sys/src/features/gen_CssStyleDeclaration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/cssText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`*"] - pub fn css_text(this: &CssStyleDeclaration) -> String; + pub fn css_text(this: &CssStyleDeclaration) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSStyleDeclaration" , js_name = cssText)] #[doc = "Setter for the `cssText` field of this object."] #[doc = ""] @@ -46,7 +47,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/getPropertyPriority)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`*"] - pub fn get_property_priority(this: &CssStyleDeclaration, property: &str) -> String; + pub fn get_property_priority( + this: &CssStyleDeclaration, + property: &str, + ) -> ::alloc::string::String; # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleDeclaration" , js_name = getPropertyValue)] #[doc = "The `getPropertyValue()` method."] #[doc = ""] @@ -56,21 +60,24 @@ extern "C" { pub fn get_property_value( this: &CssStyleDeclaration, property: &str, - ) -> Result; + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (method , structural , js_class = "CSSStyleDeclaration" , js_name = item)] #[doc = "The `item()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/item)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`*"] - pub fn item(this: &CssStyleDeclaration, index: u32) -> String; + pub fn item(this: &CssStyleDeclaration, index: u32) -> ::alloc::string::String; # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleDeclaration" , js_name = removeProperty)] #[doc = "The `removeProperty()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/removeProperty)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`*"] - pub fn remove_property(this: &CssStyleDeclaration, property: &str) -> Result; + pub fn remove_property( + this: &CssStyleDeclaration, + property: &str, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleDeclaration" , js_name = setProperty)] #[doc = "The `setProperty()` method."] #[doc = ""] @@ -95,10 +102,10 @@ extern "C" { priority: &str, ) -> Result<(), JsValue>; #[wasm_bindgen(method, structural, js_class = "CSSStyleDeclaration", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`*"] - pub fn get(this: &CssStyleDeclaration, index: u32) -> Option; + pub fn get(this: &CssStyleDeclaration, index: u32) -> Option<::alloc::string::String>; } diff --git a/crates/web-sys/src/features/gen_CssStyleRule.rs b/crates/web-sys/src/features/gen_CssStyleRule.rs index c244a2af79d..c96d34cc5d0 100644 --- a/crates/web-sys/src/features/gen_CssStyleRule.rs +++ b/crates/web-sys/src/features/gen_CssStyleRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleRule/selectorText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssStyleRule`*"] - pub fn selector_text(this: &CssStyleRule) -> String; + pub fn selector_text(this: &CssStyleRule) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "CSSStyleRule" , js_name = selectorText)] #[doc = "Setter for the `selectorText` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_CssStyleSheet.rs b/crates/web-sys/src/features/gen_CssStyleSheet.rs index 9ffbb61bd45..833c2fd6574 100644 --- a/crates/web-sys/src/features/gen_CssStyleSheet.rs +++ b/crates/web-sys/src/features/gen_CssStyleSheet.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -27,6 +28,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssRuleList`, `CssStyleSheet`*"] pub fn css_rules(this: &CssStyleSheet) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "CSSStyleSheet")] + #[doc = "The `new CssStyleSheet(..)` constructor, creating a new instance of `CssStyleSheet`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"] + pub fn new() -> Result; # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleSheet" , js_name = deleteRule)] #[doc = "The `deleteRule()` method."] #[doc = ""] @@ -52,4 +60,18 @@ extern "C" { rule: &str, index: u32, ) -> Result; + # [wasm_bindgen (method , structural , js_class = "CSSStyleSheet" , js_name = replace)] + #[doc = "The `replace()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/replace)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"] + pub fn replace(this: &CssStyleSheet, text: &str) -> ::js_sys::Promise; + # [wasm_bindgen (catch , method , structural , js_class = "CSSStyleSheet" , js_name = replaceSync)] + #[doc = "The `replaceSync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/replaceSync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`*"] + pub fn replace_sync(this: &CssStyleSheet, text: &str) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_CssStyleSheetParsingMode.rs b/crates/web-sys/src/features/gen_CssStyleSheetParsingMode.rs index 9db3f6054c2..8c721650b66 100644 --- a/crates/web-sys/src/features/gen_CssStyleSheetParsingMode.rs +++ b/crates/web-sys/src/features/gen_CssStyleSheetParsingMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `CssStyleSheetParsingMode` enum."] diff --git a/crates/web-sys/src/features/gen_CssSupportsRule.rs b/crates/web-sys/src/features/gen_CssSupportsRule.rs index 13c879bf965..91fad021401 100644 --- a/crates/web-sys/src/features/gen_CssSupportsRule.rs +++ b/crates/web-sys/src/features/gen_CssSupportsRule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CssTransition.rs b/crates/web-sys/src/features/gen_CssTransition.rs index 6a222ecded8..3654703b497 100644 --- a/crates/web-sys/src/features/gen_CssTransition.rs +++ b/crates/web-sys/src/features/gen_CssTransition.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,5 +18,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSSTransition/transitionProperty)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssTransition`*"] - pub fn transition_property(this: &CssTransition) -> String; + pub fn transition_property(this: &CssTransition) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_CustomElementRegistry.rs b/crates/web-sys/src/features/gen_CustomElementRegistry.rs index 651968f7fe1..d811e6aa56f 100644 --- a/crates/web-sys/src/features/gen_CustomElementRegistry.rs +++ b/crates/web-sys/src/features/gen_CustomElementRegistry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CustomEvent.rs b/crates/web-sys/src/features/gen_CustomEvent.rs index 4c0c671cde2..b30a0953430 100644 --- a/crates/web-sys/src/features/gen_CustomEvent.rs +++ b/crates/web-sys/src/features/gen_CustomEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_CustomEventInit.rs b/crates/web-sys/src/features/gen_CustomEventInit.rs index b0bbf763268..b9f8dc37f6d 100644 --- a/crates/web-sys/src/features/gen_CustomEventInit.rs +++ b/crates/web-sys/src/features/gen_CustomEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] pub type CustomEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &CustomEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &CustomEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &CustomEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &CustomEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &CustomEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &CustomEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &CustomEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &CustomEventInit, val: &::wasm_bindgen::JsValue); } impl CustomEventInit { #[doc = "Construct a new `CustomEventInit`."] @@ -19,69 +60,24 @@ impl CustomEventInit { 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: `CustomEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CustomEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } } diff --git a/crates/web-sys/src/features/gen_DataTransfer.rs b/crates/web-sys/src/features/gen_DataTransfer.rs index 9b6b7942852..763633bfa7d 100644 --- a/crates/web-sys/src/features/gen_DataTransfer.rs +++ b/crates/web-sys/src/features/gen_DataTransfer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/dropEffect)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"] - pub fn drop_effect(this: &DataTransfer) -> String; + pub fn drop_effect(this: &DataTransfer) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "DataTransfer" , js_name = dropEffect)] #[doc = "Setter for the `dropEffect` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/effectAllowed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"] - pub fn effect_allowed(this: &DataTransfer) -> String; + pub fn effect_allowed(this: &DataTransfer) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "DataTransfer" , js_name = effectAllowed)] #[doc = "Setter for the `effectAllowed` field of this object."] #[doc = ""] @@ -89,7 +90,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/getData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"] - pub fn get_data(this: &DataTransfer, format: &str) -> Result; + pub fn get_data(this: &DataTransfer, format: &str) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "DataTransfer" , js_name = getFiles)] #[doc = "The `getFiles()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DataTransferItem.rs b/crates/web-sys/src/features/gen_DataTransferItem.rs index 0ea18263f06..5942032ce5c 100644 --- a/crates/web-sys/src/features/gen_DataTransferItem.rs +++ b/crates/web-sys/src/features/gen_DataTransferItem.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/kind)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"] - pub fn kind(this: &DataTransferItem) -> String; + pub fn kind(this: &DataTransferItem) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "DataTransferItem" , 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/DataTransferItem/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"] - pub fn type_(this: &DataTransferItem) -> String; + pub fn type_(this: &DataTransferItem) -> ::alloc::string::String; #[cfg(feature = "File")] # [wasm_bindgen (catch , method , structural , js_class = "DataTransferItem" , js_name = getAsFile)] #[doc = "The `getAsFile()` method."] @@ -33,6 +34,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`, `File`*"] pub fn get_as_file(this: &DataTransferItem) -> Result, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "DataTransferItem" , js_name = getAsFileSystemHandle)] + #[doc = "The `getAsFileSystemHandle()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsFileSystemHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_as_file_system_handle(this: &DataTransferItem) -> ::js_sys::Promise; # [wasm_bindgen (catch , method , structural , js_class = "DataTransferItem" , js_name = getAsString)] #[doc = "The `getAsString()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DataTransferItemList.rs b/crates/web-sys/src/features/gen_DataTransferItemList.rs index c2f2efc186b..efe6ce96cb7 100644 --- a/crates/web-sys/src/features/gen_DataTransferItemList.rs +++ b/crates/web-sys/src/features/gen_DataTransferItemList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -57,7 +58,7 @@ extern "C" { pub fn remove(this: &DataTransferItemList, index: u32) -> Result<(), JsValue>; #[cfg(feature = "DataTransferItem")] #[wasm_bindgen(method, structural, js_class = "DataTransferItemList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DateTimeValue.rs b/crates/web-sys/src/features/gen_DateTimeValue.rs index 23a320850f6..2d374919524 100644 --- a/crates/web-sys/src/features/gen_DateTimeValue.rs +++ b/crates/web-sys/src/features/gen_DateTimeValue.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] pub type DateTimeValue; + #[doc = "Get the `day` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, getter = "day")] + pub fn get_day(this: &DateTimeValue) -> Option; + #[doc = "Change the `day` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, setter = "day")] + pub fn set_day(this: &DateTimeValue, val: i32); + #[doc = "Get the `hour` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, getter = "hour")] + pub fn get_hour(this: &DateTimeValue) -> Option; + #[doc = "Change the `hour` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, setter = "hour")] + pub fn set_hour(this: &DateTimeValue, val: i32); + #[doc = "Get the `minute` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, getter = "minute")] + pub fn get_minute(this: &DateTimeValue) -> Option; + #[doc = "Change the `minute` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, setter = "minute")] + pub fn set_minute(this: &DateTimeValue, val: i32); + #[doc = "Get the `month` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, getter = "month")] + pub fn get_month(this: &DateTimeValue) -> Option; + #[doc = "Change the `month` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, setter = "month")] + pub fn set_month(this: &DateTimeValue, val: i32); + #[doc = "Get the `year` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, getter = "year")] + pub fn get_year(this: &DateTimeValue) -> Option; + #[doc = "Change the `year` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[wasm_bindgen(method, setter = "year")] + pub fn set_year(this: &DateTimeValue, val: i32); } impl DateTimeValue { #[doc = "Construct a new `DateTimeValue`."] @@ -19,70 +70,29 @@ impl DateTimeValue { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `day` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[deprecated = "Use `set_day()` instead."] pub fn day(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("day"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_day(val); self } - #[doc = "Change the `hour` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[deprecated = "Use `set_hour()` instead."] pub fn hour(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hour"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hour(val); self } - #[doc = "Change the `minute` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[deprecated = "Use `set_minute()` instead."] pub fn minute(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("minute"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_minute(val); self } - #[doc = "Change the `month` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[deprecated = "Use `set_month()` instead."] pub fn month(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("month"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_month(val); self } - #[doc = "Change the `year` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DateTimeValue`*"] + #[deprecated = "Use `set_year()` instead."] pub fn year(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("year"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_year(val); self } } diff --git a/crates/web-sys/src/features/gen_DecoderDoctorNotification.rs b/crates/web-sys/src/features/gen_DecoderDoctorNotification.rs index 59f4340c49b..415a965cad3 100644 --- a/crates/web-sys/src/features/gen_DecoderDoctorNotification.rs +++ b/crates/web-sys/src/features/gen_DecoderDoctorNotification.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,80 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] pub type DecoderDoctorNotification; + #[doc = "Get the `decodeIssue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, getter = "decodeIssue")] + pub fn get_decode_issue(this: &DecoderDoctorNotification) -> Option<::alloc::string::String>; + #[doc = "Change the `decodeIssue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, setter = "decodeIssue")] + pub fn set_decode_issue(this: &DecoderDoctorNotification, val: &str); + #[doc = "Get the `decoderDoctorReportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, getter = "decoderDoctorReportId")] + pub fn get_decoder_doctor_report_id( + this: &DecoderDoctorNotification, + ) -> ::alloc::string::String; + #[doc = "Change the `decoderDoctorReportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, setter = "decoderDoctorReportId")] + pub fn set_decoder_doctor_report_id(this: &DecoderDoctorNotification, val: &str); + #[doc = "Get the `docURL` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, getter = "docURL")] + pub fn get_doc_url(this: &DecoderDoctorNotification) -> Option<::alloc::string::String>; + #[doc = "Change the `docURL` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, setter = "docURL")] + pub fn set_doc_url(this: &DecoderDoctorNotification, val: &str); + #[doc = "Get the `formats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, getter = "formats")] + pub fn get_formats(this: &DecoderDoctorNotification) -> Option<::alloc::string::String>; + #[doc = "Change the `formats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, setter = "formats")] + pub fn set_formats(this: &DecoderDoctorNotification, val: &str); + #[doc = "Get the `isSolved` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, getter = "isSolved")] + pub fn get_is_solved(this: &DecoderDoctorNotification) -> bool; + #[doc = "Change the `isSolved` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, setter = "isSolved")] + pub fn set_is_solved(this: &DecoderDoctorNotification, val: bool); + #[doc = "Get the `resourceURL` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, getter = "resourceURL")] + pub fn get_resource_url(this: &DecoderDoctorNotification) -> Option<::alloc::string::String>; + #[doc = "Change the `resourceURL` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[wasm_bindgen(method, setter = "resourceURL")] + pub fn set_resource_url(this: &DecoderDoctorNotification, val: &str); + #[cfg(feature = "DecoderDoctorNotificationType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`, `DecoderDoctorNotificationType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &DecoderDoctorNotification) -> DecoderDoctorNotificationType; + #[cfg(feature = "DecoderDoctorNotificationType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`, `DecoderDoctorNotificationType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &DecoderDoctorNotification, val: DecoderDoctorNotificationType); } impl DecoderDoctorNotification { #[cfg(feature = "DecoderDoctorNotificationType")] @@ -22,122 +97,45 @@ impl DecoderDoctorNotification { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.decoder_doctor_report_id(decoder_doctor_report_id); - ret.is_solved(is_solved); - ret.type_(type_); + ret.set_decoder_doctor_report_id(decoder_doctor_report_id); + ret.set_is_solved(is_solved); + ret.set_type(type_); ret } - #[doc = "Change the `decodeIssue` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[deprecated = "Use `set_decode_issue()` instead."] pub fn decode_issue(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("decodeIssue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_decode_issue(val); self } - #[doc = "Change the `decoderDoctorReportId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[deprecated = "Use `set_decoder_doctor_report_id()` instead."] pub fn decoder_doctor_report_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("decoderDoctorReportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_decoder_doctor_report_id(val); self } - #[doc = "Change the `docURL` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[deprecated = "Use `set_doc_url()` instead."] pub fn doc_url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("docURL"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_doc_url(val); self } - #[doc = "Change the `formats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[deprecated = "Use `set_formats()` instead."] pub fn formats(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("formats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_formats(val); self } - #[doc = "Change the `isSolved` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[deprecated = "Use `set_is_solved()` instead."] pub fn is_solved(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isSolved"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_solved(val); self } - #[doc = "Change the `resourceURL` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"] + #[deprecated = "Use `set_resource_url()` instead."] pub fn resource_url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resourceURL"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_resource_url(val); self } #[cfg(feature = "DecoderDoctorNotificationType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`, `DecoderDoctorNotificationType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: DecoderDoctorNotificationType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_DecoderDoctorNotificationType.rs b/crates/web-sys/src/features/gen_DecoderDoctorNotificationType.rs index adec72fe3a8..2c742b090cb 100644 --- a/crates/web-sys/src/features/gen_DecoderDoctorNotificationType.rs +++ b/crates/web-sys/src/features/gen_DecoderDoctorNotificationType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `DecoderDoctorNotificationType` enum."] diff --git a/crates/web-sys/src/features/gen_DecompressionStream.rs b/crates/web-sys/src/features/gen_DecompressionStream.rs new file mode 100644 index 00000000000..e7807ab9805 --- /dev/null +++ b/crates/web-sys/src/features/gen_DecompressionStream.rs @@ -0,0 +1,55 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DecompressionStream , typescript_type = "DecompressionStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `DecompressionStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecompressionStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type DecompressionStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "DecompressionStream" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecompressionStream`, `ReadableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &DecompressionStream) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "DecompressionStream" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DecompressionStream`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &DecompressionStream) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CompressionFormat")] + #[wasm_bindgen(catch, constructor, js_class = "DecompressionStream")] + #[doc = "The `new DecompressionStream(..)` constructor, creating a new instance of `DecompressionStream`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream/DecompressionStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompressionFormat`, `DecompressionStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: CompressionFormat) -> Result; +} diff --git a/crates/web-sys/src/features/gen_DedicatedWorkerGlobalScope.rs b/crates/web-sys/src/features/gen_DedicatedWorkerGlobalScope.rs index c16c3690d28..79d14f2a6f8 100644 --- a/crates/web-sys/src/features/gen_DedicatedWorkerGlobalScope.rs +++ b/crates/web-sys/src/features/gen_DedicatedWorkerGlobalScope.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DedicatedWorkerGlobalScope`*"] - pub fn name(this: &DedicatedWorkerGlobalScope) -> String; + pub fn name(this: &DedicatedWorkerGlobalScope) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "DedicatedWorkerGlobalScope" , js_name = onmessage)] #[doc = "Getter for the `onmessage` field of this object."] #[doc = ""] @@ -49,6 +50,31 @@ extern "C" { this: &DedicatedWorkerGlobalScope, value: Option<&::js_sys::Function>, ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "DedicatedWorkerGlobalScope" , js_name = onrtctransform)] + #[doc = "Getter for the `onrtctransform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/onrtctransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DedicatedWorkerGlobalScope`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onrtctransform(this: &DedicatedWorkerGlobalScope) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "DedicatedWorkerGlobalScope" , js_name = onrtctransform)] + #[doc = "Setter for the `onrtctransform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/onrtctransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DedicatedWorkerGlobalScope`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onrtctransform( + this: &DedicatedWorkerGlobalScope, + value: Option<&::js_sys::Function>, + ); # [wasm_bindgen (method , structural , js_class = "DedicatedWorkerGlobalScope" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] @@ -77,4 +103,24 @@ extern "C" { message: &::wasm_bindgen::JsValue, transfer: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "DedicatedWorkerGlobalScope" , js_name = cancelAnimationFrame)] + #[doc = "The `cancelAnimationFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/cancelAnimationFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DedicatedWorkerGlobalScope`*"] + pub fn cancel_animation_frame( + this: &DedicatedWorkerGlobalScope, + handle: i32, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "DedicatedWorkerGlobalScope" , js_name = requestAnimationFrame)] + #[doc = "The `requestAnimationFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DedicatedWorkerGlobalScope`*"] + pub fn request_animation_frame( + this: &DedicatedWorkerGlobalScope, + callback: &::js_sys::Function, + ) -> Result; } diff --git a/crates/web-sys/src/features/gen_DelayNode.rs b/crates/web-sys/src/features/gen_DelayNode.rs index 4518ed3a2c2..e37d1980f29 100644 --- a/crates/web-sys/src/features/gen_DelayNode.rs +++ b/crates/web-sys/src/features/gen_DelayNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DelayOptions.rs b/crates/web-sys/src/features/gen_DelayOptions.rs index 8422b161489..2228e7e529b 100644 --- a/crates/web-sys/src/features/gen_DelayOptions.rs +++ b/crates/web-sys/src/features/gen_DelayOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,60 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] pub type DelayOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &DelayOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &DelayOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `DelayOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &DelayOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `DelayOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &DelayOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `DelayOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &DelayOptions) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `DelayOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &DelayOptions, val: ChannelInterpretation); + #[doc = "Get the `delayTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] + #[wasm_bindgen(method, getter = "delayTime")] + pub fn get_delay_time(this: &DelayOptions) -> Option; + #[doc = "Change the `delayTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] + #[wasm_bindgen(method, setter = "delayTime")] + pub fn set_delay_time(this: &DelayOptions, val: f64); + #[doc = "Get the `maxDelayTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] + #[wasm_bindgen(method, getter = "maxDelayTime")] + pub fn get_max_delay_time(this: &DelayOptions) -> Option; + #[doc = "Change the `maxDelayTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] + #[wasm_bindgen(method, setter = "maxDelayTime")] + pub fn set_max_delay_time(this: &DelayOptions, val: f64); } impl DelayOptions { #[doc = "Construct a new `DelayOptions`."] @@ -19,91 +74,31 @@ impl DelayOptions { 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: `DelayOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `DelayOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `DelayOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `delayTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] + #[deprecated = "Use `set_delay_time()` instead."] pub fn delay_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("delayTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delay_time(val); self } - #[doc = "Change the `maxDelayTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DelayOptions`*"] + #[deprecated = "Use `set_max_delay_time()` instead."] pub fn max_delay_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxDelayTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max_delay_time(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceAcceleration.rs b/crates/web-sys/src/features/gen_DeviceAcceleration.rs index 8fbfb8b67f0..63f5dab2ec1 100644 --- a/crates/web-sys/src/features/gen_DeviceAcceleration.rs +++ b/crates/web-sys/src/features/gen_DeviceAcceleration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DeviceAccelerationInit.rs b/crates/web-sys/src/features/gen_DeviceAccelerationInit.rs index 95c7aa20801..ca98e86bb70 100644 --- a/crates/web-sys/src/features/gen_DeviceAccelerationInit.rs +++ b/crates/web-sys/src/features/gen_DeviceAccelerationInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] pub type DeviceAccelerationInit; + #[doc = "Get the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &DeviceAccelerationInit) -> Option; + #[doc = "Change the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &DeviceAccelerationInit, val: Option); + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &DeviceAccelerationInit) -> Option; + #[doc = "Change the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &DeviceAccelerationInit, val: Option); + #[doc = "Get the `z` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[wasm_bindgen(method, getter = "z")] + pub fn get_z(this: &DeviceAccelerationInit) -> Option; + #[doc = "Change the `z` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[wasm_bindgen(method, setter = "z")] + pub fn set_z(this: &DeviceAccelerationInit, val: Option); } impl DeviceAccelerationInit { #[doc = "Construct a new `DeviceAccelerationInit`."] @@ -19,43 +50,19 @@ impl DeviceAccelerationInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `x` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[deprecated = "Use `set_x()` instead."] pub fn x(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x(val); self } - #[doc = "Change the `y` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[deprecated = "Use `set_y()` instead."] pub fn y(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_y(val); self } - #[doc = "Change the `z` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`*"] + #[deprecated = "Use `set_z()` instead."] pub fn z(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("z"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_z(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceLightEvent.rs b/crates/web-sys/src/features/gen_DeviceLightEvent.rs index 39087647839..8afd712fe6e 100644 --- a/crates/web-sys/src/features/gen_DeviceLightEvent.rs +++ b/crates/web-sys/src/features/gen_DeviceLightEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DeviceLightEventInit.rs b/crates/web-sys/src/features/gen_DeviceLightEventInit.rs index ddb30f603fc..8aa438238e0 100644 --- a/crates/web-sys/src/features/gen_DeviceLightEventInit.rs +++ b/crates/web-sys/src/features/gen_DeviceLightEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] pub type DeviceLightEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &DeviceLightEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &DeviceLightEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &DeviceLightEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &DeviceLightEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &DeviceLightEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &DeviceLightEventInit, val: bool); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &DeviceLightEventInit) -> Option; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &DeviceLightEventInit, val: f64); } impl DeviceLightEventInit { #[doc = "Construct a new `DeviceLightEventInit`."] @@ -19,68 +60,24 @@ impl DeviceLightEventInit { 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: `DeviceLightEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceLightEventInit`*"] + #[deprecated = "Use `set_value()` instead."] pub fn value(&mut self, val: f64) -> &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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceMotionEvent.rs b/crates/web-sys/src/features/gen_DeviceMotionEvent.rs index 5993f726f03..a83040d4a8b 100644 --- a/crates/web-sys/src/features/gen_DeviceMotionEvent.rs +++ b/crates/web-sys/src/features/gen_DeviceMotionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DeviceMotionEventInit.rs b/crates/web-sys/src/features/gen_DeviceMotionEventInit.rs index bec31205212..6f46ea20a4d 100644 --- a/crates/web-sys/src/features/gen_DeviceMotionEventInit.rs +++ b/crates/web-sys/src/features/gen_DeviceMotionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,87 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] pub type DeviceMotionEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &DeviceMotionEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &DeviceMotionEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &DeviceMotionEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &DeviceMotionEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &DeviceMotionEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &DeviceMotionEventInit, val: bool); + #[cfg(feature = "DeviceAccelerationInit")] + #[doc = "Get the `acceleration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, getter = "acceleration")] + pub fn get_acceleration(this: &DeviceMotionEventInit) -> Option; + #[cfg(feature = "DeviceAccelerationInit")] + #[doc = "Change the `acceleration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, setter = "acceleration")] + pub fn set_acceleration(this: &DeviceMotionEventInit, val: &DeviceAccelerationInit); + #[cfg(feature = "DeviceAccelerationInit")] + #[doc = "Get the `accelerationIncludingGravity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, getter = "accelerationIncludingGravity")] + pub fn get_acceleration_including_gravity( + this: &DeviceMotionEventInit, + ) -> Option; + #[cfg(feature = "DeviceAccelerationInit")] + #[doc = "Change the `accelerationIncludingGravity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, setter = "accelerationIncludingGravity")] + pub fn set_acceleration_including_gravity( + this: &DeviceMotionEventInit, + val: &DeviceAccelerationInit, + ); + #[doc = "Get the `interval` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, getter = "interval")] + pub fn get_interval(this: &DeviceMotionEventInit) -> Option; + #[doc = "Change the `interval` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[wasm_bindgen(method, setter = "interval")] + pub fn set_interval(this: &DeviceMotionEventInit, val: Option); + #[cfg(feature = "DeviceRotationRateInit")] + #[doc = "Get the `rotationRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`, `DeviceRotationRateInit`*"] + #[wasm_bindgen(method, getter = "rotationRate")] + pub fn get_rotation_rate(this: &DeviceMotionEventInit) -> Option; + #[cfg(feature = "DeviceRotationRateInit")] + #[doc = "Change the `rotationRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`, `DeviceRotationRateInit`*"] + #[wasm_bindgen(method, setter = "rotationRate")] + pub fn set_rotation_rate(this: &DeviceMotionEventInit, val: &DeviceRotationRateInit); } impl DeviceMotionEventInit { #[doc = "Construct a new `DeviceMotionEventInit`."] @@ -19,126 +101,42 @@ impl DeviceMotionEventInit { 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: `DeviceMotionEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "DeviceAccelerationInit")] - #[doc = "Change the `acceleration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"] + #[deprecated = "Use `set_acceleration()` instead."] pub fn acceleration(&mut self, val: &DeviceAccelerationInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("acceleration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_acceleration(val); self } #[cfg(feature = "DeviceAccelerationInit")] - #[doc = "Change the `accelerationIncludingGravity` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"] + #[deprecated = "Use `set_acceleration_including_gravity()` instead."] pub fn acceleration_including_gravity(&mut self, val: &DeviceAccelerationInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("accelerationIncludingGravity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_acceleration_including_gravity(val); self } - #[doc = "Change the `interval` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"] + #[deprecated = "Use `set_interval()` instead."] pub fn interval(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("interval"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_interval(val); self } #[cfg(feature = "DeviceRotationRateInit")] - #[doc = "Change the `rotationRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`, `DeviceRotationRateInit`*"] + #[deprecated = "Use `set_rotation_rate()` instead."] pub fn rotation_rate(&mut self, val: &DeviceRotationRateInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rotationRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rotation_rate(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceOrientationEvent.rs b/crates/web-sys/src/features/gen_DeviceOrientationEvent.rs index d7ec8c767cd..e1908e033f4 100644 --- a/crates/web-sys/src/features/gen_DeviceOrientationEvent.rs +++ b/crates/web-sys/src/features/gen_DeviceOrientationEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DeviceOrientationEventInit.rs b/crates/web-sys/src/features/gen_DeviceOrientationEventInit.rs index 70445bb19ed..5570bf982a0 100644 --- a/crates/web-sys/src/features/gen_DeviceOrientationEventInit.rs +++ b/crates/web-sys/src/features/gen_DeviceOrientationEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,76 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] pub type DeviceOrientationEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &DeviceOrientationEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &DeviceOrientationEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &DeviceOrientationEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &DeviceOrientationEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &DeviceOrientationEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &DeviceOrientationEventInit, val: bool); + #[doc = "Get the `absolute` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, getter = "absolute")] + pub fn get_absolute(this: &DeviceOrientationEventInit) -> Option; + #[doc = "Change the `absolute` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, setter = "absolute")] + pub fn set_absolute(this: &DeviceOrientationEventInit, val: bool); + #[doc = "Get the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &DeviceOrientationEventInit) -> Option; + #[doc = "Change the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &DeviceOrientationEventInit, val: Option); + #[doc = "Get the `beta` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, getter = "beta")] + pub fn get_beta(this: &DeviceOrientationEventInit) -> Option; + #[doc = "Change the `beta` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, setter = "beta")] + pub fn set_beta(this: &DeviceOrientationEventInit, val: Option); + #[doc = "Get the `gamma` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, getter = "gamma")] + pub fn get_gamma(this: &DeviceOrientationEventInit) -> Option; + #[doc = "Change the `gamma` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[wasm_bindgen(method, setter = "gamma")] + pub fn set_gamma(this: &DeviceOrientationEventInit, val: Option); } impl DeviceOrientationEventInit { #[doc = "Construct a new `DeviceOrientationEventInit`."] @@ -19,111 +90,39 @@ impl DeviceOrientationEventInit { 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: `DeviceOrientationEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `absolute` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[deprecated = "Use `set_absolute()` instead."] pub fn absolute(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("absolute"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_absolute(val); self } - #[doc = "Change the `alpha` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[deprecated = "Use `set_alpha()` instead."] pub fn alpha(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alpha(val); self } - #[doc = "Change the `beta` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[deprecated = "Use `set_beta()` instead."] pub fn beta(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("beta"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_beta(val); self } - #[doc = "Change the `gamma` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceOrientationEventInit`*"] + #[deprecated = "Use `set_gamma()` instead."] pub fn gamma(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("gamma"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gamma(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceProximityEvent.rs b/crates/web-sys/src/features/gen_DeviceProximityEvent.rs index c3c92ac8fc6..3b38d176cdf 100644 --- a/crates/web-sys/src/features/gen_DeviceProximityEvent.rs +++ b/crates/web-sys/src/features/gen_DeviceProximityEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DeviceProximityEventInit.rs b/crates/web-sys/src/features/gen_DeviceProximityEventInit.rs index 9ff310343fd..d63d3350759 100644 --- a/crates/web-sys/src/features/gen_DeviceProximityEventInit.rs +++ b/crates/web-sys/src/features/gen_DeviceProximityEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] pub type DeviceProximityEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &DeviceProximityEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &DeviceProximityEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &DeviceProximityEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &DeviceProximityEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &DeviceProximityEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &DeviceProximityEventInit, val: bool); + #[doc = "Get the `max` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, getter = "max")] + pub fn get_max(this: &DeviceProximityEventInit) -> Option; + #[doc = "Change the `max` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, setter = "max")] + pub fn set_max(this: &DeviceProximityEventInit, val: f64); + #[doc = "Get the `min` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, getter = "min")] + pub fn get_min(this: &DeviceProximityEventInit) -> Option; + #[doc = "Change the `min` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, setter = "min")] + pub fn set_min(this: &DeviceProximityEventInit, val: f64); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &DeviceProximityEventInit) -> Option; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &DeviceProximityEventInit, val: f64); } impl DeviceProximityEventInit { #[doc = "Construct a new `DeviceProximityEventInit`."] @@ -19,94 +80,34 @@ impl DeviceProximityEventInit { 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: `DeviceProximityEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `max` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[deprecated = "Use `set_max()` instead."] pub fn max(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("max"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max(val); self } - #[doc = "Change the `min` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[deprecated = "Use `set_min()` instead."] pub fn min(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("min"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_min(val); self } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceProximityEventInit`*"] + #[deprecated = "Use `set_value()` instead."] pub fn value(&mut self, val: f64) -> &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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_DeviceRotationRate.rs b/crates/web-sys/src/features/gen_DeviceRotationRate.rs index 73782abebc9..ee7a2e44266 100644 --- a/crates/web-sys/src/features/gen_DeviceRotationRate.rs +++ b/crates/web-sys/src/features/gen_DeviceRotationRate.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DeviceRotationRateInit.rs b/crates/web-sys/src/features/gen_DeviceRotationRateInit.rs index fe6dcb0d2bc..84272777672 100644 --- a/crates/web-sys/src/features/gen_DeviceRotationRateInit.rs +++ b/crates/web-sys/src/features/gen_DeviceRotationRateInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] pub type DeviceRotationRateInit; + #[doc = "Get the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &DeviceRotationRateInit) -> Option; + #[doc = "Change the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &DeviceRotationRateInit, val: Option); + #[doc = "Get the `beta` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[wasm_bindgen(method, getter = "beta")] + pub fn get_beta(this: &DeviceRotationRateInit) -> Option; + #[doc = "Change the `beta` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[wasm_bindgen(method, setter = "beta")] + pub fn set_beta(this: &DeviceRotationRateInit, val: Option); + #[doc = "Get the `gamma` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[wasm_bindgen(method, getter = "gamma")] + pub fn get_gamma(this: &DeviceRotationRateInit) -> Option; + #[doc = "Change the `gamma` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[wasm_bindgen(method, setter = "gamma")] + pub fn set_gamma(this: &DeviceRotationRateInit, val: Option); } impl DeviceRotationRateInit { #[doc = "Construct a new `DeviceRotationRateInit`."] @@ -19,43 +50,19 @@ impl DeviceRotationRateInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `alpha` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[deprecated = "Use `set_alpha()` instead."] pub fn alpha(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alpha(val); self } - #[doc = "Change the `beta` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[deprecated = "Use `set_beta()` instead."] pub fn beta(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("beta"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_beta(val); self } - #[doc = "Change the `gamma` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DeviceRotationRateInit`*"] + #[deprecated = "Use `set_gamma()` instead."] pub fn gamma(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("gamma"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gamma(val); self } } diff --git a/crates/web-sys/src/features/gen_DhKeyDeriveParams.rs b/crates/web-sys/src/features/gen_DhKeyDeriveParams.rs index 3bb1bbc3c12..f683e249b35 100644 --- a/crates/web-sys/src/features/gen_DhKeyDeriveParams.rs +++ b/crates/web-sys/src/features/gen_DhKeyDeriveParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DhKeyDeriveParams`*"] pub type DhKeyDeriveParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DhKeyDeriveParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &DhKeyDeriveParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DhKeyDeriveParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &DhKeyDeriveParams, val: &str); + #[cfg(feature = "CryptoKey")] + #[doc = "Get the `public` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `DhKeyDeriveParams`*"] + #[wasm_bindgen(method, getter = "public")] + pub fn get_public(this: &DhKeyDeriveParams) -> CryptoKey; + #[cfg(feature = "CryptoKey")] + #[doc = "Change the `public` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `DhKeyDeriveParams`*"] + #[wasm_bindgen(method, setter = "public")] + pub fn set_public(this: &DhKeyDeriveParams, val: &CryptoKey); } impl DhKeyDeriveParams { #[cfg(feature = "CryptoKey")] @@ -18,36 +41,19 @@ impl DhKeyDeriveParams { pub fn new(name: &str, public: &CryptoKey) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.public(public); + ret.set_name(name); + ret.set_public(public); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DhKeyDeriveParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } #[cfg(feature = "CryptoKey")] - #[doc = "Change the `public` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `DhKeyDeriveParams`*"] + #[deprecated = "Use `set_public()` instead."] pub fn public(&mut self, val: &CryptoKey) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("public"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_public(val); self } } diff --git a/crates/web-sys/src/features/gen_DirectionSetting.rs b/crates/web-sys/src/features/gen_DirectionSetting.rs index 087bac82bbf..d6c9a5dd394 100644 --- a/crates/web-sys/src/features/gen_DirectionSetting.rs +++ b/crates/web-sys/src/features/gen_DirectionSetting.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `DirectionSetting` enum."] diff --git a/crates/web-sys/src/features/gen_Directory.rs b/crates/web-sys/src/features/gen_Directory.rs index 6eed3203e74..81f41df7cf4 100644 --- a/crates/web-sys/src/features/gen_Directory.rs +++ b/crates/web-sys/src/features/gen_Directory.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Directory/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Directory`*"] - pub fn name(this: &Directory) -> Result; + pub fn name(this: &Directory) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "Directory" , js_name = path)] #[doc = "Getter for the `path` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Directory/path)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Directory`*"] - pub fn path(this: &Directory) -> Result; + pub fn path(this: &Directory) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Directory" , js_name = getFiles)] #[doc = "The `getFiles()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DirectoryPickerOptions.rs b/crates/web-sys/src/features/gen_DirectoryPickerOptions.rs new file mode 100644 index 00000000000..45ac3c7cf9c --- /dev/null +++ b/crates/web-sys/src/features/gen_DirectoryPickerOptions.rs @@ -0,0 +1,112 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DirectoryPickerOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `DirectoryPickerOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type DirectoryPickerOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &DirectoryPickerOptions) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &DirectoryPickerOptions, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`, `FileSystemPermissionMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &DirectoryPickerOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`, `FileSystemPermissionMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &DirectoryPickerOptions, val: FileSystemPermissionMode); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `startIn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "startIn")] + pub fn get_start_in(this: &DirectoryPickerOptions) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `startIn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "startIn")] + pub fn set_start_in(this: &DirectoryPickerOptions, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl DirectoryPickerOptions { + #[doc = "Construct a new `DirectoryPickerOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: FileSystemPermissionMode) -> &mut Self { + self.set_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_start_in()` instead."] + pub fn start_in(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_start_in(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for DirectoryPickerOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_DisplayMediaStreamConstraints.rs b/crates/web-sys/src/features/gen_DisplayMediaStreamConstraints.rs index 16a5bf869be..814a1279c88 100644 --- a/crates/web-sys/src/features/gen_DisplayMediaStreamConstraints.rs +++ b/crates/web-sys/src/features/gen_DisplayMediaStreamConstraints.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] pub type DisplayMediaStreamConstraints; + #[doc = "Get the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] + #[wasm_bindgen(method, getter = "audio")] + pub fn get_audio(this: &DisplayMediaStreamConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] + #[wasm_bindgen(method, setter = "audio")] + pub fn set_audio(this: &DisplayMediaStreamConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] + #[wasm_bindgen(method, getter = "video")] + pub fn get_video(this: &DisplayMediaStreamConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] + #[wasm_bindgen(method, setter = "video")] + pub fn set_video(this: &DisplayMediaStreamConstraints, val: &::wasm_bindgen::JsValue); } impl DisplayMediaStreamConstraints { #[doc = "Construct a new `DisplayMediaStreamConstraints`."] @@ -19,30 +40,14 @@ impl DisplayMediaStreamConstraints { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `audio` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] + #[deprecated = "Use `set_audio()` instead."] pub fn audio(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio(val); self } - #[doc = "Change the `video` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DisplayMediaStreamConstraints`*"] + #[deprecated = "Use `set_video()` instead."] pub fn video(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_video(val); self } } diff --git a/crates/web-sys/src/features/gen_DisplayNameOptions.rs b/crates/web-sys/src/features/gen_DisplayNameOptions.rs index 97d843e79a7..7795b4be0e8 100644 --- a/crates/web-sys/src/features/gen_DisplayNameOptions.rs +++ b/crates/web-sys/src/features/gen_DisplayNameOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] pub type DisplayNameOptions; + #[doc = "Get the `keys` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] + #[wasm_bindgen(method, getter = "keys")] + pub fn get_keys(this: &DisplayNameOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `keys` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] + #[wasm_bindgen(method, setter = "keys")] + pub fn set_keys(this: &DisplayNameOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `style` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] + #[wasm_bindgen(method, getter = "style")] + pub fn get_style(this: &DisplayNameOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `style` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] + #[wasm_bindgen(method, setter = "style")] + pub fn set_style(this: &DisplayNameOptions, val: &str); } impl DisplayNameOptions { #[doc = "Construct a new `DisplayNameOptions`."] @@ -19,30 +40,14 @@ impl DisplayNameOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `keys` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] + #[deprecated = "Use `set_keys()` instead."] pub fn keys(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("keys"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_keys(val); self } - #[doc = "Change the `style` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DisplayNameOptions`*"] + #[deprecated = "Use `set_style()` instead."] pub fn style(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("style"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_style(val); self } } diff --git a/crates/web-sys/src/features/gen_DisplayNameResult.rs b/crates/web-sys/src/features/gen_DisplayNameResult.rs index 4160474d67a..66934ee6be9 100644 --- a/crates/web-sys/src/features/gen_DisplayNameResult.rs +++ b/crates/web-sys/src/features/gen_DisplayNameResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] pub type DisplayNameResult; + #[doc = "Get the `locale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] + #[wasm_bindgen(method, getter = "locale")] + pub fn get_locale(this: &DisplayNameResult) -> Option<::alloc::string::String>; + #[doc = "Change the `locale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] + #[wasm_bindgen(method, setter = "locale")] + pub fn set_locale(this: &DisplayNameResult, val: &str); + #[doc = "Get the `style` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] + #[wasm_bindgen(method, getter = "style")] + pub fn get_style(this: &DisplayNameResult) -> Option<::alloc::string::String>; + #[doc = "Change the `style` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] + #[wasm_bindgen(method, setter = "style")] + pub fn set_style(this: &DisplayNameResult, val: &str); + #[doc = "Get the `values` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] + #[wasm_bindgen(method, getter = "values")] + pub fn get_values(this: &DisplayNameResult) -> Option<::js_sys::Object>; + #[doc = "Change the `values` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] + #[wasm_bindgen(method, setter = "values")] + pub fn set_values(this: &DisplayNameResult, val: &::js_sys::Object); } impl DisplayNameResult { #[doc = "Construct a new `DisplayNameResult`."] @@ -19,31 +50,19 @@ impl DisplayNameResult { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `locale` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] + #[deprecated = "Use `set_locale()` instead."] pub fn locale(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("locale"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_locale(val); self } - #[doc = "Change the `style` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DisplayNameResult`*"] + #[deprecated = "Use `set_style()` instead."] pub fn style(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("style"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_style(val); + self + } + #[deprecated = "Use `set_values()` instead."] + pub fn values(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_values(val); self } } diff --git a/crates/web-sys/src/features/gen_DistanceModelType.rs b/crates/web-sys/src/features/gen_DistanceModelType.rs index fd62878183d..a622e7a38b0 100644 --- a/crates/web-sys/src/features/gen_DistanceModelType.rs +++ b/crates/web-sys/src/features/gen_DistanceModelType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `DistanceModelType` enum."] diff --git a/crates/web-sys/src/features/gen_DnsCacheDict.rs b/crates/web-sys/src/features/gen_DnsCacheDict.rs index 1233264e707..a6467078f67 100644 --- a/crates/web-sys/src/features/gen_DnsCacheDict.rs +++ b/crates/web-sys/src/features/gen_DnsCacheDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheDict`*"] pub type DnsCacheDict; + #[doc = "Get the `entries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheDict`*"] + #[wasm_bindgen(method, getter = "entries")] + pub fn get_entries(this: &DnsCacheDict) -> Option<::js_sys::Array>; + #[doc = "Change the `entries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheDict`*"] + #[wasm_bindgen(method, setter = "entries")] + pub fn set_entries(this: &DnsCacheDict, val: &::wasm_bindgen::JsValue); } impl DnsCacheDict { #[doc = "Construct a new `DnsCacheDict`."] @@ -19,21 +30,9 @@ impl DnsCacheDict { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `entries` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsCacheDict`*"] + #[deprecated = "Use `set_entries()` instead."] pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_entries(val); self } } diff --git a/crates/web-sys/src/features/gen_DnsCacheEntry.rs b/crates/web-sys/src/features/gen_DnsCacheEntry.rs index f6da07e95bd..ef4dfa82670 100644 --- a/crates/web-sys/src/features/gen_DnsCacheEntry.rs +++ b/crates/web-sys/src/features/gen_DnsCacheEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] pub type DnsCacheEntry; + #[doc = "Get the `expiration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, getter = "expiration")] + pub fn get_expiration(this: &DnsCacheEntry) -> Option; + #[doc = "Change the `expiration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, setter = "expiration")] + pub fn set_expiration(this: &DnsCacheEntry, val: f64); + #[doc = "Get the `family` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, getter = "family")] + pub fn get_family(this: &DnsCacheEntry) -> Option<::alloc::string::String>; + #[doc = "Change the `family` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, setter = "family")] + pub fn set_family(this: &DnsCacheEntry, val: &str); + #[doc = "Get the `hostaddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, getter = "hostaddr")] + pub fn get_hostaddr(this: &DnsCacheEntry) -> Option<::js_sys::Array>; + #[doc = "Change the `hostaddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, setter = "hostaddr")] + pub fn set_hostaddr(this: &DnsCacheEntry, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `hostname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, getter = "hostname")] + pub fn get_hostname(this: &DnsCacheEntry) -> Option<::alloc::string::String>; + #[doc = "Change the `hostname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, setter = "hostname")] + pub fn set_hostname(this: &DnsCacheEntry, val: &str); + #[doc = "Get the `trr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, getter = "trr")] + pub fn get_trr(this: &DnsCacheEntry) -> Option; + #[doc = "Change the `trr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[wasm_bindgen(method, setter = "trr")] + pub fn set_trr(this: &DnsCacheEntry, val: bool); } impl DnsCacheEntry { #[doc = "Construct a new `DnsCacheEntry`."] @@ -19,82 +70,29 @@ impl DnsCacheEntry { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `expiration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[deprecated = "Use `set_expiration()` instead."] pub fn expiration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("expiration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_expiration(val); self } - #[doc = "Change the `family` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[deprecated = "Use `set_family()` instead."] pub fn family(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("family"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_family(val); self } - #[doc = "Change the `hostaddr` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[deprecated = "Use `set_hostaddr()` instead."] pub fn hostaddr(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hostaddr"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hostaddr(val); self } - #[doc = "Change the `hostname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[deprecated = "Use `set_hostname()` instead."] pub fn hostname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hostname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hostname(val); self } - #[doc = "Change the `trr` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"] + #[deprecated = "Use `set_trr()` instead."] pub fn trr(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("trr"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_trr(val); self } } diff --git a/crates/web-sys/src/features/gen_DnsLookupDict.rs b/crates/web-sys/src/features/gen_DnsLookupDict.rs index 590f2998725..1c2a0a874d6 100644 --- a/crates/web-sys/src/features/gen_DnsLookupDict.rs +++ b/crates/web-sys/src/features/gen_DnsLookupDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] pub type DnsLookupDict; + #[doc = "Get the `address` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[wasm_bindgen(method, getter = "address")] + pub fn get_address(this: &DnsLookupDict) -> Option<::js_sys::Array>; + #[doc = "Change the `address` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[wasm_bindgen(method, setter = "address")] + pub fn set_address(this: &DnsLookupDict, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `answer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[wasm_bindgen(method, getter = "answer")] + pub fn get_answer(this: &DnsLookupDict) -> Option; + #[doc = "Change the `answer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[wasm_bindgen(method, setter = "answer")] + pub fn set_answer(this: &DnsLookupDict, val: bool); + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &DnsLookupDict) -> Option<::alloc::string::String>; + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &DnsLookupDict, val: &str); } impl DnsLookupDict { #[doc = "Construct a new `DnsLookupDict`."] @@ -19,48 +50,19 @@ impl DnsLookupDict { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `address` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[deprecated = "Use `set_address()` instead."] pub fn address(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("address"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_address(val); self } - #[doc = "Change the `answer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[deprecated = "Use `set_answer()` instead."] pub fn answer(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("answer"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_answer(val); self } - #[doc = "Change the `error` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DnsLookupDict`*"] + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } } diff --git a/crates/web-sys/src/features/gen_Document.rs b/crates/web-sys/src/features/gen_Document.rs index 6d8cd542cb6..648c2b0cbb5 100644 --- a/crates/web-sys/src/features/gen_Document.rs +++ b/crates/web-sys/src/features/gen_Document.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,49 +26,49 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/URL)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn url(this: &Document) -> Result; + pub fn url(this: &Document) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "Document" , js_name = documentURI)] #[doc = "Getter for the `documentURI` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/documentURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn document_uri(this: &Document) -> Result; + pub fn document_uri(this: &Document) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = compatMode)] #[doc = "Getter for the `compatMode` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/compatMode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn compat_mode(this: &Document) -> String; + pub fn compat_mode(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = characterSet)] #[doc = "Getter for the `characterSet` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/characterSet)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn character_set(this: &Document) -> String; + pub fn character_set(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = charset)] #[doc = "Getter for the `charset` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/charset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn charset(this: &Document) -> String; + pub fn charset(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = inputEncoding)] #[doc = "Getter for the `inputEncoding` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/inputEncoding)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn input_encoding(this: &Document) -> String; + pub fn input_encoding(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = contentType)] #[doc = "Getter for the `contentType` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/contentType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn content_type(this: &Document) -> String; + pub fn content_type(this: &Document) -> ::alloc::string::String; #[cfg(feature = "DocumentType")] # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = doctype)] #[doc = "Getter for the `doctype` field of this object."] @@ -98,28 +99,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn referrer(this: &Document) -> String; + pub fn referrer(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = lastModified)] #[doc = "Getter for the `lastModified` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/lastModified)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn last_modified(this: &Document) -> String; + pub fn last_modified(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = readyState)] #[doc = "Getter for the `readyState` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn ready_state(this: &Document) -> String; + pub fn ready_state(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = title)] #[doc = "Getter for the `title` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/title)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn title(this: &Document) -> String; + pub fn title(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Document" , js_name = title)] #[doc = "Setter for the `title` field of this object."] #[doc = ""] @@ -133,7 +134,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/dir)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn dir(this: &Document) -> String; + pub fn dir(this: &Document) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Document" , js_name = dir)] #[doc = "Setter for the `dir` field of this object."] #[doc = ""] @@ -406,7 +407,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/selectedStyleSheetSet)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn selected_style_sheet_set(this: &Document) -> Option; + pub fn selected_style_sheet_set(this: &Document) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "Document" , js_name = selectedStyleSheetSet)] #[doc = "Setter for the `selectedStyleSheetSet` field of this object."] #[doc = ""] @@ -420,14 +421,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/lastStyleSheetSet)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn last_style_sheet_set(this: &Document) -> Option; + pub fn last_style_sheet_set(this: &Document) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = preferredStyleSheetSet)] #[doc = "Getter for the `preferredStyleSheetSet` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/preferredStyleSheetSet)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] - pub fn preferred_style_sheet_set(this: &Document) -> Option; + pub fn preferred_style_sheet_set(this: &Document) -> Option<::alloc::string::String>; #[cfg(feature = "DomStringList")] # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = styleSheetSets)] #[doc = "Getter for the `styleSheetSets` field of this object."] @@ -598,6 +599,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] pub fn set_onauxclick(this: &Document, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = onbeforetoggle)] + #[doc = "Getter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn onbeforetoggle(this: &Document) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "Document" , js_name = onbeforetoggle)] + #[doc = "Setter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn set_onbeforetoggle(this: &Document, value: Option<&::js_sys::Function>); # [wasm_bindgen (structural , method , getter , js_class = "Document" , js_name = oncanplay)] #[doc = "Getter for the `oncanplay` field of this object."] #[doc = ""] @@ -2154,6 +2169,33 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Document`*"] pub fn release_capture(this: &Document); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ViewTransition")] + # [wasm_bindgen (catch , method , structural , js_class = "Document" , js_name = startViewTransition)] + #[doc = "The `startViewTransition()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`, `ViewTransition`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn start_view_transition(this: &Document) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ViewTransition")] + # [wasm_bindgen (catch , method , structural , js_class = "Document" , js_name = startViewTransition)] + #[doc = "The `startViewTransition()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`, `ViewTransition`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn start_view_transition_with_update_callback( + this: &Document, + update_callback: Option<&::js_sys::Function>, + ) -> Result; #[cfg(feature = "Element")] # [wasm_bindgen (method , structural , js_class = "Document" , js_name = elementFromPoint)] #[doc = "The `elementFromPoint()` method."] @@ -2849,6 +2891,202 @@ extern "C" { nodes_6: &str, nodes_7: &str, ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , variadic , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node(this: &Document, nodes: &::js_sys::Array); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node_0(this: &Document); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node_1(this: &Document, nodes_1: &Node); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node_2(this: &Document, nodes_1: &Node, nodes_2: &Node); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node_3( + this: &Document, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node_4( + this: &Document, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node_5( + this: &Document, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node_6( + this: &Document, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + nodes_6: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_node_7( + this: &Document, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + nodes_6: &Node, + nodes_7: &Node, + ); + # [wasm_bindgen (method , structural , variadic , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str(this: &Document, nodes: &::js_sys::Array); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str_0(this: &Document); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str_1(this: &Document, nodes_1: &str); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str_2(this: &Document, nodes_1: &str, nodes_2: &str); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str_3( + this: &Document, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + ); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str_4( + this: &Document, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + ); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str_5( + this: &Document, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + ); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str_6( + this: &Document, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + nodes_6: &str, + ); + # [wasm_bindgen (method , structural , js_class = "Document" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Document/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`*"] + pub fn replace_children_with_str_7( + this: &Document, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + nodes_6: &str, + nodes_7: &str, + ); #[cfg(feature = "XPathExpression")] # [wasm_bindgen (catch , method , structural , js_class = "Document" , js_name = createExpression)] #[doc = "The `createExpression()` method."] diff --git a/crates/web-sys/src/features/gen_DocumentFragment.rs b/crates/web-sys/src/features/gen_DocumentFragment.rs index fa64d510a18..d21d7b374ba 100644 --- a/crates/web-sys/src/features/gen_DocumentFragment.rs +++ b/crates/web-sys/src/features/gen_DocumentFragment.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -497,4 +498,200 @@ extern "C" { nodes_6: &str, nodes_7: &str, ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , variadic , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node(this: &DocumentFragment, nodes: &::js_sys::Array); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node_0(this: &DocumentFragment); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node_1(this: &DocumentFragment, nodes_1: &Node); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node_2(this: &DocumentFragment, nodes_1: &Node, nodes_2: &Node); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node_3( + this: &DocumentFragment, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node_4( + this: &DocumentFragment, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node_5( + this: &DocumentFragment, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node_6( + this: &DocumentFragment, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + nodes_6: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_node_7( + this: &DocumentFragment, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + nodes_6: &Node, + nodes_7: &Node, + ); + # [wasm_bindgen (method , structural , variadic , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str(this: &DocumentFragment, nodes: &::js_sys::Array); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str_0(this: &DocumentFragment); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str_1(this: &DocumentFragment, nodes_1: &str); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str_2(this: &DocumentFragment, nodes_1: &str, nodes_2: &str); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str_3( + this: &DocumentFragment, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + ); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str_4( + this: &DocumentFragment, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + ); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str_5( + this: &DocumentFragment, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + ); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str_6( + this: &DocumentFragment, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + nodes_6: &str, + ); + # [wasm_bindgen (method , structural , js_class = "DocumentFragment" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`*"] + pub fn replace_children_with_str_7( + this: &DocumentFragment, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + nodes_6: &str, + nodes_7: &str, + ); } diff --git a/crates/web-sys/src/features/gen_DocumentTimeline.rs b/crates/web-sys/src/features/gen_DocumentTimeline.rs index 57247e81940..e5c862f9fb5 100644 --- a/crates/web-sys/src/features/gen_DocumentTimeline.rs +++ b/crates/web-sys/src/features/gen_DocumentTimeline.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DocumentTimelineOptions.rs b/crates/web-sys/src/features/gen_DocumentTimelineOptions.rs index 33ee6fa3c36..116bf1075b7 100644 --- a/crates/web-sys/src/features/gen_DocumentTimelineOptions.rs +++ b/crates/web-sys/src/features/gen_DocumentTimelineOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DocumentTimelineOptions`*"] pub type DocumentTimelineOptions; + #[doc = "Get the `originTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentTimelineOptions`*"] + #[wasm_bindgen(method, getter = "originTime")] + pub fn get_origin_time(this: &DocumentTimelineOptions) -> Option; + #[doc = "Change the `originTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DocumentTimelineOptions`*"] + #[wasm_bindgen(method, setter = "originTime")] + pub fn set_origin_time(this: &DocumentTimelineOptions, val: f64); } impl DocumentTimelineOptions { #[doc = "Construct a new `DocumentTimelineOptions`."] @@ -19,21 +30,9 @@ impl DocumentTimelineOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `originTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DocumentTimelineOptions`*"] + #[deprecated = "Use `set_origin_time()` instead."] pub fn origin_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("originTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_origin_time(val); self } } diff --git a/crates/web-sys/src/features/gen_DocumentType.rs b/crates/web-sys/src/features/gen_DocumentType.rs index 2b6280c9b2b..9203a78f242 100644 --- a/crates/web-sys/src/features/gen_DocumentType.rs +++ b/crates/web-sys/src/features/gen_DocumentType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,21 +18,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DocumentType`*"] - pub fn name(this: &DocumentType) -> String; + pub fn name(this: &DocumentType) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "DocumentType" , js_name = publicId)] #[doc = "Getter for the `publicId` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/publicId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DocumentType`*"] - pub fn public_id(this: &DocumentType) -> String; + pub fn public_id(this: &DocumentType) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "DocumentType" , js_name = systemId)] #[doc = "Getter for the `systemId` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/systemId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DocumentType`*"] - pub fn system_id(this: &DocumentType) -> String; + pub fn system_id(this: &DocumentType) -> ::alloc::string::String; # [wasm_bindgen (catch , method , structural , variadic , js_class = "DocumentType" , js_name = after)] #[doc = "The `after()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DomError.rs b/crates/web-sys/src/features/gen_DomError.rs index 33e4f49195b..7052c88a6b9 100644 --- a/crates/web-sys/src/features/gen_DomError.rs +++ b/crates/web-sys/src/features/gen_DomError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMError/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomError`*"] - pub fn name(this: &DomError) -> String; + pub fn name(this: &DomError) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "DOMError" , js_name = message)] #[doc = "Getter for the `message` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMError/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomError`*"] - pub fn message(this: &DomError) -> String; + pub fn message(this: &DomError) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "DOMError")] #[doc = "The `new DomError(..)` constructor, creating a new instance of `DomError`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DomException.rs b/crates/web-sys/src/features/gen_DomException.rs index d7035a17069..7fa5ad37c3c 100644 --- a/crates/web-sys/src/features/gen_DomException.rs +++ b/crates/web-sys/src/features/gen_DomException.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMException/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomException`*"] - pub fn name(this: &DomException) -> String; + pub fn name(this: &DomException) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "DOMException" , js_name = message)] #[doc = "Getter for the `message` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMException/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomException`*"] - pub fn message(this: &DomException) -> String; + pub fn message(this: &DomException) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "DOMException" , js_name = code)] #[doc = "Getter for the `code` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMException/filename)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomException`*"] - pub fn filename(this: &DomException) -> String; + pub fn filename(this: &DomException) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "DOMException" , js_name = lineNumber)] #[doc = "Getter for the `lineNumber` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMException/stack)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomException`*"] - pub fn stack(this: &DomException) -> String; + pub fn stack(this: &DomException) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "DOMException")] #[doc = "The `new DomException(..)` constructor, creating a new instance of `DomException`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DomImplementation.rs b/crates/web-sys/src/features/gen_DomImplementation.rs index 3f09acc2b6e..cb7402972fb 100644 --- a/crates/web-sys/src/features/gen_DomImplementation.rs +++ b/crates/web-sys/src/features/gen_DomImplementation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DomMatrix.rs b/crates/web-sys/src/features/gen_DomMatrix.rs index 3212e048f1b..1ed0b27be1e 100644 --- a/crates/web-sys/src/features/gen_DomMatrix.rs +++ b/crates/web-sys/src/features/gen_DomMatrix.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -353,6 +354,13 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix/DOMMatrix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix`*"] + pub fn new_with_f32_array(array32: &::js_sys::Float32Array) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "DOMMatrix")] + #[doc = "The `new DomMatrix(..)` constructor, creating a new instance of `DomMatrix`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix/DOMMatrix)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix`*"] pub fn new_with_array64(array64: &mut [f64]) -> Result; #[wasm_bindgen(catch, constructor, js_class = "DOMMatrix")] #[doc = "The `new DomMatrix(..)` constructor, creating a new instance of `DomMatrix`."] @@ -360,6 +368,13 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix/DOMMatrix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrix`*"] + pub fn new_with_f64_array(array64: &::js_sys::Float64Array) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "DOMMatrix")] + #[doc = "The `new DomMatrix(..)` constructor, creating a new instance of `DomMatrix`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix/DOMMatrix)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix`*"] pub fn new_with_number_sequence( number_sequence: &::wasm_bindgen::JsValue, ) -> Result; diff --git a/crates/web-sys/src/features/gen_DomMatrix2dInit.rs b/crates/web-sys/src/features/gen_DomMatrix2dInit.rs new file mode 100644 index 00000000000..b3ca99c9931 --- /dev/null +++ b/crates/web-sys/src/features/gen_DomMatrix2dInit.rs @@ -0,0 +1,208 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DOMMatrix2DInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `DomMatrix2dInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + pub type DomMatrix2dInit; + #[doc = "Get the `a` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "a")] + pub fn get_a(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `a` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "a")] + pub fn set_a(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `b` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "b")] + pub fn get_b(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `b` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "b")] + pub fn set_b(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `c` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "c")] + pub fn get_c(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `c` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "c")] + pub fn set_c(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `d` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "d")] + pub fn get_d(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `d` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "d")] + pub fn set_d(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `e` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "e")] + pub fn get_e(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `e` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "e")] + pub fn set_e(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `f` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "f")] + pub fn get_f(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `f` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "f")] + pub fn set_f(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `m11` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "m11")] + pub fn get_m11(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `m11` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "m11")] + pub fn set_m11(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `m12` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "m12")] + pub fn get_m12(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `m12` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "m12")] + pub fn set_m12(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `m21` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "m21")] + pub fn get_m21(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `m21` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "m21")] + pub fn set_m21(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `m22` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "m22")] + pub fn get_m22(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `m22` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "m22")] + pub fn set_m22(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `m41` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "m41")] + pub fn get_m41(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `m41` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "m41")] + pub fn set_m41(this: &DomMatrix2dInit, val: f64); + #[doc = "Get the `m42` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, getter = "m42")] + pub fn get_m42(this: &DomMatrix2dInit) -> Option; + #[doc = "Change the `m42` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + #[wasm_bindgen(method, setter = "m42")] + pub fn set_m42(this: &DomMatrix2dInit, val: f64); +} +impl DomMatrix2dInit { + #[doc = "Construct a new `DomMatrix2dInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_a()` instead."] + pub fn a(&mut self, val: f64) -> &mut Self { + self.set_a(val); + self + } + #[deprecated = "Use `set_b()` instead."] + pub fn b(&mut self, val: f64) -> &mut Self { + self.set_b(val); + self + } + #[deprecated = "Use `set_c()` instead."] + pub fn c(&mut self, val: f64) -> &mut Self { + self.set_c(val); + self + } + #[deprecated = "Use `set_d()` instead."] + pub fn d(&mut self, val: f64) -> &mut Self { + self.set_d(val); + self + } + #[deprecated = "Use `set_e()` instead."] + pub fn e(&mut self, val: f64) -> &mut Self { + self.set_e(val); + self + } + #[deprecated = "Use `set_f()` instead."] + pub fn f(&mut self, val: f64) -> &mut Self { + self.set_f(val); + self + } + #[deprecated = "Use `set_m11()` instead."] + pub fn m11(&mut self, val: f64) -> &mut Self { + self.set_m11(val); + self + } + #[deprecated = "Use `set_m12()` instead."] + pub fn m12(&mut self, val: f64) -> &mut Self { + self.set_m12(val); + self + } + #[deprecated = "Use `set_m21()` instead."] + pub fn m21(&mut self, val: f64) -> &mut Self { + self.set_m21(val); + self + } + #[deprecated = "Use `set_m22()` instead."] + pub fn m22(&mut self, val: f64) -> &mut Self { + self.set_m22(val); + self + } + #[deprecated = "Use `set_m41()` instead."] + pub fn m41(&mut self, val: f64) -> &mut Self { + self.set_m41(val); + self + } + #[deprecated = "Use `set_m42()` instead."] + pub fn m42(&mut self, val: f64) -> &mut Self { + self.set_m42(val); + self + } +} +impl Default for DomMatrix2dInit { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_DomMatrixInit.rs b/crates/web-sys/src/features/gen_DomMatrixInit.rs new file mode 100644 index 00000000000..15809896dd0 --- /dev/null +++ b/crates/web-sys/src/features/gen_DomMatrixInit.rs @@ -0,0 +1,373 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DOMMatrixInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `DomMatrixInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + pub type DomMatrixInit; + #[doc = "Get the `a` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "a")] + pub fn get_a(this: &DomMatrixInit) -> Option; + #[doc = "Change the `a` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "a")] + pub fn set_a(this: &DomMatrixInit, val: f64); + #[doc = "Get the `b` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "b")] + pub fn get_b(this: &DomMatrixInit) -> Option; + #[doc = "Change the `b` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "b")] + pub fn set_b(this: &DomMatrixInit, val: f64); + #[doc = "Get the `c` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "c")] + pub fn get_c(this: &DomMatrixInit) -> Option; + #[doc = "Change the `c` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "c")] + pub fn set_c(this: &DomMatrixInit, val: f64); + #[doc = "Get the `d` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "d")] + pub fn get_d(this: &DomMatrixInit) -> Option; + #[doc = "Change the `d` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "d")] + pub fn set_d(this: &DomMatrixInit, val: f64); + #[doc = "Get the `e` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "e")] + pub fn get_e(this: &DomMatrixInit) -> Option; + #[doc = "Change the `e` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "e")] + pub fn set_e(this: &DomMatrixInit, val: f64); + #[doc = "Get the `f` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "f")] + pub fn get_f(this: &DomMatrixInit) -> Option; + #[doc = "Change the `f` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "f")] + pub fn set_f(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m11` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m11")] + pub fn get_m11(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m11` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m11")] + pub fn set_m11(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m12` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m12")] + pub fn get_m12(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m12` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m12")] + pub fn set_m12(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m21` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m21")] + pub fn get_m21(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m21` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m21")] + pub fn set_m21(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m22` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m22")] + pub fn get_m22(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m22` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m22")] + pub fn set_m22(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m41` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m41")] + pub fn get_m41(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m41` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m41")] + pub fn set_m41(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m42` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m42")] + pub fn get_m42(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m42` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m42")] + pub fn set_m42(this: &DomMatrixInit, val: f64); + #[doc = "Get the `is2D` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "is2D")] + pub fn get_is_2d(this: &DomMatrixInit) -> Option; + #[doc = "Change the `is2D` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "is2D")] + pub fn set_is_2d(this: &DomMatrixInit, val: bool); + #[doc = "Get the `m13` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m13")] + pub fn get_m13(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m13` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m13")] + pub fn set_m13(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m14` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m14")] + pub fn get_m14(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m14` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m14")] + pub fn set_m14(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m23` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m23")] + pub fn get_m23(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m23` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m23")] + pub fn set_m23(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m24` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m24")] + pub fn get_m24(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m24` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m24")] + pub fn set_m24(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m31` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m31")] + pub fn get_m31(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m31` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m31")] + pub fn set_m31(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m32` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m32")] + pub fn get_m32(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m32` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m32")] + pub fn set_m32(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m33` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m33")] + pub fn get_m33(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m33` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m33")] + pub fn set_m33(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m34` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m34")] + pub fn get_m34(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m34` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m34")] + pub fn set_m34(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m43` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m43")] + pub fn get_m43(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m43` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m43")] + pub fn set_m43(this: &DomMatrixInit, val: f64); + #[doc = "Get the `m44` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, getter = "m44")] + pub fn get_m44(this: &DomMatrixInit) -> Option; + #[doc = "Change the `m44` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + #[wasm_bindgen(method, setter = "m44")] + pub fn set_m44(this: &DomMatrixInit, val: f64); +} +impl DomMatrixInit { + #[doc = "Construct a new `DomMatrixInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrixInit`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_a()` instead."] + pub fn a(&mut self, val: f64) -> &mut Self { + self.set_a(val); + self + } + #[deprecated = "Use `set_b()` instead."] + pub fn b(&mut self, val: f64) -> &mut Self { + self.set_b(val); + self + } + #[deprecated = "Use `set_c()` instead."] + pub fn c(&mut self, val: f64) -> &mut Self { + self.set_c(val); + self + } + #[deprecated = "Use `set_d()` instead."] + pub fn d(&mut self, val: f64) -> &mut Self { + self.set_d(val); + self + } + #[deprecated = "Use `set_e()` instead."] + pub fn e(&mut self, val: f64) -> &mut Self { + self.set_e(val); + self + } + #[deprecated = "Use `set_f()` instead."] + pub fn f(&mut self, val: f64) -> &mut Self { + self.set_f(val); + self + } + #[deprecated = "Use `set_m11()` instead."] + pub fn m11(&mut self, val: f64) -> &mut Self { + self.set_m11(val); + self + } + #[deprecated = "Use `set_m12()` instead."] + pub fn m12(&mut self, val: f64) -> &mut Self { + self.set_m12(val); + self + } + #[deprecated = "Use `set_m21()` instead."] + pub fn m21(&mut self, val: f64) -> &mut Self { + self.set_m21(val); + self + } + #[deprecated = "Use `set_m22()` instead."] + pub fn m22(&mut self, val: f64) -> &mut Self { + self.set_m22(val); + self + } + #[deprecated = "Use `set_m41()` instead."] + pub fn m41(&mut self, val: f64) -> &mut Self { + self.set_m41(val); + self + } + #[deprecated = "Use `set_m42()` instead."] + pub fn m42(&mut self, val: f64) -> &mut Self { + self.set_m42(val); + self + } + #[deprecated = "Use `set_is_2d()` instead."] + pub fn is_2d(&mut self, val: bool) -> &mut Self { + self.set_is_2d(val); + self + } + #[deprecated = "Use `set_m13()` instead."] + pub fn m13(&mut self, val: f64) -> &mut Self { + self.set_m13(val); + self + } + #[deprecated = "Use `set_m14()` instead."] + pub fn m14(&mut self, val: f64) -> &mut Self { + self.set_m14(val); + self + } + #[deprecated = "Use `set_m23()` instead."] + pub fn m23(&mut self, val: f64) -> &mut Self { + self.set_m23(val); + self + } + #[deprecated = "Use `set_m24()` instead."] + pub fn m24(&mut self, val: f64) -> &mut Self { + self.set_m24(val); + self + } + #[deprecated = "Use `set_m31()` instead."] + pub fn m31(&mut self, val: f64) -> &mut Self { + self.set_m31(val); + self + } + #[deprecated = "Use `set_m32()` instead."] + pub fn m32(&mut self, val: f64) -> &mut Self { + self.set_m32(val); + self + } + #[deprecated = "Use `set_m33()` instead."] + pub fn m33(&mut self, val: f64) -> &mut Self { + self.set_m33(val); + self + } + #[deprecated = "Use `set_m34()` instead."] + pub fn m34(&mut self, val: f64) -> &mut Self { + self.set_m34(val); + self + } + #[deprecated = "Use `set_m43()` instead."] + pub fn m43(&mut self, val: f64) -> &mut Self { + self.set_m43(val); + self + } + #[deprecated = "Use `set_m44()` instead."] + pub fn m44(&mut self, val: f64) -> &mut Self { + self.set_m44(val); + self + } +} +impl Default for DomMatrixInit { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_DomMatrixReadOnly.rs b/crates/web-sys/src/features/gen_DomMatrixReadOnly.rs index a31e55465d2..1aa88cc6b84 100644 --- a/crates/web-sys/src/features/gen_DomMatrixReadOnly.rs +++ b/crates/web-sys/src/features/gen_DomMatrixReadOnly.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -457,14 +458,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly/toFloat32Array)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixReadOnly`*"] - pub fn to_float32_array(this: &DomMatrixReadOnly) -> Result, JsValue>; + pub fn to_float32_array(this: &DomMatrixReadOnly) -> Result<::alloc::vec::Vec, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "DOMMatrixReadOnly" , js_name = toFloat64Array)] #[doc = "The `toFloat64Array()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly/toFloat64Array)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomMatrixReadOnly`*"] - pub fn to_float64_array(this: &DomMatrixReadOnly) -> Result, JsValue>; + pub fn to_float64_array(this: &DomMatrixReadOnly) -> Result<::alloc::vec::Vec, JsValue>; # [wasm_bindgen (method , structural , js_class = "DOMMatrixReadOnly" , js_name = toJSON)] #[doc = "The `toJSON()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DomParser.rs b/crates/web-sys/src/features/gen_DomParser.rs index 97385ccfef7..5a926bf24e2 100644 --- a/crates/web-sys/src/features/gen_DomParser.rs +++ b/crates/web-sys/src/features/gen_DomParser.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DomPoint.rs b/crates/web-sys/src/features/gen_DomPoint.rs index 5a563cde7d1..305e57be868 100644 --- a/crates/web-sys/src/features/gen_DomPoint.rs +++ b/crates/web-sys/src/features/gen_DomPoint.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -110,7 +111,7 @@ extern "C" { # [wasm_bindgen (static_method_of = DomPoint , js_class = "DOMPoint" , js_name = fromPoint)] #[doc = "The `fromPoint()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint/fromPoint)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint/fromPoint_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPoint`*"] pub fn from_point() -> DomPoint; @@ -118,7 +119,7 @@ extern "C" { # [wasm_bindgen (static_method_of = DomPoint , js_class = "DOMPoint" , js_name = fromPoint)] #[doc = "The `fromPoint()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint/fromPoint)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint/fromPoint_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomPointInit`*"] pub fn from_point_with_other(other: &DomPointInit) -> DomPoint; diff --git a/crates/web-sys/src/features/gen_DomPointInit.rs b/crates/web-sys/src/features/gen_DomPointInit.rs index 51be45cc560..b5f58ae1fb0 100644 --- a/crates/web-sys/src/features/gen_DomPointInit.rs +++ b/crates/web-sys/src/features/gen_DomPointInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] pub type DomPointInit; + #[doc = "Get the `w` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[wasm_bindgen(method, getter = "w")] + pub fn get_w(this: &DomPointInit) -> Option; + #[doc = "Change the `w` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[wasm_bindgen(method, setter = "w")] + pub fn set_w(this: &DomPointInit, val: f64); + #[doc = "Get the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &DomPointInit) -> Option; + #[doc = "Change the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &DomPointInit, val: f64); + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &DomPointInit) -> Option; + #[doc = "Change the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &DomPointInit, val: f64); + #[doc = "Get the `z` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[wasm_bindgen(method, getter = "z")] + pub fn get_z(this: &DomPointInit) -> Option; + #[doc = "Change the `z` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[wasm_bindgen(method, setter = "z")] + pub fn set_z(this: &DomPointInit, val: f64); } impl DomPointInit { #[doc = "Construct a new `DomPointInit`."] @@ -19,56 +60,24 @@ impl DomPointInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `w` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[deprecated = "Use `set_w()` instead."] pub fn w(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("w"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_w(val); self } - #[doc = "Change the `x` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[deprecated = "Use `set_x()` instead."] pub fn x(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x(val); self } - #[doc = "Change the `y` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[deprecated = "Use `set_y()` instead."] pub fn y(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_y(val); self } - #[doc = "Change the `z` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPointInit`*"] + #[deprecated = "Use `set_z()` instead."] pub fn z(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("z"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_z(val); self } } diff --git a/crates/web-sys/src/features/gen_DomPointReadOnly.rs b/crates/web-sys/src/features/gen_DomPointReadOnly.rs index 2601722c092..b3f52f271fe 100644 --- a/crates/web-sys/src/features/gen_DomPointReadOnly.rs +++ b/crates/web-sys/src/features/gen_DomPointReadOnly.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -82,7 +83,7 @@ extern "C" { # [wasm_bindgen (static_method_of = DomPointReadOnly , js_class = "DOMPointReadOnly" , js_name = fromPoint)] #[doc = "The `fromPoint()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly/fromPoint)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly/fromPoint_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointReadOnly`*"] pub fn from_point() -> DomPointReadOnly; @@ -90,7 +91,7 @@ extern "C" { # [wasm_bindgen (static_method_of = DomPointReadOnly , js_class = "DOMPointReadOnly" , js_name = fromPoint)] #[doc = "The `fromPoint()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly/fromPoint)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly/fromPoint_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomPointReadOnly`*"] pub fn from_point_with_other(other: &DomPointInit) -> DomPointReadOnly; diff --git a/crates/web-sys/src/features/gen_DomQuad.rs b/crates/web-sys/src/features/gen_DomQuad.rs index 26b87535eb4..679786dc3db 100644 --- a/crates/web-sys/src/features/gen_DomQuad.rs +++ b/crates/web-sys/src/features/gen_DomQuad.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DomQuadInit.rs b/crates/web-sys/src/features/gen_DomQuadInit.rs index 3bd7d907545..113f80350e0 100644 --- a/crates/web-sys/src/features/gen_DomQuadInit.rs +++ b/crates/web-sys/src/features/gen_DomQuadInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,54 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomQuadInit`*"] pub type DomQuadInit; + #[cfg(feature = "DomPointInit")] + #[doc = "Get the `p1` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[wasm_bindgen(method, getter = "p1")] + pub fn get_p1(this: &DomQuadInit) -> Option; + #[cfg(feature = "DomPointInit")] + #[doc = "Change the `p1` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[wasm_bindgen(method, setter = "p1")] + pub fn set_p1(this: &DomQuadInit, val: &DomPointInit); + #[cfg(feature = "DomPointInit")] + #[doc = "Get the `p2` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[wasm_bindgen(method, getter = "p2")] + pub fn get_p2(this: &DomQuadInit) -> Option; + #[cfg(feature = "DomPointInit")] + #[doc = "Change the `p2` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[wasm_bindgen(method, setter = "p2")] + pub fn set_p2(this: &DomQuadInit, val: &DomPointInit); + #[cfg(feature = "DomPointInit")] + #[doc = "Get the `p3` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[wasm_bindgen(method, getter = "p3")] + pub fn get_p3(this: &DomQuadInit) -> Option; + #[cfg(feature = "DomPointInit")] + #[doc = "Change the `p3` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[wasm_bindgen(method, setter = "p3")] + pub fn set_p3(this: &DomQuadInit, val: &DomPointInit); + #[cfg(feature = "DomPointInit")] + #[doc = "Get the `p4` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[wasm_bindgen(method, getter = "p4")] + pub fn get_p4(this: &DomQuadInit) -> Option; + #[cfg(feature = "DomPointInit")] + #[doc = "Change the `p4` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[wasm_bindgen(method, setter = "p4")] + pub fn set_p4(this: &DomQuadInit, val: &DomPointInit); } impl DomQuadInit { #[doc = "Construct a new `DomQuadInit`."] @@ -20,59 +69,27 @@ impl DomQuadInit { ret } #[cfg(feature = "DomPointInit")] - #[doc = "Change the `p1` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[deprecated = "Use `set_p1()` instead."] pub fn p1(&mut self, val: &DomPointInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p1"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p1(val); self } #[cfg(feature = "DomPointInit")] - #[doc = "Change the `p2` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[deprecated = "Use `set_p2()` instead."] pub fn p2(&mut self, val: &DomPointInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p2"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p2(val); self } #[cfg(feature = "DomPointInit")] - #[doc = "Change the `p3` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[deprecated = "Use `set_p3()` instead."] pub fn p3(&mut self, val: &DomPointInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p3"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p3(val); self } #[cfg(feature = "DomPointInit")] - #[doc = "Change the `p4` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `DomQuadInit`*"] + #[deprecated = "Use `set_p4()` instead."] pub fn p4(&mut self, val: &DomPointInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p4"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p4(val); self } } diff --git a/crates/web-sys/src/features/gen_DomQuadJson.rs b/crates/web-sys/src/features/gen_DomQuadJson.rs index d3316d9751d..2bba1e24bd7 100644 --- a/crates/web-sys/src/features/gen_DomQuadJson.rs +++ b/crates/web-sys/src/features/gen_DomQuadJson.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,54 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomQuadJson`*"] pub type DomQuadJson; + #[cfg(feature = "DomPoint")] + #[doc = "Get the `p1` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[wasm_bindgen(method, getter = "p1")] + pub fn get_p1(this: &DomQuadJson) -> Option; + #[cfg(feature = "DomPoint")] + #[doc = "Change the `p1` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[wasm_bindgen(method, setter = "p1")] + pub fn set_p1(this: &DomQuadJson, val: &DomPoint); + #[cfg(feature = "DomPoint")] + #[doc = "Get the `p2` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[wasm_bindgen(method, getter = "p2")] + pub fn get_p2(this: &DomQuadJson) -> Option; + #[cfg(feature = "DomPoint")] + #[doc = "Change the `p2` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[wasm_bindgen(method, setter = "p2")] + pub fn set_p2(this: &DomQuadJson, val: &DomPoint); + #[cfg(feature = "DomPoint")] + #[doc = "Get the `p3` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[wasm_bindgen(method, getter = "p3")] + pub fn get_p3(this: &DomQuadJson) -> Option; + #[cfg(feature = "DomPoint")] + #[doc = "Change the `p3` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[wasm_bindgen(method, setter = "p3")] + pub fn set_p3(this: &DomQuadJson, val: &DomPoint); + #[cfg(feature = "DomPoint")] + #[doc = "Get the `p4` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[wasm_bindgen(method, getter = "p4")] + pub fn get_p4(this: &DomQuadJson) -> Option; + #[cfg(feature = "DomPoint")] + #[doc = "Change the `p4` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[wasm_bindgen(method, setter = "p4")] + pub fn set_p4(this: &DomQuadJson, val: &DomPoint); } impl DomQuadJson { #[doc = "Construct a new `DomQuadJson`."] @@ -20,59 +69,27 @@ impl DomQuadJson { ret } #[cfg(feature = "DomPoint")] - #[doc = "Change the `p1` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[deprecated = "Use `set_p1()` instead."] pub fn p1(&mut self, val: &DomPoint) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p1"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p1(val); self } #[cfg(feature = "DomPoint")] - #[doc = "Change the `p2` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[deprecated = "Use `set_p2()` instead."] pub fn p2(&mut self, val: &DomPoint) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p2"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p2(val); self } #[cfg(feature = "DomPoint")] - #[doc = "Change the `p3` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[deprecated = "Use `set_p3()` instead."] pub fn p3(&mut self, val: &DomPoint) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p3"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p3(val); self } #[cfg(feature = "DomPoint")] - #[doc = "Change the `p4` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomPoint`, `DomQuadJson`*"] + #[deprecated = "Use `set_p4()` instead."] pub fn p4(&mut self, val: &DomPoint) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p4"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p4(val); self } } diff --git a/crates/web-sys/src/features/gen_DomRect.rs b/crates/web-sys/src/features/gen_DomRect.rs index 0d3a02988e9..6e177351fab 100644 --- a/crates/web-sys/src/features/gen_DomRect.rs +++ b/crates/web-sys/src/features/gen_DomRect.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DomRectInit.rs b/crates/web-sys/src/features/gen_DomRectInit.rs index ab4a54a2b0a..d02056c5ce2 100644 --- a/crates/web-sys/src/features/gen_DomRectInit.rs +++ b/crates/web-sys/src/features/gen_DomRectInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] pub type DomRectInit; + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &DomRectInit) -> Option; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &DomRectInit, val: f64); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &DomRectInit) -> Option; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &DomRectInit, val: f64); + #[doc = "Get the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &DomRectInit) -> Option; + #[doc = "Change the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &DomRectInit, val: f64); + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &DomRectInit) -> Option; + #[doc = "Change the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &DomRectInit, val: f64); } impl DomRectInit { #[doc = "Construct a new `DomRectInit`."] @@ -19,57 +60,24 @@ impl DomRectInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } - #[doc = "Change the `x` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[deprecated = "Use `set_x()` instead."] pub fn x(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x(val); self } - #[doc = "Change the `y` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"] + #[deprecated = "Use `set_y()` instead."] pub fn y(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_y(val); self } } diff --git a/crates/web-sys/src/features/gen_DomRectList.rs b/crates/web-sys/src/features/gen_DomRectList.rs index e668a849238..9e33e98cc74 100644 --- a/crates/web-sys/src/features/gen_DomRectList.rs +++ b/crates/web-sys/src/features/gen_DomRectList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -28,7 +29,7 @@ extern "C" { pub fn item(this: &DomRectList, index: u32) -> Option; #[cfg(feature = "DomRect")] #[wasm_bindgen(method, structural, js_class = "DOMRectList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DomRectReadOnly.rs b/crates/web-sys/src/features/gen_DomRectReadOnly.rs index 1b48f02b103..2ce9892091f 100644 --- a/crates/web-sys/src/features/gen_DomRectReadOnly.rs +++ b/crates/web-sys/src/features/gen_DomRectReadOnly.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DomRequest.rs b/crates/web-sys/src/features/gen_DomRequest.rs index 05e678563f5..ac375ffb86a 100644 --- a/crates/web-sys/src/features/gen_DomRequest.rs +++ b/crates/web-sys/src/features/gen_DomRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DomRequestReadyState.rs b/crates/web-sys/src/features/gen_DomRequestReadyState.rs index 179f9478e7f..c8a8ac4f337 100644 --- a/crates/web-sys/src/features/gen_DomRequestReadyState.rs +++ b/crates/web-sys/src/features/gen_DomRequestReadyState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `DomRequestReadyState` enum."] diff --git a/crates/web-sys/src/features/gen_DomStringList.rs b/crates/web-sys/src/features/gen_DomStringList.rs index 1b932f2915b..2f8dcd72f28 100644 --- a/crates/web-sys/src/features/gen_DomStringList.rs +++ b/crates/web-sys/src/features/gen_DomStringList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,12 +32,12 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMStringList/item)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomStringList`*"] - pub fn item(this: &DomStringList, index: u32) -> Option; + pub fn item(this: &DomStringList, index: u32) -> Option<::alloc::string::String>; #[wasm_bindgen(method, structural, js_class = "DOMStringList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomStringList`*"] - pub fn get(this: &DomStringList, index: u32) -> Option; + pub fn get(this: &DomStringList, index: u32) -> Option<::alloc::string::String>; } diff --git a/crates/web-sys/src/features/gen_DomStringMap.rs b/crates/web-sys/src/features/gen_DomStringMap.rs index c102f10850b..0d7a007b1f6 100644 --- a/crates/web-sys/src/features/gen_DomStringMap.rs +++ b/crates/web-sys/src/features/gen_DomStringMap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -12,21 +13,21 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `DomStringMap`*"] pub type DomStringMap; #[wasm_bindgen(method, structural, js_class = "DOMStringMap", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomStringMap`*"] - pub fn get(this: &DomStringMap, name: &str) -> Option; + pub fn get(this: &DomStringMap, name: &str) -> Option<::alloc::string::String>; #[wasm_bindgen(catch, method, structural, js_class = "DOMStringMap", indexing_setter)] - #[doc = "Indexing setter."] + #[doc = "Indexing setter. As in the literal Javascript `this[key] = value`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomStringMap`*"] pub fn set(this: &DomStringMap, name: &str, value: &str) -> Result<(), JsValue>; #[wasm_bindgen(method, structural, js_class = "DOMStringMap", indexing_deleter)] - #[doc = "Indexing deleter."] + #[doc = "Indexing deleter. As in the literal Javascript `delete this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_DomTokenList.rs b/crates/web-sys/src/features/gen_DomTokenList.rs index a097863d636..a4a58a5f98e 100644 --- a/crates/web-sys/src/features/gen_DomTokenList.rs +++ b/crates/web-sys/src/features/gen_DomTokenList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomTokenList`*"] - pub fn value(this: &DomTokenList) -> String; + pub fn value(this: &DomTokenList) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "DOMTokenList" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -137,13 +138,34 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomTokenList`*"] pub fn contains(this: &DomTokenList, token: &str) -> bool; + # [wasm_bindgen (method , structural , js_class = "DOMTokenList" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomTokenList`*"] + pub fn entries(this: &DomTokenList) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "DOMTokenList" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomTokenList`*"] + pub fn for_each(this: &DomTokenList, callback: &::js_sys::Function) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "DOMTokenList" , js_name = item)] #[doc = "The `item()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/item)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomTokenList`*"] - pub fn item(this: &DomTokenList, index: u32) -> Option; + pub fn item(this: &DomTokenList, index: u32) -> Option<::alloc::string::String>; + # [wasm_bindgen (method , structural , js_class = "DOMTokenList" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomTokenList`*"] + pub fn keys(this: &DomTokenList) -> ::js_sys::Iterator; # [wasm_bindgen (catch , method , structural , variadic , js_class = "DOMTokenList" , js_name = remove)] #[doc = "The `remove()` method."] #[doc = ""] @@ -274,11 +296,18 @@ extern "C" { token: &str, force: bool, ) -> Result; + # [wasm_bindgen (method , structural , js_class = "DOMTokenList" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomTokenList`*"] + pub fn values(this: &DomTokenList) -> ::js_sys::Iterator; #[wasm_bindgen(method, structural, js_class = "DOMTokenList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomTokenList`*"] - pub fn get(this: &DomTokenList, index: u32) -> Option; + pub fn get(this: &DomTokenList, index: u32) -> Option<::alloc::string::String>; } diff --git a/crates/web-sys/src/features/gen_DomWindowResizeEventDetail.rs b/crates/web-sys/src/features/gen_DomWindowResizeEventDetail.rs index 7bf972f04f4..79560ef04a7 100644 --- a/crates/web-sys/src/features/gen_DomWindowResizeEventDetail.rs +++ b/crates/web-sys/src/features/gen_DomWindowResizeEventDetail.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] pub type DomWindowResizeEventDetail; + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &DomWindowResizeEventDetail) -> Option; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &DomWindowResizeEventDetail, val: i32); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &DomWindowResizeEventDetail) -> Option; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &DomWindowResizeEventDetail, val: i32); } impl DomWindowResizeEventDetail { #[doc = "Construct a new `DomWindowResizeEventDetail`."] @@ -19,31 +40,14 @@ impl DomWindowResizeEventDetail { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomWindowResizeEventDetail`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuImageDataLayout.rs b/crates/web-sys/src/features/gen_DoubleRange.rs similarity index 54% rename from crates/web-sys/src/features/gen_GpuImageDataLayout.rs rename to crates/web-sys/src/features/gen_DoubleRange.rs index 80be6b07988..86a427e7df0 100644 --- a/crates/web-sys/src/features/gen_GpuImageDataLayout.rs +++ b/crates/web-sys/src/features/gen_DoubleRange.rs @@ -1,95 +1,84 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageDataLayout)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DoubleRange)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageDataLayout` dictionary."] + #[doc = "The `DoubleRange` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageDataLayout; -} -#[cfg(web_sys_unstable_apis)] -impl GpuImageDataLayout { - #[doc = "Construct a new `GpuImageDataLayout`."] + pub type DoubleRange; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `max` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "max")] + pub fn get_max(this: &DoubleRange) -> Option; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `bytesPerRow` field of this object."] + #[doc = "Change the `max` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesPerRow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "max")] + pub fn set_max(this: &DoubleRange, val: f64); #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `offset` field of this object."] + #[doc = "Get the `min` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, getter = "min")] + pub fn get_min(this: &DoubleRange) -> Option; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `rowsPerImage` field of this object."] + #[doc = "Change the `min` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageDataLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn rows_per_image(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rowsPerImage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + #[wasm_bindgen(method, setter = "min")] + pub fn set_min(this: &DoubleRange, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl DoubleRange { + #[doc = "Construct a new `DoubleRange`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_max()` instead."] + pub fn max(&mut self, val: f64) -> &mut Self { + self.set_max(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_min()` instead."] + pub fn min(&mut self, val: f64) -> &mut Self { + self.set_min(val); self } } #[cfg(web_sys_unstable_apis)] -impl Default for GpuImageDataLayout { +impl Default for DoubleRange { fn default() -> Self { Self::new() } diff --git a/crates/web-sys/src/features/gen_DragEvent.rs b/crates/web-sys/src/features/gen_DragEvent.rs index fc18b1ee5f0..8be938eb6a5 100644 --- a/crates/web-sys/src/features/gen_DragEvent.rs +++ b/crates/web-sys/src/features/gen_DragEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DragEventInit.rs b/crates/web-sys/src/features/gen_DragEventInit.rs index d28d127a986..0781bdf1322 100644 --- a/crates/web-sys/src/features/gen_DragEventInit.rs +++ b/crates/web-sys/src/features/gen_DragEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,292 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] pub type DragEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &DragEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &DragEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &DragEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &DragEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &DragEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &DragEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &DragEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &DragEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &DragEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &DragEventInit, val: Option<&Window>); + #[doc = "Get the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "altKey")] + pub fn get_alt_key(this: &DragEventInit) -> Option; + #[doc = "Change the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "altKey")] + pub fn set_alt_key(this: &DragEventInit, val: bool); + #[doc = "Get the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "ctrlKey")] + pub fn get_ctrl_key(this: &DragEventInit) -> Option; + #[doc = "Change the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "ctrlKey")] + pub fn set_ctrl_key(this: &DragEventInit, val: bool); + #[doc = "Get the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "metaKey")] + pub fn get_meta_key(this: &DragEventInit) -> Option; + #[doc = "Change the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "metaKey")] + pub fn set_meta_key(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierAltGraph")] + pub fn get_modifier_alt_graph(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierAltGraph")] + pub fn set_modifier_alt_graph(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierCapsLock")] + pub fn get_modifier_caps_lock(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierCapsLock")] + pub fn set_modifier_caps_lock(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFn")] + pub fn get_modifier_fn(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFn")] + pub fn set_modifier_fn(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFnLock")] + pub fn get_modifier_fn_lock(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFnLock")] + pub fn set_modifier_fn_lock(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierNumLock")] + pub fn get_modifier_num_lock(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierNumLock")] + pub fn set_modifier_num_lock(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierOS")] + pub fn get_modifier_os(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierOS")] + pub fn set_modifier_os(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierScrollLock")] + pub fn get_modifier_scroll_lock(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierScrollLock")] + pub fn set_modifier_scroll_lock(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbol")] + pub fn get_modifier_symbol(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbol")] + pub fn set_modifier_symbol(this: &DragEventInit, val: bool); + #[doc = "Get the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbolLock")] + pub fn get_modifier_symbol_lock(this: &DragEventInit) -> Option; + #[doc = "Change the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + pub fn set_modifier_symbol_lock(this: &DragEventInit, val: bool); + #[doc = "Get the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "shiftKey")] + pub fn get_shift_key(this: &DragEventInit) -> Option; + #[doc = "Change the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "shiftKey")] + pub fn set_shift_key(this: &DragEventInit, val: bool); + #[doc = "Get the `button` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "button")] + pub fn get_button(this: &DragEventInit) -> Option; + #[doc = "Change the `button` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "button")] + pub fn set_button(this: &DragEventInit, val: i16); + #[doc = "Get the `buttons` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "buttons")] + pub fn get_buttons(this: &DragEventInit) -> Option; + #[doc = "Change the `buttons` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "buttons")] + pub fn set_buttons(this: &DragEventInit, val: u16); + #[doc = "Get the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "clientX")] + pub fn get_client_x(this: &DragEventInit) -> Option; + #[doc = "Change the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "clientX")] + pub fn set_client_x(this: &DragEventInit, val: i32); + #[doc = "Get the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "clientY")] + pub fn get_client_y(this: &DragEventInit) -> Option; + #[doc = "Change the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "clientY")] + pub fn set_client_y(this: &DragEventInit, val: i32); + #[doc = "Get the `movementX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "movementX")] + pub fn get_movement_x(this: &DragEventInit) -> Option; + #[doc = "Change the `movementX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "movementX")] + pub fn set_movement_x(this: &DragEventInit, val: i32); + #[doc = "Get the `movementY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "movementY")] + pub fn get_movement_y(this: &DragEventInit) -> Option; + #[doc = "Change the `movementY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "movementY")] + pub fn set_movement_y(this: &DragEventInit, val: i32); + #[cfg(feature = "EventTarget")] + #[doc = "Get the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `EventTarget`*"] + #[wasm_bindgen(method, getter = "relatedTarget")] + pub fn get_related_target(this: &DragEventInit) -> Option; + #[cfg(feature = "EventTarget")] + #[doc = "Change the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `EventTarget`*"] + #[wasm_bindgen(method, setter = "relatedTarget")] + pub fn set_related_target(this: &DragEventInit, val: Option<&EventTarget>); + #[doc = "Get the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "screenX")] + pub fn get_screen_x(this: &DragEventInit) -> Option; + #[doc = "Change the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "screenX")] + pub fn set_screen_x(this: &DragEventInit, val: i32); + #[doc = "Get the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, getter = "screenY")] + pub fn get_screen_y(this: &DragEventInit) -> Option; + #[doc = "Change the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[wasm_bindgen(method, setter = "screenY")] + pub fn set_screen_y(this: &DragEventInit, val: i32); + #[cfg(feature = "DataTransfer")] + #[doc = "Get the `dataTransfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `DragEventInit`*"] + #[wasm_bindgen(method, getter = "dataTransfer")] + pub fn get_data_transfer(this: &DragEventInit) -> Option; + #[cfg(feature = "DataTransfer")] + #[doc = "Change the `dataTransfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `DragEventInit`*"] + #[wasm_bindgen(method, setter = "dataTransfer")] + pub fn set_data_transfer(this: &DragEventInit, val: Option<&DataTransfer>); } impl DragEventInit { #[doc = "Construct a new `DragEventInit`."] @@ -19,470 +306,147 @@ impl DragEventInit { 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: `DragEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `altKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_alt_key()` instead."] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alt_key(val); self } - #[doc = "Change the `ctrlKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_ctrl_key()` instead."] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ctrl_key(val); self } - #[doc = "Change the `metaKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_meta_key()` instead."] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_meta_key(val); self } - #[doc = "Change the `modifierAltGraph` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_alt_graph()` instead."] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_alt_graph(val); self } - #[doc = "Change the `modifierCapsLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_caps_lock()` instead."] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_caps_lock(val); self } - #[doc = "Change the `modifierFn` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_fn()` instead."] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn(val); self } - #[doc = "Change the `modifierFnLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_fn_lock()` instead."] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn_lock(val); self } - #[doc = "Change the `modifierNumLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_num_lock()` instead."] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_num_lock(val); self } - #[doc = "Change the `modifierOS` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_os()` instead."] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_os(val); self } - #[doc = "Change the `modifierScrollLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_scroll_lock()` instead."] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_scroll_lock(val); self } - #[doc = "Change the `modifierSymbol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_symbol()` instead."] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol(val); self } - #[doc = "Change the `modifierSymbolLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_modifier_symbol_lock()` instead."] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol_lock(val); self } - #[doc = "Change the `shiftKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_shift_key()` instead."] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shift_key(val); self } - #[doc = "Change the `button` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_button()` instead."] pub fn button(&mut self, val: i16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_button(val); self } - #[doc = "Change the `buttons` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_buttons()` instead."] pub fn buttons(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buttons"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_buttons(val); self } - #[doc = "Change the `clientX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_client_x()` instead."] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_x(val); self } - #[doc = "Change the `clientY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_client_y()` instead."] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_y(val); self } - #[doc = "Change the `movementX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_movement_x()` instead."] pub fn movement_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_movement_x(val); self } - #[doc = "Change the `movementY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_movement_y()` instead."] pub fn movement_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_movement_y(val); self } #[cfg(feature = "EventTarget")] - #[doc = "Change the `relatedTarget` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `EventTarget`*"] + #[deprecated = "Use `set_related_target()` instead."] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_related_target(val); self } - #[doc = "Change the `screenX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_screen_x()` instead."] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_x(val); self } - #[doc = "Change the `screenY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] + #[deprecated = "Use `set_screen_y()` instead."] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_y(val); self } #[cfg(feature = "DataTransfer")] - #[doc = "Change the `dataTransfer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `DragEventInit`*"] + #[deprecated = "Use `set_data_transfer()` instead."] pub fn data_transfer(&mut self, val: Option<&DataTransfer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataTransfer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_data_transfer(val); self } } diff --git a/crates/web-sys/src/features/gen_DynamicsCompressorNode.rs b/crates/web-sys/src/features/gen_DynamicsCompressorNode.rs index 3a7c7d5f5d0..90454ea85c0 100644 --- a/crates/web-sys/src/features/gen_DynamicsCompressorNode.rs +++ b/crates/web-sys/src/features/gen_DynamicsCompressorNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_DynamicsCompressorOptions.rs b/crates/web-sys/src/features/gen_DynamicsCompressorOptions.rs index ff594822fc8..dfd8201207c 100644 --- a/crates/web-sys/src/features/gen_DynamicsCompressorOptions.rs +++ b/crates/web-sys/src/features/gen_DynamicsCompressorOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,92 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] pub type DynamicsCompressorOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &DynamicsCompressorOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &DynamicsCompressorOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &DynamicsCompressorOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &DynamicsCompressorOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation( + this: &DynamicsCompressorOptions, + ) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &DynamicsCompressorOptions, val: ChannelInterpretation); + #[doc = "Get the `attack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, getter = "attack")] + pub fn get_attack(this: &DynamicsCompressorOptions) -> Option; + #[doc = "Change the `attack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, setter = "attack")] + pub fn set_attack(this: &DynamicsCompressorOptions, val: f32); + #[doc = "Get the `knee` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, getter = "knee")] + pub fn get_knee(this: &DynamicsCompressorOptions) -> Option; + #[doc = "Change the `knee` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, setter = "knee")] + pub fn set_knee(this: &DynamicsCompressorOptions, val: f32); + #[doc = "Get the `ratio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, getter = "ratio")] + pub fn get_ratio(this: &DynamicsCompressorOptions) -> Option; + #[doc = "Change the `ratio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, setter = "ratio")] + pub fn set_ratio(this: &DynamicsCompressorOptions, val: f32); + #[doc = "Get the `release` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, getter = "release")] + pub fn get_release(this: &DynamicsCompressorOptions) -> Option; + #[doc = "Change the `release` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, setter = "release")] + pub fn set_release(this: &DynamicsCompressorOptions, val: f32); + #[doc = "Get the `threshold` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, getter = "threshold")] + pub fn get_threshold(this: &DynamicsCompressorOptions) -> Option; + #[doc = "Change the `threshold` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[wasm_bindgen(method, setter = "threshold")] + pub fn set_threshold(this: &DynamicsCompressorOptions, val: f32); } impl DynamicsCompressorOptions { #[doc = "Construct a new `DynamicsCompressorOptions`."] @@ -19,131 +106,46 @@ impl DynamicsCompressorOptions { 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: `DynamicsCompressorOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `DynamicsCompressorOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `DynamicsCompressorOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `attack` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[deprecated = "Use `set_attack()` instead."] pub fn attack(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("attack"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attack(val); self } - #[doc = "Change the `knee` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[deprecated = "Use `set_knee()` instead."] pub fn knee(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("knee"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_knee(val); self } - #[doc = "Change the `ratio` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[deprecated = "Use `set_ratio()` instead."] pub fn ratio(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ratio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ratio(val); self } - #[doc = "Change the `release` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[deprecated = "Use `set_release()` instead."] pub fn release(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("release"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_release(val); self } - #[doc = "Change the `threshold` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DynamicsCompressorOptions`*"] + #[deprecated = "Use `set_threshold()` instead."] pub fn threshold(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("threshold"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_threshold(val); self } } diff --git a/crates/web-sys/src/features/gen_EcKeyAlgorithm.rs b/crates/web-sys/src/features/gen_EcKeyAlgorithm.rs index 3d7aec6e1b5..98fe59c5dc6 100644 --- a/crates/web-sys/src/features/gen_EcKeyAlgorithm.rs +++ b/crates/web-sys/src/features/gen_EcKeyAlgorithm.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] pub type EcKeyAlgorithm; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &EcKeyAlgorithm) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &EcKeyAlgorithm, val: &str); + #[doc = "Get the `namedCurve` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] + #[wasm_bindgen(method, getter = "namedCurve")] + pub fn get_named_curve(this: &EcKeyAlgorithm) -> ::alloc::string::String; + #[doc = "Change the `namedCurve` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] + #[wasm_bindgen(method, setter = "namedCurve")] + pub fn set_named_curve(this: &EcKeyAlgorithm, val: &str); } impl EcKeyAlgorithm { #[doc = "Construct a new `EcKeyAlgorithm`."] @@ -17,38 +38,18 @@ impl EcKeyAlgorithm { pub fn new(name: &str, named_curve: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.named_curve(named_curve); + ret.set_name(name); + ret.set_named_curve(named_curve); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `namedCurve` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"] + #[deprecated = "Use `set_named_curve()` instead."] pub fn named_curve(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namedCurve"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_named_curve(val); self } } diff --git a/crates/web-sys/src/features/gen_EcKeyGenParams.rs b/crates/web-sys/src/features/gen_EcKeyGenParams.rs index 8b1df4070db..d36d03e69fe 100644 --- a/crates/web-sys/src/features/gen_EcKeyGenParams.rs +++ b/crates/web-sys/src/features/gen_EcKeyGenParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] pub type EcKeyGenParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &EcKeyGenParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &EcKeyGenParams, val: &str); + #[doc = "Get the `namedCurve` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] + #[wasm_bindgen(method, getter = "namedCurve")] + pub fn get_named_curve(this: &EcKeyGenParams) -> ::alloc::string::String; + #[doc = "Change the `namedCurve` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] + #[wasm_bindgen(method, setter = "namedCurve")] + pub fn set_named_curve(this: &EcKeyGenParams, val: &str); } impl EcKeyGenParams { #[doc = "Construct a new `EcKeyGenParams`."] @@ -17,38 +38,18 @@ impl EcKeyGenParams { pub fn new(name: &str, named_curve: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.named_curve(named_curve); + ret.set_name(name); + ret.set_named_curve(named_curve); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `namedCurve` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcKeyGenParams`*"] + #[deprecated = "Use `set_named_curve()` instead."] pub fn named_curve(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namedCurve"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_named_curve(val); self } } diff --git a/crates/web-sys/src/features/gen_EcKeyImportParams.rs b/crates/web-sys/src/features/gen_EcKeyImportParams.rs index b6ff16b014a..b18737069f8 100644 --- a/crates/web-sys/src/features/gen_EcKeyImportParams.rs +++ b/crates/web-sys/src/features/gen_EcKeyImportParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] pub type EcKeyImportParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &EcKeyImportParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &EcKeyImportParams, val: &str); + #[doc = "Get the `namedCurve` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] + #[wasm_bindgen(method, getter = "namedCurve")] + pub fn get_named_curve(this: &EcKeyImportParams) -> Option<::alloc::string::String>; + #[doc = "Change the `namedCurve` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] + #[wasm_bindgen(method, setter = "namedCurve")] + pub fn set_named_curve(this: &EcKeyImportParams, val: &str); } impl EcKeyImportParams { #[doc = "Construct a new `EcKeyImportParams`."] @@ -17,37 +38,17 @@ impl EcKeyImportParams { 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.set_name(name); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `namedCurve` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcKeyImportParams`*"] + #[deprecated = "Use `set_named_curve()` instead."] pub fn named_curve(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namedCurve"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_named_curve(val); self } } diff --git a/crates/web-sys/src/features/gen_EcdhKeyDeriveParams.rs b/crates/web-sys/src/features/gen_EcdhKeyDeriveParams.rs index 0303bb31949..71e9da9d8eb 100644 --- a/crates/web-sys/src/features/gen_EcdhKeyDeriveParams.rs +++ b/crates/web-sys/src/features/gen_EcdhKeyDeriveParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcdhKeyDeriveParams`*"] pub type EcdhKeyDeriveParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcdhKeyDeriveParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &EcdhKeyDeriveParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcdhKeyDeriveParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &EcdhKeyDeriveParams, val: &str); + #[cfg(feature = "CryptoKey")] + #[doc = "Get the `public` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `EcdhKeyDeriveParams`*"] + #[wasm_bindgen(method, getter = "public")] + pub fn get_public(this: &EcdhKeyDeriveParams) -> CryptoKey; + #[cfg(feature = "CryptoKey")] + #[doc = "Change the `public` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `EcdhKeyDeriveParams`*"] + #[wasm_bindgen(method, setter = "public")] + pub fn set_public(this: &EcdhKeyDeriveParams, val: &CryptoKey); } impl EcdhKeyDeriveParams { #[cfg(feature = "CryptoKey")] @@ -18,36 +41,19 @@ impl EcdhKeyDeriveParams { pub fn new(name: &str, public: &CryptoKey) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.public(public); + ret.set_name(name); + ret.set_public(public); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcdhKeyDeriveParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } #[cfg(feature = "CryptoKey")] - #[doc = "Change the `public` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `EcdhKeyDeriveParams`*"] + #[deprecated = "Use `set_public()` instead."] pub fn public(&mut self, val: &CryptoKey) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("public"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_public(val); self } } diff --git a/crates/web-sys/src/features/gen_EcdsaParams.rs b/crates/web-sys/src/features/gen_EcdsaParams.rs index a54f84b7783..f1f3b22a7ad 100644 --- a/crates/web-sys/src/features/gen_EcdsaParams.rs +++ b/crates/web-sys/src/features/gen_EcdsaParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] pub type EcdsaParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &EcdsaParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &EcdsaParams, val: &str); + #[doc = "Get the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] + #[wasm_bindgen(method, getter = "hash")] + pub fn get_hash(this: &EcdsaParams) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] + #[wasm_bindgen(method, setter = "hash")] + pub fn set_hash(this: &EcdsaParams, val: &::wasm_bindgen::JsValue); } impl EcdsaParams { #[doc = "Construct a new `EcdsaParams`."] @@ -17,34 +38,18 @@ impl EcdsaParams { pub fn new(name: &str, hash: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.hash(hash); + ret.set_name(name); + ret.set_hash(hash); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EcdsaParams`*"] + #[deprecated = "Use `set_hash()` instead."] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash(val); self } } diff --git a/crates/web-sys/src/features/gen_EffectTiming.rs b/crates/web-sys/src/features/gen_EffectTiming.rs index 07e8deeeb20..2db703049ff 100644 --- a/crates/web-sys/src/features/gen_EffectTiming.rs +++ b/crates/web-sys/src/features/gen_EffectTiming.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,90 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] pub type EffectTiming; + #[doc = "Get the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, getter = "delay")] + pub fn get_delay(this: &EffectTiming) -> Option; + #[doc = "Change the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, setter = "delay")] + pub fn set_delay(this: &EffectTiming, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[doc = "Get the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`, `PlaybackDirection`*"] + #[wasm_bindgen(method, getter = "direction")] + pub fn get_direction(this: &EffectTiming) -> Option; + #[cfg(feature = "PlaybackDirection")] + #[doc = "Change the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`, `PlaybackDirection`*"] + #[wasm_bindgen(method, setter = "direction")] + pub fn set_direction(this: &EffectTiming, val: PlaybackDirection); + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &EffectTiming) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &EffectTiming, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &EffectTiming) -> Option<::alloc::string::String>; + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &EffectTiming, val: &str); + #[doc = "Get the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, getter = "endDelay")] + pub fn get_end_delay(this: &EffectTiming) -> Option; + #[doc = "Change the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, setter = "endDelay")] + pub fn set_end_delay(this: &EffectTiming, val: f64); + #[cfg(feature = "FillMode")] + #[doc = "Get the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`, `FillMode`*"] + #[wasm_bindgen(method, getter = "fill")] + pub fn get_fill(this: &EffectTiming) -> Option; + #[cfg(feature = "FillMode")] + #[doc = "Change the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`, `FillMode`*"] + #[wasm_bindgen(method, setter = "fill")] + pub fn set_fill(this: &EffectTiming, val: FillMode); + #[doc = "Get the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, getter = "iterationStart")] + pub fn get_iteration_start(this: &EffectTiming) -> Option; + #[doc = "Change the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, setter = "iterationStart")] + pub fn set_iteration_start(this: &EffectTiming, val: f64); + #[doc = "Get the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, getter = "iterations")] + pub fn get_iterations(this: &EffectTiming) -> Option; + #[doc = "Change the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[wasm_bindgen(method, setter = "iterations")] + pub fn set_iterations(this: &EffectTiming, val: f64); } impl EffectTiming { #[doc = "Construct a new `EffectTiming`."] @@ -19,131 +104,46 @@ impl EffectTiming { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `delay` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[deprecated = "Use `set_delay()` instead."] pub fn delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delay(val); self } #[cfg(feature = "PlaybackDirection")] - #[doc = "Change the `direction` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EffectTiming`, `PlaybackDirection`*"] + #[deprecated = "Use `set_direction()` instead."] pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_direction(val); self } - #[doc = "Change the `duration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[deprecated = "Use `set_duration()` instead."] pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_duration(val); self } - #[doc = "Change the `easing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[deprecated = "Use `set_easing()` instead."] 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.set_easing(val); self } - #[doc = "Change the `endDelay` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[deprecated = "Use `set_end_delay()` instead."] pub fn end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_end_delay(val); self } #[cfg(feature = "FillMode")] - #[doc = "Change the `fill` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EffectTiming`, `FillMode`*"] + #[deprecated = "Use `set_fill()` instead."] pub fn fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fill(val); self } - #[doc = "Change the `iterationStart` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[deprecated = "Use `set_iteration_start()` instead."] pub fn iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iteration_start(val); self } - #[doc = "Change the `iterations` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EffectTiming`*"] + #[deprecated = "Use `set_iterations()` instead."] pub fn iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iterations(val); self } } diff --git a/crates/web-sys/src/features/gen_Element.rs b/crates/web-sys/src/features/gen_Element.rs index 011b65d28b7..afd3417789e 100644 --- a/crates/web-sys/src/features/gen_Element.rs +++ b/crates/web-sys/src/features/gen_Element.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,35 +18,35 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/namespaceURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn namespace_uri(this: &Element) -> Option; + pub fn namespace_uri(this: &Element) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "Element" , 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/Element/prefix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn prefix(this: &Element) -> Option; + pub fn prefix(this: &Element) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "Element" , 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/Element/localName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn local_name(this: &Element) -> String; + pub fn local_name(this: &Element) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Element" , js_name = tagName)] #[doc = "Getter for the `tagName` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn tag_name(this: &Element) -> String; + pub fn tag_name(this: &Element) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Element" , 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/Element/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn id(this: &Element) -> String; + pub fn id(this: &Element) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Element" , js_name = id)] #[doc = "Setter for the `id` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/className)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn class_name(this: &Element) -> String; + pub fn class_name(this: &Element) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Element" , js_name = className)] #[doc = "Setter for the `className` field of this object."] #[doc = ""] @@ -159,7 +160,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn inner_html(this: &Element) -> String; + pub fn inner_html(this: &Element) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Element" , js_name = innerHTML)] #[doc = "Setter for the `innerHTML` field of this object."] #[doc = ""] @@ -173,7 +174,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn outer_html(this: &Element) -> String; + pub fn outer_html(this: &Element) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Element" , js_name = outerHTML)] #[doc = "Setter for the `outerHTML` field of this object."] #[doc = ""] @@ -203,7 +204,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/slot)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn slot(this: &Element) -> String; + pub fn slot(this: &Element) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "Element" , js_name = slot)] #[doc = "Setter for the `slot` field of this object."] #[doc = ""] @@ -278,7 +279,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] - pub fn get_attribute(this: &Element, name: &str) -> Option; + pub fn get_attribute(this: &Element, name: &str) -> Option<::alloc::string::String>; # [wasm_bindgen (method , structural , js_class = "Element" , js_name = getAttributeNS)] #[doc = "The `getAttributeNS()` method."] #[doc = ""] @@ -289,7 +290,7 @@ extern "C" { this: &Element, namespace: Option<&str>, local_name: &str, - ) -> Option; + ) -> Option<::alloc::string::String>; # [wasm_bindgen (method , structural , js_class = "Element" , js_name = getAttributeNames)] #[doc = "The `getAttributeNames()` method."] #[doc = ""] @@ -662,6 +663,76 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`*"] pub fn webkit_matches_selector(this: &Element, selector: &str) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Animation")] + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = animate)] + #[doc = "The `animate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Animation`, `Element`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn animate(this: &Element, keyframes: Option<&::js_sys::Object>) -> Animation; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Animation")] + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = animate)] + #[doc = "The `animate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Animation`, `Element`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn animate_with_f64( + this: &Element, + keyframes: Option<&::js_sys::Object>, + options: f64, + ) -> Animation; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "Animation", feature = "KeyframeAnimationOptions",))] + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = animate)] + #[doc = "The `animate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/animate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Animation`, `Element`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn animate_with_keyframe_animation_options( + this: &Element, + keyframes: Option<&::js_sys::Object>, + options: &KeyframeAnimationOptions, + ) -> Animation; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = getAnimations)] + #[doc = "The `getAnimations()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_animations(this: &Element) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GetAnimationsOptions")] + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = getAnimations)] + #[doc = "The `getAnimations()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `GetAnimationsOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_animations_with_options( + this: &Element, + options: &GetAnimationsOptions, + ) -> ::js_sys::Array; # [wasm_bindgen (catch , method , structural , variadic , js_class = "Element" , js_name = after)] #[doc = "The `after()` method."] #[doc = ""] @@ -1949,4 +2020,195 @@ extern "C" { nodes_6: &str, nodes_7: &str, ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , variadic , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node(this: &Element, nodes: &::js_sys::Array); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node_0(this: &Element); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node_1(this: &Element, nodes_1: &Node); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node_2(this: &Element, nodes_1: &Node, nodes_2: &Node); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node_3( + this: &Element, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node_4( + this: &Element, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node_5( + this: &Element, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node_6( + this: &Element, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + nodes_6: &Node, + ); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_node_7( + this: &Element, + nodes_1: &Node, + nodes_2: &Node, + nodes_3: &Node, + nodes_4: &Node, + nodes_5: &Node, + nodes_6: &Node, + nodes_7: &Node, + ); + # [wasm_bindgen (method , structural , variadic , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str(this: &Element, nodes: &::js_sys::Array); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str_0(this: &Element); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str_1(this: &Element, nodes_1: &str); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str_2(this: &Element, nodes_1: &str, nodes_2: &str); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str_3(this: &Element, nodes_1: &str, nodes_2: &str, nodes_3: &str); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str_4( + this: &Element, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + ); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str_5( + this: &Element, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + ); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str_6( + this: &Element, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + nodes_6: &str, + ); + # [wasm_bindgen (method , structural , js_class = "Element" , js_name = replaceChildren)] + #[doc = "The `replaceChildren()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`*"] + pub fn replace_children_with_str_7( + this: &Element, + nodes_1: &str, + nodes_2: &str, + nodes_3: &str, + nodes_4: &str, + nodes_5: &str, + nodes_6: &str, + nodes_7: &str, + ); } diff --git a/crates/web-sys/src/features/gen_ElementCreationOptions.rs b/crates/web-sys/src/features/gen_ElementCreationOptions.rs index d12dd041e90..479004ff3ab 100644 --- a/crates/web-sys/src/features/gen_ElementCreationOptions.rs +++ b/crates/web-sys/src/features/gen_ElementCreationOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] pub type ElementCreationOptions; + #[doc = "Get the `is` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] + #[wasm_bindgen(method, getter = "is")] + pub fn get_is(this: &ElementCreationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `is` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] + #[wasm_bindgen(method, setter = "is")] + pub fn set_is(this: &ElementCreationOptions, val: &str); + #[doc = "Get the `pseudo` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] + #[wasm_bindgen(method, getter = "pseudo")] + pub fn get_pseudo(this: &ElementCreationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `pseudo` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] + #[wasm_bindgen(method, setter = "pseudo")] + pub fn set_pseudo(this: &ElementCreationOptions, val: &str); } impl ElementCreationOptions { #[doc = "Construct a new `ElementCreationOptions`."] @@ -19,31 +40,14 @@ impl ElementCreationOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `is` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] + #[deprecated = "Use `set_is()` instead."] pub fn is(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("is"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is(val); self } - #[doc = "Change the `pseudo` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ElementCreationOptions`*"] + #[deprecated = "Use `set_pseudo()` instead."] pub fn pseudo(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pseudo"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pseudo(val); self } } diff --git a/crates/web-sys/src/features/gen_ElementDefinitionOptions.rs b/crates/web-sys/src/features/gen_ElementDefinitionOptions.rs index 4b9492b3b88..3e043c61657 100644 --- a/crates/web-sys/src/features/gen_ElementDefinitionOptions.rs +++ b/crates/web-sys/src/features/gen_ElementDefinitionOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ElementDefinitionOptions`*"] pub type ElementDefinitionOptions; + #[doc = "Get the `extends` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ElementDefinitionOptions`*"] + #[wasm_bindgen(method, getter = "extends")] + pub fn get_extends(this: &ElementDefinitionOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `extends` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ElementDefinitionOptions`*"] + #[wasm_bindgen(method, setter = "extends")] + pub fn set_extends(this: &ElementDefinitionOptions, val: &str); } impl ElementDefinitionOptions { #[doc = "Construct a new `ElementDefinitionOptions`."] @@ -19,21 +30,9 @@ impl ElementDefinitionOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `extends` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ElementDefinitionOptions`*"] + #[deprecated = "Use `set_extends()` instead."] pub fn extends(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("extends"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_extends(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedAudioChunk.rs b/crates/web-sys/src/features/gen_EncodedAudioChunk.rs index 93a9cd7ca06..12f42400716 100644 --- a/crates/web-sys/src/features/gen_EncodedAudioChunk.rs +++ b/crates/web-sys/src/features/gen_EncodedAudioChunk.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(init: &EncodedAudioChunkInit) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)] + # [wasm_bindgen (catch , method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)] #[doc = "The `copyTo()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedAudioChunk/copyTo)"] @@ -82,9 +83,12 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn copy_to_with_buffer_source(this: &EncodedAudioChunk, destination: &::js_sys::Object); + pub fn copy_to_with_buffer_source( + this: &EncodedAudioChunk, + destination: &::js_sys::Object, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)] + # [wasm_bindgen (catch , method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)] #[doc = "The `copyTo()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedAudioChunk/copyTo)"] @@ -93,5 +97,22 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn copy_to_with_u8_array(this: &EncodedAudioChunk, destination: &mut [u8]); + pub fn copy_to_with_u8_slice( + this: &EncodedAudioChunk, + destination: &mut [u8], + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)] + #[doc = "The `copyTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedAudioChunk/copyTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunk`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_to_with_u8_array( + this: &EncodedAudioChunk, + destination: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs b/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs index c95daf55fc6..f0bc1d16885 100644 --- a/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs +++ b/crates/web-sys/src/features/gen_EncodedAudioChunkInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,24 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type EncodedAudioChunkInit; -} -#[cfg(web_sys_unstable_apis)] -impl EncodedAudioChunkInit { - #[cfg(feature = "EncodedAudioChunkType")] - #[doc = "Construct a new `EncodedAudioChunkInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `data` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunkInit`, `EncodedAudioChunkType`*"] + #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunkInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(data: &::js_sys::Object, timestamp: f64, type_: EncodedAudioChunkType) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.data(data); - ret.timestamp(timestamp); - ret.type_(type_); - ret - } + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &EncodedAudioChunkInit) -> ::js_sys::Object; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `data` field of this object."] #[doc = ""] @@ -38,16 +30,17 @@ impl EncodedAudioChunkInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn data(&mut self, val: &::js_sys::Object) -> &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 - } + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &EncodedAudioChunkInit, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunkInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &EncodedAudioChunkInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `duration` field of this object."] #[doc = ""] @@ -55,20 +48,17 @@ impl EncodedAudioChunkInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &EncodedAudioChunkInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunkInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &EncodedAudioChunkInit) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `timestamp` field of this object."] #[doc = ""] @@ -76,20 +66,18 @@ impl EncodedAudioChunkInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &EncodedAudioChunkInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "EncodedAudioChunkType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunkInit`, `EncodedAudioChunkType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &EncodedAudioChunkInit) -> EncodedAudioChunkType; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "EncodedAudioChunkType")] #[doc = "Change the `type` field of this object."] @@ -98,14 +86,49 @@ impl EncodedAudioChunkInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &EncodedAudioChunkInit, val: EncodedAudioChunkType); +} +#[cfg(web_sys_unstable_apis)] +impl EncodedAudioChunkInit { + #[cfg(feature = "EncodedAudioChunkType")] + #[doc = "Construct a new `EncodedAudioChunkInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunkInit`, `EncodedAudioChunkType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(data: &::js_sys::Object, timestamp: f64, type_: EncodedAudioChunkType) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_data(data); + ret.set_timestamp(timestamp); + ret.set_type(type_); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data()` instead."] + pub fn data(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_duration()` instead."] + pub fn duration(&mut self, val: f64) -> &mut Self { + self.set_duration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "EncodedAudioChunkType")] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: EncodedAudioChunkType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedAudioChunkMetadata.rs b/crates/web-sys/src/features/gen_EncodedAudioChunkMetadata.rs index 6a43b98aa13..b90551f9051 100644 --- a/crates/web-sys/src/features/gen_EncodedAudioChunkMetadata.rs +++ b/crates/web-sys/src/features/gen_EncodedAudioChunkMetadata.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,26 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type EncodedAudioChunkMetadata; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioDecoderConfig")] + #[doc = "Get the `decoderConfig` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`, `EncodedAudioChunkMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "decoderConfig")] + pub fn get_decoder_config(this: &EncodedAudioChunkMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AudioDecoderConfig")] + #[doc = "Change the `decoderConfig` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`, `EncodedAudioChunkMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "decoderConfig")] + pub fn set_decoder_config(this: &EncodedAudioChunkMetadata, val: &AudioDecoderConfig); } #[cfg(web_sys_unstable_apis)] impl EncodedAudioChunkMetadata { @@ -29,24 +50,9 @@ impl EncodedAudioChunkMetadata { } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AudioDecoderConfig")] - #[doc = "Change the `decoderConfig` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`, `EncodedAudioChunkMetadata`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_decoder_config()` instead."] pub fn decoder_config(&mut self, val: &AudioDecoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("decoderConfig"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_decoder_config(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedAudioChunkType.rs b/crates/web-sys/src/features/gen_EncodedAudioChunkType.rs index 5a977aeba19..42f4dcc55d0 100644 --- a/crates/web-sys/src/features/gen_EncodedAudioChunkType.rs +++ b/crates/web-sys/src/features/gen_EncodedAudioChunkType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_EncodedVideoChunk.rs b/crates/web-sys/src/features/gen_EncodedVideoChunk.rs index a6590c850b0..b4372e5716c 100644 --- a/crates/web-sys/src/features/gen_EncodedVideoChunk.rs +++ b/crates/web-sys/src/features/gen_EncodedVideoChunk.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(init: &EncodedVideoChunkInit) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)] + # [wasm_bindgen (catch , method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)] #[doc = "The `copyTo()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedVideoChunk/copyTo)"] @@ -82,9 +83,12 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn copy_to_with_buffer_source(this: &EncodedVideoChunk, destination: &::js_sys::Object); + pub fn copy_to_with_buffer_source( + this: &EncodedVideoChunk, + destination: &::js_sys::Object, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)] + # [wasm_bindgen (catch , method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)] #[doc = "The `copyTo()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedVideoChunk/copyTo)"] @@ -93,5 +97,22 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn copy_to_with_u8_array(this: &EncodedVideoChunk, destination: &mut [u8]); + pub fn copy_to_with_u8_slice( + this: &EncodedVideoChunk, + destination: &mut [u8], + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)] + #[doc = "The `copyTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedVideoChunk/copyTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunk`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_to_with_u8_array( + this: &EncodedVideoChunk, + destination: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs b/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs index 6491aefd727..54372df9910 100644 --- a/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs +++ b/crates/web-sys/src/features/gen_EncodedVideoChunkInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,24 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type EncodedVideoChunkInit; -} -#[cfg(web_sys_unstable_apis)] -impl EncodedVideoChunkInit { - #[cfg(feature = "EncodedVideoChunkType")] - #[doc = "Construct a new `EncodedVideoChunkInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `data` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`, `EncodedVideoChunkType`*"] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(data: &::js_sys::Object, timestamp: f64, type_: EncodedVideoChunkType) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.data(data); - ret.timestamp(timestamp); - ret.type_(type_); - ret - } + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &EncodedVideoChunkInit) -> ::js_sys::Object; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `data` field of this object."] #[doc = ""] @@ -38,16 +30,17 @@ impl EncodedVideoChunkInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn data(&mut self, val: &::js_sys::Object) -> &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 - } + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &EncodedVideoChunkInit, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &EncodedVideoChunkInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `duration` field of this object."] #[doc = ""] @@ -55,20 +48,17 @@ impl EncodedVideoChunkInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &EncodedVideoChunkInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &EncodedVideoChunkInit) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `timestamp` field of this object."] #[doc = ""] @@ -76,20 +66,18 @@ impl EncodedVideoChunkInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &EncodedVideoChunkInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "EncodedVideoChunkType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`, `EncodedVideoChunkType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &EncodedVideoChunkInit) -> EncodedVideoChunkType; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "EncodedVideoChunkType")] #[doc = "Change the `type` field of this object."] @@ -98,14 +86,49 @@ impl EncodedVideoChunkInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &EncodedVideoChunkInit, val: EncodedVideoChunkType); +} +#[cfg(web_sys_unstable_apis)] +impl EncodedVideoChunkInit { + #[cfg(feature = "EncodedVideoChunkType")] + #[doc = "Construct a new `EncodedVideoChunkInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`, `EncodedVideoChunkType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(data: &::js_sys::Object, timestamp: f64, type_: EncodedVideoChunkType) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_data(data); + ret.set_timestamp(timestamp); + ret.set_type(type_); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data()` instead."] + pub fn data(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_duration()` instead."] + pub fn duration(&mut self, val: f64) -> &mut Self { + self.set_duration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "EncodedVideoChunkType")] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: EncodedVideoChunkType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedVideoChunkMetadata.rs b/crates/web-sys/src/features/gen_EncodedVideoChunkMetadata.rs index 9d0e1415268..640832b426b 100644 --- a/crates/web-sys/src/features/gen_EncodedVideoChunkMetadata.rs +++ b/crates/web-sys/src/features/gen_EncodedVideoChunkMetadata.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type EncodedVideoChunkMetadata; -} -#[cfg(web_sys_unstable_apis)] -impl EncodedVideoChunkMetadata { - #[doc = "Construct a new `EncodedVideoChunkMetadata`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `alphaSideData` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkMetadata`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "alphaSideData")] + pub fn get_alpha_side_data(this: &EncodedVideoChunkMetadata) -> Option<::js_sys::Object>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `alphaSideData` field of this object."] #[doc = ""] @@ -34,20 +30,18 @@ impl EncodedVideoChunkMetadata { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha_side_data(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("alphaSideData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alphaSideData")] + pub fn set_alpha_side_data(this: &EncodedVideoChunkMetadata, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoDecoderConfig")] + #[doc = "Get the `decoderConfig` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkMetadata`, `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "decoderConfig")] + pub fn get_decoder_config(this: &EncodedVideoChunkMetadata) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoDecoderConfig")] #[doc = "Change the `decoderConfig` field of this object."] @@ -56,20 +50,18 @@ impl EncodedVideoChunkMetadata { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn decoder_config(&mut self, val: &VideoDecoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("decoderConfig"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "decoderConfig")] + pub fn set_decoder_config(this: &EncodedVideoChunkMetadata, val: &VideoDecoderConfig); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SvcOutputMetadata")] + #[doc = "Get the `svc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkMetadata`, `SvcOutputMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "svc")] + pub fn get_svc(this: &EncodedVideoChunkMetadata) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "SvcOutputMetadata")] #[doc = "Change the `svc` field of this object."] @@ -78,14 +70,40 @@ impl EncodedVideoChunkMetadata { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "svc")] + pub fn set_svc(this: &EncodedVideoChunkMetadata, val: &SvcOutputMetadata); +} +#[cfg(web_sys_unstable_apis)] +impl EncodedVideoChunkMetadata { + #[doc = "Construct a new `EncodedVideoChunkMetadata`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_alpha_side_data()` instead."] + pub fn alpha_side_data(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_alpha_side_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoDecoderConfig")] + #[deprecated = "Use `set_decoder_config()` instead."] + pub fn decoder_config(&mut self, val: &VideoDecoderConfig) -> &mut Self { + self.set_decoder_config(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SvcOutputMetadata")] + #[deprecated = "Use `set_svc()` instead."] pub fn svc(&mut self, val: &SvcOutputMetadata) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("svc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_svc(val); self } } diff --git a/crates/web-sys/src/features/gen_EncodedVideoChunkType.rs b/crates/web-sys/src/features/gen_EncodedVideoChunkType.rs index 63537be608c..64ce2b89ee3 100644 --- a/crates/web-sys/src/features/gen_EncodedVideoChunkType.rs +++ b/crates/web-sys/src/features/gen_EncodedVideoChunkType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_EndingTypes.rs b/crates/web-sys/src/features/gen_EndingTypes.rs index 476f22965e7..0898d8f99a6 100644 --- a/crates/web-sys/src/features/gen_EndingTypes.rs +++ b/crates/web-sys/src/features/gen_EndingTypes.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `EndingTypes` enum."] diff --git a/crates/web-sys/src/features/gen_ErrorCallback.rs b/crates/web-sys/src/features/gen_ErrorCallback.rs index 067bd08050b..7ca32ff496f 100644 --- a/crates/web-sys/src/features/gen_ErrorCallback.rs +++ b/crates/web-sys/src/features/gen_ErrorCallback.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorCallback`*"] pub type ErrorCallback; + #[doc = "Get the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorCallback`*"] + #[wasm_bindgen(method, getter = "handleEvent")] + pub fn get_handle_event(this: &ErrorCallback) -> Option<::js_sys::Function>; + #[doc = "Change the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorCallback`*"] + #[wasm_bindgen(method, setter = "handleEvent")] + pub fn set_handle_event(this: &ErrorCallback, val: &::js_sys::Function); } impl ErrorCallback { #[doc = "Construct a new `ErrorCallback`."] @@ -19,21 +30,9 @@ impl ErrorCallback { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `handleEvent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ErrorCallback`*"] + #[deprecated = "Use `set_handle_event()` instead."] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_handle_event(val); self } } diff --git a/crates/web-sys/src/features/gen_ErrorEvent.rs b/crates/web-sys/src/features/gen_ErrorEvent.rs index b3bd7fb1efe..9e6f3247952 100644 --- a/crates/web-sys/src/features/gen_ErrorEvent.rs +++ b/crates/web-sys/src/features/gen_ErrorEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEvent`*"] - pub fn message(this: &ErrorEvent) -> String; + pub fn message(this: &ErrorEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "ErrorEvent" , js_name = filename)] #[doc = "Getter for the `filename` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent/filename)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEvent`*"] - pub fn filename(this: &ErrorEvent) -> String; + pub fn filename(this: &ErrorEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "ErrorEvent" , js_name = lineno)] #[doc = "Getter for the `lineno` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_ErrorEventInit.rs b/crates/web-sys/src/features/gen_ErrorEventInit.rs index cc2d881ae07..b29df968ebf 100644 --- a/crates/web-sys/src/features/gen_ErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_ErrorEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,86 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] pub type ErrorEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ErrorEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ErrorEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ErrorEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ErrorEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ErrorEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ErrorEventInit, val: bool); + #[doc = "Get the `colno` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, getter = "colno")] + pub fn get_colno(this: &ErrorEventInit) -> Option; + #[doc = "Change the `colno` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, setter = "colno")] + pub fn set_colno(this: &ErrorEventInit, val: u32); + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &ErrorEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &ErrorEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `filename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, getter = "filename")] + pub fn get_filename(this: &ErrorEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `filename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, setter = "filename")] + pub fn set_filename(this: &ErrorEventInit, val: &str); + #[doc = "Get the `lineno` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, getter = "lineno")] + pub fn get_lineno(this: &ErrorEventInit) -> Option; + #[doc = "Change the `lineno` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, setter = "lineno")] + pub fn set_lineno(this: &ErrorEventInit, val: u32); + #[doc = "Get the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, getter = "message")] + pub fn get_message(this: &ErrorEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[wasm_bindgen(method, setter = "message")] + pub fn set_message(this: &ErrorEventInit, val: &str); } impl ErrorEventInit { #[doc = "Construct a new `ErrorEventInit`."] @@ -19,129 +100,44 @@ impl ErrorEventInit { 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: `ErrorEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `colno` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[deprecated = "Use `set_colno()` instead."] pub fn colno(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("colno"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_colno(val); self } - #[doc = "Change the `error` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } - #[doc = "Change the `filename` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[deprecated = "Use `set_filename()` instead."] pub fn filename(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_filename(val); self } - #[doc = "Change the `lineno` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[deprecated = "Use `set_lineno()` instead."] pub fn lineno(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("lineno"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_lineno(val); self } - #[doc = "Change the `message` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ErrorEventInit`*"] + #[deprecated = "Use `set_message()` instead."] pub fn message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_message(val); self } } diff --git a/crates/web-sys/src/features/gen_Event.rs b/crates/web-sys/src/features/gen_Event.rs index bb3c3cffcb7..b3ede1b6707 100644 --- a/crates/web-sys/src/features/gen_Event.rs +++ b/crates/web-sys/src/features/gen_Event.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Event/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Event`*"] - pub fn type_(this: &Event) -> String; + pub fn type_(this: &Event) -> ::alloc::string::String; #[cfg(feature = "EventTarget")] # [wasm_bindgen (structural , method , getter , js_class = "Event" , js_name = target)] #[doc = "Getter for the `target` field of this object."] diff --git a/crates/web-sys/src/features/gen_EventInit.rs b/crates/web-sys/src/features/gen_EventInit.rs index 6b44b167bcb..218f4c21e47 100644 --- a/crates/web-sys/src/features/gen_EventInit.rs +++ b/crates/web-sys/src/features/gen_EventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] pub type EventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &EventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &EventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &EventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &EventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &EventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &EventInit, val: bool); } impl EventInit { #[doc = "Construct a new `EventInit`."] @@ -19,55 +50,19 @@ impl EventInit { 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: `EventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } } diff --git a/crates/web-sys/src/features/gen_EventListener.rs b/crates/web-sys/src/features/gen_EventListener.rs index af46e7ad6c4..20b2ba07407 100644 --- a/crates/web-sys/src/features/gen_EventListener.rs +++ b/crates/web-sys/src/features/gen_EventListener.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventListener`*"] pub type EventListener; + #[doc = "Get the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventListener`*"] + #[wasm_bindgen(method, getter = "handleEvent")] + pub fn get_handle_event(this: &EventListener) -> Option<::js_sys::Function>; + #[doc = "Change the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventListener`*"] + #[wasm_bindgen(method, setter = "handleEvent")] + pub fn set_handle_event(this: &EventListener, val: &::js_sys::Function); } impl EventListener { #[doc = "Construct a new `EventListener`."] @@ -19,21 +30,9 @@ impl EventListener { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `handleEvent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventListener`*"] + #[deprecated = "Use `set_handle_event()` instead."] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_handle_event(val); self } } diff --git a/crates/web-sys/src/features/gen_EventListenerOptions.rs b/crates/web-sys/src/features/gen_EventListenerOptions.rs index 9162ee8d2e2..521069c5617 100644 --- a/crates/web-sys/src/features/gen_EventListenerOptions.rs +++ b/crates/web-sys/src/features/gen_EventListenerOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventListenerOptions`*"] pub type EventListenerOptions; + #[doc = "Get the `capture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventListenerOptions`*"] + #[wasm_bindgen(method, getter = "capture")] + pub fn get_capture(this: &EventListenerOptions) -> Option; + #[doc = "Change the `capture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventListenerOptions`*"] + #[wasm_bindgen(method, setter = "capture")] + pub fn set_capture(this: &EventListenerOptions, val: bool); } impl EventListenerOptions { #[doc = "Construct a new `EventListenerOptions`."] @@ -19,21 +30,9 @@ impl EventListenerOptions { 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: `EventListenerOptions`*"] + #[deprecated = "Use `set_capture()` instead."] 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.set_capture(val); self } } diff --git a/crates/web-sys/src/features/gen_EventModifierInit.rs b/crates/web-sys/src/features/gen_EventModifierInit.rs index 02c06addcbe..1e19e648c12 100644 --- a/crates/web-sys/src/features/gen_EventModifierInit.rs +++ b/crates/web-sys/src/features/gen_EventModifierInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,188 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] pub type EventModifierInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &EventModifierInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &EventModifierInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &EventModifierInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &EventModifierInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &EventModifierInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &EventModifierInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &EventModifierInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &EventModifierInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &EventModifierInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &EventModifierInit, val: Option<&Window>); + #[doc = "Get the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "altKey")] + pub fn get_alt_key(this: &EventModifierInit) -> Option; + #[doc = "Change the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "altKey")] + pub fn set_alt_key(this: &EventModifierInit, val: bool); + #[doc = "Get the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "ctrlKey")] + pub fn get_ctrl_key(this: &EventModifierInit) -> Option; + #[doc = "Change the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "ctrlKey")] + pub fn set_ctrl_key(this: &EventModifierInit, val: bool); + #[doc = "Get the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "metaKey")] + pub fn get_meta_key(this: &EventModifierInit) -> Option; + #[doc = "Change the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "metaKey")] + pub fn set_meta_key(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierAltGraph")] + pub fn get_modifier_alt_graph(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierAltGraph")] + pub fn set_modifier_alt_graph(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierCapsLock")] + pub fn get_modifier_caps_lock(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierCapsLock")] + pub fn set_modifier_caps_lock(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierFn")] + pub fn get_modifier_fn(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierFn")] + pub fn set_modifier_fn(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierFnLock")] + pub fn get_modifier_fn_lock(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierFnLock")] + pub fn set_modifier_fn_lock(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierNumLock")] + pub fn get_modifier_num_lock(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierNumLock")] + pub fn set_modifier_num_lock(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierOS")] + pub fn get_modifier_os(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierOS")] + pub fn set_modifier_os(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierScrollLock")] + pub fn get_modifier_scroll_lock(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierScrollLock")] + pub fn set_modifier_scroll_lock(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbol")] + pub fn get_modifier_symbol(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbol")] + pub fn set_modifier_symbol(this: &EventModifierInit, val: bool); + #[doc = "Get the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbolLock")] + pub fn get_modifier_symbol_lock(this: &EventModifierInit) -> Option; + #[doc = "Change the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + pub fn set_modifier_symbol_lock(this: &EventModifierInit, val: bool); + #[doc = "Get the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, getter = "shiftKey")] + pub fn get_shift_key(this: &EventModifierInit) -> Option; + #[doc = "Change the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[wasm_bindgen(method, setter = "shiftKey")] + pub fn set_shift_key(this: &EventModifierInit, val: bool); } impl EventModifierInit { #[doc = "Construct a new `EventModifierInit`."] @@ -19,301 +202,95 @@ impl EventModifierInit { 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: `EventModifierInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `altKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_alt_key()` instead."] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alt_key(val); self } - #[doc = "Change the `ctrlKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_ctrl_key()` instead."] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ctrl_key(val); self } - #[doc = "Change the `metaKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_meta_key()` instead."] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_meta_key(val); self } - #[doc = "Change the `modifierAltGraph` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_alt_graph()` instead."] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_alt_graph(val); self } - #[doc = "Change the `modifierCapsLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_caps_lock()` instead."] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_caps_lock(val); self } - #[doc = "Change the `modifierFn` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_fn()` instead."] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn(val); self } - #[doc = "Change the `modifierFnLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_fn_lock()` instead."] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn_lock(val); self } - #[doc = "Change the `modifierNumLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_num_lock()` instead."] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_num_lock(val); self } - #[doc = "Change the `modifierOS` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_os()` instead."] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_os(val); self } - #[doc = "Change the `modifierScrollLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_scroll_lock()` instead."] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_scroll_lock(val); self } - #[doc = "Change the `modifierSymbol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_symbol()` instead."] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol(val); self } - #[doc = "Change the `modifierSymbolLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_modifier_symbol_lock()` instead."] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol_lock(val); self } - #[doc = "Change the `shiftKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventModifierInit`*"] + #[deprecated = "Use `set_shift_key()` instead."] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shift_key(val); self } } diff --git a/crates/web-sys/src/features/gen_EventSource.rs b/crates/web-sys/src/features/gen_EventSource.rs index 816817f378a..c9a9abf49c4 100644 --- a/crates/web-sys/src/features/gen_EventSource.rs +++ b/crates/web-sys/src/features/gen_EventSource.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EventSource/url)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventSource`*"] - pub fn url(this: &EventSource) -> String; + pub fn url(this: &EventSource) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "EventSource" , js_name = withCredentials)] #[doc = "Getter for the `withCredentials` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_EventSourceInit.rs b/crates/web-sys/src/features/gen_EventSourceInit.rs index f8e5f4af48d..24afbe7a88b 100644 --- a/crates/web-sys/src/features/gen_EventSourceInit.rs +++ b/crates/web-sys/src/features/gen_EventSourceInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `EventSourceInit`*"] pub type EventSourceInit; + #[doc = "Get the `withCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventSourceInit`*"] + #[wasm_bindgen(method, getter = "withCredentials")] + pub fn get_with_credentials(this: &EventSourceInit) -> Option; + #[doc = "Change the `withCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventSourceInit`*"] + #[wasm_bindgen(method, setter = "withCredentials")] + pub fn set_with_credentials(this: &EventSourceInit, val: bool); } impl EventSourceInit { #[doc = "Construct a new `EventSourceInit`."] @@ -19,21 +30,9 @@ impl EventSourceInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `withCredentials` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventSourceInit`*"] + #[deprecated = "Use `set_with_credentials()` instead."] pub fn with_credentials(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("withCredentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_with_credentials(val); self } } diff --git a/crates/web-sys/src/features/gen_EventTarget.rs b/crates/web-sys/src/features/gen_EventTarget.rs index 431b5a63190..a87f6d46f54 100644 --- a/crates/web-sys/src/features/gen_EventTarget.rs +++ b/crates/web-sys/src/features/gen_EventTarget.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_Exception.rs b/crates/web-sys/src/features/gen_Exception.rs index d38c6f66ee1..da7168bf738 100644 --- a/crates/web-sys/src/features/gen_Exception.rs +++ b/crates/web-sys/src/features/gen_Exception.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Exception/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Exception`*"] - pub fn name(this: &Exception) -> String; + pub fn name(this: &Exception) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Exception" , js_name = message)] #[doc = "Getter for the `message` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Exception/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Exception`*"] - pub fn message(this: &Exception) -> String; + pub fn message(this: &Exception) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Exception" , js_name = result)] #[doc = "Getter for the `result` field of this object."] #[doc = ""] @@ -38,7 +39,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Exception/filename)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Exception`*"] - pub fn filename(this: &Exception) -> String; + pub fn filename(this: &Exception) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Exception" , js_name = lineNumber)] #[doc = "Getter for the `lineNumber` field of this object."] #[doc = ""] @@ -66,5 +67,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Exception/stack)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Exception`*"] - pub fn stack(this: &Exception) -> String; + pub fn stack(this: &Exception) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_ExtBlendMinmax.rs b/crates/web-sys/src/features/gen_ExtBlendMinmax.rs index 9e274a31074..e352522c3c3 100644 --- a/crates/web-sys/src/features/gen_ExtBlendMinmax.rs +++ b/crates/web-sys/src/features/gen_ExtBlendMinmax.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtColorBufferFloat.rs b/crates/web-sys/src/features/gen_ExtColorBufferFloat.rs index 884e06c1627..f5ddf436c8d 100644 --- a/crates/web-sys/src/features/gen_ExtColorBufferFloat.rs +++ b/crates/web-sys/src/features/gen_ExtColorBufferFloat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtColorBufferHalfFloat.rs b/crates/web-sys/src/features/gen_ExtColorBufferHalfFloat.rs index 26ffa3c74bc..c50dd77f5d9 100644 --- a/crates/web-sys/src/features/gen_ExtColorBufferHalfFloat.rs +++ b/crates/web-sys/src/features/gen_ExtColorBufferHalfFloat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtDisjointTimerQuery.rs b/crates/web-sys/src/features/gen_ExtDisjointTimerQuery.rs index 1df18d754d2..f1be27d7d2d 100644 --- a/crates/web-sys/src/features/gen_ExtDisjointTimerQuery.rs +++ b/crates/web-sys/src/features/gen_ExtDisjointTimerQuery.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtFragDepth.rs b/crates/web-sys/src/features/gen_ExtFragDepth.rs index fd2f30f389b..53a284febb4 100644 --- a/crates/web-sys/src/features/gen_ExtFragDepth.rs +++ b/crates/web-sys/src/features/gen_ExtFragDepth.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtSRgb.rs b/crates/web-sys/src/features/gen_ExtSRgb.rs index c97cde65539..2cf4e65becd 100644 --- a/crates/web-sys/src/features/gen_ExtSRgb.rs +++ b/crates/web-sys/src/features/gen_ExtSRgb.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtShaderTextureLod.rs b/crates/web-sys/src/features/gen_ExtShaderTextureLod.rs index daa45adb7d7..52e5635acc3 100644 --- a/crates/web-sys/src/features/gen_ExtShaderTextureLod.rs +++ b/crates/web-sys/src/features/gen_ExtShaderTextureLod.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtTextureFilterAnisotropic.rs b/crates/web-sys/src/features/gen_ExtTextureFilterAnisotropic.rs index 905b2d225c3..e5d1da50427 100644 --- a/crates/web-sys/src/features/gen_ExtTextureFilterAnisotropic.rs +++ b/crates/web-sys/src/features/gen_ExtTextureFilterAnisotropic.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtTextureNorm16.rs b/crates/web-sys/src/features/gen_ExtTextureNorm16.rs new file mode 100644 index 00000000000..125e3403f99 --- /dev/null +++ b/crates/web-sys/src/features/gen_ExtTextureNorm16.rs @@ -0,0 +1,49 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (is_type_of = | _ | false , extends = :: js_sys :: Object , js_name = EXT_texture_norm16 , typescript_type = "EXT_texture_norm16")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ExtTextureNorm16` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_norm16)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub type ExtTextureNorm16; +} +impl ExtTextureNorm16 { + #[doc = "The `EXT_texture_norm16.R16_EXT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub const R16_EXT: u32 = 33322u64 as u32; + #[doc = "The `EXT_texture_norm16.RG16_EXT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub const RG16_EXT: u32 = 33324u64 as u32; + #[doc = "The `EXT_texture_norm16.RGB16_EXT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub const RGB16_EXT: u32 = 32852u64 as u32; + #[doc = "The `EXT_texture_norm16.RGBA16_EXT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub const RGBA16_EXT: u32 = 32859u64 as u32; + #[doc = "The `EXT_texture_norm16.R16_SNORM_EXT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub const R16_SNORM_EXT: u32 = 36760u64 as u32; + #[doc = "The `EXT_texture_norm16.RG16_SNORM_EXT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub const RG16_SNORM_EXT: u32 = 36761u64 as u32; + #[doc = "The `EXT_texture_norm16.RGB16_SNORM_EXT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub const RGB16_SNORM_EXT: u32 = 36762u64 as u32; + #[doc = "The `EXT_texture_norm16.RGBA16_SNORM_EXT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtTextureNorm16`*"] + pub const RGBA16_SNORM_EXT: u32 = 36763u64 as u32; +} diff --git a/crates/web-sys/src/features/gen_ExtendableEvent.rs b/crates/web-sys/src/features/gen_ExtendableEvent.rs index d3c14235aad..5b9b54067f0 100644 --- a/crates/web-sys/src/features/gen_ExtendableEvent.rs +++ b/crates/web-sys/src/features/gen_ExtendableEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ExtendableEventInit.rs b/crates/web-sys/src/features/gen_ExtendableEventInit.rs index 6bdb395c355..5d701d27c82 100644 --- a/crates/web-sys/src/features/gen_ExtendableEventInit.rs +++ b/crates/web-sys/src/features/gen_ExtendableEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] pub type ExtendableEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ExtendableEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ExtendableEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ExtendableEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ExtendableEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ExtendableEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ExtendableEventInit, val: bool); } impl ExtendableEventInit { #[doc = "Construct a new `ExtendableEventInit`."] @@ -19,55 +50,19 @@ impl ExtendableEventInit { 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: `ExtendableEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } } diff --git a/crates/web-sys/src/features/gen_ExtendableMessageEvent.rs b/crates/web-sys/src/features/gen_ExtendableMessageEvent.rs index fdbb3a2bee2..4cf19b6ac21 100644 --- a/crates/web-sys/src/features/gen_ExtendableMessageEvent.rs +++ b/crates/web-sys/src/features/gen_ExtendableMessageEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,14 +25,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ExtendableMessageEvent/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEvent`*"] - pub fn origin(this: &ExtendableMessageEvent) -> String; + pub fn origin(this: &ExtendableMessageEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "ExtendableMessageEvent" , js_name = lastEventId)] #[doc = "Getter for the `lastEventId` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ExtendableMessageEvent/lastEventId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEvent`*"] - pub fn last_event_id(this: &ExtendableMessageEvent) -> String; + pub fn last_event_id(this: &ExtendableMessageEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "ExtendableMessageEvent" , js_name = source)] #[doc = "Getter for the `source` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_ExtendableMessageEventInit.rs b/crates/web-sys/src/features/gen_ExtendableMessageEventInit.rs index 13577af8283..ba05aee789e 100644 --- a/crates/web-sys/src/features/gen_ExtendableMessageEventInit.rs +++ b/crates/web-sys/src/features/gen_ExtendableMessageEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,86 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] pub type ExtendableMessageEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ExtendableMessageEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ExtendableMessageEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ExtendableMessageEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ExtendableMessageEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ExtendableMessageEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ExtendableMessageEventInit, val: bool); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &ExtendableMessageEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &ExtendableMessageEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `lastEventId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, getter = "lastEventId")] + pub fn get_last_event_id(this: &ExtendableMessageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `lastEventId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, setter = "lastEventId")] + pub fn set_last_event_id(this: &ExtendableMessageEventInit, val: &str); + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &ExtendableMessageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &ExtendableMessageEventInit, val: &str); + #[doc = "Get the `ports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, getter = "ports")] + pub fn get_ports(this: &ExtendableMessageEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `ports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, setter = "ports")] + pub fn set_ports(this: &ExtendableMessageEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &ExtendableMessageEventInit) -> Option<::js_sys::Object>; + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &ExtendableMessageEventInit, val: Option<&::js_sys::Object>); } impl ExtendableMessageEventInit { #[doc = "Construct a new `ExtendableMessageEventInit`."] @@ -19,126 +100,44 @@ impl ExtendableMessageEventInit { 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: `ExtendableMessageEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `data` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[deprecated = "Use `set_data()` instead."] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_data(val); self } - #[doc = "Change the `lastEventId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[deprecated = "Use `set_last_event_id()` instead."] pub fn last_event_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastEventId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_last_event_id(val); self } - #[doc = "Change the `origin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[deprecated = "Use `set_origin()` instead."] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_origin(val); self } - #[doc = "Change the `ports` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[deprecated = "Use `set_ports()` instead."] pub fn ports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ports"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ports(val); self } - #[doc = "Change the `source` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ExtendableMessageEventInit`*"] + #[deprecated = "Use `set_source()` instead."] pub fn source(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source(val); self } } diff --git a/crates/web-sys/src/features/gen_External.rs b/crates/web-sys/src/features/gen_External.rs index bc58c96019c..66974fd4da9 100644 --- a/crates/web-sys/src/features/gen_External.rs +++ b/crates/web-sys/src/features/gen_External.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FakePluginMimeEntry.rs b/crates/web-sys/src/features/gen_FakePluginMimeEntry.rs index 9a024929439..92e2ccef0a8 100644 --- a/crates/web-sys/src/features/gen_FakePluginMimeEntry.rs +++ b/crates/web-sys/src/features/gen_FakePluginMimeEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] pub type FakePluginMimeEntry; + #[doc = "Get the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[wasm_bindgen(method, getter = "description")] + pub fn get_description(this: &FakePluginMimeEntry) -> Option<::alloc::string::String>; + #[doc = "Change the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[wasm_bindgen(method, setter = "description")] + pub fn set_description(this: &FakePluginMimeEntry, val: &str); + #[doc = "Get the `extension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[wasm_bindgen(method, getter = "extension")] + pub fn get_extension(this: &FakePluginMimeEntry) -> Option<::alloc::string::String>; + #[doc = "Change the `extension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[wasm_bindgen(method, setter = "extension")] + pub fn set_extension(this: &FakePluginMimeEntry, val: &str); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &FakePluginMimeEntry) -> ::alloc::string::String; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &FakePluginMimeEntry, val: &str); } impl FakePluginMimeEntry { #[doc = "Construct a new `FakePluginMimeEntry`."] @@ -17,54 +48,22 @@ impl FakePluginMimeEntry { pub fn new(type_: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.type_(type_); + ret.set_type(type_); ret } - #[doc = "Change the `description` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[deprecated = "Use `set_description()` instead."] pub fn description(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_description(val); self } - #[doc = "Change the `extension` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[deprecated = "Use `set_extension()` instead."] pub fn extension(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("extension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_extension(val); self } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginMimeEntry`*"] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_FakePluginTagInit.rs b/crates/web-sys/src/features/gen_FakePluginTagInit.rs index ce81b452df3..f29b10c51a6 100644 --- a/crates/web-sys/src/features/gen_FakePluginTagInit.rs +++ b/crates/web-sys/src/features/gen_FakePluginTagInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,96 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] pub type FakePluginTagInit; + #[doc = "Get the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "description")] + pub fn get_description(this: &FakePluginTagInit) -> Option<::alloc::string::String>; + #[doc = "Change the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "description")] + pub fn set_description(this: &FakePluginTagInit, val: &str); + #[doc = "Get the `fileName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "fileName")] + pub fn get_file_name(this: &FakePluginTagInit) -> Option<::alloc::string::String>; + #[doc = "Change the `fileName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "fileName")] + pub fn set_file_name(this: &FakePluginTagInit, val: &str); + #[doc = "Get the `fullPath` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "fullPath")] + pub fn get_full_path(this: &FakePluginTagInit) -> Option<::alloc::string::String>; + #[doc = "Change the `fullPath` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "fullPath")] + pub fn set_full_path(this: &FakePluginTagInit, val: &str); + #[doc = "Get the `handlerURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "handlerURI")] + pub fn get_handler_uri(this: &FakePluginTagInit) -> ::alloc::string::String; + #[doc = "Change the `handlerURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "handlerURI")] + pub fn set_handler_uri(this: &FakePluginTagInit, val: &str); + #[doc = "Get the `mimeEntries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "mimeEntries")] + pub fn get_mime_entries(this: &FakePluginTagInit) -> ::js_sys::Array; + #[doc = "Change the `mimeEntries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "mimeEntries")] + pub fn set_mime_entries(this: &FakePluginTagInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &FakePluginTagInit) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &FakePluginTagInit, val: &str); + #[doc = "Get the `niceName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "niceName")] + pub fn get_nice_name(this: &FakePluginTagInit) -> Option<::alloc::string::String>; + #[doc = "Change the `niceName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "niceName")] + pub fn set_nice_name(this: &FakePluginTagInit, val: &str); + #[doc = "Get the `sandboxScript` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "sandboxScript")] + pub fn get_sandbox_script(this: &FakePluginTagInit) -> Option<::alloc::string::String>; + #[doc = "Change the `sandboxScript` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "sandboxScript")] + pub fn set_sandbox_script(this: &FakePluginTagInit, val: &str); + #[doc = "Get the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, getter = "version")] + pub fn get_version(this: &FakePluginTagInit) -> Option<::alloc::string::String>; + #[doc = "Change the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[wasm_bindgen(method, setter = "version")] + pub fn set_version(this: &FakePluginTagInit, val: &str); } impl FakePluginTagInit { #[doc = "Construct a new `FakePluginTagInit`."] @@ -17,157 +108,53 @@ impl FakePluginTagInit { pub fn new(handler_uri: &str, mime_entries: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.handler_uri(handler_uri); - ret.mime_entries(mime_entries); + ret.set_handler_uri(handler_uri); + ret.set_mime_entries(mime_entries); ret } - #[doc = "Change the `description` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_description()` instead."] pub fn description(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_description(val); self } - #[doc = "Change the `fileName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_file_name()` instead."] pub fn file_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fileName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_file_name(val); self } - #[doc = "Change the `fullPath` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_full_path()` instead."] pub fn full_path(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fullPath"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_full_path(val); self } - #[doc = "Change the `handlerURI` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_handler_uri()` instead."] pub fn handler_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handlerURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_handler_uri(val); self } - #[doc = "Change the `mimeEntries` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_mime_entries()` instead."] pub fn mime_entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mimeEntries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mime_entries(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `niceName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_nice_name()` instead."] pub fn nice_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("niceName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_nice_name(val); self } - #[doc = "Change the `sandboxScript` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_sandbox_script()` instead."] pub fn sandbox_script(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sandboxScript"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sandbox_script(val); self } - #[doc = "Change the `version` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FakePluginTagInit`*"] + #[deprecated = "Use `set_version()` instead."] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_version(val); self } } diff --git a/crates/web-sys/src/features/gen_FetchEvent.rs b/crates/web-sys/src/features/gen_FetchEvent.rs index 70f378fe4c2..46005abafe9 100644 --- a/crates/web-sys/src/features/gen_FetchEvent.rs +++ b/crates/web-sys/src/features/gen_FetchEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/clientId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEvent`*"] - pub fn client_id(this: &FetchEvent) -> Option; + pub fn client_id(this: &FetchEvent) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "FetchEvent" , js_name = isReload)] #[doc = "Getter for the `isReload` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_FetchEventInit.rs b/crates/web-sys/src/features/gen_FetchEventInit.rs index baeace312f6..505b441d698 100644 --- a/crates/web-sys/src/features/gen_FetchEventInit.rs +++ b/crates/web-sys/src/features/gen_FetchEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,68 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] pub type FetchEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &FetchEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &FetchEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &FetchEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &FetchEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &FetchEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &FetchEventInit, val: bool); + #[doc = "Get the `clientId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, getter = "clientId")] + pub fn get_client_id(this: &FetchEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `clientId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, setter = "clientId")] + pub fn set_client_id(this: &FetchEventInit, val: Option<&str>); + #[doc = "Get the `isReload` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, getter = "isReload")] + pub fn get_is_reload(this: &FetchEventInit) -> Option; + #[doc = "Change the `isReload` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[wasm_bindgen(method, setter = "isReload")] + pub fn set_is_reload(this: &FetchEventInit, val: bool); + #[cfg(feature = "Request")] + #[doc = "Get the `request` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`, `Request`*"] + #[wasm_bindgen(method, getter = "request")] + pub fn get_request(this: &FetchEventInit) -> Request; + #[cfg(feature = "Request")] + #[doc = "Change the `request` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`, `Request`*"] + #[wasm_bindgen(method, setter = "request")] + pub fn set_request(this: &FetchEventInit, val: &Request); } impl FetchEventInit { #[cfg(feature = "Request")] @@ -18,110 +81,38 @@ impl FetchEventInit { pub fn new(request: &Request) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.request(request); + ret.set_request(request); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `clientId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[deprecated = "Use `set_client_id()` instead."] pub fn client_id(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_id(val); self } - #[doc = "Change the `isReload` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`*"] + #[deprecated = "Use `set_is_reload()` instead."] pub fn is_reload(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isReload"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_reload(val); self } #[cfg(feature = "Request")] - #[doc = "Change the `request` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FetchEventInit`, `Request`*"] + #[deprecated = "Use `set_request()` instead."] pub fn request(&mut self, val: &Request) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("request"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_request(val); self } } diff --git a/crates/web-sys/src/features/gen_FetchObserver.rs b/crates/web-sys/src/features/gen_FetchObserver.rs index e08d9341c14..264c14ee0eb 100644 --- a/crates/web-sys/src/features/gen_FetchObserver.rs +++ b/crates/web-sys/src/features/gen_FetchObserver.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FetchReadableStreamReadDataArray.rs b/crates/web-sys/src/features/gen_FetchReadableStreamReadDataArray.rs index 8e5fa2c3ec5..6fbca890dc4 100644 --- a/crates/web-sys/src/features/gen_FetchReadableStreamReadDataArray.rs +++ b/crates/web-sys/src/features/gen_FetchReadableStreamReadDataArray.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataArray`*"] pub type FetchReadableStreamReadDataArray; + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataArray`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &FetchReadableStreamReadDataArray) -> Option<::alloc::vec::Vec>; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataArray`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &FetchReadableStreamReadDataArray, val: &::js_sys::Uint8Array); } impl FetchReadableStreamReadDataArray { #[doc = "Construct a new `FetchReadableStreamReadDataArray`."] @@ -19,6 +30,11 @@ impl FetchReadableStreamReadDataArray { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } + #[deprecated = "Use `set_value()` instead."] + pub fn value(&mut self, val: &::js_sys::Uint8Array) -> &mut Self { + self.set_value(val); + self + } } impl Default for FetchReadableStreamReadDataArray { fn default() -> Self { diff --git a/crates/web-sys/src/features/gen_FetchReadableStreamReadDataDone.rs b/crates/web-sys/src/features/gen_FetchReadableStreamReadDataDone.rs index c3f81924c3f..04e2c6e4040 100644 --- a/crates/web-sys/src/features/gen_FetchReadableStreamReadDataDone.rs +++ b/crates/web-sys/src/features/gen_FetchReadableStreamReadDataDone.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataDone`*"] pub type FetchReadableStreamReadDataDone; + #[doc = "Get the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataDone`*"] + #[wasm_bindgen(method, getter = "done")] + pub fn get_done(this: &FetchReadableStreamReadDataDone) -> Option; + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataDone`*"] + #[wasm_bindgen(method, setter = "done")] + pub fn set_done(this: &FetchReadableStreamReadDataDone, val: bool); } impl FetchReadableStreamReadDataDone { #[doc = "Construct a new `FetchReadableStreamReadDataDone`."] @@ -19,17 +30,9 @@ impl FetchReadableStreamReadDataDone { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataDone`*"] + #[deprecated = "Use `set_done()` instead."] pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_done(val); self } } diff --git a/crates/web-sys/src/features/gen_FetchState.rs b/crates/web-sys/src/features/gen_FetchState.rs index 84ff3c6bb57..e3adc4aed2d 100644 --- a/crates/web-sys/src/features/gen_FetchState.rs +++ b/crates/web-sys/src/features/gen_FetchState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `FetchState` enum."] diff --git a/crates/web-sys/src/features/gen_File.rs b/crates/web-sys/src/features/gen_File.rs index d22c7495a06..9b12f29675c 100644 --- a/crates/web-sys/src/features/gen_File.rs +++ b/crates/web-sys/src/features/gen_File.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `File`*"] - pub fn name(this: &File) -> String; + pub fn name(this: &File) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "File" , js_name = lastModified)] #[doc = "Getter for the `lastModified` field of this object."] #[doc = ""] @@ -41,6 +42,16 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `File`*"] + pub fn new_with_u8_slice_sequence( + file_bits: &::wasm_bindgen::JsValue, + file_name: &str, + ) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "File")] + #[doc = "The `new File(..)` constructor, creating a new instance of `File`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `File`*"] pub fn new_with_u8_array_sequence( file_bits: &::wasm_bindgen::JsValue, file_name: &str, @@ -84,6 +95,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `File`, `FilePropertyBag`*"] + pub fn new_with_u8_slice_sequence_and_options( + file_bits: &::wasm_bindgen::JsValue, + file_name: &str, + options: &FilePropertyBag, + ) -> Result; + #[cfg(feature = "FilePropertyBag")] + #[wasm_bindgen(catch, constructor, js_class = "File")] + #[doc = "The `new File(..)` constructor, creating a new instance of `File`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/File/File)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `File`, `FilePropertyBag`*"] pub fn new_with_u8_array_sequence_and_options( file_bits: &::wasm_bindgen::JsValue, file_name: &str, diff --git a/crates/web-sys/src/features/gen_FileCallback.rs b/crates/web-sys/src/features/gen_FileCallback.rs index fd46ab2290f..3aa94c60949 100644 --- a/crates/web-sys/src/features/gen_FileCallback.rs +++ b/crates/web-sys/src/features/gen_FileCallback.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileCallback`*"] pub type FileCallback; + #[doc = "Get the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileCallback`*"] + #[wasm_bindgen(method, getter = "handleEvent")] + pub fn get_handle_event(this: &FileCallback) -> Option<::js_sys::Function>; + #[doc = "Change the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileCallback`*"] + #[wasm_bindgen(method, setter = "handleEvent")] + pub fn set_handle_event(this: &FileCallback, val: &::js_sys::Function); } impl FileCallback { #[doc = "Construct a new `FileCallback`."] @@ -19,21 +30,9 @@ impl FileCallback { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `handleEvent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FileCallback`*"] + #[deprecated = "Use `set_handle_event()` instead."] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_handle_event(val); self } } diff --git a/crates/web-sys/src/features/gen_FileList.rs b/crates/web-sys/src/features/gen_FileList.rs index 5e6132dc306..6eabb324b25 100644 --- a/crates/web-sys/src/features/gen_FileList.rs +++ b/crates/web-sys/src/features/gen_FileList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -28,7 +29,7 @@ extern "C" { pub fn item(this: &FileList, index: u32) -> Option; #[cfg(feature = "File")] #[wasm_bindgen(method, structural, js_class = "FileList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_FilePickerAcceptType.rs b/crates/web-sys/src/features/gen_FilePickerAcceptType.rs new file mode 100644 index 00000000000..364fd367c5e --- /dev/null +++ b/crates/web-sys/src/features/gen_FilePickerAcceptType.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FilePickerAcceptType)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FilePickerAcceptType` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerAcceptType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type FilePickerAcceptType; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `accept` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerAcceptType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "accept")] + pub fn get_accept(this: &FilePickerAcceptType) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `accept` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerAcceptType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "accept")] + pub fn set_accept(this: &FilePickerAcceptType, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerAcceptType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "description")] + pub fn get_description(this: &FilePickerAcceptType) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerAcceptType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "description")] + pub fn set_description(this: &FilePickerAcceptType, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl FilePickerAcceptType { + #[doc = "Construct a new `FilePickerAcceptType`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerAcceptType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_accept()` instead."] + pub fn accept(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_accept(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_description()` instead."] + pub fn description(&mut self, val: &str) -> &mut Self { + self.set_description(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for FilePickerAcceptType { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FilePickerOptions.rs b/crates/web-sys/src/features/gen_FilePickerOptions.rs new file mode 100644 index 00000000000..74b1bda1cb8 --- /dev/null +++ b/crates/web-sys/src/features/gen_FilePickerOptions.rs @@ -0,0 +1,133 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FilePickerOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FilePickerOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type FilePickerOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `excludeAcceptAllOption` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "excludeAcceptAllOption")] + pub fn get_exclude_accept_all_option(this: &FilePickerOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `excludeAcceptAllOption` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "excludeAcceptAllOption")] + pub fn set_exclude_accept_all_option(this: &FilePickerOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &FilePickerOptions) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &FilePickerOptions, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `startIn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "startIn")] + pub fn get_start_in(this: &FilePickerOptions) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `startIn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "startIn")] + pub fn set_start_in(this: &FilePickerOptions, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `types` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "types")] + pub fn get_types(this: &FilePickerOptions) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `types` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "types")] + pub fn set_types(this: &FilePickerOptions, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl FilePickerOptions { + #[doc = "Construct a new `FilePickerOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_exclude_accept_all_option()` instead."] + pub fn exclude_accept_all_option(&mut self, val: bool) -> &mut Self { + self.set_exclude_accept_all_option(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_start_in()` instead."] + pub fn start_in(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_start_in(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_types()` instead."] + pub fn types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_types(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for FilePickerOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FilePropertyBag.rs b/crates/web-sys/src/features/gen_FilePropertyBag.rs index 594aea9bbf8..674fb53292d 100644 --- a/crates/web-sys/src/features/gen_FilePropertyBag.rs +++ b/crates/web-sys/src/features/gen_FilePropertyBag.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] pub type FilePropertyBag; + #[doc = "Get the `lastModified` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] + #[wasm_bindgen(method, getter = "lastModified")] + pub fn get_last_modified(this: &FilePropertyBag) -> Option; + #[doc = "Change the `lastModified` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] + #[wasm_bindgen(method, setter = "lastModified")] + pub fn set_last_modified(this: &FilePropertyBag, val: f64); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &FilePropertyBag) -> Option<::alloc::string::String>; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &FilePropertyBag, val: &str); } impl FilePropertyBag { #[doc = "Construct a new `FilePropertyBag`."] @@ -19,34 +40,14 @@ impl FilePropertyBag { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `lastModified` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] + #[deprecated = "Use `set_last_modified()` instead."] pub fn last_modified(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastModified"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_last_modified(val); self } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FilePropertyBag`*"] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_FileReader.rs b/crates/web-sys/src/features/gen_FileReader.rs index 5263af6817d..6ecf1165da0 100644 --- a/crates/web-sys/src/features/gen_FileReader.rs +++ b/crates/web-sys/src/features/gen_FileReader.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FileReaderSync.rs b/crates/web-sys/src/features/gen_FileReaderSync.rs index c8ec2a66444..5602ccd1bde 100644 --- a/crates/web-sys/src/features/gen_FileReaderSync.rs +++ b/crates/web-sys/src/features/gen_FileReaderSync.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -36,7 +37,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/readAsBinaryString)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReaderSync`*"] - pub fn read_as_binary_string(this: &FileReaderSync, blob: &Blob) -> Result; + pub fn read_as_binary_string( + this: &FileReaderSync, + blob: &Blob, + ) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "FileReaderSync" , js_name = readAsDataURL)] #[doc = "The `readAsDataURL()` method."] @@ -44,7 +48,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/readAsDataURL)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReaderSync`*"] - pub fn read_as_data_url(this: &FileReaderSync, blob: &Blob) -> Result; + pub fn read_as_data_url( + this: &FileReaderSync, + blob: &Blob, + ) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "FileReaderSync" , js_name = readAsText)] #[doc = "The `readAsText()` method."] @@ -52,7 +59,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync/readAsText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileReaderSync`*"] - pub fn read_as_text(this: &FileReaderSync, blob: &Blob) -> Result; + pub fn read_as_text( + this: &FileReaderSync, + blob: &Blob, + ) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "FileReaderSync" , js_name = readAsText)] #[doc = "The `readAsText()` method."] @@ -64,5 +74,5 @@ extern "C" { this: &FileReaderSync, blob: &Blob, encoding: &str, - ) -> Result; + ) -> Result<::alloc::string::String, JsValue>; } diff --git a/crates/web-sys/src/features/gen_FileSystem.rs b/crates/web-sys/src/features/gen_FileSystem.rs index 09f217e0e00..84ae4b461d2 100644 --- a/crates/web-sys/src/features/gen_FileSystem.rs +++ b/crates/web-sys/src/features/gen_FileSystem.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystem/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystem`*"] - pub fn name(this: &FileSystem) -> String; + pub fn name(this: &FileSystem) -> ::alloc::string::String; #[cfg(feature = "FileSystemDirectoryEntry")] # [wasm_bindgen (structural , method , getter , js_class = "FileSystem" , js_name = root)] #[doc = "Getter for the `root` field of this object."] diff --git a/crates/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs b/crates/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs new file mode 100644 index 00000000000..3d03f2adf65 --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemCreateWritableOptions.rs @@ -0,0 +1,43 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemCreateWritableOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemCreateWritableOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] + pub type FileSystemCreateWritableOptions; + #[doc = "Get the `keepExistingData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] + #[wasm_bindgen(method, getter = "keepExistingData")] + pub fn get_keep_existing_data(this: &FileSystemCreateWritableOptions) -> Option; + #[doc = "Change the `keepExistingData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] + #[wasm_bindgen(method, setter = "keepExistingData")] + pub fn set_keep_existing_data(this: &FileSystemCreateWritableOptions, val: bool); +} +impl FileSystemCreateWritableOptions { + #[doc = "Construct a new `FileSystemCreateWritableOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_keep_existing_data()` instead."] + pub fn keep_existing_data(&mut self, val: bool) -> &mut Self { + self.set_keep_existing_data(val); + self + } +} +impl Default for FileSystemCreateWritableOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FileSystemDirectoryEntry.rs b/crates/web-sys/src/features/gen_FileSystemDirectoryEntry.rs index 1a291e44124..7e810175526 100644 --- a/crates/web-sys/src/features/gen_FileSystemDirectoryEntry.rs +++ b/crates/web-sys/src/features/gen_FileSystemDirectoryEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FileSystemDirectoryHandle.rs b/crates/web-sys/src/features/gen_FileSystemDirectoryHandle.rs new file mode 100644 index 00000000000..c7ce4bed22c --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemDirectoryHandle.rs @@ -0,0 +1,103 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = FileSystemHandle , extends = :: js_sys :: Object , js_name = FileSystemDirectoryHandle , typescript_type = "FileSystemDirectoryHandle")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemDirectoryHandle` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] + pub type FileSystemDirectoryHandle; + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] + pub fn entries(this: &FileSystemDirectoryHandle) -> ::js_sys::AsyncIterator; + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = getDirectoryHandle)] + #[doc = "The `getDirectoryHandle()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] + pub fn get_directory_handle(this: &FileSystemDirectoryHandle, name: &str) -> ::js_sys::Promise; + #[cfg(feature = "FileSystemGetDirectoryOptions")] + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = getDirectoryHandle)] + #[doc = "The `getDirectoryHandle()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`, `FileSystemGetDirectoryOptions`*"] + pub fn get_directory_handle_with_options( + this: &FileSystemDirectoryHandle, + name: &str, + options: &FileSystemGetDirectoryOptions, + ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = getFileHandle)] + #[doc = "The `getFileHandle()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getFileHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] + pub fn get_file_handle(this: &FileSystemDirectoryHandle, name: &str) -> ::js_sys::Promise; + #[cfg(feature = "FileSystemGetFileOptions")] + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = getFileHandle)] + #[doc = "The `getFileHandle()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getFileHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`, `FileSystemGetFileOptions`*"] + pub fn get_file_handle_with_options( + this: &FileSystemDirectoryHandle, + name: &str, + options: &FileSystemGetFileOptions, + ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] + pub fn keys(this: &FileSystemDirectoryHandle) -> ::js_sys::AsyncIterator; + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = removeEntry)] + #[doc = "The `removeEntry()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] + pub fn remove_entry(this: &FileSystemDirectoryHandle, name: &str) -> ::js_sys::Promise; + #[cfg(feature = "FileSystemRemoveOptions")] + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = removeEntry)] + #[doc = "The `removeEntry()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`, `FileSystemRemoveOptions`*"] + pub fn remove_entry_with_options( + this: &FileSystemDirectoryHandle, + name: &str, + options: &FileSystemRemoveOptions, + ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = resolve)] + #[doc = "The `resolve()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/resolve)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] + pub fn resolve( + this: &FileSystemDirectoryHandle, + possible_descendant: &FileSystemHandle, + ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "FileSystemDirectoryHandle" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemDirectoryHandle`*"] + pub fn values(this: &FileSystemDirectoryHandle) -> ::js_sys::AsyncIterator; +} diff --git a/crates/web-sys/src/features/gen_FileSystemDirectoryReader.rs b/crates/web-sys/src/features/gen_FileSystemDirectoryReader.rs index 4d6a922b850..0723db298ee 100644 --- a/crates/web-sys/src/features/gen_FileSystemDirectoryReader.rs +++ b/crates/web-sys/src/features/gen_FileSystemDirectoryReader.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FileSystemEntriesCallback.rs b/crates/web-sys/src/features/gen_FileSystemEntriesCallback.rs index f8ef26903b5..581452a8fda 100644 --- a/crates/web-sys/src/features/gen_FileSystemEntriesCallback.rs +++ b/crates/web-sys/src/features/gen_FileSystemEntriesCallback.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemEntriesCallback`*"] pub type FileSystemEntriesCallback; + #[doc = "Get the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemEntriesCallback`*"] + #[wasm_bindgen(method, getter = "handleEvent")] + pub fn get_handle_event(this: &FileSystemEntriesCallback) -> Option<::js_sys::Function>; + #[doc = "Change the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemEntriesCallback`*"] + #[wasm_bindgen(method, setter = "handleEvent")] + pub fn set_handle_event(this: &FileSystemEntriesCallback, val: &::js_sys::Function); } impl FileSystemEntriesCallback { #[doc = "Construct a new `FileSystemEntriesCallback`."] @@ -19,21 +30,9 @@ impl FileSystemEntriesCallback { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `handleEvent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FileSystemEntriesCallback`*"] + #[deprecated = "Use `set_handle_event()` instead."] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_handle_event(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemEntry.rs b/crates/web-sys/src/features/gen_FileSystemEntry.rs index 7834d6868ef..835fef7e02f 100644 --- a/crates/web-sys/src/features/gen_FileSystemEntry.rs +++ b/crates/web-sys/src/features/gen_FileSystemEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,14 +32,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemEntry`*"] - pub fn name(this: &FileSystemEntry) -> String; + pub fn name(this: &FileSystemEntry) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "FileSystemEntry" , js_name = fullPath)] #[doc = "Getter for the `fullPath` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry/fullPath)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemEntry`*"] - pub fn full_path(this: &FileSystemEntry) -> String; + pub fn full_path(this: &FileSystemEntry) -> ::alloc::string::String; #[cfg(feature = "FileSystem")] # [wasm_bindgen (structural , method , getter , js_class = "FileSystemEntry" , js_name = filesystem)] #[doc = "Getter for the `filesystem` field of this object."] diff --git a/crates/web-sys/src/features/gen_FileSystemEntryCallback.rs b/crates/web-sys/src/features/gen_FileSystemEntryCallback.rs index 38f4306e3b3..ef3d86cf1b6 100644 --- a/crates/web-sys/src/features/gen_FileSystemEntryCallback.rs +++ b/crates/web-sys/src/features/gen_FileSystemEntryCallback.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemEntryCallback`*"] pub type FileSystemEntryCallback; + #[doc = "Get the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemEntryCallback`*"] + #[wasm_bindgen(method, getter = "handleEvent")] + pub fn get_handle_event(this: &FileSystemEntryCallback) -> Option<::js_sys::Function>; + #[doc = "Change the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemEntryCallback`*"] + #[wasm_bindgen(method, setter = "handleEvent")] + pub fn set_handle_event(this: &FileSystemEntryCallback, val: &::js_sys::Function); } impl FileSystemEntryCallback { #[doc = "Construct a new `FileSystemEntryCallback`."] @@ -19,21 +30,9 @@ impl FileSystemEntryCallback { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `handleEvent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FileSystemEntryCallback`*"] + #[deprecated = "Use `set_handle_event()` instead."] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_handle_event(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemFileEntry.rs b/crates/web-sys/src/features/gen_FileSystemFileEntry.rs index 84dc290ab82..8e4011817c8 100644 --- a/crates/web-sys/src/features/gen_FileSystemFileEntry.rs +++ b/crates/web-sys/src/features/gen_FileSystemFileEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FileSystemFileHandle.rs b/crates/web-sys/src/features/gen_FileSystemFileHandle.rs new file mode 100644 index 00000000000..b22d79832ef --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemFileHandle.rs @@ -0,0 +1,47 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = FileSystemHandle , extends = :: js_sys :: Object , js_name = FileSystemFileHandle , typescript_type = "FileSystemFileHandle")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemFileHandle` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemFileHandle`*"] + pub type FileSystemFileHandle; + # [wasm_bindgen (method , structural , js_class = "FileSystemFileHandle" , js_name = createSyncAccessHandle)] + #[doc = "The `createSyncAccessHandle()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createSyncAccessHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemFileHandle`*"] + pub fn create_sync_access_handle(this: &FileSystemFileHandle) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "FileSystemFileHandle" , js_name = createWritable)] + #[doc = "The `createWritable()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemFileHandle`*"] + pub fn create_writable(this: &FileSystemFileHandle) -> ::js_sys::Promise; + #[cfg(feature = "FileSystemCreateWritableOptions")] + # [wasm_bindgen (method , structural , js_class = "FileSystemFileHandle" , js_name = createWritable)] + #[doc = "The `createWritable()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemCreateWritableOptions`, `FileSystemFileHandle`*"] + pub fn create_writable_with_options( + this: &FileSystemFileHandle, + options: &FileSystemCreateWritableOptions, + ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "FileSystemFileHandle" , js_name = getFile)] + #[doc = "The `getFile()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/getFile)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemFileHandle`*"] + pub fn get_file(this: &FileSystemFileHandle) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_FileSystemFlags.rs b/crates/web-sys/src/features/gen_FileSystemFlags.rs index 3faa152473b..62be51dd863 100644 --- a/crates/web-sys/src/features/gen_FileSystemFlags.rs +++ b/crates/web-sys/src/features/gen_FileSystemFlags.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] pub type FileSystemFlags; + #[doc = "Get the `create` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] + #[wasm_bindgen(method, getter = "create")] + pub fn get_create(this: &FileSystemFlags) -> Option; + #[doc = "Change the `create` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] + #[wasm_bindgen(method, setter = "create")] + pub fn set_create(this: &FileSystemFlags, val: bool); + #[doc = "Get the `exclusive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] + #[wasm_bindgen(method, getter = "exclusive")] + pub fn get_exclusive(this: &FileSystemFlags) -> Option; + #[doc = "Change the `exclusive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] + #[wasm_bindgen(method, setter = "exclusive")] + pub fn set_exclusive(this: &FileSystemFlags, val: bool); } impl FileSystemFlags { #[doc = "Construct a new `FileSystemFlags`."] @@ -19,35 +40,14 @@ impl FileSystemFlags { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `create` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] + #[deprecated = "Use `set_create()` instead."] pub fn create(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("create"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_create(val); self } - #[doc = "Change the `exclusive` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FileSystemFlags`*"] + #[deprecated = "Use `set_exclusive()` instead."] pub fn exclusive(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("exclusive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_exclusive(val); self } } diff --git a/crates/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs b/crates/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs new file mode 100644 index 00000000000..1d5c1d52131 --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemGetDirectoryOptions.rs @@ -0,0 +1,43 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemGetDirectoryOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemGetDirectoryOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] + pub type FileSystemGetDirectoryOptions; + #[doc = "Get the `create` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] + #[wasm_bindgen(method, getter = "create")] + pub fn get_create(this: &FileSystemGetDirectoryOptions) -> Option; + #[doc = "Change the `create` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] + #[wasm_bindgen(method, setter = "create")] + pub fn set_create(this: &FileSystemGetDirectoryOptions, val: bool); +} +impl FileSystemGetDirectoryOptions { + #[doc = "Construct a new `FileSystemGetDirectoryOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemGetDirectoryOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_create()` instead."] + pub fn create(&mut self, val: bool) -> &mut Self { + self.set_create(val); + self + } +} +impl Default for FileSystemGetDirectoryOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FileSystemGetFileOptions.rs b/crates/web-sys/src/features/gen_FileSystemGetFileOptions.rs new file mode 100644 index 00000000000..2aebf3b23ea --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemGetFileOptions.rs @@ -0,0 +1,43 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemGetFileOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemGetFileOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] + pub type FileSystemGetFileOptions; + #[doc = "Get the `create` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] + #[wasm_bindgen(method, getter = "create")] + pub fn get_create(this: &FileSystemGetFileOptions) -> Option; + #[doc = "Change the `create` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] + #[wasm_bindgen(method, setter = "create")] + pub fn set_create(this: &FileSystemGetFileOptions, val: bool); +} +impl FileSystemGetFileOptions { + #[doc = "Construct a new `FileSystemGetFileOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemGetFileOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_create()` instead."] + pub fn create(&mut self, val: bool) -> &mut Self { + self.set_create(val); + self + } +} +impl Default for FileSystemGetFileOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FileSystemHandle.rs b/crates/web-sys/src/features/gen_FileSystemHandle.rs new file mode 100644 index 00000000000..ebfdfd64e38 --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemHandle.rs @@ -0,0 +1,89 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemHandle , typescript_type = "FileSystemHandle")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemHandle` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`*"] + pub type FileSystemHandle; + #[cfg(feature = "FileSystemHandleKind")] + # [wasm_bindgen (structural , method , getter , js_class = "FileSystemHandle" , 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/FileSystemHandle/kind)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemHandleKind`*"] + pub fn kind(this: &FileSystemHandle) -> FileSystemHandleKind; + # [wasm_bindgen (structural , method , getter , js_class = "FileSystemHandle" , 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/FileSystemHandle/name)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`*"] + pub fn name(this: &FileSystemHandle) -> ::alloc::string::String; + # [wasm_bindgen (method , structural , js_class = "FileSystemHandle" , js_name = isSameEntry)] + #[doc = "The `isSameEntry()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/isSameEntry)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`*"] + pub fn is_same_entry(this: &FileSystemHandle, other: &FileSystemHandle) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "FileSystemHandle" , js_name = queryPermission)] + #[doc = "The `queryPermission()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/queryPermission)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn query_permission(this: &FileSystemHandle) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemHandlePermissionDescriptor")] + # [wasm_bindgen (method , structural , js_class = "FileSystemHandle" , js_name = queryPermission)] + #[doc = "The `queryPermission()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/queryPermission)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemHandlePermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn query_permission_with_descriptor( + this: &FileSystemHandle, + descriptor: &FileSystemHandlePermissionDescriptor, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "FileSystemHandle" , js_name = requestPermission)] + #[doc = "The `requestPermission()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/requestPermission)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_permission(this: &FileSystemHandle) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemHandlePermissionDescriptor")] + # [wasm_bindgen (method , structural , js_class = "FileSystemHandle" , js_name = requestPermission)] + #[doc = "The `requestPermission()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/requestPermission)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemHandlePermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_permission_with_descriptor( + this: &FileSystemHandle, + descriptor: &FileSystemHandlePermissionDescriptor, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_FileSystemHandleKind.rs b/crates/web-sys/src/features/gen_FileSystemHandleKind.rs new file mode 100644 index 00000000000..4cb6fdb6fe6 --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemHandleKind.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `FileSystemHandleKind` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `FileSystemHandleKind`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum FileSystemHandleKind { + File = "file", + Directory = "directory", +} diff --git a/crates/web-sys/src/features/gen_FileSystemHandlePermissionDescriptor.rs b/crates/web-sys/src/features/gen_FileSystemHandlePermissionDescriptor.rs new file mode 100644 index 00000000000..8f8aaa1c0ed --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemHandlePermissionDescriptor.rs @@ -0,0 +1,66 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemHandlePermissionDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemHandlePermissionDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandlePermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type FileSystemHandlePermissionDescriptor; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandlePermissionDescriptor`, `FileSystemPermissionMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode( + this: &FileSystemHandlePermissionDescriptor, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandlePermissionDescriptor`, `FileSystemPermissionMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &FileSystemHandlePermissionDescriptor, val: FileSystemPermissionMode); +} +#[cfg(web_sys_unstable_apis)] +impl FileSystemHandlePermissionDescriptor { + #[doc = "Construct a new `FileSystemHandlePermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandlePermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: FileSystemPermissionMode) -> &mut Self { + self.set_mode(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for FileSystemHandlePermissionDescriptor { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FileSystemPermissionDescriptor.rs b/crates/web-sys/src/features/gen_FileSystemPermissionDescriptor.rs new file mode 100644 index 00000000000..fae34b1c58e --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemPermissionDescriptor.rs @@ -0,0 +1,115 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemPermissionDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemPermissionDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type FileSystemPermissionDescriptor; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionDescriptor`, `PermissionName`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &FileSystemPermissionDescriptor) -> PermissionName; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionDescriptor`, `PermissionName`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &FileSystemPermissionDescriptor, val: PermissionName); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemHandle")] + #[doc = "Get the `handle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "handle")] + pub fn get_handle(this: &FileSystemPermissionDescriptor) -> FileSystemHandle; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemHandle")] + #[doc = "Change the `handle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "handle")] + pub fn set_handle(this: &FileSystemPermissionDescriptor, val: &FileSystemHandle); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionDescriptor`, `FileSystemPermissionMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &FileSystemPermissionDescriptor) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionDescriptor`, `FileSystemPermissionMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &FileSystemPermissionDescriptor, val: FileSystemPermissionMode); +} +#[cfg(web_sys_unstable_apis)] +impl FileSystemPermissionDescriptor { + #[cfg(all(feature = "FileSystemHandle", feature = "PermissionName",))] + #[doc = "Construct a new `FileSystemPermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemPermissionDescriptor`, `PermissionName`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(name: PermissionName, handle: &FileSystemHandle) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_name(name); + ret.set_handle(handle); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: PermissionName) -> &mut Self { + self.set_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemHandle")] + #[deprecated = "Use `set_handle()` instead."] + pub fn handle(&mut self, val: &FileSystemHandle) -> &mut Self { + self.set_handle(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FileSystemPermissionMode")] + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: FileSystemPermissionMode) -> &mut Self { + self.set_mode(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_FileSystemPermissionMode.rs b/crates/web-sys/src/features/gen_FileSystemPermissionMode.rs new file mode 100644 index 00000000000..11636456c13 --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemPermissionMode.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `FileSystemPermissionMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum FileSystemPermissionMode { + Read = "read", + Readwrite = "readwrite", +} diff --git a/crates/web-sys/src/features/gen_FileSystemReadWriteOptions.rs b/crates/web-sys/src/features/gen_FileSystemReadWriteOptions.rs new file mode 100644 index 00000000000..2cdd030a0ee --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemReadWriteOptions.rs @@ -0,0 +1,43 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemReadWriteOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemReadWriteOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] + pub type FileSystemReadWriteOptions; + #[doc = "Get the `at` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] + #[wasm_bindgen(method, getter = "at")] + pub fn get_at(this: &FileSystemReadWriteOptions) -> Option; + #[doc = "Change the `at` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] + #[wasm_bindgen(method, setter = "at")] + pub fn set_at(this: &FileSystemReadWriteOptions, val: f64); +} +impl FileSystemReadWriteOptions { + #[doc = "Construct a new `FileSystemReadWriteOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_at()` instead."] + pub fn at(&mut self, val: f64) -> &mut Self { + self.set_at(val); + self + } +} +impl Default for FileSystemReadWriteOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FileSystemRemoveOptions.rs b/crates/web-sys/src/features/gen_FileSystemRemoveOptions.rs new file mode 100644 index 00000000000..e1ec6700ef1 --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemRemoveOptions.rs @@ -0,0 +1,43 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemRemoveOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemRemoveOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] + pub type FileSystemRemoveOptions; + #[doc = "Get the `recursive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] + #[wasm_bindgen(method, getter = "recursive")] + pub fn get_recursive(this: &FileSystemRemoveOptions) -> Option; + #[doc = "Change the `recursive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] + #[wasm_bindgen(method, setter = "recursive")] + pub fn set_recursive(this: &FileSystemRemoveOptions, val: bool); +} +impl FileSystemRemoveOptions { + #[doc = "Construct a new `FileSystemRemoveOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemRemoveOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_recursive()` instead."] + pub fn recursive(&mut self, val: bool) -> &mut Self { + self.set_recursive(val); + self + } +} +impl Default for FileSystemRemoveOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FileSystemSyncAccessHandle.rs b/crates/web-sys/src/features/gen_FileSystemSyncAccessHandle.rs new file mode 100644 index 00000000000..aff3405c116 --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemSyncAccessHandle.rs @@ -0,0 +1,188 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FileSystemSyncAccessHandle , typescript_type = "FileSystemSyncAccessHandle")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemSyncAccessHandle` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub type FileSystemSyncAccessHandle; + # [wasm_bindgen (method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn close(this: &FileSystemSyncAccessHandle); + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = flush)] + #[doc = "The `flush()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/flush)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn flush(this: &FileSystemSyncAccessHandle) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = getSize)] + #[doc = "The `getSize()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/getSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn get_size(this: &FileSystemSyncAccessHandle) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] + #[doc = "The `read()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn read_with_buffer_source( + this: &FileSystemSyncAccessHandle, + buffer: &::js_sys::Object, + ) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] + #[doc = "The `read()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn read_with_u8_array( + this: &FileSystemSyncAccessHandle, + buffer: &mut [u8], + ) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] + #[doc = "The `read()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn read_with_js_u8_array( + this: &FileSystemSyncAccessHandle, + buffer: &::js_sys::Uint8Array, + ) -> Result; + #[cfg(feature = "FileSystemReadWriteOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] + #[doc = "The `read()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] + pub fn read_with_buffer_source_and_options( + this: &FileSystemSyncAccessHandle, + buffer: &::js_sys::Object, + options: &FileSystemReadWriteOptions, + ) -> Result; + #[cfg(feature = "FileSystemReadWriteOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] + #[doc = "The `read()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] + pub fn read_with_u8_array_and_options( + this: &FileSystemSyncAccessHandle, + buffer: &mut [u8], + options: &FileSystemReadWriteOptions, + ) -> Result; + #[cfg(feature = "FileSystemReadWriteOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = read)] + #[doc = "The `read()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] + pub fn read_with_js_u8_array_and_options( + this: &FileSystemSyncAccessHandle, + buffer: &::js_sys::Uint8Array, + options: &FileSystemReadWriteOptions, + ) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = truncate)] + #[doc = "The `truncate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/truncate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn truncate_with_u32( + this: &FileSystemSyncAccessHandle, + new_size: u32, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = truncate)] + #[doc = "The `truncate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/truncate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn truncate_with_f64( + this: &FileSystemSyncAccessHandle, + new_size: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn write_with_buffer_source( + this: &FileSystemSyncAccessHandle, + buffer: &::js_sys::Object, + ) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn write_with_u8_array( + this: &FileSystemSyncAccessHandle, + buffer: &[u8], + ) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemSyncAccessHandle`*"] + pub fn write_with_js_u8_array( + this: &FileSystemSyncAccessHandle, + buffer: &::js_sys::Uint8Array, + ) -> Result; + #[cfg(feature = "FileSystemReadWriteOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] + pub fn write_with_buffer_source_and_options( + this: &FileSystemSyncAccessHandle, + buffer: &::js_sys::Object, + options: &FileSystemReadWriteOptions, + ) -> Result; + #[cfg(feature = "FileSystemReadWriteOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] + pub fn write_with_u8_array_and_options( + this: &FileSystemSyncAccessHandle, + buffer: &[u8], + options: &FileSystemReadWriteOptions, + ) -> Result; + #[cfg(feature = "FileSystemReadWriteOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemSyncAccessHandle" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemReadWriteOptions`, `FileSystemSyncAccessHandle`*"] + pub fn write_with_js_u8_array_and_options( + this: &FileSystemSyncAccessHandle, + buffer: &::js_sys::Uint8Array, + options: &FileSystemReadWriteOptions, + ) -> Result; +} diff --git a/crates/web-sys/src/features/gen_FileSystemWritableFileStream.rs b/crates/web-sys/src/features/gen_FileSystemWritableFileStream.rs new file mode 100644 index 00000000000..9de810e62ef --- /dev/null +++ b/crates/web-sys/src/features/gen_FileSystemWritableFileStream.rs @@ -0,0 +1,117 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = WritableStream , extends = :: js_sys :: Object , js_name = FileSystemWritableFileStream , typescript_type = "FileSystemWritableFileStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FileSystemWritableFileStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub type FileSystemWritableFileStream; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = seek)] + #[doc = "The `seek()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/seek)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub fn seek_with_u32( + this: &FileSystemWritableFileStream, + position: u32, + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = seek)] + #[doc = "The `seek()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/seek)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub fn seek_with_f64( + this: &FileSystemWritableFileStream, + position: f64, + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = truncate)] + #[doc = "The `truncate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/truncate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub fn truncate_with_u32( + this: &FileSystemWritableFileStream, + size: u32, + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = truncate)] + #[doc = "The `truncate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/truncate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub fn truncate_with_f64( + this: &FileSystemWritableFileStream, + size: f64, + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub fn write_with_buffer_source( + this: &FileSystemWritableFileStream, + data: &::js_sys::Object, + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub fn write_with_u8_array( + this: &FileSystemWritableFileStream, + data: &[u8], + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub fn write_with_js_u8_array( + this: &FileSystemWritableFileStream, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "Blob")] + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Blob`, `FileSystemWritableFileStream`*"] + pub fn write_with_blob( + this: &FileSystemWritableFileStream, + data: &Blob, + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`*"] + pub fn write_with_str( + this: &FileSystemWritableFileStream, + data: &str, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "WriteParams")] + # [wasm_bindgen (catch , method , structural , js_class = "FileSystemWritableFileStream" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FileSystemWritableFileStream`, `WriteParams`*"] + pub fn write_with_write_params( + this: &FileSystemWritableFileStream, + data: &WriteParams, + ) -> Result<::js_sys::Promise, JsValue>; +} diff --git a/crates/web-sys/src/features/gen_FillMode.rs b/crates/web-sys/src/features/gen_FillMode.rs index 1e1001a6860..8897bde8524 100644 --- a/crates/web-sys/src/features/gen_FillMode.rs +++ b/crates/web-sys/src/features/gen_FillMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `FillMode` enum."] diff --git a/crates/web-sys/src/features/gen_FlashClassification.rs b/crates/web-sys/src/features/gen_FlashClassification.rs index eecf9f8f65c..08e526915ff 100644 --- a/crates/web-sys/src/features/gen_FlashClassification.rs +++ b/crates/web-sys/src/features/gen_FlashClassification.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `FlashClassification` enum."] diff --git a/crates/web-sys/src/features/gen_FlowControlType.rs b/crates/web-sys/src/features/gen_FlowControlType.rs new file mode 100644 index 00000000000..0b9f4c5e999 --- /dev/null +++ b/crates/web-sys/src/features/gen_FlowControlType.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `FlowControlType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `FlowControlType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum FlowControlType { + None = "none", + Hardware = "hardware", +} diff --git a/crates/web-sys/src/features/gen_FocusEvent.rs b/crates/web-sys/src/features/gen_FocusEvent.rs index d50c0dca39d..90f7c679b1a 100644 --- a/crates/web-sys/src/features/gen_FocusEvent.rs +++ b/crates/web-sys/src/features/gen_FocusEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FocusEventInit.rs b/crates/web-sys/src/features/gen_FocusEventInit.rs index b58db20764e..a7a84b2eb99 100644 --- a/crates/web-sys/src/features/gen_FocusEventInit.rs +++ b/crates/web-sys/src/features/gen_FocusEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,70 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] pub type FocusEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &FocusEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &FocusEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &FocusEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &FocusEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &FocusEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &FocusEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &FocusEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &FocusEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &FocusEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &FocusEventInit, val: Option<&Window>); + #[cfg(feature = "EventTarget")] + #[doc = "Get the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `FocusEventInit`*"] + #[wasm_bindgen(method, getter = "relatedTarget")] + pub fn get_related_target(this: &FocusEventInit) -> Option; + #[cfg(feature = "EventTarget")] + #[doc = "Change the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `FocusEventInit`*"] + #[wasm_bindgen(method, setter = "relatedTarget")] + pub fn set_related_target(this: &FocusEventInit, val: Option<&EventTarget>); } impl FocusEventInit { #[doc = "Construct a new `FocusEventInit`."] @@ -19,101 +84,36 @@ impl FocusEventInit { 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: `FocusEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FocusEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } #[cfg(feature = "EventTarget")] - #[doc = "Change the `relatedTarget` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `FocusEventInit`*"] + #[deprecated = "Use `set_related_target()` instead."] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_related_target(val); self } } diff --git a/crates/web-sys/src/features/gen_FocusOptions.rs b/crates/web-sys/src/features/gen_FocusOptions.rs new file mode 100644 index 00000000000..d1ae31c1dab --- /dev/null +++ b/crates/web-sys/src/features/gen_FocusOptions.rs @@ -0,0 +1,58 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FocusOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FocusOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`*"] + pub type FocusOptions; + #[doc = "Get the `focusVisible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`*"] + #[wasm_bindgen(method, getter = "focusVisible")] + pub fn get_focus_visible(this: &FocusOptions) -> Option; + #[doc = "Change the `focusVisible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`*"] + #[wasm_bindgen(method, setter = "focusVisible")] + pub fn set_focus_visible(this: &FocusOptions, val: bool); + #[doc = "Get the `preventScroll` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`*"] + #[wasm_bindgen(method, getter = "preventScroll")] + pub fn get_prevent_scroll(this: &FocusOptions) -> Option; + #[doc = "Change the `preventScroll` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`*"] + #[wasm_bindgen(method, setter = "preventScroll")] + pub fn set_prevent_scroll(this: &FocusOptions, val: bool); +} +impl FocusOptions { + #[doc = "Construct a new `FocusOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_focus_visible()` instead."] + pub fn focus_visible(&mut self, val: bool) -> &mut Self { + self.set_focus_visible(val); + self + } + #[deprecated = "Use `set_prevent_scroll()` instead."] + pub fn prevent_scroll(&mut self, val: bool) -> &mut Self { + self.set_prevent_scroll(val); + self + } +} +impl Default for FocusOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_FontData.rs b/crates/web-sys/src/features/gen_FontData.rs new file mode 100644 index 00000000000..512ee1a219c --- /dev/null +++ b/crates/web-sys/src/features/gen_FontData.rs @@ -0,0 +1,74 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = FontData , typescript_type = "FontData")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `FontData` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type FontData; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "FontData" , js_name = postscriptName)] + #[doc = "Getter for the `postscriptName` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontData/postscriptName)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn postscript_name(this: &FontData) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "FontData" , js_name = fullName)] + #[doc = "Getter for the `fullName` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontData/fullName)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn full_name(this: &FontData) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "FontData" , js_name = family)] + #[doc = "Getter for the `family` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontData/family)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn family(this: &FontData) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "FontData" , js_name = style)] + #[doc = "Getter for the `style` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontData/style)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn style(this: &FontData) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "FontData" , js_name = blob)] + #[doc = "The `blob()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontData/blob)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn blob(this: &FontData) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_FontFace.rs b/crates/web-sys/src/features/gen_FontFace.rs index 4c841ed0c75..88fd885ff89 100644 --- a/crates/web-sys/src/features/gen_FontFace.rs +++ b/crates/web-sys/src/features/gen_FontFace.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/family)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn family(this: &FontFace) -> String; + pub fn family(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = family)] #[doc = "Setter for the `family` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/style)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn style(this: &FontFace) -> String; + pub fn style(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = style)] #[doc = "Setter for the `style` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/weight)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn weight(this: &FontFace) -> String; + pub fn weight(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = weight)] #[doc = "Setter for the `weight` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/stretch)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn stretch(this: &FontFace) -> String; + pub fn stretch(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = stretch)] #[doc = "Setter for the `stretch` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/unicodeRange)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn unicode_range(this: &FontFace) -> String; + pub fn unicode_range(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = unicodeRange)] #[doc = "Setter for the `unicodeRange` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/variant)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn variant(this: &FontFace) -> String; + pub fn variant(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = variant)] #[doc = "Setter for the `variant` field of this object."] #[doc = ""] @@ -101,7 +102,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/featureSettings)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn feature_settings(this: &FontFace) -> String; + pub fn feature_settings(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = featureSettings)] #[doc = "Setter for the `featureSettings` field of this object."] #[doc = ""] @@ -115,7 +116,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/variationSettings)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn variation_settings(this: &FontFace) -> String; + pub fn variation_settings(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = variationSettings)] #[doc = "Setter for the `variationSettings` field of this object."] #[doc = ""] @@ -129,7 +130,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/display)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn display(this: &FontFace) -> String; + pub fn display(this: &FontFace) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "FontFace" , js_name = display)] #[doc = "Setter for the `display` field of this object."] #[doc = ""] @@ -185,7 +186,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/FontFace)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn new_with_u8_array(family: &str, source: &mut [u8]) -> Result; + pub fn new_with_u8_array(family: &str, source: &[u8]) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "FontFace")] + #[doc = "The `new FontFace(..)` constructor, creating a new instance of `FontFace`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/FontFace)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] + pub fn new_with_js_u8_array( + family: &str, + source: &::js_sys::Uint8Array, + ) -> Result; #[cfg(feature = "FontFaceDescriptors")] #[wasm_bindgen(catch, constructor, js_class = "FontFace")] #[doc = "The `new FontFace(..)` constructor, creating a new instance of `FontFace`."] @@ -231,7 +242,19 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `FontFace`, `FontFaceDescriptors`*"] pub fn new_with_u8_array_and_descriptors( family: &str, - source: &mut [u8], + source: &[u8], + descriptors: &FontFaceDescriptors, + ) -> Result; + #[cfg(feature = "FontFaceDescriptors")] + #[wasm_bindgen(catch, constructor, js_class = "FontFace")] + #[doc = "The `new FontFace(..)` constructor, creating a new instance of `FontFace`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/FontFace)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFace`, `FontFaceDescriptors`*"] + pub fn new_with_js_u8_array_and_descriptors( + family: &str, + source: &::js_sys::Uint8Array, descriptors: &FontFaceDescriptors, ) -> Result; # [wasm_bindgen (catch , method , structural , js_class = "FontFace" , js_name = load)] diff --git a/crates/web-sys/src/features/gen_FontFaceDescriptors.rs b/crates/web-sys/src/features/gen_FontFaceDescriptors.rs index 080792fc1ba..c9a1690045f 100644 --- a/crates/web-sys/src/features/gen_FontFaceDescriptors.rs +++ b/crates/web-sys/src/features/gen_FontFaceDescriptors.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,86 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] pub type FontFaceDescriptors; + #[doc = "Get the `display` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, getter = "display")] + pub fn get_display(this: &FontFaceDescriptors) -> Option<::alloc::string::String>; + #[doc = "Change the `display` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, setter = "display")] + pub fn set_display(this: &FontFaceDescriptors, val: &str); + #[doc = "Get the `featureSettings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, getter = "featureSettings")] + pub fn get_feature_settings(this: &FontFaceDescriptors) -> Option<::alloc::string::String>; + #[doc = "Change the `featureSettings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, setter = "featureSettings")] + pub fn set_feature_settings(this: &FontFaceDescriptors, val: &str); + #[doc = "Get the `stretch` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, getter = "stretch")] + pub fn get_stretch(this: &FontFaceDescriptors) -> Option<::alloc::string::String>; + #[doc = "Change the `stretch` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, setter = "stretch")] + pub fn set_stretch(this: &FontFaceDescriptors, val: &str); + #[doc = "Get the `style` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, getter = "style")] + pub fn get_style(this: &FontFaceDescriptors) -> Option<::alloc::string::String>; + #[doc = "Change the `style` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, setter = "style")] + pub fn set_style(this: &FontFaceDescriptors, val: &str); + #[doc = "Get the `unicodeRange` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, getter = "unicodeRange")] + pub fn get_unicode_range(this: &FontFaceDescriptors) -> Option<::alloc::string::String>; + #[doc = "Change the `unicodeRange` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, setter = "unicodeRange")] + pub fn set_unicode_range(this: &FontFaceDescriptors, val: &str); + #[doc = "Get the `variant` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, getter = "variant")] + pub fn get_variant(this: &FontFaceDescriptors) -> Option<::alloc::string::String>; + #[doc = "Change the `variant` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, setter = "variant")] + pub fn set_variant(this: &FontFaceDescriptors, val: &str); + #[doc = "Get the `variationSettings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, getter = "variationSettings")] + pub fn get_variation_settings(this: &FontFaceDescriptors) -> Option<::alloc::string::String>; + #[doc = "Change the `variationSettings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, setter = "variationSettings")] + pub fn set_variation_settings(this: &FontFaceDescriptors, val: &str); + #[doc = "Get the `weight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, getter = "weight")] + pub fn get_weight(this: &FontFaceDescriptors) -> Option<::alloc::string::String>; + #[doc = "Change the `weight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[wasm_bindgen(method, setter = "weight")] + pub fn set_weight(this: &FontFaceDescriptors, val: &str); } impl FontFaceDescriptors { #[doc = "Construct a new `FontFaceDescriptors`."] @@ -19,133 +100,44 @@ impl FontFaceDescriptors { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `display` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[deprecated = "Use `set_display()` instead."] pub fn display(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("display"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_display(val); self } - #[doc = "Change the `featureSettings` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[deprecated = "Use `set_feature_settings()` instead."] pub fn feature_settings(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("featureSettings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_feature_settings(val); self } - #[doc = "Change the `stretch` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[deprecated = "Use `set_stretch()` instead."] pub fn stretch(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stretch"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stretch(val); self } - #[doc = "Change the `style` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[deprecated = "Use `set_style()` instead."] pub fn style(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("style"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_style(val); self } - #[doc = "Change the `unicodeRange` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[deprecated = "Use `set_unicode_range()` instead."] pub fn unicode_range(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unicodeRange"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_unicode_range(val); self } - #[doc = "Change the `variant` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[deprecated = "Use `set_variant()` instead."] pub fn variant(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("variant"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_variant(val); self } - #[doc = "Change the `variationSettings` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[deprecated = "Use `set_variation_settings()` instead."] pub fn variation_settings(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("variationSettings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_variation_settings(val); self } - #[doc = "Change the `weight` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceDescriptors`*"] + #[deprecated = "Use `set_weight()` instead."] pub fn weight(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("weight"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_weight(val); self } } diff --git a/crates/web-sys/src/features/gen_FontFaceLoadStatus.rs b/crates/web-sys/src/features/gen_FontFaceLoadStatus.rs index f029f8cf157..2d86cda84cb 100644 --- a/crates/web-sys/src/features/gen_FontFaceLoadStatus.rs +++ b/crates/web-sys/src/features/gen_FontFaceLoadStatus.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `FontFaceLoadStatus` enum."] diff --git a/crates/web-sys/src/features/gen_FontFaceSet.rs b/crates/web-sys/src/features/gen_FontFaceSet.rs index 99c8a1f0846..75a23e3d0a9 100644 --- a/crates/web-sys/src/features/gen_FontFaceSet.rs +++ b/crates/web-sys/src/features/gen_FontFaceSet.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FontFaceSetIterator.rs b/crates/web-sys/src/features/gen_FontFaceSetIterator.rs index 8191f5d102f..fe0d8069bb2 100644 --- a/crates/web-sys/src/features/gen_FontFaceSetIterator.rs +++ b/crates/web-sys/src/features/gen_FontFaceSetIterator.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FontFaceSetIteratorResult.rs b/crates/web-sys/src/features/gen_FontFaceSetIteratorResult.rs index 5b9bcf37683..f022a56ec71 100644 --- a/crates/web-sys/src/features/gen_FontFaceSetIteratorResult.rs +++ b/crates/web-sys/src/features/gen_FontFaceSetIteratorResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] pub type FontFaceSetIteratorResult; + #[doc = "Get the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] + #[wasm_bindgen(method, getter = "done")] + pub fn get_done(this: &FontFaceSetIteratorResult) -> bool; + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] + #[wasm_bindgen(method, setter = "done")] + pub fn set_done(this: &FontFaceSetIteratorResult, val: bool); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &FontFaceSetIteratorResult) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &FontFaceSetIteratorResult, val: &::wasm_bindgen::JsValue); } impl FontFaceSetIteratorResult { #[doc = "Construct a new `FontFaceSetIteratorResult`."] @@ -17,34 +38,18 @@ impl FontFaceSetIteratorResult { pub fn new(done: bool, value: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.done(done); - ret.value(value); + ret.set_done(done); + ret.set_value(value); ret } - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] + #[deprecated = "Use `set_done()` instead."] pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_done(val); self } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceSetIteratorResult`*"] + #[deprecated = "Use `set_value()` instead."] pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_FontFaceSetLoadEvent.rs b/crates/web-sys/src/features/gen_FontFaceSetLoadEvent.rs index 800102f8fc0..a8bd6a68dd1 100644 --- a/crates/web-sys/src/features/gen_FontFaceSetLoadEvent.rs +++ b/crates/web-sys/src/features/gen_FontFaceSetLoadEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_FontFaceSetLoadEventInit.rs b/crates/web-sys/src/features/gen_FontFaceSetLoadEventInit.rs index 34570f4cb6c..147a3316581 100644 --- a/crates/web-sys/src/features/gen_FontFaceSetLoadEventInit.rs +++ b/crates/web-sys/src/features/gen_FontFaceSetLoadEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] pub type FontFaceSetLoadEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &FontFaceSetLoadEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &FontFaceSetLoadEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &FontFaceSetLoadEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &FontFaceSetLoadEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &FontFaceSetLoadEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &FontFaceSetLoadEventInit, val: bool); + #[doc = "Get the `fontfaces` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[wasm_bindgen(method, getter = "fontfaces")] + pub fn get_fontfaces(this: &FontFaceSetLoadEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `fontfaces` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[wasm_bindgen(method, setter = "fontfaces")] + pub fn set_fontfaces(this: &FontFaceSetLoadEventInit, val: &::wasm_bindgen::JsValue); } impl FontFaceSetLoadEventInit { #[doc = "Construct a new `FontFaceSetLoadEventInit`."] @@ -19,72 +60,24 @@ impl FontFaceSetLoadEventInit { 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: `FontFaceSetLoadEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `fontfaces` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadEventInit`*"] + #[deprecated = "Use `set_fontfaces()` instead."] pub fn fontfaces(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fontfaces"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fontfaces(val); self } } diff --git a/crates/web-sys/src/features/gen_FontFaceSetLoadStatus.rs b/crates/web-sys/src/features/gen_FontFaceSetLoadStatus.rs index a97a1cefd7e..ab61481eafb 100644 --- a/crates/web-sys/src/features/gen_FontFaceSetLoadStatus.rs +++ b/crates/web-sys/src/features/gen_FontFaceSetLoadStatus.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `FontFaceSetLoadStatus` enum."] diff --git a/crates/web-sys/src/features/gen_FormData.rs b/crates/web-sys/src/features/gen_FormData.rs index e60528529ae..959d014ed3b 100644 --- a/crates/web-sys/src/features/gen_FormData.rs +++ b/crates/web-sys/src/features/gen_FormData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -61,6 +62,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FormData`*"] pub fn delete(this: &FormData, name: &str); + # [wasm_bindgen (method , structural , js_class = "FormData" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FormData`*"] + pub fn entries(this: &FormData) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "FormData" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FormData`*"] + pub fn for_each(this: &FormData, callback: &::js_sys::Function) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "FormData" , js_name = get)] #[doc = "The `get()` method."] #[doc = ""] @@ -82,6 +97,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FormData`*"] pub fn has(this: &FormData, name: &str) -> bool; + # [wasm_bindgen (method , structural , js_class = "FormData" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FormData`*"] + pub fn keys(this: &FormData) -> ::js_sys::Iterator; #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "FormData" , js_name = set)] #[doc = "The `set()` method."] @@ -110,4 +132,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FormData`*"] pub fn set_with_str(this: &FormData, name: &str, value: &str) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "FormData" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FormData/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FormData`*"] + pub fn values(this: &FormData) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_FrameType.rs b/crates/web-sys/src/features/gen_FrameType.rs index 2e375342696..fd18caca04e 100644 --- a/crates/web-sys/src/features/gen_FrameType.rs +++ b/crates/web-sys/src/features/gen_FrameType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `FrameType` enum."] diff --git a/crates/web-sys/src/features/gen_FuzzingFunctions.rs b/crates/web-sys/src/features/gen_FuzzingFunctions.rs index f3a6d7fcac4..d1001cac9c8 100644 --- a/crates/web-sys/src/features/gen_FuzzingFunctions.rs +++ b/crates/web-sys/src/features/gen_FuzzingFunctions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -14,21 +15,21 @@ extern "C" { # [wasm_bindgen (static_method_of = FuzzingFunctions , js_class = "FuzzingFunctions" , js_name = cycleCollect)] #[doc = "The `cycleCollect()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FuzzingFunctions/cycleCollect)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FuzzingFunctions/cycleCollect_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FuzzingFunctions`*"] pub fn cycle_collect(); # [wasm_bindgen (catch , static_method_of = FuzzingFunctions , js_class = "FuzzingFunctions" , js_name = enableAccessibility)] #[doc = "The `enableAccessibility()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FuzzingFunctions/enableAccessibility)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FuzzingFunctions/enableAccessibility_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FuzzingFunctions`*"] pub fn enable_accessibility() -> Result<(), JsValue>; # [wasm_bindgen (static_method_of = FuzzingFunctions , js_class = "FuzzingFunctions" , js_name = garbageCollect)] #[doc = "The `garbageCollect()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FuzzingFunctions/garbageCollect)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FuzzingFunctions/garbageCollect_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FuzzingFunctions`*"] pub fn garbage_collect(); diff --git a/crates/web-sys/src/features/gen_GainNode.rs b/crates/web-sys/src/features/gen_GainNode.rs index fe5d28d70ca..fc96a098e1d 100644 --- a/crates/web-sys/src/features/gen_GainNode.rs +++ b/crates/web-sys/src/features/gen_GainNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GainOptions.rs b/crates/web-sys/src/features/gen_GainOptions.rs index 9fc6b7605ea..11dbccc476b 100644 --- a/crates/web-sys/src/features/gen_GainOptions.rs +++ b/crates/web-sys/src/features/gen_GainOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,50 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] pub type GainOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &GainOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &GainOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `GainOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &GainOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `GainOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &GainOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `GainOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &GainOptions) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `GainOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &GainOptions, val: ChannelInterpretation); + #[doc = "Get the `gain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] + #[wasm_bindgen(method, getter = "gain")] + pub fn get_gain(this: &GainOptions) -> Option; + #[doc = "Change the `gain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] + #[wasm_bindgen(method, setter = "gain")] + pub fn set_gain(this: &GainOptions, val: f32); } impl GainOptions { #[doc = "Construct a new `GainOptions`."] @@ -19,70 +64,26 @@ impl GainOptions { 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: `GainOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `GainOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `GainOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `gain` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"] + #[deprecated = "Use `set_gain()` instead."] 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.set_gain(val); self } } diff --git a/crates/web-sys/src/features/gen_Gamepad.rs b/crates/web-sys/src/features/gen_Gamepad.rs index 7545cec16fc..1347d62a6c9 100644 --- a/crates/web-sys/src/features/gen_Gamepad.rs +++ b/crates/web-sys/src/features/gen_Gamepad.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] - pub fn id(this: &Gamepad) -> String; + pub fn id(this: &Gamepad) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = index)] #[doc = "Getter for the `index` field of this object."] #[doc = ""] @@ -25,6 +26,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] pub fn index(this: &Gamepad) -> u32; + # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = connected)] + #[doc = "Getter for the `connected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/connected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] + pub fn connected(this: &Gamepad) -> bool; + # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = timestamp)] + #[doc = "Getter for the `timestamp` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/timestamp)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] + pub fn timestamp(this: &Gamepad) -> f64; #[cfg(feature = "GamepadMappingType")] # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = mapping)] #[doc = "Getter for the `mapping` field of this object."] @@ -33,28 +48,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadMappingType`*"] pub fn mapping(this: &Gamepad) -> GamepadMappingType; - #[cfg(feature = "GamepadHand")] - # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = hand)] - #[doc = "Getter for the `hand` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/hand)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadHand`*"] - pub fn hand(this: &Gamepad) -> GamepadHand; - # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = displayId)] - #[doc = "Getter for the `displayId` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/displayId)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] - pub fn display_id(this: &Gamepad) -> u32; - # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = connected)] - #[doc = "Getter for the `connected` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = axes)] + #[doc = "Getter for the `axes` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/connected)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/axes)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] - pub fn connected(this: &Gamepad) -> bool; + pub fn axes(this: &Gamepad) -> ::js_sys::Array; # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = buttons)] #[doc = "Getter for the `buttons` field of this object."] #[doc = ""] @@ -62,20 +62,29 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] pub fn buttons(this: &Gamepad) -> ::js_sys::Array; - # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = axes)] - #[doc = "Getter for the `axes` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = displayId)] + #[doc = "Getter for the `displayId` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/axes)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/displayId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] - pub fn axes(this: &Gamepad) -> ::js_sys::Array; - # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = timestamp)] - #[doc = "Getter for the `timestamp` field of this object."] + #[deprecated] + pub fn display_id(this: &Gamepad) -> u32; + #[cfg(feature = "GamepadHand")] + # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = hand)] + #[doc = "Getter for the `hand` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/timestamp)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/hand)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadHand`*"] + pub fn hand(this: &Gamepad) -> GamepadHand; + # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = hapticActuators)] + #[doc = "Getter for the `hapticActuators` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/hapticActuators)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] - pub fn timestamp(this: &Gamepad) -> f64; + pub fn haptic_actuators(this: &Gamepad) -> ::js_sys::Array; #[cfg(feature = "GamepadPose")] # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = pose)] #[doc = "Getter for the `pose` field of this object."] @@ -84,11 +93,27 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadPose`*"] pub fn pose(this: &Gamepad) -> Option; - # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = hapticActuators)] - #[doc = "Getter for the `hapticActuators` field of this object."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GamepadHapticActuator")] + # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = vibrationActuator)] + #[doc = "Getter for the `vibrationActuator` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/hapticActuators)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/vibrationActuator)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadHapticActuator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn vibration_actuator(this: &Gamepad) -> GamepadHapticActuator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Gamepad" , js_name = touchEvents)] + #[doc = "Getter for the `touchEvents` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/touchEvents)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Gamepad`*"] - pub fn haptic_actuators(this: &Gamepad) -> ::js_sys::Array; + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn touch_events(this: &Gamepad) -> Option<::js_sys::Array>; } diff --git a/crates/web-sys/src/features/gen_GamepadAxisMoveEvent.rs b/crates/web-sys/src/features/gen_GamepadAxisMoveEvent.rs deleted file mode 100644 index 479cf3e4c69..00000000000 --- a/crates/web-sys/src/features/gen_GamepadAxisMoveEvent.rs +++ /dev/null @@ -1,46 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = GamepadEvent , extends = Event , extends = :: js_sys :: Object , js_name = GamepadAxisMoveEvent , typescript_type = "GamepadAxisMoveEvent")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GamepadAxisMoveEvent` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadAxisMoveEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEvent`*"] - pub type GamepadAxisMoveEvent; - # [wasm_bindgen (structural , method , getter , js_class = "GamepadAxisMoveEvent" , js_name = axis)] - #[doc = "Getter for the `axis` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadAxisMoveEvent/axis)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEvent`*"] - pub fn axis(this: &GamepadAxisMoveEvent) -> u32; - # [wasm_bindgen (structural , method , getter , js_class = "GamepadAxisMoveEvent" , 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/GamepadAxisMoveEvent/value)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEvent`*"] - pub fn value(this: &GamepadAxisMoveEvent) -> f64; - #[wasm_bindgen(catch, constructor, js_class = "GamepadAxisMoveEvent")] - #[doc = "The `new GamepadAxisMoveEvent(..)` constructor, creating a new instance of `GamepadAxisMoveEvent`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadAxisMoveEvent/GamepadAxisMoveEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEvent`*"] - pub fn new(type_: &str) -> Result; - #[cfg(feature = "GamepadAxisMoveEventInit")] - #[wasm_bindgen(catch, constructor, js_class = "GamepadAxisMoveEvent")] - #[doc = "The `new GamepadAxisMoveEvent(..)` constructor, creating a new instance of `GamepadAxisMoveEvent`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadAxisMoveEvent/GamepadAxisMoveEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEvent`, `GamepadAxisMoveEventInit`*"] - pub fn new_with_event_init_dict( - type_: &str, - event_init_dict: &GamepadAxisMoveEventInit, - ) -> Result; -} diff --git a/crates/web-sys/src/features/gen_GamepadAxisMoveEventInit.rs b/crates/web-sys/src/features/gen_GamepadAxisMoveEventInit.rs deleted file mode 100644 index 4118c3e7a1d..00000000000 --- a/crates/web-sys/src/features/gen_GamepadAxisMoveEventInit.rs +++ /dev/null @@ -1,122 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GamepadAxisMoveEventInit)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GamepadAxisMoveEventInit` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] - pub type GamepadAxisMoveEventInit; -} -impl GamepadAxisMoveEventInit { - #[doc = "Construct a new `GamepadAxisMoveEventInit`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] - 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: `GamepadAxisMoveEventInit`*"] - 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: `GamepadAxisMoveEventInit`*"] - 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: `GamepadAxisMoveEventInit`*"] - 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 = "Gamepad")] - #[doc = "Change the `gamepad` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadAxisMoveEventInit`*"] - pub fn gamepad(&mut self, val: Option<&Gamepad>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gamepad"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `axis` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadAxisMoveEventInit`*"] - pub fn axis(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("axis"), &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: `GamepadAxisMoveEventInit`*"] - pub fn value(&mut self, val: f64) -> &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 - } -} -impl Default for GamepadAxisMoveEventInit { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_GamepadButton.rs b/crates/web-sys/src/features/gen_GamepadButton.rs index f06e3ec7d81..93dacc17b82 100644 --- a/crates/web-sys/src/features/gen_GamepadButton.rs +++ b/crates/web-sys/src/features/gen_GamepadButton.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GamepadButtonEvent.rs b/crates/web-sys/src/features/gen_GamepadButtonEvent.rs deleted file mode 100644 index c04f7249673..00000000000 --- a/crates/web-sys/src/features/gen_GamepadButtonEvent.rs +++ /dev/null @@ -1,39 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = GamepadEvent , extends = Event , extends = :: js_sys :: Object , js_name = GamepadButtonEvent , typescript_type = "GamepadButtonEvent")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GamepadButtonEvent` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadButtonEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEvent`*"] - pub type GamepadButtonEvent; - # [wasm_bindgen (structural , method , getter , js_class = "GamepadButtonEvent" , js_name = button)] - #[doc = "Getter for the `button` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadButtonEvent/button)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEvent`*"] - pub fn button(this: &GamepadButtonEvent) -> u32; - #[wasm_bindgen(catch, constructor, js_class = "GamepadButtonEvent")] - #[doc = "The `new GamepadButtonEvent(..)` constructor, creating a new instance of `GamepadButtonEvent`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadButtonEvent/GamepadButtonEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEvent`*"] - pub fn new(type_: &str) -> Result; - #[cfg(feature = "GamepadButtonEventInit")] - #[wasm_bindgen(catch, constructor, js_class = "GamepadButtonEvent")] - #[doc = "The `new GamepadButtonEvent(..)` constructor, creating a new instance of `GamepadButtonEvent`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadButtonEvent/GamepadButtonEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEvent`, `GamepadButtonEventInit`*"] - pub fn new_with_event_init_dict( - type_: &str, - event_init_dict: &GamepadButtonEventInit, - ) -> Result; -} diff --git a/crates/web-sys/src/features/gen_GamepadButtonEventInit.rs b/crates/web-sys/src/features/gen_GamepadButtonEventInit.rs deleted file mode 100644 index 3882908c985..00000000000 --- a/crates/web-sys/src/features/gen_GamepadButtonEventInit.rs +++ /dev/null @@ -1,110 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GamepadButtonEventInit)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GamepadButtonEventInit` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEventInit`*"] - pub type GamepadButtonEventInit; -} -impl GamepadButtonEventInit { - #[doc = "Construct a new `GamepadButtonEventInit`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEventInit`*"] - 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: `GamepadButtonEventInit`*"] - 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: `GamepadButtonEventInit`*"] - 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: `GamepadButtonEventInit`*"] - 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 = "Gamepad")] - #[doc = "Change the `gamepad` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadButtonEventInit`*"] - pub fn gamepad(&mut self, val: Option<&Gamepad>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gamepad"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `button` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadButtonEventInit`*"] - pub fn button(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for GamepadButtonEventInit { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_GamepadEffectParameters.rs b/crates/web-sys/src/features/gen_GamepadEffectParameters.rs new file mode 100644 index 00000000000..07849052610 --- /dev/null +++ b/crates/web-sys/src/features/gen_GamepadEffectParameters.rs @@ -0,0 +1,181 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GamepadEffectParameters)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GamepadEffectParameters` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GamepadEffectParameters; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &GamepadEffectParameters) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &GamepadEffectParameters, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `leftTrigger` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "leftTrigger")] + pub fn get_left_trigger(this: &GamepadEffectParameters) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `leftTrigger` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "leftTrigger")] + pub fn set_left_trigger(this: &GamepadEffectParameters, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rightTrigger` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rightTrigger")] + pub fn get_right_trigger(this: &GamepadEffectParameters) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rightTrigger` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rightTrigger")] + pub fn set_right_trigger(this: &GamepadEffectParameters, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `startDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "startDelay")] + pub fn get_start_delay(this: &GamepadEffectParameters) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `startDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "startDelay")] + pub fn set_start_delay(this: &GamepadEffectParameters, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `strongMagnitude` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "strongMagnitude")] + pub fn get_strong_magnitude(this: &GamepadEffectParameters) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `strongMagnitude` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "strongMagnitude")] + pub fn set_strong_magnitude(this: &GamepadEffectParameters, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `weakMagnitude` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "weakMagnitude")] + pub fn get_weak_magnitude(this: &GamepadEffectParameters) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `weakMagnitude` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "weakMagnitude")] + pub fn set_weak_magnitude(this: &GamepadEffectParameters, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl GamepadEffectParameters { + #[doc = "Construct a new `GamepadEffectParameters`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_duration()` instead."] + pub fn duration(&mut self, val: f64) -> &mut Self { + self.set_duration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_left_trigger()` instead."] + pub fn left_trigger(&mut self, val: f64) -> &mut Self { + self.set_left_trigger(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_right_trigger()` instead."] + pub fn right_trigger(&mut self, val: f64) -> &mut Self { + self.set_right_trigger(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_start_delay()` instead."] + pub fn start_delay(&mut self, val: f64) -> &mut Self { + self.set_start_delay(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_strong_magnitude()` instead."] + pub fn strong_magnitude(&mut self, val: f64) -> &mut Self { + self.set_strong_magnitude(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_weak_magnitude()` instead."] + pub fn weak_magnitude(&mut self, val: f64) -> &mut Self { + self.set_weak_magnitude(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for GamepadEffectParameters { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_GamepadEvent.rs b/crates/web-sys/src/features/gen_GamepadEvent.rs index 22988feac87..aee274f3d6c 100644 --- a/crates/web-sys/src/features/gen_GamepadEvent.rs +++ b/crates/web-sys/src/features/gen_GamepadEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GamepadEventInit.rs b/crates/web-sys/src/features/gen_GamepadEventInit.rs index 67d67ad7b32..de166b1d735 100644 --- a/crates/web-sys/src/features/gen_GamepadEventInit.rs +++ b/crates/web-sys/src/features/gen_GamepadEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] pub type GamepadEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &GamepadEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &GamepadEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &GamepadEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &GamepadEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &GamepadEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &GamepadEventInit, val: bool); + #[cfg(feature = "Gamepad")] + #[doc = "Get the `gamepad` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadEventInit`*"] + #[wasm_bindgen(method, getter = "gamepad")] + pub fn get_gamepad(this: &GamepadEventInit) -> Option; + #[cfg(feature = "Gamepad")] + #[doc = "Change the `gamepad` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadEventInit`*"] + #[wasm_bindgen(method, setter = "gamepad")] + pub fn set_gamepad(this: &GamepadEventInit, val: Option<&Gamepad>); } impl GamepadEventInit { #[doc = "Construct a new `GamepadEventInit`."] @@ -19,73 +62,25 @@ impl GamepadEventInit { 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: `GamepadEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "Gamepad")] - #[doc = "Change the `gamepad` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `GamepadEventInit`*"] + #[deprecated = "Use `set_gamepad()` instead."] pub fn gamepad(&mut self, val: Option<&Gamepad>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gamepad"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gamepad(val); self } } diff --git a/crates/web-sys/src/features/gen_GamepadHand.rs b/crates/web-sys/src/features/gen_GamepadHand.rs index 88650f3cb94..191aff88eff 100644 --- a/crates/web-sys/src/features/gen_GamepadHand.rs +++ b/crates/web-sys/src/features/gen_GamepadHand.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `GamepadHand` enum."] diff --git a/crates/web-sys/src/features/gen_GamepadHapticActuator.rs b/crates/web-sys/src/features/gen_GamepadHapticActuator.rs index 98c01912ef6..b1d1ac87e81 100644 --- a/crates/web-sys/src/features/gen_GamepadHapticActuator.rs +++ b/crates/web-sys/src/features/gen_GamepadHapticActuator.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -18,7 +19,53 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`, `GamepadHapticActuatorType`*"] + #[deprecated] pub fn type_(this: &GamepadHapticActuator) -> GamepadHapticActuatorType; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GamepadHapticActuator" , js_name = effects)] + #[doc = "Getter for the `effects` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/effects)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn effects(this: &GamepadHapticActuator) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GamepadHapticEffectType")] + # [wasm_bindgen (method , structural , js_class = "GamepadHapticActuator" , js_name = playEffect)] + #[doc = "The `playEffect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/playEffect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`, `GamepadHapticEffectType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn play_effect( + this: &GamepadHapticActuator, + type_: GamepadHapticEffectType, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(all( + feature = "GamepadEffectParameters", + feature = "GamepadHapticEffectType", + ))] + # [wasm_bindgen (method , structural , js_class = "GamepadHapticActuator" , js_name = playEffect)] + #[doc = "The `playEffect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/playEffect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadEffectParameters`, `GamepadHapticActuator`, `GamepadHapticEffectType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn play_effect_with_params( + this: &GamepadHapticActuator, + type_: GamepadHapticEffectType, + params: &GamepadEffectParameters, + ) -> ::js_sys::Promise; # [wasm_bindgen (catch , method , structural , js_class = "GamepadHapticActuator" , js_name = pulse)] #[doc = "The `pulse()` method."] #[doc = ""] @@ -30,4 +77,15 @@ extern "C" { value: f64, duration: f64, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GamepadHapticActuator" , js_name = reset)] + #[doc = "The `reset()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/reset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn reset(this: &GamepadHapticActuator) -> ::js_sys::Promise; } diff --git a/crates/web-sys/src/features/gen_GamepadHapticActuatorType.rs b/crates/web-sys/src/features/gen_GamepadHapticActuatorType.rs index cc6bf0441fe..7fb9239ed94 100644 --- a/crates/web-sys/src/features/gen_GamepadHapticActuatorType.rs +++ b/crates/web-sys/src/features/gen_GamepadHapticActuatorType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `GamepadHapticActuatorType` enum."] diff --git a/crates/web-sys/src/features/gen_GamepadHapticEffectType.rs b/crates/web-sys/src/features/gen_GamepadHapticEffectType.rs new file mode 100644 index 00000000000..f78269698f8 --- /dev/null +++ b/crates/web-sys/src/features/gen_GamepadHapticEffectType.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GamepadHapticEffectType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GamepadHapticEffectType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GamepadHapticEffectType { + DualRumble = "dual-rumble", + TriggerRumble = "trigger-rumble", +} diff --git a/crates/web-sys/src/features/gen_GamepadHapticsResult.rs b/crates/web-sys/src/features/gen_GamepadHapticsResult.rs new file mode 100644 index 00000000000..14a59728c18 --- /dev/null +++ b/crates/web-sys/src/features/gen_GamepadHapticsResult.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GamepadHapticsResult` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GamepadHapticsResult`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GamepadHapticsResult { + Complete = "complete", + Preempted = "preempted", +} diff --git a/crates/web-sys/src/features/gen_GamepadMappingType.rs b/crates/web-sys/src/features/gen_GamepadMappingType.rs index 14b69f24b06..00873cf87d2 100644 --- a/crates/web-sys/src/features/gen_GamepadMappingType.rs +++ b/crates/web-sys/src/features/gen_GamepadMappingType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `GamepadMappingType` enum."] diff --git a/crates/web-sys/src/features/gen_GamepadPose.rs b/crates/web-sys/src/features/gen_GamepadPose.rs index a8980c3f777..fb1b1ef287c 100644 --- a/crates/web-sys/src/features/gen_GamepadPose.rs +++ b/crates/web-sys/src/features/gen_GamepadPose.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,40 +32,44 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/position)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"] - pub fn position(this: &GamepadPose) -> Result>, JsValue>; + pub fn position(this: &GamepadPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = linearVelocity)] #[doc = "Getter for the `linearVelocity` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/linearVelocity)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"] - pub fn linear_velocity(this: &GamepadPose) -> Result>, JsValue>; + pub fn linear_velocity(this: &GamepadPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = linearAcceleration)] #[doc = "Getter for the `linearAcceleration` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/linearAcceleration)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"] - pub fn linear_acceleration(this: &GamepadPose) -> Result>, JsValue>; + pub fn linear_acceleration( + this: &GamepadPose, + ) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = orientation)] #[doc = "Getter for the `orientation` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/orientation)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"] - pub fn orientation(this: &GamepadPose) -> Result>, JsValue>; + pub fn orientation(this: &GamepadPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = angularVelocity)] #[doc = "Getter for the `angularVelocity` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/angularVelocity)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"] - pub fn angular_velocity(this: &GamepadPose) -> Result>, JsValue>; + pub fn angular_velocity(this: &GamepadPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = angularAcceleration)] #[doc = "Getter for the `angularAcceleration` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/angularAcceleration)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"] - pub fn angular_acceleration(this: &GamepadPose) -> Result>, JsValue>; + pub fn angular_acceleration( + this: &GamepadPose, + ) -> Result>, JsValue>; } diff --git a/crates/web-sys/src/features/gen_GamepadServiceTest.rs b/crates/web-sys/src/features/gen_GamepadServiceTest.rs deleted file mode 100644 index 93db8333185..00000000000 --- a/crates/web-sys/src/features/gen_GamepadServiceTest.rs +++ /dev/null @@ -1,127 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GamepadServiceTest , typescript_type = "GamepadServiceTest")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GamepadServiceTest` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadServiceTest`*"] - pub type GamepadServiceTest; - #[cfg(feature = "GamepadMappingType")] - # [wasm_bindgen (structural , method , getter , js_class = "GamepadServiceTest" , js_name = noMapping)] - #[doc = "Getter for the `noMapping` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/noMapping)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadMappingType`, `GamepadServiceTest`*"] - pub fn no_mapping(this: &GamepadServiceTest) -> GamepadMappingType; - #[cfg(feature = "GamepadMappingType")] - # [wasm_bindgen (structural , method , getter , js_class = "GamepadServiceTest" , js_name = standardMapping)] - #[doc = "Getter for the `standardMapping` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/standardMapping)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadMappingType`, `GamepadServiceTest`*"] - pub fn standard_mapping(this: &GamepadServiceTest) -> GamepadMappingType; - #[cfg(feature = "GamepadHand")] - # [wasm_bindgen (structural , method , getter , js_class = "GamepadServiceTest" , js_name = noHand)] - #[doc = "Getter for the `noHand` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/noHand)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadHand`, `GamepadServiceTest`*"] - pub fn no_hand(this: &GamepadServiceTest) -> GamepadHand; - #[cfg(feature = "GamepadHand")] - # [wasm_bindgen (structural , method , getter , js_class = "GamepadServiceTest" , js_name = leftHand)] - #[doc = "Getter for the `leftHand` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/leftHand)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadHand`, `GamepadServiceTest`*"] - pub fn left_hand(this: &GamepadServiceTest) -> GamepadHand; - #[cfg(feature = "GamepadHand")] - # [wasm_bindgen (structural , method , getter , js_class = "GamepadServiceTest" , js_name = rightHand)] - #[doc = "Getter for the `rightHand` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/rightHand)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadHand`, `GamepadServiceTest`*"] - pub fn right_hand(this: &GamepadServiceTest) -> GamepadHand; - #[cfg(all(feature = "GamepadHand", feature = "GamepadMappingType",))] - # [wasm_bindgen (catch , method , structural , js_class = "GamepadServiceTest" , js_name = addGamepad)] - #[doc = "The `addGamepad()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/addGamepad)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadHand`, `GamepadMappingType`, `GamepadServiceTest`*"] - pub fn add_gamepad( - this: &GamepadServiceTest, - id: &str, - mapping: GamepadMappingType, - hand: GamepadHand, - num_buttons: u32, - num_axes: u32, - num_haptics: u32, - ) -> Result<::js_sys::Promise, JsValue>; - # [wasm_bindgen (method , structural , js_class = "GamepadServiceTest" , js_name = newAxisMoveEvent)] - #[doc = "The `newAxisMoveEvent()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/newAxisMoveEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadServiceTest`*"] - pub fn new_axis_move_event(this: &GamepadServiceTest, index: u32, axis: u32, value: f64); - # [wasm_bindgen (method , structural , js_class = "GamepadServiceTest" , js_name = newButtonEvent)] - #[doc = "The `newButtonEvent()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/newButtonEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadServiceTest`*"] - pub fn new_button_event( - this: &GamepadServiceTest, - index: u32, - button: u32, - pressed: bool, - touched: bool, - ); - # [wasm_bindgen (method , structural , js_class = "GamepadServiceTest" , js_name = newButtonValueEvent)] - #[doc = "The `newButtonValueEvent()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/newButtonValueEvent)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadServiceTest`*"] - pub fn new_button_value_event( - this: &GamepadServiceTest, - index: u32, - button: u32, - pressed: bool, - touched: bool, - value: f64, - ); - # [wasm_bindgen (method , structural , js_class = "GamepadServiceTest" , js_name = newPoseMove)] - #[doc = "The `newPoseMove()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/newPoseMove)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadServiceTest`*"] - pub fn new_pose_move( - this: &GamepadServiceTest, - index: u32, - orient: Option<&mut [f32]>, - pos: Option<&mut [f32]>, - ang_velocity: Option<&mut [f32]>, - ang_acceleration: Option<&mut [f32]>, - lin_velocity: Option<&mut [f32]>, - lin_acceleration: Option<&mut [f32]>, - ); - # [wasm_bindgen (method , structural , js_class = "GamepadServiceTest" , js_name = removeGamepad)] - #[doc = "The `removeGamepad()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadServiceTest/removeGamepad)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadServiceTest`*"] - pub fn remove_gamepad(this: &GamepadServiceTest, index: u32); -} diff --git a/crates/web-sys/src/features/gen_GamepadTouch.rs b/crates/web-sys/src/features/gen_GamepadTouch.rs new file mode 100644 index 00000000000..f1bcd039a34 --- /dev/null +++ b/crates/web-sys/src/features/gen_GamepadTouch.rs @@ -0,0 +1,63 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GamepadTouch , typescript_type = "GamepadTouch")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GamepadTouch` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadTouch)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadTouch`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GamepadTouch; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GamepadTouch" , js_name = touchId)] + #[doc = "Getter for the `touchId` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadTouch/touchId)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadTouch`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn touch_id(this: &GamepadTouch) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GamepadTouch" , js_name = surfaceId)] + #[doc = "Getter for the `surfaceId` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadTouch/surfaceId)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadTouch`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn surface_id(this: &GamepadTouch) -> u8; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GamepadTouch" , js_name = position)] + #[doc = "Getter for the `position` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadTouch/position)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadTouch`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn position(this: &GamepadTouch) -> ::alloc::vec::Vec; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GamepadTouch" , js_name = surfaceDimensions)] + #[doc = "Getter for the `surfaceDimensions` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadTouch/surfaceDimensions)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GamepadTouch`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn surface_dimensions(this: &GamepadTouch) -> Option<::alloc::vec::Vec>; +} diff --git a/crates/web-sys/src/features/gen_Geolocation.rs b/crates/web-sys/src/features/gen_Geolocation.rs index 896b7ffb90a..26b3d62479a 100644 --- a/crates/web-sys/src/features/gen_Geolocation.rs +++ b/crates/web-sys/src/features/gen_Geolocation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs b/crates/web-sys/src/features/gen_GetAnimationsOptions.rs similarity index 57% rename from crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs rename to crates/web-sys/src/features/gen_GetAnimationsOptions.rs index a381dd24781..3781d6ebc90 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyExternalImage.rs +++ b/crates/web-sys/src/features/gen_GetAnimationsOptions.rs @@ -1,67 +1,61 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyExternalImage)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GetAnimationsOptions)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyExternalImage` dictionary."] + #[doc = "The `GetAnimationsOptions` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GetAnimationsOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyExternalImage; -} -#[cfg(web_sys_unstable_apis)] -impl GpuImageCopyExternalImage { - #[doc = "Construct a new `GpuImageCopyExternalImage`."] + pub type GetAnimationsOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `subtree` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GetAnimationsOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(source: &::js_sys::Object) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.source(source); - ret - } + #[wasm_bindgen(method, getter = "subtree")] + pub fn get_subtree(this: &GetAnimationsOptions) -> Option; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `origin` field of this object."] + #[doc = "Change the `subtree` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GetAnimationsOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `source` field of this object."] + #[wasm_bindgen(method, setter = "subtree")] + pub fn set_subtree(this: &GetAnimationsOptions, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl GetAnimationsOptions { + #[doc = "Construct a new `GetAnimationsOptions`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`*"] + #[doc = "*This API requires the following crate features to be activated: `GetAnimationsOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn source(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_subtree()` instead."] + pub fn subtree(&mut self, val: bool) -> &mut Self { + self.set_subtree(val); self } } +#[cfg(web_sys_unstable_apis)] +impl Default for GetAnimationsOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_GetNotificationOptions.rs b/crates/web-sys/src/features/gen_GetNotificationOptions.rs deleted file mode 100644 index 3dc3788f707..00000000000 --- a/crates/web-sys/src/features/gen_GetNotificationOptions.rs +++ /dev/null @@ -1,40 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GetNotificationOptions)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GetNotificationOptions` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GetNotificationOptions`*"] - pub type GetNotificationOptions; -} -impl GetNotificationOptions { - #[doc = "Construct a new `GetNotificationOptions`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GetNotificationOptions`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `tag` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GetNotificationOptions`*"] - pub fn tag(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tag"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for GetNotificationOptions { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_GetRootNodeOptions.rs b/crates/web-sys/src/features/gen_GetRootNodeOptions.rs index 41a8cc3db7f..616cfaa611e 100644 --- a/crates/web-sys/src/features/gen_GetRootNodeOptions.rs +++ b/crates/web-sys/src/features/gen_GetRootNodeOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GetRootNodeOptions`*"] pub type GetRootNodeOptions; + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GetRootNodeOptions`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &GetRootNodeOptions) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GetRootNodeOptions`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &GetRootNodeOptions, val: bool); } impl GetRootNodeOptions { #[doc = "Construct a new `GetRootNodeOptions`."] @@ -19,21 +30,9 @@ impl GetRootNodeOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GetRootNodeOptions`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } } diff --git a/crates/web-sys/src/features/gen_GetUserMediaRequest.rs b/crates/web-sys/src/features/gen_GetUserMediaRequest.rs index da4a744cb20..94b9b1dbadb 100644 --- a/crates/web-sys/src/features/gen_GetUserMediaRequest.rs +++ b/crates/web-sys/src/features/gen_GetUserMediaRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,21 +32,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GetUserMediaRequest/callID)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GetUserMediaRequest`*"] - pub fn call_id(this: &GetUserMediaRequest) -> String; + pub fn call_id(this: &GetUserMediaRequest) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "GetUserMediaRequest" , js_name = rawID)] #[doc = "Getter for the `rawID` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GetUserMediaRequest/rawID)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GetUserMediaRequest`*"] - pub fn raw_id(this: &GetUserMediaRequest) -> String; + pub fn raw_id(this: &GetUserMediaRequest) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "GetUserMediaRequest" , js_name = mediaSource)] #[doc = "Getter for the `mediaSource` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GetUserMediaRequest/mediaSource)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GetUserMediaRequest`*"] - pub fn media_source(this: &GetUserMediaRequest) -> String; + pub fn media_source(this: &GetUserMediaRequest) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "GetUserMediaRequest" , js_name = isSecure)] #[doc = "Getter for the `isSecure` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_Gpu.rs b/crates/web-sys/src/features/gen_Gpu.rs index bb48e073bec..1fe433a1ade 100644 --- a/crates/web-sys/src/features/gen_Gpu.rs +++ b/crates/web-sys/src/features/gen_Gpu.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,6 +17,30 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type Gpu; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WgslLanguageFeatures")] + # [wasm_bindgen (structural , method , getter , js_class = "GPU" , js_name = wgslLanguageFeatures)] + #[doc = "Getter for the `wgslLanguageFeatures` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU/wgslLanguageFeatures)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gpu`, `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn wgsl_language_features(this: &Gpu) -> WgslLanguageFeatures; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + # [wasm_bindgen (method , structural , js_class = "GPU" , js_name = getPreferredCanvasFormat)] + #[doc = "The `getPreferredCanvasFormat()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPU/getPreferredCanvasFormat)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gpu`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_preferred_canvas_format(this: &Gpu) -> GpuTextureFormat; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPU" , js_name = requestAdapter)] #[doc = "The `requestAdapter()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_GpuAdapter.rs b/crates/web-sys/src/features/gen_GpuAdapter.rs index 2700e02b360..f9cc0511177 100644 --- a/crates/web-sys/src/features/gen_GpuAdapter.rs +++ b/crates/web-sys/src/features/gen_GpuAdapter.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,17 +17,6 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuAdapter; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , 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/GPUAdapter/name)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn name(this: &GpuAdapter) -> String; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuSupportedFeatures")] # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = features)] #[doc = "Getter for the `features` field of this object."] @@ -51,16 +41,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn limits(this: &GpuAdapter) -> GpuSupportedLimits; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = isSoftware)] - #[doc = "Getter for the `isSoftware` field of this object."] + #[cfg(feature = "GpuAdapterInfo")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = info)] + #[doc = "Getter for the `info` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/info)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuAdapterInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn info(this: &GpuAdapter) -> GpuAdapterInfo; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapter" , js_name = isFallbackAdapter)] + #[doc = "Getter for the `isFallbackAdapter` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/isSoftware)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/isFallbackAdapter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_software(this: &GpuAdapter) -> bool; + pub fn is_fallback_adapter(this: &GpuAdapter) -> bool; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUAdapter" , js_name = requestDevice)] #[doc = "The `requestDevice()` method."] diff --git a/crates/web-sys/src/features/gen_GpuAdapterInfo.rs b/crates/web-sys/src/features/gen_GpuAdapterInfo.rs new file mode 100644 index 00000000000..8152dc1f896 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuAdapterInfo.rs @@ -0,0 +1,63 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUAdapterInfo , typescript_type = "GPUAdapterInfo")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuAdapterInfo` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuAdapterInfo; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterInfo" , js_name = vendor)] + #[doc = "Getter for the `vendor` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo/vendor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn vendor(this: &GpuAdapterInfo) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterInfo" , js_name = architecture)] + #[doc = "Getter for the `architecture` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo/architecture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn architecture(this: &GpuAdapterInfo) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterInfo" , js_name = device)] + #[doc = "Getter for the `device` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo/device)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device(this: &GpuAdapterInfo) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUAdapterInfo" , js_name = description)] + #[doc = "Getter for the `description` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo/description)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn description(this: &GpuAdapterInfo) -> ::alloc::string::String; +} diff --git a/crates/web-sys/src/features/gen_GpuAddressMode.rs b/crates/web-sys/src/features/gen_GpuAddressMode.rs index b607dc093b8..c0710da06cf 100644 --- a/crates/web-sys/src/features/gen_GpuAddressMode.rs +++ b/crates/web-sys/src/features/gen_GpuAddressMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuAutoLayoutMode.rs b/crates/web-sys/src/features/gen_GpuAutoLayoutMode.rs new file mode 100644 index 00000000000..8b56987a9ac --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuAutoLayoutMode.rs @@ -0,0 +1,15 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuAutoLayoutMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuAutoLayoutMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuAutoLayoutMode { + Auto = "auto", +} diff --git a/crates/web-sys/src/features/gen_GpuBindGroup.rs b/crates/web-sys/src/features/gen_GpuBindGroup.rs index e235001a313..44bd4e3250f 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroup.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroup.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuBindGroup) -> Option; + pub fn label(this: &GpuBindGroup) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUBindGroup" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,5 +37,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuBindGroup, value: Option<&str>); + pub fn set_label(this: &GpuBindGroup, value: &str); } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs b/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs index 528a40a46e6..36c3fab45be 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,23 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBindGroupDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBindGroupDescriptor { - #[cfg(feature = "GpuBindGroupLayout")] - #[doc = "Construct a new `GpuBindGroupDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(entries: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.entries(entries); - ret.layout(layout); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuBindGroupDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -37,16 +30,17 @@ impl GpuBindGroupDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuBindGroupDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `entries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entries")] + pub fn get_entries(this: &GpuBindGroupDescriptor) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `entries` field of this object."] #[doc = ""] @@ -54,20 +48,18 @@ impl GpuBindGroupDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "entries")] + pub fn set_entries(this: &GpuBindGroupDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBindGroupLayout")] + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuBindGroupDescriptor) -> GpuBindGroupLayout; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroupLayout")] #[doc = "Change the `layout` field of this object."] @@ -76,15 +68,42 @@ impl GpuBindGroupDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuBindGroupDescriptor, val: &GpuBindGroupLayout); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBindGroupDescriptor { + #[cfg(feature = "GpuBindGroupLayout")] + #[doc = "Construct a new `GpuBindGroupDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entries: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_entries(entries); + ret.set_layout(layout); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_entries()` instead."] + pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_entries(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBindGroupLayout")] + #[deprecated = "Use `set_layout()` instead."] pub fn layout(&mut self, val: &GpuBindGroupLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_layout(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupEntry.rs b/crates/web-sys/src/features/gen_GpuBindGroupEntry.rs index 72c7de2ac6a..261e29d9b65 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupEntry.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBindGroupEntry; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBindGroupEntry { - #[doc = "Construct a new `GpuBindGroupEntry`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `binding` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(binding: u32, resource: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.binding(binding); - ret.resource(resource); - ret - } + #[wasm_bindgen(method, getter = "binding")] + pub fn get_binding(this: &GpuBindGroupEntry) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `binding` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl GpuBindGroupEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn binding(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binding"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "binding")] + pub fn set_binding(this: &GpuBindGroupEntry, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `resource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "resource")] + pub fn get_resource(this: &GpuBindGroupEntry) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `resource` field of this object."] #[doc = ""] @@ -57,18 +48,34 @@ impl GpuBindGroupEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "resource")] + pub fn set_resource(this: &GpuBindGroupEntry, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBindGroupEntry { + #[doc = "Construct a new `GpuBindGroupEntry`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(binding: u32, resource: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_binding(binding); + ret.set_resource(resource); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_binding()` instead."] + pub fn binding(&mut self, val: u32) -> &mut Self { + self.set_binding(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_resource()` instead."] pub fn resource(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_resource(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupLayout.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayout.rs index d60a2b399df..a49305da88d 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupLayout.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuBindGroupLayout) -> Option; + pub fn label(this: &GpuBindGroupLayout) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUBindGroupLayout" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,5 +37,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuBindGroupLayout, value: Option<&str>); + pub fn set_label(this: &GpuBindGroupLayout, value: &str); } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs index 0a67dc1bded..d82524670a9 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayoutDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBindGroupLayoutDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBindGroupLayoutDescriptor { - #[doc = "Construct a new `GpuBindGroupLayoutDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(entries: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.entries(entries); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuBindGroupLayoutDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -35,16 +30,17 @@ impl GpuBindGroupLayoutDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuBindGroupLayoutDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `entries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entries")] + pub fn get_entries(this: &GpuBindGroupLayoutDescriptor) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `entries` field of this object."] #[doc = ""] @@ -52,18 +48,33 @@ impl GpuBindGroupLayoutDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "entries")] + pub fn set_entries(this: &GpuBindGroupLayoutDescriptor, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBindGroupLayoutDescriptor { + #[doc = "Construct a new `GpuBindGroupLayoutDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(entries: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_entries(entries); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_entries()` instead."] pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_entries(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs b/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs index 94e04dc429b..7d034cd6d30 100644 --- a/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs +++ b/crates/web-sys/src/features/gen_GpuBindGroupLayoutEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBindGroupLayoutEntry; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBindGroupLayoutEntry { - #[doc = "Construct a new `GpuBindGroupLayoutEntry`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `binding` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(binding: u32, visibility: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.binding(binding); - ret.visibility(visibility); - ret - } + #[wasm_bindgen(method, getter = "binding")] + pub fn get_binding(this: &GpuBindGroupLayoutEntry) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `binding` field of this object."] #[doc = ""] @@ -36,20 +30,18 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn binding(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binding"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "binding")] + pub fn set_binding(this: &GpuBindGroupLayoutEntry, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBufferBindingLayout")] + #[doc = "Get the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "buffer")] + pub fn get_buffer(this: &GpuBindGroupLayoutEntry) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBufferBindingLayout")] #[doc = "Change the `buffer` field of this object."] @@ -58,17 +50,20 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn buffer(&mut self, val: &GpuBufferBindingLayout) -> &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 - } + #[wasm_bindgen(method, setter = "buffer")] + pub fn set_buffer(this: &GpuBindGroupLayoutEntry, val: &GpuBufferBindingLayout); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuExternalTextureBindingLayout")] + #[doc = "Get the `externalTexture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuExternalTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "externalTexture")] + pub fn get_external_texture( + this: &GpuBindGroupLayoutEntry, + ) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuExternalTextureBindingLayout")] #[doc = "Change the `externalTexture` field of this object."] @@ -77,20 +72,21 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn external_texture(&mut self, val: &GpuExternalTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("externalTexture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "externalTexture")] + pub fn set_external_texture( + this: &GpuBindGroupLayoutEntry, + val: &GpuExternalTextureBindingLayout, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuSamplerBindingLayout")] + #[doc = "Get the `sampler` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuSamplerBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampler")] + pub fn get_sampler(this: &GpuBindGroupLayoutEntry) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuSamplerBindingLayout")] #[doc = "Change the `sampler` field of this object."] @@ -99,20 +95,20 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sampler(&mut self, val: &GpuSamplerBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampler"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "sampler")] + pub fn set_sampler(this: &GpuBindGroupLayoutEntry, val: &GpuSamplerBindingLayout); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStorageTextureBindingLayout")] + #[doc = "Get the `storageTexture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuStorageTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "storageTexture")] + pub fn get_storage_texture( + this: &GpuBindGroupLayoutEntry, + ) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStorageTextureBindingLayout")] #[doc = "Change the `storageTexture` field of this object."] @@ -121,20 +117,21 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn storage_texture(&mut self, val: &GpuStorageTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storageTexture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "storageTexture")] + pub fn set_storage_texture( + this: &GpuBindGroupLayoutEntry, + val: &GpuStorageTextureBindingLayout, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureBindingLayout")] + #[doc = "Get the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "texture")] + pub fn get_texture(this: &GpuBindGroupLayoutEntry) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureBindingLayout")] #[doc = "Change the `texture` field of this object."] @@ -143,20 +140,17 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn texture(&mut self, val: &GpuTextureBindingLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "texture")] + pub fn set_texture(this: &GpuBindGroupLayoutEntry, val: &GpuTextureBindingLayout); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `visibility` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "visibility")] + pub fn get_visibility(this: &GpuBindGroupLayoutEntry) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `visibility` field of this object."] #[doc = ""] @@ -164,18 +158,69 @@ impl GpuBindGroupLayoutEntry { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "visibility")] + pub fn set_visibility(this: &GpuBindGroupLayoutEntry, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBindGroupLayoutEntry { + #[doc = "Construct a new `GpuBindGroupLayoutEntry`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(binding: u32, visibility: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_binding(binding); + ret.set_visibility(visibility); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_binding()` instead."] + pub fn binding(&mut self, val: u32) -> &mut Self { + self.set_binding(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBufferBindingLayout")] + #[deprecated = "Use `set_buffer()` instead."] + pub fn buffer(&mut self, val: &GpuBufferBindingLayout) -> &mut Self { + self.set_buffer(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuExternalTextureBindingLayout")] + #[deprecated = "Use `set_external_texture()` instead."] + pub fn external_texture(&mut self, val: &GpuExternalTextureBindingLayout) -> &mut Self { + self.set_external_texture(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuSamplerBindingLayout")] + #[deprecated = "Use `set_sampler()` instead."] + pub fn sampler(&mut self, val: &GpuSamplerBindingLayout) -> &mut Self { + self.set_sampler(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStorageTextureBindingLayout")] + #[deprecated = "Use `set_storage_texture()` instead."] + pub fn storage_texture(&mut self, val: &GpuStorageTextureBindingLayout) -> &mut Self { + self.set_storage_texture(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureBindingLayout")] + #[deprecated = "Use `set_texture()` instead."] + pub fn texture(&mut self, val: &GpuTextureBindingLayout) -> &mut Self { + self.set_texture(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_visibility()` instead."] pub fn visibility(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("visibility"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_visibility(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBlendComponent.rs b/crates/web-sys/src/features/gen_GpuBlendComponent.rs index ed62e7dcbf4..10f53d345f4 100644 --- a/crates/web-sys/src/features/gen_GpuBlendComponent.rs +++ b/crates/web-sys/src/features/gen_GpuBlendComponent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBlendComponent; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBlendComponent { - #[doc = "Construct a new `GpuBlendComponent`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendFactor")] + #[doc = "Get the `dstFactor` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendFactor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "dstFactor")] + pub fn get_dst_factor(this: &GpuBlendComponent) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBlendFactor")] #[doc = "Change the `dstFactor` field of this object."] @@ -35,20 +32,18 @@ impl GpuBlendComponent { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dst_factor(&mut self, val: GpuBlendFactor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dstFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "dstFactor")] + pub fn set_dst_factor(this: &GpuBlendComponent, val: GpuBlendFactor); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendOperation")] + #[doc = "Get the `operation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "operation")] + pub fn get_operation(this: &GpuBlendComponent) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBlendOperation")] #[doc = "Change the `operation` field of this object."] @@ -57,20 +52,18 @@ impl GpuBlendComponent { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn operation(&mut self, val: GpuBlendOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("operation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "operation")] + pub fn set_operation(this: &GpuBlendComponent, val: GpuBlendOperation); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendFactor")] + #[doc = "Get the `srcFactor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendFactor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "srcFactor")] + pub fn get_src_factor(this: &GpuBlendComponent) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBlendFactor")] #[doc = "Change the `srcFactor` field of this object."] @@ -79,18 +72,41 @@ impl GpuBlendComponent { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "srcFactor")] + pub fn set_src_factor(this: &GpuBlendComponent, val: GpuBlendFactor); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBlendComponent { + #[doc = "Construct a new `GpuBlendComponent`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendFactor")] + #[deprecated = "Use `set_dst_factor()` instead."] + pub fn dst_factor(&mut self, val: GpuBlendFactor) -> &mut Self { + self.set_dst_factor(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendOperation")] + #[deprecated = "Use `set_operation()` instead."] + pub fn operation(&mut self, val: GpuBlendOperation) -> &mut Self { + self.set_operation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendFactor")] + #[deprecated = "Use `set_src_factor()` instead."] pub fn src_factor(&mut self, val: GpuBlendFactor) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("srcFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_src_factor(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBlendFactor.rs b/crates/web-sys/src/features/gen_GpuBlendFactor.rs index 77aed0f3ecb..6ae84672461 100644 --- a/crates/web-sys/src/features/gen_GpuBlendFactor.rs +++ b/crates/web-sys/src/features/gen_GpuBlendFactor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -23,4 +24,8 @@ pub enum GpuBlendFactor { SrcAlphaSaturated = "src-alpha-saturated", Constant = "constant", OneMinusConstant = "one-minus-constant", + Src1 = "src1", + OneMinusSrc1 = "one-minus-src1", + Src1Alpha = "src1-alpha", + OneMinusSrc1Alpha = "one-minus-src1-alpha", } diff --git a/crates/web-sys/src/features/gen_GpuBlendOperation.rs b/crates/web-sys/src/features/gen_GpuBlendOperation.rs index 69ae1f0ac90..ad66d0a51f5 100644 --- a/crates/web-sys/src/features/gen_GpuBlendOperation.rs +++ b/crates/web-sys/src/features/gen_GpuBlendOperation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuBlendState.rs b/crates/web-sys/src/features/gen_GpuBlendState.rs index 3d9204ae7e0..19891949998 100644 --- a/crates/web-sys/src/features/gen_GpuBlendState.rs +++ b/crates/web-sys/src/features/gen_GpuBlendState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,23 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBlendState; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBlendState { + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBlendComponent")] - #[doc = "Construct a new `GpuBlendState`."] + #[doc = "Get the `alpha` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.alpha(alpha); - ret.color(color); - ret - } + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &GpuBlendState) -> GpuBlendComponent; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBlendComponent")] #[doc = "Change the `alpha` field of this object."] @@ -38,16 +32,18 @@ impl GpuBlendState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha(&mut self, val: &GpuBlendComponent) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &GpuBlendState, val: &GpuBlendComponent); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendComponent")] + #[doc = "Get the `color` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "color")] + pub fn get_color(this: &GpuBlendState) -> GpuBlendComponent; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBlendComponent")] #[doc = "Change the `color` field of this object."] @@ -56,14 +52,37 @@ impl GpuBlendState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "color")] + pub fn set_color(this: &GpuBlendState, val: &GpuBlendComponent); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBlendState { + #[cfg(feature = "GpuBlendComponent")] + #[doc = "Construct a new `GpuBlendState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_alpha(alpha); + ret.set_color(color); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendComponent")] + #[deprecated = "Use `set_alpha()` instead."] + pub fn alpha(&mut self, val: &GpuBlendComponent) -> &mut Self { + self.set_alpha(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendComponent")] + #[deprecated = "Use `set_color()` instead."] pub fn color(&mut self, val: &GpuBlendComponent) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("color"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_color(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBuffer.rs b/crates/web-sys/src/features/gen_GpuBuffer.rs index 046b43ff04f..b06cf363cdb 100644 --- a/crates/web-sys/src/features/gen_GpuBuffer.rs +++ b/crates/web-sys/src/features/gen_GpuBuffer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,6 +17,40 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBuffer; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUBuffer" , 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/GPUBuffer/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &GpuBuffer) -> f64; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUBuffer" , js_name = usage)] + #[doc = "Getter for the `usage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/usage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn usage(this: &GpuBuffer) -> u32; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBufferMapState")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUBuffer" , js_name = mapState)] + #[doc = "Getter for the `mapState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferMapState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn map_state(this: &GpuBuffer) -> GpuBufferMapState; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUBuffer" , js_name = label)] #[doc = "Getter for the `label` field of this object."] #[doc = ""] @@ -25,7 +60,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuBuffer) -> Option; + pub fn label(this: &GpuBuffer) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUBuffer" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,7 +71,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuBuffer, value: Option<&str>); + pub fn set_label(this: &GpuBuffer, value: &str); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = destroy)] #[doc = "The `destroy()` method."] @@ -49,7 +84,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn destroy(this: &GpuBuffer); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -58,9 +93,9 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_mapped_range(this: &GpuBuffer) -> ::js_sys::ArrayBuffer; + pub fn get_mapped_range(this: &GpuBuffer) -> Result<::js_sys::ArrayBuffer, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -69,9 +104,12 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_mapped_range_with_u32(this: &GpuBuffer, offset: u32) -> ::js_sys::ArrayBuffer; + pub fn get_mapped_range_with_u32( + this: &GpuBuffer, + offset: u32, + ) -> Result<::js_sys::ArrayBuffer, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -80,9 +118,12 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_mapped_range_with_f64(this: &GpuBuffer, offset: f64) -> ::js_sys::ArrayBuffer; + pub fn get_mapped_range_with_f64( + this: &GpuBuffer, + offset: f64, + ) -> Result<::js_sys::ArrayBuffer, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -95,9 +136,9 @@ extern "C" { this: &GpuBuffer, offset: u32, size: u32, - ) -> ::js_sys::ArrayBuffer; + ) -> Result<::js_sys::ArrayBuffer, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -110,9 +151,9 @@ extern "C" { this: &GpuBuffer, offset: f64, size: u32, - ) -> ::js_sys::ArrayBuffer; + ) -> Result<::js_sys::ArrayBuffer, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -125,9 +166,9 @@ extern "C" { this: &GpuBuffer, offset: u32, size: f64, - ) -> ::js_sys::ArrayBuffer; + ) -> Result<::js_sys::ArrayBuffer, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUBuffer" , js_name = getMappedRange)] #[doc = "The `getMappedRange()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"] @@ -140,7 +181,7 @@ extern "C" { this: &GpuBuffer, offset: f64, size: f64, - ) -> ::js_sys::ArrayBuffer; + ) -> Result<::js_sys::ArrayBuffer, JsValue>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUBuffer" , js_name = mapAsync)] #[doc = "The `mapAsync()` method."] diff --git a/crates/web-sys/src/features/gen_GpuBufferBinding.rs b/crates/web-sys/src/features/gen_GpuBufferBinding.rs index 0e0c8904746..24d42a64e29 100644 --- a/crates/web-sys/src/features/gen_GpuBufferBinding.rs +++ b/crates/web-sys/src/features/gen_GpuBufferBinding.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBufferBinding; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBufferBinding { + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - #[doc = "Construct a new `GpuBufferBinding`."] + #[doc = "Get the `buffer` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(buffer: &GpuBuffer) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.buffer(buffer); - ret - } + #[wasm_bindgen(method, getter = "buffer")] + pub fn get_buffer(this: &GpuBufferBinding) -> GpuBuffer; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] #[doc = "Change the `buffer` field of this object."] @@ -37,17 +32,17 @@ impl GpuBufferBinding { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn buffer(&mut self, val: &GpuBuffer) -> &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 - } + #[wasm_bindgen(method, setter = "buffer")] + pub fn set_buffer(this: &GpuBufferBinding, val: &GpuBuffer); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &GpuBufferBinding) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `offset` field of this object."] #[doc = ""] @@ -55,17 +50,17 @@ impl GpuBufferBinding { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &GpuBufferBinding, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &GpuBufferBinding) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `size` field of this object."] #[doc = ""] @@ -73,14 +68,41 @@ impl GpuBufferBinding { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &GpuBufferBinding, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBufferBinding { + #[cfg(feature = "GpuBuffer")] + #[doc = "Construct a new `GpuBufferBinding`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(buffer: &GpuBuffer) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_buffer(buffer); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + #[deprecated = "Use `set_buffer()` instead."] + pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self { + self.set_buffer(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: f64) -> &mut Self { + self.set_offset(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_size()` instead."] pub fn size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_size(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs b/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs index e722860d620..47def45064b 100644 --- a/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuBufferBindingLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBufferBindingLayout; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBufferBindingLayout { - #[doc = "Construct a new `GpuBufferBindingLayout`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `hasDynamicOffset` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "hasDynamicOffset")] + pub fn get_has_dynamic_offset(this: &GpuBufferBindingLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `hasDynamicOffset` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl GpuBufferBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn has_dynamic_offset(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hasDynamicOffset"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "hasDynamicOffset")] + pub fn set_has_dynamic_offset(this: &GpuBufferBindingLayout, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `minBindingSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "minBindingSize")] + pub fn get_min_binding_size(this: &GpuBufferBindingLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `minBindingSize` field of this object."] #[doc = ""] @@ -55,20 +48,18 @@ impl GpuBufferBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn min_binding_size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minBindingSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "minBindingSize")] + pub fn set_min_binding_size(this: &GpuBufferBindingLayout, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBufferBindingType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`, `GpuBufferBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &GpuBufferBindingLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBufferBindingType")] #[doc = "Change the `type` field of this object."] @@ -77,14 +68,39 @@ impl GpuBufferBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &GpuBufferBindingLayout, val: GpuBufferBindingType); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBufferBindingLayout { + #[doc = "Construct a new `GpuBufferBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_has_dynamic_offset()` instead."] + pub fn has_dynamic_offset(&mut self, val: bool) -> &mut Self { + self.set_has_dynamic_offset(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_min_binding_size()` instead."] + pub fn min_binding_size(&mut self, val: f64) -> &mut Self { + self.set_min_binding_size(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBufferBindingType")] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: GpuBufferBindingType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBufferBindingType.rs b/crates/web-sys/src/features/gen_GpuBufferBindingType.rs index 8be5d8fe774..d297f54b43b 100644 --- a/crates/web-sys/src/features/gen_GpuBufferBindingType.rs +++ b/crates/web-sys/src/features/gen_GpuBufferBindingType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs b/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs index cc677ecb5e9..76717205232 100644 --- a/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuBufferDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuBufferDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBufferDescriptor { - #[doc = "Construct a new `GpuBufferDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(size: f64, usage: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.size(size); - ret.usage(usage); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuBufferDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -36,16 +30,17 @@ impl GpuBufferDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuBufferDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mappedAtCreation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mappedAtCreation")] + pub fn get_mapped_at_creation(this: &GpuBufferDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `mappedAtCreation` field of this object."] #[doc = ""] @@ -53,20 +48,17 @@ impl GpuBufferDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mapped_at_creation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mappedAtCreation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "mappedAtCreation")] + pub fn set_mapped_at_creation(this: &GpuBufferDescriptor, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &GpuBufferDescriptor) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `size` field of this object."] #[doc = ""] @@ -74,16 +66,17 @@ impl GpuBufferDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &GpuBufferDescriptor, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &GpuBufferDescriptor) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usage` field of this object."] #[doc = ""] @@ -91,14 +84,46 @@ impl GpuBufferDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &GpuBufferDescriptor, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuBufferDescriptor { + #[doc = "Construct a new `GpuBufferDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(size: f64, usage: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_size(size); + ret.set_usage(usage); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mapped_at_creation()` instead."] + pub fn mapped_at_creation(&mut self, val: bool) -> &mut Self { + self.set_mapped_at_creation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_size()` instead."] + pub fn size(&mut self, val: f64) -> &mut Self { + self.set_size(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage()` instead."] pub fn usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_usage(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuBufferMapState.rs b/crates/web-sys/src/features/gen_GpuBufferMapState.rs new file mode 100644 index 00000000000..3e6049ffdd5 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuBufferMapState.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuBufferMapState` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuBufferMapState`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuBufferMapState { + Unmapped = "unmapped", + Pending = "pending", + Mapped = "mapped", +} diff --git a/crates/web-sys/src/features/gen_GpuCanvasCompositingAlphaMode.rs b/crates/web-sys/src/features/gen_GpuCanvasAlphaMode.rs similarity index 78% rename from crates/web-sys/src/features/gen_GpuCanvasCompositingAlphaMode.rs rename to crates/web-sys/src/features/gen_GpuCanvasAlphaMode.rs index 589dada7fdd..96d11c720b7 100644 --- a/crates/web-sys/src/features/gen_GpuCanvasCompositingAlphaMode.rs +++ b/crates/web-sys/src/features/gen_GpuCanvasAlphaMode.rs @@ -1,15 +1,16 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] -#[doc = "The `GpuCanvasCompositingAlphaMode` enum."] +#[doc = "The `GpuCanvasAlphaMode` enum."] #[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `GpuCanvasCompositingAlphaMode`*"] +#[doc = "*This API requires the following crate features to be activated: `GpuCanvasAlphaMode`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GpuCanvasCompositingAlphaMode { +pub enum GpuCanvasAlphaMode { Opaque = "opaque", Premultiplied = "premultiplied", } diff --git a/crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs b/crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs index ec51cbc692d..b54672a0a8b 100644 --- a/crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs +++ b/crates/web-sys/src/features/gen_GpuCanvasConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,67 +14,36 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuCanvasConfiguration; -} -#[cfg(web_sys_unstable_apis)] -impl GpuCanvasConfiguration { - #[cfg(all(feature = "GpuDevice", feature = "GpuTextureFormat",))] - #[doc = "Construct a new `GpuCanvasConfiguration`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCanvasAlphaMode")] + #[doc = "Get the `alphaMode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuDevice`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasAlphaMode`, `GpuCanvasConfiguration`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(device: &GpuDevice, format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.device(device); - ret.format(format); - ret - } + #[wasm_bindgen(method, getter = "alphaMode")] + pub fn get_alpha_mode(this: &GpuCanvasConfiguration) -> Option; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuPredefinedColorSpace")] - #[doc = "Change the `colorSpace` field of this object."] + #[cfg(feature = "GpuCanvasAlphaMode")] + #[doc = "Change the `alphaMode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuPredefinedColorSpace`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasAlphaMode`, `GpuCanvasConfiguration`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_space(&mut self, val: GpuPredefinedColorSpace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alphaMode")] + pub fn set_alpha_mode(this: &GpuCanvasConfiguration, val: GpuCanvasAlphaMode); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuCanvasCompositingAlphaMode")] - #[doc = "Change the `compositingAlphaMode` field of this object."] + #[cfg(feature = "GpuDevice")] + #[doc = "Get the `device` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCanvasCompositingAlphaMode`, `GpuCanvasConfiguration`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuDevice`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn compositing_alpha_mode(&mut self, val: GpuCanvasCompositingAlphaMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compositingAlphaMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "device")] + pub fn get_device(this: &GpuCanvasConfiguration) -> GpuDevice; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuDevice")] #[doc = "Change the `device` field of this object."] @@ -82,17 +52,18 @@ impl GpuCanvasConfiguration { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn device(&mut self, val: &GpuDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "device")] + pub fn set_device(this: &GpuCanvasConfiguration, val: &GpuDevice); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuCanvasConfiguration) -> GpuTextureFormat; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureFormat")] #[doc = "Change the `format` field of this object."] @@ -101,34 +72,37 @@ impl GpuCanvasConfiguration { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuCanvasConfiguration, val: GpuTextureFormat); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCanvasToneMapping")] + #[doc = "Get the `toneMapping` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasToneMapping`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "toneMapping")] + pub fn get_tone_mapping(this: &GpuCanvasConfiguration) -> Option; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `size` field of this object."] + #[cfg(feature = "GpuCanvasToneMapping")] + #[doc = "Change the `toneMapping` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasToneMapping`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "toneMapping")] + pub fn set_tone_mapping(this: &GpuCanvasConfiguration, val: &GpuCanvasToneMapping); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usage` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn size(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &GpuCanvasConfiguration) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usage` field of this object."] #[doc = ""] @@ -136,14 +110,81 @@ impl GpuCanvasConfiguration { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &GpuCanvasConfiguration, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `viewFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "viewFormats")] + pub fn get_view_formats(this: &GpuCanvasConfiguration) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `viewFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "viewFormats")] + pub fn set_view_formats(this: &GpuCanvasConfiguration, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuCanvasConfiguration { + #[cfg(all(feature = "GpuDevice", feature = "GpuTextureFormat",))] + #[doc = "Construct a new `GpuCanvasConfiguration`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuDevice`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(device: &GpuDevice, format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_device(device); + ret.set_format(format); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCanvasAlphaMode")] + #[deprecated = "Use `set_alpha_mode()` instead."] + pub fn alpha_mode(&mut self, val: GpuCanvasAlphaMode) -> &mut Self { + self.set_alpha_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuDevice")] + #[deprecated = "Use `set_device()` instead."] + pub fn device(&mut self, val: &GpuDevice) -> &mut Self { + self.set_device(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCanvasToneMapping")] + #[deprecated = "Use `set_tone_mapping()` instead."] + pub fn tone_mapping(&mut self, val: &GpuCanvasToneMapping) -> &mut Self { + self.set_tone_mapping(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage()` instead."] pub fn usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_usage(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_view_formats()` instead."] + pub fn view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_view_formats(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuCanvasContext.rs b/crates/web-sys/src/features/gen_GpuCanvasContext.rs index 3fa41f7297b..232fb7fe5b8 100644 --- a/crates/web-sys/src/features/gen_GpuCanvasContext.rs +++ b/crates/web-sys/src/features/gen_GpuCanvasContext.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -28,7 +29,7 @@ extern "C" { pub fn canvas(this: &GpuCanvasContext) -> ::js_sys::Object; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuCanvasConfiguration")] - # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = configure)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCanvasContext" , js_name = configure)] #[doc = "The `configure()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure)"] @@ -37,31 +38,34 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn configure(this: &GpuCanvasContext, configuration: &GpuCanvasConfiguration); + pub fn configure( + this: &GpuCanvasContext, + configuration: &GpuCanvasConfiguration, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTexture")] - # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = getCurrentTexture)] - #[doc = "The `getCurrentTexture()` method."] + #[cfg(feature = "GpuCanvasConfiguration")] + # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = getConfiguration)] + #[doc = "The `getConfiguration()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getCurrentTexture)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getConfiguration)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasContext`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_current_texture(this: &GpuCanvasContext) -> GpuTexture; + pub fn get_configuration(this: &GpuCanvasContext) -> Option; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuAdapter", feature = "GpuTextureFormat",))] - # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = getPreferredFormat)] - #[doc = "The `getPreferredFormat()` method."] + #[cfg(feature = "GpuTexture")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCanvasContext" , js_name = getCurrentTexture)] + #[doc = "The `getCurrentTexture()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getPreferredFormat)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getCurrentTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuCanvasContext`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_preferred_format(this: &GpuCanvasContext, adapter: &GpuAdapter) -> GpuTextureFormat; + pub fn get_current_texture(this: &GpuCanvasContext) -> Result; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUCanvasContext" , js_name = unconfigure)] #[doc = "The `unconfigure()` method."] diff --git a/crates/web-sys/src/features/gen_GpuCanvasToneMapping.rs b/crates/web-sys/src/features/gen_GpuCanvasToneMapping.rs new file mode 100644 index 00000000000..c2fa53c0eff --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCanvasToneMapping.rs @@ -0,0 +1,64 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCanvasToneMapping)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCanvasToneMapping` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCanvasToneMapping; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCanvasToneMappingMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`, `GpuCanvasToneMappingMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &GpuCanvasToneMapping) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCanvasToneMappingMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`, `GpuCanvasToneMappingMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &GpuCanvasToneMapping, val: GpuCanvasToneMappingMode); +} +#[cfg(web_sys_unstable_apis)] +impl GpuCanvasToneMapping { + #[doc = "Construct a new `GpuCanvasToneMapping`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMapping`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCanvasToneMappingMode")] + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: GpuCanvasToneMappingMode) -> &mut Self { + self.set_mode(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for GpuCanvasToneMapping { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_GpuCanvasToneMappingMode.rs b/crates/web-sys/src/features/gen_GpuCanvasToneMappingMode.rs new file mode 100644 index 00000000000..106664a51ad --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCanvasToneMappingMode.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuCanvasToneMappingMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuCanvasToneMappingMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuCanvasToneMappingMode { + Standard = "standard", + Extended = "extended", +} diff --git a/crates/web-sys/src/features/gen_GpuColorDict.rs b/crates/web-sys/src/features/gen_GpuColorDict.rs index de5420ee5a1..382cdee44d1 100644 --- a/crates/web-sys/src/features/gen_GpuColorDict.rs +++ b/crates/web-sys/src/features/gen_GpuColorDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,24 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuColorDict; -} -#[cfg(web_sys_unstable_apis)] -impl GpuColorDict { - #[doc = "Construct a new `GpuColorDict`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `a` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(a: f64, b: f64, g: f64, r: f64) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.a(a); - ret.b(b); - ret.g(g); - ret.r(r); - ret - } + #[wasm_bindgen(method, getter = "a")] + pub fn get_a(this: &GpuColorDict) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `a` field of this object."] #[doc = ""] @@ -38,16 +30,17 @@ impl GpuColorDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn a(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("a"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "a")] + pub fn set_a(this: &GpuColorDict, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `b` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "b")] + pub fn get_b(this: &GpuColorDict) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `b` field of this object."] #[doc = ""] @@ -55,16 +48,17 @@ impl GpuColorDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn b(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("b"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "b")] + pub fn set_b(this: &GpuColorDict, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `g` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "g")] + pub fn get_g(this: &GpuColorDict) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `g` field of this object."] #[doc = ""] @@ -72,16 +66,17 @@ impl GpuColorDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn g(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("g"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "g")] + pub fn set_g(this: &GpuColorDict, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `r` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "r")] + pub fn get_r(this: &GpuColorDict) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `r` field of this object."] #[doc = ""] @@ -89,14 +84,48 @@ impl GpuColorDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "r")] + pub fn set_r(this: &GpuColorDict, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl GpuColorDict { + #[doc = "Construct a new `GpuColorDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(a: f64, b: f64, g: f64, r: f64) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_a(a); + ret.set_b(b); + ret.set_g(g); + ret.set_r(r); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_a()` instead."] + pub fn a(&mut self, val: f64) -> &mut Self { + self.set_a(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_b()` instead."] + pub fn b(&mut self, val: f64) -> &mut Self { + self.set_b(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_g()` instead."] + pub fn g(&mut self, val: f64) -> &mut Self { + self.set_g(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_r()` instead."] pub fn r(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("r"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_r(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuColorTargetState.rs b/crates/web-sys/src/features/gen_GpuColorTargetState.rs index 2e910d7b6cb..74f0be3bbe4 100644 --- a/crates/web-sys/src/features/gen_GpuColorTargetState.rs +++ b/crates/web-sys/src/features/gen_GpuColorTargetState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuColorTargetState; -} -#[cfg(web_sys_unstable_apis)] -impl GpuColorTargetState { - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Construct a new `GpuColorTargetState`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendState")] + #[doc = "Get the `blend` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`, `GpuColorTargetState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret - } + #[wasm_bindgen(method, getter = "blend")] + pub fn get_blend(this: &GpuColorTargetState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBlendState")] #[doc = "Change the `blend` field of this object."] @@ -37,16 +32,18 @@ impl GpuColorTargetState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn blend(&mut self, val: &GpuBlendState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("blend"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "blend")] + pub fn set_blend(this: &GpuColorTargetState, val: &GpuBlendState); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuColorTargetState) -> GpuTextureFormat; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureFormat")] #[doc = "Change the `format` field of this object."] @@ -55,17 +52,17 @@ impl GpuColorTargetState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuColorTargetState, val: GpuTextureFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `writeMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "writeMask")] + pub fn get_write_mask(this: &GpuColorTargetState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `writeMask` field of this object."] #[doc = ""] @@ -73,18 +70,42 @@ impl GpuColorTargetState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "writeMask")] + pub fn set_write_mask(this: &GpuColorTargetState, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuColorTargetState { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuColorTargetState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBlendState")] + #[deprecated = "Use `set_blend()` instead."] + pub fn blend(&mut self, val: &GpuBlendState) -> &mut Self { + self.set_blend(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_write_mask()` instead."] pub fn write_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("writeMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_write_mask(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuCommandBuffer.rs b/crates/web-sys/src/features/gen_GpuCommandBuffer.rs index 5df42c67868..f5c24baa66a 100644 --- a/crates/web-sys/src/features/gen_GpuCommandBuffer.rs +++ b/crates/web-sys/src/features/gen_GpuCommandBuffer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,17 +17,6 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuCommandBuffer; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "GPUCommandBuffer" , js_name = executionTime)] - #[doc = "Getter for the `executionTime` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer/executionTime)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandBuffer`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn execution_time(this: &GpuCommandBuffer) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUCommandBuffer" , js_name = label)] #[doc = "Getter for the `label` field of this object."] #[doc = ""] @@ -36,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuCommandBuffer) -> Option; + pub fn label(this: &GpuCommandBuffer) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUCommandBuffer" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -47,5 +37,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuCommandBuffer, value: Option<&str>); + pub fn set_label(this: &GpuCommandBuffer, value: &str); } diff --git a/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs b/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs index c5fec9f8cf1..1db6b1097db 100644 --- a/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuCommandBufferDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuCommandBufferDescriptor; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuCommandBufferDescriptor) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuCommandBufferDescriptor, val: &str); } #[cfg(web_sys_unstable_apis)] impl GpuCommandBufferDescriptor { @@ -28,20 +47,9 @@ impl GpuCommandBufferDescriptor { ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandBufferDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuCommandEncoder.rs b/crates/web-sys/src/features/gen_GpuCommandEncoder.rs index ac1e1b9959f..426b59447fc 100644 --- a/crates/web-sys/src/features/gen_GpuCommandEncoder.rs +++ b/crates/web-sys/src/features/gen_GpuCommandEncoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuCommandEncoder) -> Option; + pub fn label(this: &GpuCommandEncoder) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUCommandEncoder" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,7 +37,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuCommandEncoder, value: Option<&str>); + pub fn set_label(this: &GpuCommandEncoder, value: &str); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuComputePassEncoder")] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = beginComputePass)] @@ -69,7 +70,7 @@ extern "C" { ) -> GpuComputePassEncoder; #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuRenderPassDescriptor", feature = "GpuRenderPassEncoder",))] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = beginRenderPass)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = beginRenderPass)] #[doc = "The `beginRenderPass()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/beginRenderPass)"] @@ -81,10 +82,114 @@ extern "C" { pub fn begin_render_pass( this: &GpuCommandEncoder, descriptor: &GpuRenderPassDescriptor, - ) -> GpuRenderPassEncoder; + ) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer(this: &GpuCommandEncoder, buffer: &GpuBuffer); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_u32(this: &GpuCommandEncoder, buffer: &GpuBuffer, offset: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_f64(this: &GpuCommandEncoder, buffer: &GpuBuffer, offset: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_u32_and_u32( + this: &GpuCommandEncoder, + buffer: &GpuBuffer, + offset: u32, + size: u32, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_f64_and_u32( + this: &GpuCommandEncoder, + buffer: &GpuBuffer, + offset: f64, + size: u32, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_u32_and_f64( + this: &GpuCommandEncoder, + buffer: &GpuBuffer, + offset: u32, + size: f64, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = clearBuffer)] + #[doc = "The `clearBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/clearBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn clear_buffer_with_f64_and_f64( + this: &GpuCommandEncoder, + buffer: &GpuBuffer, + offset: f64, + size: f64, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -100,10 +205,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -119,10 +224,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -138,10 +243,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -157,10 +262,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -176,10 +281,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -195,10 +300,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -214,10 +319,10 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToBuffer)] #[doc = "The `copyBufferToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToBuffer)"] @@ -233,117 +338,123 @@ extern "C" { destination: &GpuBuffer, destination_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyBuffer", feature = "GpuImageCopyTexture",))] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] + #[cfg(all( + feature = "GpuTexelCopyBufferInfo", + feature = "GpuTexelCopyTextureInfo", + ))] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] #[doc = "The `copyBufferToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_buffer_to_texture_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyBuffer, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyBufferInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyBuffer", - feature = "GpuImageCopyTexture", + feature = "GpuTexelCopyBufferInfo", + feature = "GpuTexelCopyTextureInfo", ))] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyBufferToTexture)] #[doc = "The `copyBufferToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyBufferToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_buffer_to_texture_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyBuffer, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyBufferInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyBuffer", feature = "GpuImageCopyTexture",))] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] + #[cfg(all( + feature = "GpuTexelCopyBufferInfo", + feature = "GpuTexelCopyTextureInfo", + ))] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] #[doc = "The `copyTextureToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_buffer_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyBuffer, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyBufferInfo, copy_size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyBuffer", - feature = "GpuImageCopyTexture", + feature = "GpuTexelCopyBufferInfo", + feature = "GpuTexelCopyTextureInfo", ))] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToBuffer)] #[doc = "The `copyTextureToBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToBuffer)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyBuffer`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyBufferInfo`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_buffer_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyBuffer, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyBufferInfo, copy_size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuImageCopyTexture")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] + #[cfg(feature = "GpuTexelCopyTextureInfo")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] #[doc = "The `copyTextureToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_texture_with_u32_sequence( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuExtent3dDict", feature = "GpuImageCopyTexture",))] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] + #[cfg(all(feature = "GpuExtent3dDict", feature = "GpuTexelCopyTextureInfo",))] + # [wasm_bindgen (catch , method , structural , js_class = "GPUCommandEncoder" , js_name = copyTextureToTexture)] #[doc = "The `copyTextureToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/copyTextureToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuImageCopyTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuExtent3dDict`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_texture_to_texture_with_gpu_extent_3d_dict( this: &GpuCommandEncoder, - source: &GpuImageCopyTexture, - destination: &GpuImageCopyTexture, + source: &GpuTexelCopyTextureInfo, + destination: &GpuTexelCopyTextureInfo, copy_size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuCommandBuffer")] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = finish)] @@ -372,39 +483,6 @@ extern "C" { descriptor: &GpuCommandBufferDescriptor, ) -> GpuCommandBuffer; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = insertDebugMarker)] - #[doc = "The `insertDebugMarker()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/insertDebugMarker)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn insert_debug_marker(this: &GpuCommandEncoder, marker_label: &str); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = popDebugGroup)] - #[doc = "The `popDebugGroup()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/popDebugGroup)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn pop_debug_group(this: &GpuCommandEncoder); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = pushDebugGroup)] - #[doc = "The `pushDebugGroup()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/pushDebugGroup)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn push_debug_group(this: &GpuCommandEncoder, group_label: &str); - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuBuffer", feature = "GpuQuerySet",))] # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = resolveQuerySet)] #[doc = "The `resolveQuerySet()` method."] @@ -443,15 +521,36 @@ extern "C" { destination_offset: f64, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuQuerySet")] - # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = writeTimestamp)] - #[doc = "The `writeTimestamp()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = insertDebugMarker)] + #[doc = "The `insertDebugMarker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/insertDebugMarker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn insert_debug_marker(this: &GpuCommandEncoder, marker_label: &str); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = popDebugGroup)] + #[doc = "The `popDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/popDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_debug_group(this: &GpuCommandEncoder); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUCommandEncoder" , js_name = pushDebugGroup)] + #[doc = "The `pushDebugGroup()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/writeTimestamp)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandEncoder/pushDebugGroup)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`, `GpuQuerySet`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_timestamp(this: &GpuCommandEncoder, query_set: &GpuQuerySet, query_index: u32); + pub fn push_debug_group(this: &GpuCommandEncoder, group_label: &str); } diff --git a/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs b/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs index d2dc0af5067..51632a57feb 100644 --- a/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuCommandEncoderDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuCommandEncoderDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuCommandEncoderDescriptor { - #[doc = "Construct a new `GpuCommandEncoderDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuCommandEncoderDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -34,35 +30,26 @@ impl GpuCommandEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `measureExecutionTime` field of this object."] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuCommandEncoderDescriptor, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl GpuCommandEncoderDescriptor { + #[doc = "Construct a new `GpuCommandEncoderDescriptor`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuCommandEncoderDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn measure_execution_time(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("measureExecutionTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuCompareFunction.rs b/crates/web-sys/src/features/gen_GpuCompareFunction.rs index cdbeaae6b04..8e01e1903dc 100644 --- a/crates/web-sys/src/features/gen_GpuCompareFunction.rs +++ b/crates/web-sys/src/features/gen_GpuCompareFunction.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuCompilationInfo.rs b/crates/web-sys/src/features/gen_GpuCompilationInfo.rs index 02974b61563..c8785939ea9 100644 --- a/crates/web-sys/src/features/gen_GpuCompilationInfo.rs +++ b/crates/web-sys/src/features/gen_GpuCompilationInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_GpuCompilationMessage.rs b/crates/web-sys/src/features/gen_GpuCompilationMessage.rs index 927a3c5459d..83c01717793 100644 --- a/crates/web-sys/src/features/gen_GpuCompilationMessage.rs +++ b/crates/web-sys/src/features/gen_GpuCompilationMessage.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn message(this: &GpuCompilationMessage) -> String; + pub fn message(this: &GpuCompilationMessage) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuCompilationMessageType")] # [wasm_bindgen (structural , method , getter , js_class = "GPUCompilationMessage" , js_name = type)] diff --git a/crates/web-sys/src/features/gen_GpuCompilationMessageType.rs b/crates/web-sys/src/features/gen_GpuCompilationMessageType.rs index 6f11081414b..74780e3d56a 100644 --- a/crates/web-sys/src/features/gen_GpuCompilationMessageType.rs +++ b/crates/web-sys/src/features/gen_GpuCompilationMessageType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs b/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs index 9b1ccee18e3..e7ba89476d1 100644 --- a/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuComputePassDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,49 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuComputePassDescriptor; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuComputePassDescriptor) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuComputePassDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuComputePassTimestampWrites")] + #[doc = "Get the `timestampWrites` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`, `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestampWrites")] + pub fn get_timestamp_writes( + this: &GpuComputePassDescriptor, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuComputePassTimestampWrites")] + #[doc = "Change the `timestampWrites` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`, `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestampWrites")] + pub fn set_timestamp_writes( + this: &GpuComputePassDescriptor, + val: &GpuComputePassTimestampWrites, + ); } #[cfg(web_sys_unstable_apis)] impl GpuComputePassDescriptor { @@ -28,20 +72,16 @@ impl GpuComputePassDescriptor { ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuComputePassTimestampWrites")] + #[deprecated = "Use `set_timestamp_writes()` instead."] + pub fn timestamp_writes(&mut self, val: &GpuComputePassTimestampWrites) -> &mut Self { + self.set_timestamp_writes(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuComputePassEncoder.rs b/crates/web-sys/src/features/gen_GpuComputePassEncoder.rs index 35ce98ae728..7f9daed5033 100644 --- a/crates/web-sys/src/features/gen_GpuComputePassEncoder.rs +++ b/crates/web-sys/src/features/gen_GpuComputePassEncoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuComputePassEncoder) -> Option; + pub fn label(this: &GpuComputePassEncoder) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUComputePassEncoder" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,110 +37,92 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuComputePassEncoder, value: Option<&str>); + pub fn set_label(this: &GpuComputePassEncoder, value: &str); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuQuerySet")] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = beginPipelineStatisticsQuery)] - #[doc = "The `beginPipelineStatisticsQuery()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroups)] + #[doc = "The `dispatchWorkgroups()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/beginPipelineStatisticsQuery)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`, `GpuQuerySet`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn begin_pipeline_statistics_query( - this: &GpuComputePassEncoder, - query_set: &GpuQuerySet, - query_index: u32, - ); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatch)] - #[doc = "The `dispatch()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatch)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroups)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dispatch(this: &GpuComputePassEncoder, x: u32); + pub fn dispatch_workgroups(this: &GpuComputePassEncoder, workgroup_count_x: u32); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatch)] - #[doc = "The `dispatch()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroups)] + #[doc = "The `dispatchWorkgroups()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatch)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroups)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dispatch_with_y(this: &GpuComputePassEncoder, x: u32, y: u32); + pub fn dispatch_workgroups_with_workgroup_count_y( + this: &GpuComputePassEncoder, + workgroup_count_x: u32, + workgroup_count_y: u32, + ); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatch)] - #[doc = "The `dispatch()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroups)] + #[doc = "The `dispatchWorkgroups()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatch)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroups)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dispatch_with_y_and_z(this: &GpuComputePassEncoder, x: u32, y: u32, z: u32); + pub fn dispatch_workgroups_with_workgroup_count_y_and_workgroup_count_z( + this: &GpuComputePassEncoder, + workgroup_count_x: u32, + workgroup_count_y: u32, + workgroup_count_z: u32, + ); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchIndirect)] - #[doc = "The `dispatchIndirect()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroupsIndirect)] + #[doc = "The `dispatchWorkgroupsIndirect()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchIndirect)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroupsIndirect)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuComputePassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dispatch_indirect_with_u32( + pub fn dispatch_workgroups_indirect_with_u32( this: &GpuComputePassEncoder, indirect_buffer: &GpuBuffer, indirect_offset: u32, ); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchIndirect)] - #[doc = "The `dispatchIndirect()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = dispatchWorkgroupsIndirect)] + #[doc = "The `dispatchWorkgroupsIndirect()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchIndirect)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/dispatchWorkgroupsIndirect)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuComputePassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dispatch_indirect_with_f64( + pub fn dispatch_workgroups_indirect_with_f64( this: &GpuComputePassEncoder, indirect_buffer: &GpuBuffer, indirect_offset: f64, ); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = endPass)] - #[doc = "The `endPass()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/endPass)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn end_pass(this: &GpuComputePassEncoder); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = endPipelineStatisticsQuery)] - #[doc = "The `endPipelineStatisticsQuery()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = end)] + #[doc = "The `end()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/endPipelineStatisticsQuery)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/end)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn end_pipeline_statistics_query(this: &GpuComputePassEncoder); + pub fn end(this: &GpuComputePassEncoder); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuComputePipeline")] # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setPipeline)] @@ -153,53 +136,41 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_pipeline(this: &GpuComputePassEncoder, pipeline: &GpuComputePipeline); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuQuerySet")] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = writeTimestamp)] - #[doc = "The `writeTimestamp()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/writeTimestamp)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`, `GpuQuerySet`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_timestamp(this: &GpuComputePassEncoder, query_set: &GpuQuerySet, query_index: u32); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = insertDebugMarker)] - #[doc = "The `insertDebugMarker()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/insertDebugMarker)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn insert_debug_marker(this: &GpuComputePassEncoder, marker_label: &str); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = popDebugGroup)] - #[doc = "The `popDebugGroup()` method."] + #[cfg(feature = "GpuBindGroup")] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/popDebugGroup)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn pop_debug_group(this: &GpuComputePassEncoder); + pub fn set_bind_group( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + ); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = pushDebugGroup)] - #[doc = "The `pushDebugGroup()` method."] + #[cfg(feature = "GpuBindGroup")] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/pushDebugGroup)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuComputePassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn push_debug_group(this: &GpuComputePassEncoder, group_label: &str); + pub fn set_bind_group_with_u32_sequence( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] @@ -208,10 +179,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group(this: &GpuComputePassEncoder, index: u32, bind_group: &GpuBindGroup); + pub fn set_bind_group_with_u32_slice_and_u32_and_dynamic_offsets_data_length( + this: &GpuComputePassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] @@ -220,15 +198,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_sequence( + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( this: &GpuComputePassEncoder, index: u32, - bind_group: &GpuBindGroup, - dynamic_offsets: &::wasm_bindgen::JsValue, - ); + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] @@ -237,17 +217,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_slice_and_f64_and_dynamic_offsets_data_length( this: &GpuComputePassEncoder, index: u32, - bind_group: &GpuBindGroup, + bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], - dynamic_offsets_data_start: u32, + dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUComputePassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/setBindGroup)"] @@ -259,9 +239,42 @@ extern "C" { pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( this: &GpuComputePassEncoder, index: u32, - bind_group: &GpuBindGroup, - dynamic_offsets_data: &[u32], + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = insertDebugMarker)] + #[doc = "The `insertDebugMarker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/insertDebugMarker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn insert_debug_marker(this: &GpuComputePassEncoder, marker_label: &str); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = popDebugGroup)] + #[doc = "The `popDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/popDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_debug_group(this: &GpuComputePassEncoder); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUComputePassEncoder" , js_name = pushDebugGroup)] + #[doc = "The `pushDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUComputePassEncoder/pushDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn push_debug_group(this: &GpuComputePassEncoder, group_label: &str); } diff --git a/crates/web-sys/src/features/gen_GpuComputePassTimestampWrites.rs b/crates/web-sys/src/features/gen_GpuComputePassTimestampWrites.rs new file mode 100644 index 00000000000..91d78ef3220 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuComputePassTimestampWrites.rs @@ -0,0 +1,108 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUComputePassTimestampWrites)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuComputePassTimestampWrites` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuComputePassTimestampWrites; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `beginningOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "beginningOfPassWriteIndex")] + pub fn get_beginning_of_pass_write_index(this: &GpuComputePassTimestampWrites) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `beginningOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "beginningOfPassWriteIndex")] + pub fn set_beginning_of_pass_write_index(this: &GpuComputePassTimestampWrites, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `endOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "endOfPassWriteIndex")] + pub fn get_end_of_pass_write_index(this: &GpuComputePassTimestampWrites) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `endOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "endOfPassWriteIndex")] + pub fn set_end_of_pass_write_index(this: &GpuComputePassTimestampWrites, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQuerySet")] + #[doc = "Get the `querySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "querySet")] + pub fn get_query_set(this: &GpuComputePassTimestampWrites) -> GpuQuerySet; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQuerySet")] + #[doc = "Change the `querySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "querySet")] + pub fn set_query_set(this: &GpuComputePassTimestampWrites, val: &GpuQuerySet); +} +#[cfg(web_sys_unstable_apis)] +impl GpuComputePassTimestampWrites { + #[cfg(feature = "GpuQuerySet")] + #[doc = "Construct a new `GpuComputePassTimestampWrites`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePassTimestampWrites`, `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(query_set: &GpuQuerySet) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_query_set(query_set); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_beginning_of_pass_write_index()` instead."] + pub fn beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { + self.set_beginning_of_pass_write_index(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_end_of_pass_write_index()` instead."] + pub fn end_of_pass_write_index(&mut self, val: u32) -> &mut Self { + self.set_end_of_pass_write_index(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQuerySet")] + #[deprecated = "Use `set_query_set()` instead."] + pub fn query_set(&mut self, val: &GpuQuerySet) -> &mut Self { + self.set_query_set(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuComputePipeline.rs b/crates/web-sys/src/features/gen_GpuComputePipeline.rs index 452e4ee6f7e..64f33cd44da 100644 --- a/crates/web-sys/src/features/gen_GpuComputePipeline.rs +++ b/crates/web-sys/src/features/gen_GpuComputePipeline.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuComputePipeline) -> Option; + pub fn label(this: &GpuComputePipeline) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUComputePipeline" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,7 +37,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuComputePipeline, value: Option<&str>); + pub fn set_label(this: &GpuComputePipeline, value: &str); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroupLayout")] # [wasm_bindgen (method , structural , js_class = "GPUComputePipeline" , js_name = getBindGroupLayout)] diff --git a/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs b/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs index 1f8e089bbe9..59e45fe7058 100644 --- a/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuComputePipelineDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuComputePipelineDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuComputePipelineDescriptor { - #[cfg(feature = "GpuProgrammableStage")] - #[doc = "Construct a new `GpuComputePipelineDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(compute: &GpuProgrammableStage) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.compute(compute); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuComputePipelineDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -36,35 +30,36 @@ impl GpuComputePipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuComputePipelineDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuComputePipelineDescriptor) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuPipelineLayout")] #[doc = "Change the `layout` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuPipelineLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn layout(&mut self, val: &GpuPipelineLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuComputePipelineDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuProgrammableStage")] + #[doc = "Get the `compute` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "compute")] + pub fn get_compute(this: &GpuComputePipelineDescriptor) -> GpuProgrammableStage; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuProgrammableStage")] #[doc = "Change the `compute` field of this object."] @@ -73,18 +68,42 @@ impl GpuComputePipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "compute")] + pub fn set_compute(this: &GpuComputePipelineDescriptor, val: &GpuProgrammableStage); +} +#[cfg(web_sys_unstable_apis)] +impl GpuComputePipelineDescriptor { + #[cfg(feature = "GpuProgrammableStage")] + #[doc = "Construct a new `GpuComputePipelineDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuComputePipelineDescriptor`, `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(layout: &::wasm_bindgen::JsValue, compute: &GpuProgrammableStage) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_layout(layout); + ret.set_compute(compute); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_layout()` instead."] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_layout(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuProgrammableStage")] + #[deprecated = "Use `set_compute()` instead."] pub fn compute(&mut self, val: &GpuProgrammableStage) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compute"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_compute(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuCopyExternalImageDestInfo.rs b/crates/web-sys/src/features/gen_GpuCopyExternalImageDestInfo.rs new file mode 100644 index 00000000000..07556787ff0 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCopyExternalImageDestInfo.rs @@ -0,0 +1,159 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCopyExternalImageDestInfo)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCopyExternalImageDestInfo` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCopyExternalImageDestInfo; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureAspect")] + #[doc = "Get the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTextureAspect`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "aspect")] + pub fn get_aspect(this: &GpuCopyExternalImageDestInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureAspect")] + #[doc = "Change the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTextureAspect`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "aspect")] + pub fn set_aspect(this: &GpuCopyExternalImageDestInfo, val: GpuTextureAspect); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipLevel")] + pub fn get_mip_level(this: &GpuCopyExternalImageDestInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mipLevel")] + pub fn set_mip_level(this: &GpuCopyExternalImageDestInfo, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &GpuCopyExternalImageDestInfo) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &GpuCopyExternalImageDestInfo, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTexture")] + #[doc = "Get the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "texture")] + pub fn get_texture(this: &GpuCopyExternalImageDestInfo) -> GpuTexture; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTexture")] + #[doc = "Change the `texture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "texture")] + pub fn set_texture(this: &GpuCopyExternalImageDestInfo, val: &GpuTexture); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `premultipliedAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "premultipliedAlpha")] + pub fn get_premultiplied_alpha(this: &GpuCopyExternalImageDestInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `premultipliedAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "premultipliedAlpha")] + pub fn set_premultiplied_alpha(this: &GpuCopyExternalImageDestInfo, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl GpuCopyExternalImageDestInfo { + #[cfg(feature = "GpuTexture")] + #[doc = "Construct a new `GpuCopyExternalImageDestInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(texture: &GpuTexture) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_texture(texture); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureAspect")] + #[deprecated = "Use `set_aspect()` instead."] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + self.set_aspect(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mip_level()` instead."] + pub fn mip_level(&mut self, val: u32) -> &mut Self { + self.set_mip_level(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_origin()` instead."] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_origin(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTexture")] + #[deprecated = "Use `set_texture()` instead."] + pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { + self.set_texture(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_premultiplied_alpha()` instead."] + pub fn premultiplied_alpha(&mut self, val: bool) -> &mut Self { + self.set_premultiplied_alpha(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuCopyExternalImageSourceInfo.rs b/crates/web-sys/src/features/gen_GpuCopyExternalImageSourceInfo.rs new file mode 100644 index 00000000000..4e66439b2e4 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuCopyExternalImageSourceInfo.rs @@ -0,0 +1,104 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUCopyExternalImageSourceInfo)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuCopyExternalImageSourceInfo` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuCopyExternalImageSourceInfo; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `flipY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "flipY")] + pub fn get_flip_y(this: &GpuCopyExternalImageSourceInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `flipY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "flipY")] + pub fn set_flip_y(this: &GpuCopyExternalImageSourceInfo, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &GpuCopyExternalImageSourceInfo) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &GpuCopyExternalImageSourceInfo, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &GpuCopyExternalImageSourceInfo) -> ::js_sys::Object; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &GpuCopyExternalImageSourceInfo, val: &::js_sys::Object); +} +#[cfg(web_sys_unstable_apis)] +impl GpuCopyExternalImageSourceInfo { + #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(source: &::js_sys::Object) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_source(source); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_flip_y()` instead."] + pub fn flip_y(&mut self, val: bool) -> &mut Self { + self.set_flip_y(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_origin()` instead."] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_origin(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_source()` instead."] + pub fn source(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_source(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuCullMode.rs b/crates/web-sys/src/features/gen_GpuCullMode.rs index 4c53e8e880b..f17ba15111e 100644 --- a/crates/web-sys/src/features/gen_GpuCullMode.rs +++ b/crates/web-sys/src/features/gen_GpuCullMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuDepthStencilState.rs b/crates/web-sys/src/features/gen_GpuDepthStencilState.rs index cad23eadf68..9b7136cd992 100644 --- a/crates/web-sys/src/features/gen_GpuDepthStencilState.rs +++ b/crates/web-sys/src/features/gen_GpuDepthStencilState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuDepthStencilState; -} -#[cfg(web_sys_unstable_apis)] -impl GpuDepthStencilState { - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Construct a new `GpuDepthStencilState`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthBias` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret - } + #[wasm_bindgen(method, getter = "depthBias")] + pub fn get_depth_bias(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthBias` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBias"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthBias")] + pub fn set_depth_bias(this: &GpuDepthStencilState, val: i32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthBiasClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthBiasClamp")] + pub fn get_depth_bias_clamp(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthBiasClamp` field of this object."] #[doc = ""] @@ -57,20 +48,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBiasClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthBiasClamp")] + pub fn set_depth_bias_clamp(this: &GpuDepthStencilState, val: f32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthBiasSlopeScale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthBiasSlopeScale")] + pub fn get_depth_bias_slope_scale(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthBiasSlopeScale` field of this object."] #[doc = ""] @@ -78,20 +66,18 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthBiasSlopeScale"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthBiasSlopeScale")] + pub fn set_depth_bias_slope_scale(this: &GpuDepthStencilState, val: f32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCompareFunction")] + #[doc = "Get the `depthCompare` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthCompare")] + pub fn get_depth_compare(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuCompareFunction")] #[doc = "Change the `depthCompare` field of this object."] @@ -100,20 +86,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthCompare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthCompare")] + pub fn set_depth_compare(this: &GpuDepthStencilState, val: GpuCompareFunction); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthWriteEnabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthWriteEnabled")] + pub fn get_depth_write_enabled(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthWriteEnabled` field of this object."] #[doc = ""] @@ -121,20 +104,18 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthWriteEnabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthWriteEnabled")] + pub fn set_depth_write_enabled(this: &GpuDepthStencilState, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuDepthStencilState) -> GpuTextureFormat; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureFormat")] #[doc = "Change the `format` field of this object."] @@ -143,17 +124,18 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuDepthStencilState, val: GpuTextureFormat); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilFaceState")] + #[doc = "Get the `stencilBack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilBack")] + pub fn get_stencil_back(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStencilFaceState")] #[doc = "Change the `stencilBack` field of this object."] @@ -162,20 +144,18 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilBack"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilBack")] + pub fn set_stencil_back(this: &GpuDepthStencilState, val: &GpuStencilFaceState); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilFaceState")] + #[doc = "Get the `stencilFront` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilFront")] + pub fn get_stencil_front(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStencilFaceState")] #[doc = "Change the `stencilFront` field of this object."] @@ -184,20 +164,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilFront"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilFront")] + pub fn set_stencil_front(this: &GpuDepthStencilState, val: &GpuStencilFaceState); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `stencilReadMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilReadMask")] + pub fn get_stencil_read_mask(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `stencilReadMask` field of this object."] #[doc = ""] @@ -205,20 +182,17 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilReadMask")] + pub fn set_stencil_read_mask(this: &GpuDepthStencilState, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `stencilWriteMask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilWriteMask")] + pub fn get_stencil_write_mask(this: &GpuDepthStencilState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `stencilWriteMask` field of this object."] #[doc = ""] @@ -226,18 +200,86 @@ impl GpuDepthStencilState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stencilWriteMask")] + pub fn set_stencil_write_mask(this: &GpuDepthStencilState, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuDepthStencilState { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuDepthStencilState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_bias()` instead."] + pub fn depth_bias(&mut self, val: i32) -> &mut Self { + self.set_depth_bias(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_bias_clamp()` instead."] + pub fn depth_bias_clamp(&mut self, val: f32) -> &mut Self { + self.set_depth_bias_clamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_bias_slope_scale()` instead."] + pub fn depth_bias_slope_scale(&mut self, val: f32) -> &mut Self { + self.set_depth_bias_slope_scale(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCompareFunction")] + #[deprecated = "Use `set_depth_compare()` instead."] + pub fn depth_compare(&mut self, val: GpuCompareFunction) -> &mut Self { + self.set_depth_compare(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_write_enabled()` instead."] + pub fn depth_write_enabled(&mut self, val: bool) -> &mut Self { + self.set_depth_write_enabled(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilFaceState")] + #[deprecated = "Use `set_stencil_back()` instead."] + pub fn stencil_back(&mut self, val: &GpuStencilFaceState) -> &mut Self { + self.set_stencil_back(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilFaceState")] + #[deprecated = "Use `set_stencil_front()` instead."] + pub fn stencil_front(&mut self, val: &GpuStencilFaceState) -> &mut Self { + self.set_stencil_front(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stencil_read_mask()` instead."] + pub fn stencil_read_mask(&mut self, val: u32) -> &mut Self { + self.set_stencil_read_mask(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stencil_write_mask()` instead."] pub fn stencil_write_mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilWriteMask"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stencil_write_mask(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuDevice.rs b/crates/web-sys/src/features/gen_GpuDevice.rs index 536725265c1..eadade16939 100644 --- a/crates/web-sys/src/features/gen_GpuDevice.rs +++ b/crates/web-sys/src/features/gen_GpuDevice.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -40,6 +41,18 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn limits(this: &GpuDevice) -> GpuSupportedLimits; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAdapterInfo")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = adapterInfo)] + #[doc = "Getter for the `adapterInfo` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/adapterInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAdapterInfo`, `GpuDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn adapter_info(this: &GpuDevice) -> GpuAdapterInfo; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuQueue")] # [wasm_bindgen (structural , method , getter , js_class = "GPUDevice" , js_name = queue)] #[doc = "Getter for the `queue` field of this object."] @@ -94,7 +107,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuDevice) -> Option; + pub fn label(this: &GpuDevice) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUDevice" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -105,7 +118,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuDevice, value: Option<&str>); + pub fn set_label(this: &GpuDevice, value: &str); #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuBindGroup", feature = "GpuBindGroupDescriptor",))] # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createBindGroup)] @@ -124,7 +137,7 @@ extern "C" { feature = "GpuBindGroupLayout", feature = "GpuBindGroupLayoutDescriptor", ))] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createBindGroupLayout)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createBindGroupLayout)] #[doc = "The `createBindGroupLayout()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBindGroupLayout)"] @@ -136,10 +149,10 @@ extern "C" { pub fn create_bind_group_layout( this: &GpuDevice, descriptor: &GpuBindGroupLayoutDescriptor, - ) -> GpuBindGroupLayout; + ) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuBuffer", feature = "GpuBufferDescriptor",))] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createBuffer)] #[doc = "The `createBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createBuffer)"] @@ -148,7 +161,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_buffer(this: &GpuDevice, descriptor: &GpuBufferDescriptor) -> GpuBuffer; + pub fn create_buffer( + this: &GpuDevice, + descriptor: &GpuBufferDescriptor, + ) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuCommandEncoder")] # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createCommandEncoder)] @@ -226,7 +242,7 @@ extern "C" { ) -> GpuPipelineLayout; #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuQuerySet", feature = "GpuQuerySetDescriptor",))] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createQuerySet)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createQuerySet)] #[doc = "The `createQuerySet()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createQuerySet)"] @@ -235,13 +251,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_query_set(this: &GpuDevice, descriptor: &GpuQuerySetDescriptor) -> GpuQuerySet; + pub fn create_query_set( + this: &GpuDevice, + descriptor: &GpuQuerySetDescriptor, + ) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuRenderBundleEncoder", feature = "GpuRenderBundleEncoderDescriptor", ))] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderBundleEncoder)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createRenderBundleEncoder)] #[doc = "The `createRenderBundleEncoder()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderBundleEncoder)"] @@ -253,10 +272,10 @@ extern "C" { pub fn create_render_bundle_encoder( this: &GpuDevice, descriptor: &GpuRenderBundleEncoderDescriptor, - ) -> GpuRenderBundleEncoder; + ) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuRenderPipeline", feature = "GpuRenderPipelineDescriptor",))] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderPipeline)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createRenderPipeline)] #[doc = "The `createRenderPipeline()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createRenderPipeline)"] @@ -268,7 +287,7 @@ extern "C" { pub fn create_render_pipeline( this: &GpuDevice, descriptor: &GpuRenderPipelineDescriptor, - ) -> GpuRenderPipeline; + ) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuRenderPipelineDescriptor")] # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createRenderPipelineAsync)] @@ -328,7 +347,7 @@ extern "C" { ) -> GpuShaderModule; #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuTexture", feature = "GpuTextureDescriptor",))] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = createTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = createTexture)] #[doc = "The `createTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createTexture)"] @@ -337,7 +356,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_texture(this: &GpuDevice, descriptor: &GpuTextureDescriptor) -> GpuTexture; + pub fn create_texture( + this: &GpuDevice, + descriptor: &GpuTextureDescriptor, + ) -> Result; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = destroy)] #[doc = "The `destroy()` method."] @@ -354,7 +376,7 @@ extern "C" { feature = "GpuExternalTexture", feature = "GpuExternalTextureDescriptor", ))] - # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = importExternalTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUDevice" , js_name = importExternalTexture)] #[doc = "The `importExternalTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/importExternalTexture)"] @@ -366,7 +388,7 @@ extern "C" { pub fn import_external_texture( this: &GpuDevice, descriptor: &GpuExternalTextureDescriptor, - ) -> GpuExternalTexture; + ) -> Result; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUDevice" , js_name = popErrorScope)] #[doc = "The `popErrorScope()` method."] diff --git a/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs b/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs index 614b1104464..dd7c58ffca3 100644 --- a/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuDeviceDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuDeviceDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuDeviceDescriptor { - #[doc = "Construct a new `GpuDeviceDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuDeviceDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -34,16 +30,37 @@ impl GpuDeviceDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuDeviceDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQueueDescriptor")] + #[doc = "Get the `defaultQueue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`, `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "defaultQueue")] + pub fn get_default_queue(this: &GpuDeviceDescriptor) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQueueDescriptor")] + #[doc = "Change the `defaultQueue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`, `GpuQueueDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "defaultQueue")] + pub fn set_default_queue(this: &GpuDeviceDescriptor, val: &GpuQueueDescriptor); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `requiredFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requiredFeatures")] + pub fn get_required_features(this: &GpuDeviceDescriptor) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `requiredFeatures` field of this object."] #[doc = ""] @@ -51,18 +68,63 @@ impl GpuDeviceDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "requiredFeatures")] + pub fn set_required_features(this: &GpuDeviceDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `requiredLimits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requiredLimits")] + pub fn get_required_limits(this: &GpuDeviceDescriptor) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `requiredLimits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "requiredLimits")] + pub fn set_required_limits(this: &GpuDeviceDescriptor, val: &::js_sys::Object); +} +#[cfg(web_sys_unstable_apis)] +impl GpuDeviceDescriptor { + #[doc = "Construct a new `GpuDeviceDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQueueDescriptor")] + #[deprecated = "Use `set_default_queue()` instead."] + pub fn default_queue(&mut self, val: &GpuQueueDescriptor) -> &mut Self { + self.set_default_queue(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_required_features()` instead."] pub fn required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requiredFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_required_features(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_required_limits()` instead."] + pub fn required_limits(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_required_limits(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs b/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs index bcc59f58ebc..2929b7b4acb 100644 --- a/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs +++ b/crates/web-sys/src/features/gen_GpuDeviceLostInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,16 +17,17 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuDeviceLostInfo; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuDeviceLostReason")] # [wasm_bindgen (structural , method , getter , js_class = "GPUDeviceLostInfo" , js_name = reason)] #[doc = "Getter for the `reason` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUDeviceLostInfo/reason)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuDeviceLostInfo`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuDeviceLostInfo`, `GpuDeviceLostReason`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn reason(this: &GpuDeviceLostInfo) -> ::wasm_bindgen::JsValue; + pub fn reason(this: &GpuDeviceLostInfo) -> GpuDeviceLostReason; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUDeviceLostInfo" , js_name = message)] #[doc = "Getter for the `message` field of this object."] @@ -36,5 +38,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn message(this: &GpuDeviceLostInfo) -> String; + pub fn message(this: &GpuDeviceLostInfo) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_GpuDeviceLostReason.rs b/crates/web-sys/src/features/gen_GpuDeviceLostReason.rs index 1317793dc5f..554f1473303 100644 --- a/crates/web-sys/src/features/gen_GpuDeviceLostReason.rs +++ b/crates/web-sys/src/features/gen_GpuDeviceLostReason.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -10,5 +11,6 @@ use wasm_bindgen::prelude::*; #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuDeviceLostReason { + Unknown = "unknown", Destroyed = "destroyed", } diff --git a/crates/web-sys/src/features/gen_GpuError.rs b/crates/web-sys/src/features/gen_GpuError.rs new file mode 100644 index 00000000000..8354754aeda --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuError.rs @@ -0,0 +1,30 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUError , typescript_type = "GPUError")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuError` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuError; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUError" , js_name = message)] + #[doc = "Getter for the `message` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUError/message)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn message(this: &GpuError) -> ::alloc::string::String; +} diff --git a/crates/web-sys/src/features/gen_GpuErrorFilter.rs b/crates/web-sys/src/features/gen_GpuErrorFilter.rs index 9c84cc776ed..070f8e98499 100644 --- a/crates/web-sys/src/features/gen_GpuErrorFilter.rs +++ b/crates/web-sys/src/features/gen_GpuErrorFilter.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -10,6 +11,7 @@ use wasm_bindgen::prelude::*; #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuErrorFilter { - OutOfMemory = "out-of-memory", Validation = "validation", + OutOfMemory = "out-of-memory", + Internal = "internal", } diff --git a/crates/web-sys/src/features/gen_GpuExtent3dDict.rs b/crates/web-sys/src/features/gen_GpuExtent3dDict.rs index 5d0c8aafa0c..9f929493bbb 100644 --- a/crates/web-sys/src/features/gen_GpuExtent3dDict.rs +++ b/crates/web-sys/src/features/gen_GpuExtent3dDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuExtent3dDict; -} -#[cfg(web_sys_unstable_apis)] -impl GpuExtent3dDict { - #[doc = "Construct a new `GpuExtent3dDict`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthOrArrayLayers` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(width: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.width(width); - ret - } + #[wasm_bindgen(method, getter = "depthOrArrayLayers")] + pub fn get_depth_or_array_layers(this: &GpuExtent3dDict) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthOrArrayLayers` field of this object."] #[doc = ""] @@ -35,20 +30,17 @@ impl GpuExtent3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_or_array_layers(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthOrArrayLayers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthOrArrayLayers")] + pub fn set_depth_or_array_layers(this: &GpuExtent3dDict, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &GpuExtent3dDict) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `height` field of this object."] #[doc = ""] @@ -56,17 +48,17 @@ impl GpuExtent3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &GpuExtent3dDict, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &GpuExtent3dDict) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `width` field of this object."] #[doc = ""] @@ -74,14 +66,39 @@ impl GpuExtent3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &GpuExtent3dDict, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuExtent3dDict { + #[doc = "Construct a new `GpuExtent3dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(width: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_width(width); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_or_array_layers()` instead."] + pub fn depth_or_array_layers(&mut self, val: u32) -> &mut Self { + self.set_depth_or_array_layers(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_height()` instead."] + pub fn height(&mut self, val: u32) -> &mut Self { + self.set_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuExternalTexture.rs b/crates/web-sys/src/features/gen_GpuExternalTexture.rs index 6142e8536cf..011cc5be316 100644 --- a/crates/web-sys/src/features/gen_GpuExternalTexture.rs +++ b/crates/web-sys/src/features/gen_GpuExternalTexture.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuExternalTexture) -> Option; + pub fn label(this: &GpuExternalTexture) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUExternalTexture" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,5 +37,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuExternalTexture, value: Option<&str>); + pub fn set_label(this: &GpuExternalTexture, value: &str); } diff --git a/crates/web-sys/src/features/gen_GpuExternalTextureBindingLayout.rs b/crates/web-sys/src/features/gen_GpuExternalTextureBindingLayout.rs index d9d6071ca05..334427d0ec3 100644 --- a/crates/web-sys/src/features/gen_GpuExternalTextureBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuExternalTextureBindingLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_GpuExternalTextureDescriptor.rs b/crates/web-sys/src/features/gen_GpuExternalTextureDescriptor.rs index 36f49b65dab..f37b1fdfafd 100644 --- a/crates/web-sys/src/features/gen_GpuExternalTextureDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuExternalTextureDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuExternalTextureDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuExternalTextureDescriptor { - #[cfg(feature = "HtmlVideoElement")] - #[doc = "Construct a new `GpuExternalTextureDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `HtmlVideoElement`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(source: &HtmlVideoElement) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.source(source); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuExternalTextureDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -36,55 +30,51 @@ impl GpuExternalTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuExternalTextureDescriptor, val: &str); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuPredefinedColorSpace")] - #[doc = "Change the `colorSpace` field of this object."] + #[doc = "Get the `source` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `GpuPredefinedColorSpace`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_space(&mut self, val: GpuPredefinedColorSpace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &GpuExternalTextureDescriptor) -> ::js_sys::Object; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "HtmlVideoElement")] #[doc = "Change the `source` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `HtmlVideoElement`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn source(&mut self, val: &HtmlVideoElement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &GpuExternalTextureDescriptor, val: &::js_sys::Object); +} +#[cfg(web_sys_unstable_apis)] +impl GpuExternalTextureDescriptor { + #[doc = "Construct a new `GpuExternalTextureDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(source: &::js_sys::Object) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_source(source); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_source()` instead."] + pub fn source(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_source(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuFeatureName.rs b/crates/web-sys/src/features/gen_GpuFeatureName.rs index 5ebc2785a6a..b4bbf30a2b3 100644 --- a/crates/web-sys/src/features/gen_GpuFeatureName.rs +++ b/crates/web-sys/src/features/gen_GpuFeatureName.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -10,10 +11,20 @@ use wasm_bindgen::prelude::*; #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuFeatureName { - DepthClamping = "depth-clamping", - Depth24unormStencil8 = "depth24unorm-stencil8", + DepthClipControl = "depth-clip-control", Depth32floatStencil8 = "depth32float-stencil8", - PipelineStatisticsQuery = "pipeline-statistics-query", TextureCompressionBc = "texture-compression-bc", + TextureCompressionBcSliced3d = "texture-compression-bc-sliced-3d", + TextureCompressionEtc2 = "texture-compression-etc2", + TextureCompressionAstc = "texture-compression-astc", + TextureCompressionAstcSliced3d = "texture-compression-astc-sliced-3d", TimestampQuery = "timestamp-query", + IndirectFirstInstance = "indirect-first-instance", + ShaderF16 = "shader-f16", + Rg11b10ufloatRenderable = "rg11b10ufloat-renderable", + Bgra8unormStorage = "bgra8unorm-storage", + Float32Filterable = "float32-filterable", + Float32Blendable = "float32-blendable", + ClipDistances = "clip-distances", + DualSourceBlending = "dual-source-blending", } diff --git a/crates/web-sys/src/features/gen_GpuFilterMode.rs b/crates/web-sys/src/features/gen_GpuFilterMode.rs index b1a7f1d1805..7edd76b6c06 100644 --- a/crates/web-sys/src/features/gen_GpuFilterMode.rs +++ b/crates/web-sys/src/features/gen_GpuFilterMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuFragmentState.rs b/crates/web-sys/src/features/gen_GpuFragmentState.rs index 395df4ffdd3..629d5d91457 100644 --- a/crates/web-sys/src/features/gen_GpuFragmentState.rs +++ b/crates/web-sys/src/features/gen_GpuFragmentState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,28 +14,33 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuFragmentState; -} -#[cfg(web_sys_unstable_apis)] -impl GpuFragmentState { - #[cfg(feature = "GpuShaderModule")] - #[doc = "Construct a new `GpuFragmentState`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `constants` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new( - entry_point: &str, - module: &GpuShaderModule, - targets: &::wasm_bindgen::JsValue, - ) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.entry_point(entry_point); - ret.module(module); - ret.targets(targets); - ret - } + #[wasm_bindgen(method, getter = "constants")] + pub fn get_constants(this: &GpuFragmentState) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `constants` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "constants")] + pub fn set_constants(this: &GpuFragmentState, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entryPoint")] + pub fn get_entry_point(this: &GpuFragmentState) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `entryPoint` field of this object."] #[doc = ""] @@ -42,20 +48,18 @@ impl GpuFragmentState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "entryPoint")] + pub fn set_entry_point(this: &GpuFragmentState, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuShaderModule")] + #[doc = "Get the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "module")] + pub fn get_module(this: &GpuFragmentState) -> GpuShaderModule; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuShaderModule")] #[doc = "Change the `module` field of this object."] @@ -64,17 +68,17 @@ impl GpuFragmentState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "module")] + pub fn set_module(this: &GpuFragmentState, val: &GpuShaderModule); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `targets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "targets")] + pub fn get_targets(this: &GpuFragmentState) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `targets` field of this object."] #[doc = ""] @@ -82,18 +86,48 @@ impl GpuFragmentState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "targets")] + pub fn set_targets(this: &GpuFragmentState, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuFragmentState { + #[cfg(feature = "GpuShaderModule")] + #[doc = "Construct a new `GpuFragmentState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(module: &GpuShaderModule, targets: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_module(module); + ret.set_targets(targets); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_constants()` instead."] + pub fn constants(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_constants(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_entry_point()` instead."] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + self.set_entry_point(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuShaderModule")] + #[deprecated = "Use `set_module()` instead."] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + self.set_module(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_targets()` instead."] pub fn targets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_targets(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuFrontFace.rs b/crates/web-sys/src/features/gen_GpuFrontFace.rs index 04eac273cc4..af1f79c3e12 100644 --- a/crates/web-sys/src/features/gen_GpuFrontFace.rs +++ b/crates/web-sys/src/features/gen_GpuFrontFace.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs b/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs deleted file mode 100644 index 0e55fc2ccd1..00000000000 --- a/crates/web-sys/src/features/gen_GpuImageCopyTexture.rs +++ /dev/null @@ -1,112 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTexture)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyTexture` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyTexture; -} -#[cfg(web_sys_unstable_apis)] -impl GpuImageCopyTexture { - #[cfg(feature = "GpuTexture")] - #[doc = "Construct a new `GpuImageCopyTexture`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(texture: &GpuTexture) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.texture(texture); - ret - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTextureAspect")] - #[doc = "Change the `aspect` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTextureAspect`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `mipLevel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `origin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuTexture")] - #[doc = "Change the `texture` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} diff --git a/crates/web-sys/src/features/gen_GpuIndexFormat.rs b/crates/web-sys/src/features/gen_GpuIndexFormat.rs index ffc65c10b65..6812c5c52cd 100644 --- a/crates/web-sys/src/features/gen_GpuIndexFormat.rs +++ b/crates/web-sys/src/features/gen_GpuIndexFormat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuInternalError.rs b/crates/web-sys/src/features/gen_GpuInternalError.rs new file mode 100644 index 00000000000..ed26c9ae094 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuInternalError.rs @@ -0,0 +1,30 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = GpuError , extends = :: js_sys :: Object , js_name = GPUInternalError , typescript_type = "GPUInternalError")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuInternalError` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUInternalError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuInternalError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuInternalError; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "GPUInternalError")] + #[doc = "The `new GpuInternalError(..)` constructor, creating a new instance of `GpuInternalError`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUInternalError/GPUInternalError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuInternalError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(message: &str) -> Result; +} diff --git a/crates/web-sys/src/features/gen_GpuLoadOp.rs b/crates/web-sys/src/features/gen_GpuLoadOp.rs index 2973e168bf3..e7baab63bab 100644 --- a/crates/web-sys/src/features/gen_GpuLoadOp.rs +++ b/crates/web-sys/src/features/gen_GpuLoadOp.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -11,4 +12,5 @@ use wasm_bindgen::prelude::*; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuLoadOp { Load = "load", + Clear = "clear", } diff --git a/crates/web-sys/src/features/gen_GpuMipmapFilterMode.rs b/crates/web-sys/src/features/gen_GpuMipmapFilterMode.rs new file mode 100644 index 00000000000..ec34e9a6d6b --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuMipmapFilterMode.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuMipmapFilterMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuMipmapFilterMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuMipmapFilterMode { + Nearest = "nearest", + Linear = "linear", +} diff --git a/crates/web-sys/src/features/gen_GpuMultisampleState.rs b/crates/web-sys/src/features/gen_GpuMultisampleState.rs index 1cb538ded9a..7c969efbd9e 100644 --- a/crates/web-sys/src/features/gen_GpuMultisampleState.rs +++ b/crates/web-sys/src/features/gen_GpuMultisampleState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuMultisampleState; -} -#[cfg(web_sys_unstable_apis)] -impl GpuMultisampleState { - #[doc = "Construct a new `GpuMultisampleState`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `alphaToCoverageEnabled` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "alphaToCoverageEnabled")] + pub fn get_alpha_to_coverage_enabled(this: &GpuMultisampleState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `alphaToCoverageEnabled` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl GpuMultisampleState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("alphaToCoverageEnabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alphaToCoverageEnabled")] + pub fn set_alpha_to_coverage_enabled(this: &GpuMultisampleState, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `count` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "count")] + pub fn get_count(this: &GpuMultisampleState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `count` field of this object."] #[doc = ""] @@ -55,16 +48,17 @@ impl GpuMultisampleState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "count")] + pub fn set_count(this: &GpuMultisampleState, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mask")] + pub fn get_mask(this: &GpuMultisampleState) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `mask` field of this object."] #[doc = ""] @@ -72,14 +66,38 @@ impl GpuMultisampleState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mask")] + pub fn set_mask(this: &GpuMultisampleState, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuMultisampleState { + #[doc = "Construct a new `GpuMultisampleState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_alpha_to_coverage_enabled()` instead."] + pub fn alpha_to_coverage_enabled(&mut self, val: bool) -> &mut Self { + self.set_alpha_to_coverage_enabled(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_count()` instead."] + pub fn count(&mut self, val: u32) -> &mut Self { + self.set_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mask()` instead."] pub fn mask(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mask(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs b/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs index a8fe6844525..c14221bc4c3 100644 --- a/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs +++ b/crates/web-sys/src/features/gen_GpuObjectDescriptorBase.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuObjectDescriptorBase; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuObjectDescriptorBase) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuObjectDescriptorBase, val: &str); } #[cfg(web_sys_unstable_apis)] impl GpuObjectDescriptorBase { @@ -28,20 +47,9 @@ impl GpuObjectDescriptorBase { ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuObjectDescriptorBase`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs b/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs index 7e608ca1047..a0732ec3fb6 100644 --- a/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs +++ b/crates/web-sys/src/features/gen_GpuOrigin2dDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuOrigin2dDict; -} -#[cfg(web_sys_unstable_apis)] -impl GpuOrigin2dDict { - #[doc = "Construct a new `GpuOrigin2dDict`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `x` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &GpuOrigin2dDict) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `x` field of this object."] #[doc = ""] @@ -34,16 +30,17 @@ impl GpuOrigin2dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn x(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &GpuOrigin2dDict, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &GpuOrigin2dDict) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `y` field of this object."] #[doc = ""] @@ -51,14 +48,32 @@ impl GpuOrigin2dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &GpuOrigin2dDict, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuOrigin2dDict { + #[doc = "Construct a new `GpuOrigin2dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin2dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_x()` instead."] + pub fn x(&mut self, val: u32) -> &mut Self { + self.set_x(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_y()` instead."] pub fn y(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_y(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs b/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs index 6bc5fb63bd8..a14679d2d60 100644 --- a/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs +++ b/crates/web-sys/src/features/gen_GpuOrigin3dDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuOrigin3dDict; -} -#[cfg(web_sys_unstable_apis)] -impl GpuOrigin3dDict { - #[doc = "Construct a new `GpuOrigin3dDict`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `x` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &GpuOrigin3dDict) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `x` field of this object."] #[doc = ""] @@ -34,16 +30,17 @@ impl GpuOrigin3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn x(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &GpuOrigin3dDict, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &GpuOrigin3dDict) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `y` field of this object."] #[doc = ""] @@ -51,16 +48,17 @@ impl GpuOrigin3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn y(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &GpuOrigin3dDict, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `z` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "z")] + pub fn get_z(this: &GpuOrigin3dDict) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `z` field of this object."] #[doc = ""] @@ -68,14 +66,38 @@ impl GpuOrigin3dDict { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "z")] + pub fn set_z(this: &GpuOrigin3dDict, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuOrigin3dDict { + #[doc = "Construct a new `GpuOrigin3dDict`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuOrigin3dDict`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_x()` instead."] + pub fn x(&mut self, val: u32) -> &mut Self { + self.set_x(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_y()` instead."] + pub fn y(&mut self, val: u32) -> &mut Self { + self.set_y(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_z()` instead."] pub fn z(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("z"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_z(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuOutOfMemoryError.rs b/crates/web-sys/src/features/gen_GpuOutOfMemoryError.rs index d2628d32298..039b3936cc1 100644 --- a/crates/web-sys/src/features/gen_GpuOutOfMemoryError.rs +++ b/crates/web-sys/src/features/gen_GpuOutOfMemoryError.rs @@ -1,10 +1,11 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUOutOfMemoryError , typescript_type = "GPUOutOfMemoryError")] + # [wasm_bindgen (extends = GpuError , extends = :: js_sys :: Object , js_name = GPUOutOfMemoryError , typescript_type = "GPUOutOfMemoryError")] #[derive(Debug, Clone, PartialEq, Eq)] #[doc = "The `GpuOutOfMemoryError` class."] #[doc = ""] @@ -25,5 +26,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Result; + pub fn new(message: &str) -> Result; } diff --git a/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs b/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs index a1d2fdcfdcd..e1c0e767c89 100644 --- a/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs +++ b/crates/web-sys/src/features/gen_GpuPipelineDescriptorBase.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuPipelineDescriptorBase; -} -#[cfg(web_sys_unstable_apis)] -impl GpuPipelineDescriptorBase { - #[doc = "Construct a new `GpuPipelineDescriptorBase`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuPipelineDescriptorBase) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -34,39 +30,51 @@ impl GpuPipelineDescriptorBase { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuPipelineDescriptorBase, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuPipelineDescriptorBase) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuPipelineLayout")] #[doc = "Change the `layout` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`, `GpuPipelineLayout`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuPipelineDescriptorBase, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuPipelineDescriptorBase { + #[doc = "Construct a new `GpuPipelineDescriptorBase`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineDescriptorBase`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn layout(&mut self, val: &GpuPipelineLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + pub fn new(layout: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_layout(layout); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); self } -} -#[cfg(web_sys_unstable_apis)] -impl Default for GpuPipelineDescriptorBase { - fn default() -> Self { - Self::new() + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_layout()` instead."] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_layout(val); + self } } diff --git a/crates/web-sys/src/features/gen_GpuPipelineError.rs b/crates/web-sys/src/features/gen_GpuPipelineError.rs new file mode 100644 index 00000000000..7fe7c408f2b --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuPipelineError.rs @@ -0,0 +1,58 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = DomException , extends = :: js_sys :: Object , js_name = GPUPipelineError , typescript_type = "GPUPipelineError")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuPipelineError` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuPipelineError; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPipelineErrorReason")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUPipelineError" , js_name = reason)] + #[doc = "Getter for the `reason` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineError/reason)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineError`, `GpuPipelineErrorReason`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn reason(this: &GpuPipelineError) -> GpuPipelineErrorReason; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPipelineErrorInit")] + #[wasm_bindgen(catch, constructor, js_class = "GPUPipelineError")] + #[doc = "The `new GpuPipelineError(..)` constructor, creating a new instance of `GpuPipelineError`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineError/GPUPipelineError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineError`, `GpuPipelineErrorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(options: &GpuPipelineErrorInit) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPipelineErrorInit")] + #[wasm_bindgen(catch, constructor, js_class = "GPUPipelineError")] + #[doc = "The `new GpuPipelineError(..)` constructor, creating a new instance of `GpuPipelineError`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUPipelineError/GPUPipelineError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineError`, `GpuPipelineErrorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_message( + message: &str, + options: &GpuPipelineErrorInit, + ) -> Result; +} diff --git a/crates/web-sys/src/features/gen_GpuPipelineErrorInit.rs b/crates/web-sys/src/features/gen_GpuPipelineErrorInit.rs new file mode 100644 index 00000000000..0fa5b6ad82b --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuPipelineErrorInit.rs @@ -0,0 +1,60 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUPipelineErrorInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuPipelineErrorInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineErrorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuPipelineErrorInit; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPipelineErrorReason")] + #[doc = "Get the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineErrorInit`, `GpuPipelineErrorReason`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "reason")] + pub fn get_reason(this: &GpuPipelineErrorInit) -> GpuPipelineErrorReason; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPipelineErrorReason")] + #[doc = "Change the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineErrorInit`, `GpuPipelineErrorReason`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "reason")] + pub fn set_reason(this: &GpuPipelineErrorInit, val: GpuPipelineErrorReason); +} +#[cfg(web_sys_unstable_apis)] +impl GpuPipelineErrorInit { + #[cfg(feature = "GpuPipelineErrorReason")] + #[doc = "Construct a new `GpuPipelineErrorInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineErrorInit`, `GpuPipelineErrorReason`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(reason: GpuPipelineErrorReason) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_reason(reason); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPipelineErrorReason")] + #[deprecated = "Use `set_reason()` instead."] + pub fn reason(&mut self, val: GpuPipelineErrorReason) -> &mut Self { + self.set_reason(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuPipelineErrorReason.rs b/crates/web-sys/src/features/gen_GpuPipelineErrorReason.rs new file mode 100644 index 00000000000..3d2fd0bf194 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuPipelineErrorReason.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `GpuPipelineErrorReason` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `GpuPipelineErrorReason`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum GpuPipelineErrorReason { + Validation = "validation", + Internal = "internal", +} diff --git a/crates/web-sys/src/features/gen_GpuPipelineLayout.rs b/crates/web-sys/src/features/gen_GpuPipelineLayout.rs index 4a9a2b7ac1f..339e6d3582a 100644 --- a/crates/web-sys/src/features/gen_GpuPipelineLayout.rs +++ b/crates/web-sys/src/features/gen_GpuPipelineLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuPipelineLayout) -> Option; + pub fn label(this: &GpuPipelineLayout) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUPipelineLayout" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,5 +37,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuPipelineLayout, value: Option<&str>); + pub fn set_label(this: &GpuPipelineLayout, value: &str); } diff --git a/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs b/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs index 4e9b55e5f9c..a3a85ed1f38 100644 --- a/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuPipelineLayoutDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuPipelineLayoutDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuPipelineLayoutDescriptor { - #[doc = "Construct a new `GpuPipelineLayoutDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(bind_group_layouts: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.bind_group_layouts(bind_group_layouts); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuPipelineLayoutDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -35,16 +30,17 @@ impl GpuPipelineLayoutDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuPipelineLayoutDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bindGroupLayouts` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bindGroupLayouts")] + pub fn get_bind_group_layouts(this: &GpuPipelineLayoutDescriptor) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bindGroupLayouts` field of this object."] #[doc = ""] @@ -52,18 +48,36 @@ impl GpuPipelineLayoutDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bindGroupLayouts")] + pub fn set_bind_group_layouts( + this: &GpuPipelineLayoutDescriptor, + val: &::wasm_bindgen::JsValue, + ); +} +#[cfg(web_sys_unstable_apis)] +impl GpuPipelineLayoutDescriptor { + #[doc = "Construct a new `GpuPipelineLayoutDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayoutDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(bind_group_layouts: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_bind_group_layouts(bind_group_layouts); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bind_group_layouts()` instead."] pub fn bind_group_layouts(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bindGroupLayouts"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bind_group_layouts(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuPowerPreference.rs b/crates/web-sys/src/features/gen_GpuPowerPreference.rs index 1bf7015f2b3..41c15a84d88 100644 --- a/crates/web-sys/src/features/gen_GpuPowerPreference.rs +++ b/crates/web-sys/src/features/gen_GpuPowerPreference.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuPrimitiveState.rs b/crates/web-sys/src/features/gen_GpuPrimitiveState.rs index 36e89cdb8ae..aae66b1cde7 100644 --- a/crates/web-sys/src/features/gen_GpuPrimitiveState.rs +++ b/crates/web-sys/src/features/gen_GpuPrimitiveState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,63 +14,36 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuPrimitiveState; -} -#[cfg(web_sys_unstable_apis)] -impl GpuPrimitiveState { - #[doc = "Construct a new `GpuPrimitiveState`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCullMode")] + #[doc = "Get the `cullMode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCullMode`, `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "cullMode")] + pub fn get_cull_mode(this: &GpuPrimitiveState) -> Option; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `clampDepth` field of this object."] + #[cfg(feature = "GpuCullMode")] + #[doc = "Change the `cullMode` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCullMode`, `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn clamp_depth(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clampDepth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "cullMode")] + pub fn set_cull_mode(this: &GpuPrimitiveState, val: GpuCullMode); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuCullMode")] - #[doc = "Change the `cullMode` field of this object."] + #[cfg(feature = "GpuFrontFace")] + #[doc = "Get the `frontFace` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuCullMode`, `GpuPrimitiveState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuFrontFace`, `GpuPrimitiveState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn cull_mode(&mut self, val: GpuCullMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cullMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "frontFace")] + pub fn get_front_face(this: &GpuPrimitiveState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuFrontFace")] #[doc = "Change the `frontFace` field of this object."] @@ -78,20 +52,18 @@ impl GpuPrimitiveState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn front_face(&mut self, val: GpuFrontFace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frontFace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "frontFace")] + pub fn set_front_face(this: &GpuPrimitiveState, val: GpuFrontFace); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuIndexFormat")] + #[doc = "Get the `stripIndexFormat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuIndexFormat`, `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stripIndexFormat")] + pub fn get_strip_index_format(this: &GpuPrimitiveState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuIndexFormat")] #[doc = "Change the `stripIndexFormat` field of this object."] @@ -100,20 +72,18 @@ impl GpuPrimitiveState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn strip_index_format(&mut self, val: GpuIndexFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stripIndexFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stripIndexFormat")] + pub fn set_strip_index_format(this: &GpuPrimitiveState, val: GpuIndexFormat); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPrimitiveTopology")] + #[doc = "Get the `topology` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuPrimitiveTopology`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "topology")] + pub fn get_topology(this: &GpuPrimitiveState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuPrimitiveTopology")] #[doc = "Change the `topology` field of this object."] @@ -122,18 +92,72 @@ impl GpuPrimitiveState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "topology")] + pub fn set_topology(this: &GpuPrimitiveState, val: GpuPrimitiveTopology); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unclippedDepth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unclippedDepth")] + pub fn get_unclipped_depth(this: &GpuPrimitiveState) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `unclippedDepth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "unclippedDepth")] + pub fn set_unclipped_depth(this: &GpuPrimitiveState, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl GpuPrimitiveState { + #[doc = "Construct a new `GpuPrimitiveState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCullMode")] + #[deprecated = "Use `set_cull_mode()` instead."] + pub fn cull_mode(&mut self, val: GpuCullMode) -> &mut Self { + self.set_cull_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuFrontFace")] + #[deprecated = "Use `set_front_face()` instead."] + pub fn front_face(&mut self, val: GpuFrontFace) -> &mut Self { + self.set_front_face(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuIndexFormat")] + #[deprecated = "Use `set_strip_index_format()` instead."] + pub fn strip_index_format(&mut self, val: GpuIndexFormat) -> &mut Self { + self.set_strip_index_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPrimitiveTopology")] + #[deprecated = "Use `set_topology()` instead."] pub fn topology(&mut self, val: GpuPrimitiveTopology) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("topology"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_topology(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unclipped_depth()` instead."] + pub fn unclipped_depth(&mut self, val: bool) -> &mut Self { + self.set_unclipped_depth(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuPrimitiveTopology.rs b/crates/web-sys/src/features/gen_GpuPrimitiveTopology.rs index 341611a1961..848b4c3e18c 100644 --- a/crates/web-sys/src/features/gen_GpuPrimitiveTopology.rs +++ b/crates/web-sys/src/features/gen_GpuPrimitiveTopology.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuProgrammableStage.rs b/crates/web-sys/src/features/gen_GpuProgrammableStage.rs index cf569c1e4ea..e1c87405e80 100644 --- a/crates/web-sys/src/features/gen_GpuProgrammableStage.rs +++ b/crates/web-sys/src/features/gen_GpuProgrammableStage.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,62 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuProgrammableStage; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `constants` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "constants")] + pub fn get_constants(this: &GpuProgrammableStage) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `constants` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "constants")] + pub fn set_constants(this: &GpuProgrammableStage, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entryPoint")] + pub fn get_entry_point(this: &GpuProgrammableStage) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "entryPoint")] + pub fn set_entry_point(this: &GpuProgrammableStage, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuShaderModule")] + #[doc = "Get the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "module")] + pub fn get_module(this: &GpuProgrammableStage) -> GpuShaderModule; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuShaderModule")] + #[doc = "Change the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "module")] + pub fn set_module(this: &GpuProgrammableStage, val: &GpuShaderModule); } #[cfg(web_sys_unstable_apis)] impl GpuProgrammableStage { @@ -23,51 +80,29 @@ impl GpuProgrammableStage { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(entry_point: &str, module: &GpuShaderModule) -> Self { + pub fn new(module: &GpuShaderModule) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.entry_point(entry_point); - ret.module(module); + ret.set_module(module); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `entryPoint` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_constants()` instead."] + pub fn constants(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_constants(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_entry_point()` instead."] pub fn entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_entry_point(val); self } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuShaderModule")] - #[doc = "Change the `module` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuProgrammableStage`, `GpuShaderModule`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_module()` instead."] pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_module(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuQuerySet.rs b/crates/web-sys/src/features/gen_GpuQuerySet.rs index da2a4141fcc..0d08c58eb33 100644 --- a/crates/web-sys/src/features/gen_GpuQuerySet.rs +++ b/crates/web-sys/src/features/gen_GpuQuerySet.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,6 +17,29 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuQuerySet; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQueryType")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUQuerySet" , 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/GPUQuerySet/type)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuQueryType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(this: &GpuQuerySet) -> GpuQueryType; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUQuerySet" , js_name = count)] + #[doc = "Getter for the `count` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQuerySet/count)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn count(this: &GpuQuerySet) -> u32; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUQuerySet" , js_name = label)] #[doc = "Getter for the `label` field of this object."] #[doc = ""] @@ -25,7 +49,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuQuerySet) -> Option; + pub fn label(this: &GpuQuerySet) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUQuerySet" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,7 +60,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuQuerySet, value: Option<&str>); + pub fn set_label(this: &GpuQuerySet, value: &str); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUQuerySet" , js_name = destroy)] #[doc = "The `destroy()` method."] diff --git a/crates/web-sys/src/features/gen_GpuQuerySetDescriptor.rs b/crates/web-sys/src/features/gen_GpuQuerySetDescriptor.rs index eca1a478427..c632dcd98e1 100644 --- a/crates/web-sys/src/features/gen_GpuQuerySetDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuQuerySetDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,23 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuQuerySetDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuQuerySetDescriptor { - #[cfg(feature = "GpuQueryType")] - #[doc = "Construct a new `GpuQuerySetDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(count: u32, type_: GpuQueryType) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.count(count); - ret.type_(type_); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuQuerySetDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -37,54 +30,36 @@ impl GpuQuerySetDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuQuerySetDescriptor, val: &str); #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `count` field of this object."] + #[doc = "Get the `count` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "count")] + pub fn get_count(this: &GpuQuerySetDescriptor) -> u32; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `pipelineStatistics` field of this object."] + #[doc = "Change the `count` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn pipeline_statistics(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pipelineStatistics"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "count")] + pub fn set_count(this: &GpuQuerySetDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQueryType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &GpuQuerySetDescriptor) -> GpuQueryType; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuQueryType")] #[doc = "Change the `type` field of this object."] @@ -93,14 +68,42 @@ impl GpuQuerySetDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &GpuQuerySetDescriptor, val: GpuQueryType); +} +#[cfg(web_sys_unstable_apis)] +impl GpuQuerySetDescriptor { + #[cfg(feature = "GpuQueryType")] + #[doc = "Construct a new `GpuQuerySetDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(count: u32, type_: GpuQueryType) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_count(count); + ret.set_type(type_); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_count()` instead."] + pub fn count(&mut self, val: u32) -> &mut Self { + self.set_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQueryType")] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: GpuQueryType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuQueryType.rs b/crates/web-sys/src/features/gen_GpuQueryType.rs index 4355a137533..4e115a98709 100644 --- a/crates/web-sys/src/features/gen_GpuQueryType.rs +++ b/crates/web-sys/src/features/gen_GpuQueryType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -11,6 +12,5 @@ use wasm_bindgen::prelude::*; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuQueryType { Occlusion = "occlusion", - PipelineStatistics = "pipeline-statistics", Timestamp = "timestamp", } diff --git a/crates/web-sys/src/features/gen_GpuQueue.rs b/crates/web-sys/src/features/gen_GpuQueue.rs index 8e6668bf111..70087a2f665 100644 --- a/crates/web-sys/src/features/gen_GpuQueue.rs +++ b/crates/web-sys/src/features/gen_GpuQueue.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuQueue) -> Option; + pub fn label(this: &GpuQueue) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUQueue" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,48 +37,48 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuQueue, value: Option<&str>); + pub fn set_label(this: &GpuQueue, value: &str); #[cfg(web_sys_unstable_apis)] #[cfg(all( - feature = "GpuImageCopyExternalImage", - feature = "GpuImageCopyTextureTagged", + feature = "GpuCopyExternalImageDestInfo", + feature = "GpuCopyExternalImageSourceInfo", ))] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] #[doc = "The `copyExternalImageToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyExternalImageToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyExternalImage`, `GpuImageCopyTextureTagged`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuCopyExternalImageSourceInfo`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_external_image_to_texture_with_u32_sequence( this: &GpuQueue, - source: &GpuImageCopyExternalImage, - destination: &GpuImageCopyTextureTagged, + source: &GpuCopyExternalImageSourceInfo, + destination: &GpuCopyExternalImageDestInfo, copy_size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( + feature = "GpuCopyExternalImageDestInfo", + feature = "GpuCopyExternalImageSourceInfo", feature = "GpuExtent3dDict", - feature = "GpuImageCopyExternalImage", - feature = "GpuImageCopyTextureTagged", ))] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = copyExternalImageToTexture)] #[doc = "The `copyExternalImageToTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/copyExternalImageToTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyExternalImage`, `GpuImageCopyTextureTagged`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageDestInfo`, `GpuCopyExternalImageSourceInfo`, `GpuExtent3dDict`, `GpuQueue`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn copy_external_image_to_texture_with_gpu_extent_3d_dict( this: &GpuQueue, - source: &GpuImageCopyExternalImage, - destination: &GpuImageCopyTextureTagged, + source: &GpuCopyExternalImageSourceInfo, + destination: &GpuCopyExternalImageDestInfo, copy_size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = onSubmittedWorkDone)] #[doc = "The `onSubmittedWorkDone()` method."] @@ -102,7 +103,7 @@ extern "C" { pub fn submit(this: &GpuQueue, command_buffers: &::wasm_bindgen::JsValue); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -116,10 +117,10 @@ extern "C" { buffer: &GpuBuffer, buffer_offset: u32, data: &::js_sys::Object, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -133,10 +134,10 @@ extern "C" { buffer: &GpuBuffer, buffer_offset: f64, data: &::js_sys::Object, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -145,15 +146,15 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array( + pub fn write_buffer_with_u32_and_u8_slice( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -162,15 +163,49 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array( + pub fn write_buffer_with_f64_and_u8_slice( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -185,10 +220,10 @@ extern "C" { buffer_offset: u32, data: &::js_sys::Object, data_offset: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -203,10 +238,10 @@ extern "C" { buffer_offset: f64, data: &::js_sys::Object, data_offset: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -215,16 +250,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_u32( + pub fn write_buffer_with_u32_and_u8_slice_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -233,16 +268,52 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_u32( + pub fn write_buffer_with_f64_and_u8_slice_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: u32, - ); + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: u32, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: u32, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -257,10 +328,10 @@ extern "C" { buffer_offset: u32, data: &::js_sys::Object, data_offset: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -275,10 +346,10 @@ extern "C" { buffer_offset: f64, data: &::js_sys::Object, data_offset: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -287,16 +358,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_f64( + pub fn write_buffer_with_u32_and_u8_slice_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -305,16 +376,52 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_f64( + pub fn write_buffer_with_f64_and_u8_slice_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: f64, - ); + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: f64, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -330,10 +437,10 @@ extern "C" { data: &::js_sys::Object, data_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -349,10 +456,10 @@ extern "C" { data: &::js_sys::Object, data_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -361,17 +468,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_u32_and_u32( + pub fn write_buffer_with_u32_and_u8_slice_and_u32_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -380,17 +487,55 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_u32_and_u32( + pub fn write_buffer_with_f64_and_u8_slice_and_u32_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: u32, size: u32, - ); + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: u32, + size: u32, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: u32, + size: u32, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -406,10 +551,10 @@ extern "C" { data: &::js_sys::Object, data_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -425,10 +570,10 @@ extern "C" { data: &::js_sys::Object, data_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -437,17 +582,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_f64_and_u32( + pub fn write_buffer_with_u32_and_u8_slice_and_f64_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -456,17 +601,55 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_f64_and_u32( + pub fn write_buffer_with_f64_and_u8_slice_and_f64_and_u32( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: f64, size: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: f64, + size: u32, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64_and_u32( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: f64, + size: u32, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -482,10 +665,10 @@ extern "C" { data: &::js_sys::Object, data_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -501,10 +684,10 @@ extern "C" { data: &::js_sys::Object, data_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -513,17 +696,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_u32_and_f64( + pub fn write_buffer_with_u32_and_u8_slice_and_u32_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -532,17 +715,55 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_u32_and_f64( + pub fn write_buffer_with_f64_and_u8_slice_and_u32_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: u32, size: f64, - ); + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_u32_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: u32, + size: f64, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_u32_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: u32, + size: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -558,10 +779,10 @@ extern "C" { data: &::js_sys::Object, data_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -577,10 +798,10 @@ extern "C" { data: &::js_sys::Object, data_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -589,17 +810,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_u32_and_u8_array_and_f64_and_f64( + pub fn write_buffer_with_u32_and_u8_slice_and_f64_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: u32, data: &[u8], data_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] #[doc = "The `writeBuffer()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] @@ -608,92 +829,179 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_buffer_with_f64_and_u8_array_and_f64_and_f64( + pub fn write_buffer_with_f64_and_u8_slice_and_f64_and_f64( this: &GpuQueue, buffer: &GpuBuffer, buffer_offset: f64, data: &[u8], data_offset: f64, size: f64, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyTexture", feature = "GpuImageDataLayout",))] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_u32_and_u8_array_and_f64_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: u32, + data: &::js_sys::Uint8Array, + data_offset: f64, + size: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeBuffer)] + #[doc = "The `writeBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuQueue`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_buffer_with_f64_and_u8_array_and_f64_and_f64( + this: &GpuQueue, + buffer: &GpuBuffer, + buffer_offset: f64, + data: &::js_sys::Uint8Array, + data_offset: f64, + size: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all( + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", + ))] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_buffer_source_and_u32_sequence( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &::js_sys::Object, - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] - #[cfg(all(feature = "GpuImageCopyTexture", feature = "GpuImageDataLayout",))] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[cfg(all( + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", + ))] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_texture_with_u8_array_and_u32_sequence( + pub fn write_texture_with_u8_slice_and_u32_sequence( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &[u8], - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, + size: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all( + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", + ))] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[doc = "The `writeTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_texture_with_u8_array_and_u32_sequence( + this: &GpuQueue, + destination: &GpuTexelCopyTextureInfo, + data: &::js_sys::Uint8Array, + data_layout: &GpuTexelCopyBufferLayout, size: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyTexture", - feature = "GpuImageDataLayout", + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", ))] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_texture_with_buffer_source_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &::js_sys::Object, - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all( feature = "GpuExtent3dDict", - feature = "GpuImageCopyTexture", - feature = "GpuImageDataLayout", + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", ))] - # [wasm_bindgen (method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] #[doc = "The `writeTexture()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuImageCopyTexture`, `GpuImageDataLayout`, `GpuQueue`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_texture_with_u8_array_and_gpu_extent_3d_dict( + pub fn write_texture_with_u8_slice_and_gpu_extent_3d_dict( this: &GpuQueue, - destination: &GpuImageCopyTexture, + destination: &GpuTexelCopyTextureInfo, data: &[u8], - data_layout: &GpuImageDataLayout, + data_layout: &GpuTexelCopyBufferLayout, + size: &GpuExtent3dDict, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all( + feature = "GpuExtent3dDict", + feature = "GpuTexelCopyBufferLayout", + feature = "GpuTexelCopyTextureInfo", + ))] + # [wasm_bindgen (catch , method , structural , js_class = "GPUQueue" , js_name = writeTexture)] + #[doc = "The `writeTexture()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUQueue/writeTexture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuExtent3dDict`, `GpuQueue`, `GpuTexelCopyBufferLayout`, `GpuTexelCopyTextureInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn write_texture_with_u8_array_and_gpu_extent_3d_dict( + this: &GpuQueue, + destination: &GpuTexelCopyTextureInfo, + data: &::js_sys::Uint8Array, + data_layout: &GpuTexelCopyBufferLayout, size: &GpuExtent3dDict, - ); + ) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_GpuShaderStage.rs b/crates/web-sys/src/features/gen_GpuQueueDescriptor.rs similarity index 59% rename from crates/web-sys/src/features/gen_GpuShaderStage.rs rename to crates/web-sys/src/features/gen_GpuQueueDescriptor.rs index f9b2538c119..c7d599625bc 100644 --- a/crates/web-sys/src/features/gen_GpuShaderStage.rs +++ b/crates/web-sys/src/features/gen_GpuQueueDescriptor.rs @@ -1,45 +1,61 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUShaderStage , typescript_type = "GPUShaderStage")] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUQueueDescriptor)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuShaderStage` class."] + #[doc = "The `GpuQueueDescriptor` dictionary."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderStage)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuShaderStage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuShaderStage; -} -#[cfg(web_sys_unstable_apis)] -impl GpuShaderStage { + pub type GpuQueueDescriptor; #[cfg(web_sys_unstable_apis)] - #[doc = "The `GPUShaderStage.VERTEX` const."] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuShaderStage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub const VERTEX: u32 = 1u64 as u32; + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuQueueDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] - #[doc = "The `GPUShaderStage.FRAGMENT` const."] + #[doc = "Change the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuShaderStage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub const FRAGMENT: u32 = 2u64 as u32; - #[cfg(web_sys_unstable_apis)] - #[doc = "The `GPUShaderStage.COMPUTE` const."] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuQueueDescriptor, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl GpuQueueDescriptor { + #[doc = "Construct a new `GpuQueueDescriptor`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuShaderStage`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuQueueDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub const COMPUTE: u32 = 4u64 as u32; + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for GpuQueueDescriptor { + fn default() -> Self { + Self::new() + } } diff --git a/crates/web-sys/src/features/gen_GpuRenderBundle.rs b/crates/web-sys/src/features/gen_GpuRenderBundle.rs index 7ef770ae428..4871f17f0a8 100644 --- a/crates/web-sys/src/features/gen_GpuRenderBundle.rs +++ b/crates/web-sys/src/features/gen_GpuRenderBundle.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuRenderBundle) -> Option; + pub fn label(this: &GpuRenderBundle) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPURenderBundle" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,5 +37,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuRenderBundle, value: Option<&str>); + pub fn set_label(this: &GpuRenderBundle, value: &str); } diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs index 22ef82ce854..ac6b825b6a3 100644 --- a/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderBundleDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderBundleDescriptor; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderBundleDescriptor) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderBundleDescriptor, val: &str); } #[cfg(web_sys_unstable_apis)] impl GpuRenderBundleDescriptor { @@ -28,20 +47,9 @@ impl GpuRenderBundleDescriptor { ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleDescriptor`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs b/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs index 7eba9a2fb39..de06739ca0f 100644 --- a/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs +++ b/crates/web-sys/src/features/gen_GpuRenderBundleEncoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuRenderBundleEncoder) -> Option; + pub fn label(this: &GpuRenderBundleEncoder) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPURenderBundleEncoder" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,7 +37,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuRenderBundleEncoder, value: Option<&str>); + pub fn set_label(this: &GpuRenderBundleEncoder, value: &str); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuRenderBundle")] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = finish)] @@ -65,41 +66,41 @@ extern "C" { descriptor: &GpuRenderBundleDescriptor, ) -> GpuRenderBundle; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = insertDebugMarker)] - #[doc = "The `insertDebugMarker()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/insertDebugMarker)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn insert_debug_marker(this: &GpuRenderBundleEncoder, marker_label: &str); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = popDebugGroup)] - #[doc = "The `popDebugGroup()` method."] + #[cfg(feature = "GpuBindGroup")] + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/popDebugGroup)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn pop_debug_group(this: &GpuRenderBundleEncoder); + pub fn set_bind_group( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + ); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = pushDebugGroup)] - #[doc = "The `pushDebugGroup()` method."] + #[cfg(feature = "GpuBindGroup")] + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/pushDebugGroup)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderBundleEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn push_debug_group(this: &GpuRenderBundleEncoder, group_label: &str); + pub fn set_bind_group_with_u32_sequence( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] @@ -108,10 +109,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group(this: &GpuRenderBundleEncoder, index: u32, bind_group: &GpuBindGroup); + pub fn set_bind_group_with_u32_slice_and_u32_and_dynamic_offsets_data_length( + this: &GpuRenderBundleEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] @@ -120,15 +128,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_sequence( + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( this: &GpuRenderBundleEncoder, index: u32, - bind_group: &GpuBindGroup, - dynamic_offsets: &::wasm_bindgen::JsValue, - ); + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] @@ -137,17 +147,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_slice_and_f64_and_dynamic_offsets_data_length( this: &GpuRenderBundleEncoder, index: u32, - bind_group: &GpuBindGroup, + bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], - dynamic_offsets_data_start: u32, + dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderBundleEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/setBindGroup)"] @@ -159,11 +169,44 @@ extern "C" { pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( this: &GpuRenderBundleEncoder, index: u32, - bind_group: &GpuBindGroup, - dynamic_offsets_data: &[u32], + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = insertDebugMarker)] + #[doc = "The `insertDebugMarker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/insertDebugMarker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn insert_debug_marker(this: &GpuRenderBundleEncoder, marker_label: &str); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = popDebugGroup)] + #[doc = "The `popDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/popDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_debug_group(this: &GpuRenderBundleEncoder); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = pushDebugGroup)] + #[doc = "The `pushDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderBundleEncoder/pushDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn push_debug_group(this: &GpuRenderBundleEncoder, group_label: &str); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = draw)] #[doc = "The `draw()` method."] @@ -509,7 +552,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_vertex_buffer(this: &GpuRenderBundleEncoder, slot: u32, buffer: &GpuBuffer); + pub fn set_vertex_buffer(this: &GpuRenderBundleEncoder, slot: u32, buffer: Option<&GpuBuffer>); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] # [wasm_bindgen (method , structural , js_class = "GPURenderBundleEncoder" , js_name = setVertexBuffer)] @@ -524,7 +567,7 @@ extern "C" { pub fn set_vertex_buffer_with_u32( this: &GpuRenderBundleEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: u32, ); #[cfg(web_sys_unstable_apis)] @@ -541,7 +584,7 @@ extern "C" { pub fn set_vertex_buffer_with_f64( this: &GpuRenderBundleEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: f64, ); #[cfg(web_sys_unstable_apis)] @@ -558,7 +601,7 @@ extern "C" { pub fn set_vertex_buffer_with_u32_and_u32( this: &GpuRenderBundleEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: u32, size: u32, ); @@ -576,7 +619,7 @@ extern "C" { pub fn set_vertex_buffer_with_f64_and_u32( this: &GpuRenderBundleEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: f64, size: u32, ); @@ -594,7 +637,7 @@ extern "C" { pub fn set_vertex_buffer_with_u32_and_f64( this: &GpuRenderBundleEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: u32, size: f64, ); @@ -612,7 +655,7 @@ extern "C" { pub fn set_vertex_buffer_with_f64_and_f64( this: &GpuRenderBundleEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: f64, size: f64, ); diff --git a/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs index d120becc516..04a4f6022f9 100644 --- a/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderBundleEncoderDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderBundleEncoderDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuRenderBundleEncoderDescriptor { - #[doc = "Construct a new `GpuRenderBundleEncoderDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(color_formats: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.color_formats(color_formats); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderBundleEncoderDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -35,16 +30,17 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderBundleEncoderDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `colorFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "colorFormats")] + pub fn get_color_formats(this: &GpuRenderBundleEncoderDescriptor) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `colorFormats` field of this object."] #[doc = ""] @@ -52,20 +48,23 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "colorFormats")] + pub fn set_color_formats( + this: &GpuRenderBundleEncoderDescriptor, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Get the `depthStencilFormat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStencilFormat")] + pub fn get_depth_stencil_format( + this: &GpuRenderBundleEncoderDescriptor, + ) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureFormat")] #[doc = "Change the `depthStencilFormat` field of this object."] @@ -74,20 +73,17 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthStencilFormat")] + pub fn set_depth_stencil_format(this: &GpuRenderBundleEncoderDescriptor, val: GpuTextureFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleCount")] + pub fn get_sample_count(this: &GpuRenderBundleEncoderDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `sampleCount` field of this object."] #[doc = ""] @@ -95,20 +91,17 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sample_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "sampleCount")] + pub fn set_sample_count(this: &GpuRenderBundleEncoderDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthReadOnly")] + pub fn get_depth_read_only(this: &GpuRenderBundleEncoderDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthReadOnly` field of this object."] #[doc = ""] @@ -116,20 +109,17 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthReadOnly")] + pub fn set_depth_read_only(this: &GpuRenderBundleEncoderDescriptor, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `stencilReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilReadOnly")] + pub fn get_stencil_read_only(this: &GpuRenderBundleEncoderDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `stencilReadOnly` field of this object."] #[doc = ""] @@ -137,18 +127,58 @@ impl GpuRenderBundleEncoderDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stencilReadOnly")] + pub fn set_stencil_read_only(this: &GpuRenderBundleEncoderDescriptor, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl GpuRenderBundleEncoderDescriptor { + #[doc = "Construct a new `GpuRenderBundleEncoderDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(color_formats: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_color_formats(color_formats); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_color_formats()` instead."] + pub fn color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_color_formats(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[deprecated = "Use `set_depth_stencil_format()` instead."] + pub fn depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_depth_stencil_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sample_count()` instead."] + pub fn sample_count(&mut self, val: u32) -> &mut Self { + self.set_sample_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_read_only()` instead."] + pub fn depth_read_only(&mut self, val: bool) -> &mut Self { + self.set_depth_read_only(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stencil_read_only()` instead."] pub fn stencil_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stencil_read_only(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs b/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs index aa05089c5b7..e2f6377ae81 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassColorAttachment.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,49 +14,72 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPassColorAttachment; -} -#[cfg(web_sys_unstable_apis)] -impl GpuRenderPassColorAttachment { - #[cfg(all(feature = "GpuStoreOp", feature = "GpuTextureView",))] - #[doc = "Construct a new `GpuRenderPassColorAttachment`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `clearValue` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTextureView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new( - load_value: &::wasm_bindgen::JsValue, - store_op: GpuStoreOp, - view: &GpuTextureView, - ) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.load_value(load_value); - ret.store_op(store_op); - ret.view(view); - ret - } + #[wasm_bindgen(method, getter = "clearValue")] + pub fn get_clear_value(this: &GpuRenderPassColorAttachment) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `loadValue` field of this object."] + #[doc = "Change the `clearValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("loadValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "clearValue")] + pub fn set_clear_value(this: &GpuRenderPassColorAttachment, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthSlice` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthSlice")] + pub fn get_depth_slice(this: &GpuRenderPassColorAttachment) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `depthSlice` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "depthSlice")] + pub fn set_depth_slice(this: &GpuRenderPassColorAttachment, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[doc = "Get the `loadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "loadOp")] + pub fn get_load_op(this: &GpuRenderPassColorAttachment) -> GpuLoadOp; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[doc = "Change the `loadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "loadOp")] + pub fn set_load_op(this: &GpuRenderPassColorAttachment, val: GpuLoadOp); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureView")] + #[doc = "Get the `resolveTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "resolveTarget")] + pub fn get_resolve_target(this: &GpuRenderPassColorAttachment) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureView")] #[doc = "Change the `resolveTarget` field of this object."] @@ -64,20 +88,18 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resolveTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "resolveTarget")] + pub fn set_resolve_target(this: &GpuRenderPassColorAttachment, val: &GpuTextureView); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStoreOp")] + #[doc = "Get the `storeOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "storeOp")] + pub fn get_store_op(this: &GpuRenderPassColorAttachment) -> GpuStoreOp; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStoreOp")] #[doc = "Change the `storeOp` field of this object."] @@ -86,20 +108,18 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storeOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "storeOp")] + pub fn set_store_op(this: &GpuRenderPassColorAttachment, val: GpuStoreOp); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureView")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassColorAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &GpuRenderPassColorAttachment) -> GpuTextureView; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureView")] #[doc = "Change the `view` field of this object."] @@ -108,14 +128,68 @@ impl GpuRenderPassColorAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &GpuRenderPassColorAttachment, val: &GpuTextureView); +} +#[cfg(web_sys_unstable_apis)] +impl GpuRenderPassColorAttachment { + #[cfg(all( + feature = "GpuLoadOp", + feature = "GpuStoreOp", + feature = "GpuTextureView", + ))] + #[doc = "Construct a new `GpuRenderPassColorAttachment`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassColorAttachment`, `GpuStoreOp`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(load_op: GpuLoadOp, store_op: GpuStoreOp, view: &GpuTextureView) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_load_op(load_op); + ret.set_store_op(store_op); + ret.set_view(view); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_clear_value()` instead."] + pub fn clear_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_clear_value(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_slice()` instead."] + pub fn depth_slice(&mut self, val: u32) -> &mut Self { + self.set_depth_slice(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[deprecated = "Use `set_load_op()` instead."] + pub fn load_op(&mut self, val: GpuLoadOp) -> &mut Self { + self.set_load_op(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureView")] + #[deprecated = "Use `set_resolve_target()` instead."] + pub fn resolve_target(&mut self, val: &GpuTextureView) -> &mut Self { + self.set_resolve_target(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStoreOp")] + #[deprecated = "Use `set_store_op()` instead."] + pub fn store_op(&mut self, val: GpuStoreOp) -> &mut Self { + self.set_store_op(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureView")] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs b/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs index 83fbe10bc90..45858297551 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassDepthStencilAttachment.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,53 +14,53 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPassDepthStencilAttachment; -} -#[cfg(web_sys_unstable_apis)] -impl GpuRenderPassDepthStencilAttachment { - #[cfg(all(feature = "GpuStoreOp", feature = "GpuTextureView",))] - #[doc = "Construct a new `GpuRenderPassDepthStencilAttachment`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthClearValue` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`, `GpuTextureView`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new( - depth_load_value: &::wasm_bindgen::JsValue, - depth_store_op: GpuStoreOp, - stencil_load_value: &::wasm_bindgen::JsValue, - stencil_store_op: GpuStoreOp, - view: &GpuTextureView, - ) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.depth_load_value(depth_load_value); - ret.depth_store_op(depth_store_op); - ret.stencil_load_value(stencil_load_value); - ret.stencil_store_op(stencil_store_op); - ret.view(view); - ret - } + #[wasm_bindgen(method, getter = "depthClearValue")] + pub fn get_depth_clear_value(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `depthLoadValue` field of this object."] + #[doc = "Change the `depthClearValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthLoadValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthClearValue")] + pub fn set_depth_clear_value(this: &GpuRenderPassDepthStencilAttachment, val: f32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[doc = "Get the `depthLoadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthLoadOp")] + pub fn get_depth_load_op(this: &GpuRenderPassDepthStencilAttachment) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[doc = "Change the `depthLoadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "depthLoadOp")] + pub fn set_depth_load_op(this: &GpuRenderPassDepthStencilAttachment, val: GpuLoadOp); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthReadOnly")] + pub fn get_depth_read_only(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthReadOnly` field of this object."] #[doc = ""] @@ -67,20 +68,18 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthReadOnly")] + pub fn set_depth_read_only(this: &GpuRenderPassDepthStencilAttachment, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStoreOp")] + #[doc = "Get the `depthStoreOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStoreOp")] + pub fn get_depth_store_op(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStoreOp")] #[doc = "Change the `depthStoreOp` field of this object."] @@ -89,41 +88,55 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStoreOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthStoreOp")] + pub fn set_depth_store_op(this: &GpuRenderPassDepthStencilAttachment, val: GpuStoreOp); #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `stencilLoadValue` field of this object."] + #[doc = "Get the `stencilClearValue` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_load_value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilLoadValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "stencilClearValue")] + pub fn get_stencil_clear_value(this: &GpuRenderPassDepthStencilAttachment) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `stencilClearValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stencilClearValue")] + pub fn set_stencil_clear_value(this: &GpuRenderPassDepthStencilAttachment, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[doc = "Get the `stencilLoadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilLoadOp")] + pub fn get_stencil_load_op(this: &GpuRenderPassDepthStencilAttachment) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[doc = "Change the `stencilLoadOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuLoadOp`, `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stencilLoadOp")] + pub fn set_stencil_load_op(this: &GpuRenderPassDepthStencilAttachment, val: GpuLoadOp); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `stencilReadOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilReadOnly")] + pub fn get_stencil_read_only(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `stencilReadOnly` field of this object."] #[doc = ""] @@ -131,20 +144,18 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_read_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilReadOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilReadOnly")] + pub fn set_stencil_read_only(this: &GpuRenderPassDepthStencilAttachment, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStoreOp")] + #[doc = "Get the `stencilStoreOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuStoreOp`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencilStoreOp")] + pub fn get_stencil_store_op(this: &GpuRenderPassDepthStencilAttachment) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStoreOp")] #[doc = "Change the `stencilStoreOp` field of this object."] @@ -153,20 +164,18 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn stencil_store_op(&mut self, val: GpuStoreOp) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencilStoreOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "stencilStoreOp")] + pub fn set_stencil_store_op(this: &GpuRenderPassDepthStencilAttachment, val: GpuStoreOp); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureView")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &GpuRenderPassDepthStencilAttachment) -> GpuTextureView; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureView")] #[doc = "Change the `view` field of this object."] @@ -175,14 +184,81 @@ impl GpuRenderPassDepthStencilAttachment { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &GpuRenderPassDepthStencilAttachment, val: &GpuTextureView); +} +#[cfg(web_sys_unstable_apis)] +impl GpuRenderPassDepthStencilAttachment { + #[cfg(feature = "GpuTextureView")] + #[doc = "Construct a new `GpuRenderPassDepthStencilAttachment`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuTextureView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(view: &GpuTextureView) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_view(view); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_clear_value()` instead."] + pub fn depth_clear_value(&mut self, val: f32) -> &mut Self { + self.set_depth_clear_value(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[deprecated = "Use `set_depth_load_op()` instead."] + pub fn depth_load_op(&mut self, val: GpuLoadOp) -> &mut Self { + self.set_depth_load_op(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_read_only()` instead."] + pub fn depth_read_only(&mut self, val: bool) -> &mut Self { + self.set_depth_read_only(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStoreOp")] + #[deprecated = "Use `set_depth_store_op()` instead."] + pub fn depth_store_op(&mut self, val: GpuStoreOp) -> &mut Self { + self.set_depth_store_op(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stencil_clear_value()` instead."] + pub fn stencil_clear_value(&mut self, val: u32) -> &mut Self { + self.set_stencil_clear_value(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuLoadOp")] + #[deprecated = "Use `set_stencil_load_op()` instead."] + pub fn stencil_load_op(&mut self, val: GpuLoadOp) -> &mut Self { + self.set_stencil_load_op(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stencil_read_only()` instead."] + pub fn stencil_read_only(&mut self, val: bool) -> &mut Self { + self.set_stencil_read_only(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStoreOp")] + #[deprecated = "Use `set_stencil_store_op()` instead."] + pub fn stencil_store_op(&mut self, val: GpuStoreOp) -> &mut Self { + self.set_stencil_store_op(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureView")] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: &GpuTextureView) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs index 1228090a1ba..e7e581c00ed 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPassDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuRenderPassDescriptor { - #[doc = "Construct a new `GpuRenderPassDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(color_attachments: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.color_attachments(color_attachments); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderPassDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -35,16 +30,17 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderPassDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `colorAttachments` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "colorAttachments")] + pub fn get_color_attachments(this: &GpuRenderPassDescriptor) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `colorAttachments` field of this object."] #[doc = ""] @@ -52,20 +48,20 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_attachments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorAttachments"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "colorAttachments")] + pub fn set_color_attachments(this: &GpuRenderPassDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] + #[doc = "Get the `depthStencilAttachment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDepthStencilAttachment`, `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStencilAttachment")] + pub fn get_depth_stencil_attachment( + this: &GpuRenderPassDescriptor, + ) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] #[doc = "Change the `depthStencilAttachment` field of this object."] @@ -74,23 +70,39 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_stencil_attachment( - &mut self, + #[wasm_bindgen(method, setter = "depthStencilAttachment")] + pub fn set_depth_stencil_attachment( + this: &GpuRenderPassDescriptor, val: &GpuRenderPassDepthStencilAttachment, - ) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilAttachment"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `maxDrawCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "maxDrawCount")] + pub fn get_max_draw_count(this: &GpuRenderPassDescriptor) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `maxDrawCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "maxDrawCount")] + pub fn set_max_draw_count(this: &GpuRenderPassDescriptor, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQuerySet")] + #[doc = "Get the `occlusionQuerySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "occlusionQuerySet")] + pub fn get_occlusion_query_set(this: &GpuRenderPassDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuQuerySet")] #[doc = "Change the `occlusionQuerySet` field of this object."] @@ -99,18 +111,85 @@ impl GpuRenderPassDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "occlusionQuerySet")] + pub fn set_occlusion_query_set(this: &GpuRenderPassDescriptor, val: &GpuQuerySet); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuRenderPassTimestampWrites")] + #[doc = "Get the `timestampWrites` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestampWrites")] + pub fn get_timestamp_writes( + this: &GpuRenderPassDescriptor, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuRenderPassTimestampWrites")] + #[doc = "Change the `timestampWrites` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestampWrites")] + pub fn set_timestamp_writes(this: &GpuRenderPassDescriptor, val: &GpuRenderPassTimestampWrites); +} +#[cfg(web_sys_unstable_apis)] +impl GpuRenderPassDescriptor { + #[doc = "Construct a new `GpuRenderPassDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(color_attachments: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_color_attachments(color_attachments); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_color_attachments()` instead."] + pub fn color_attachments(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_color_attachments(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] + #[deprecated = "Use `set_depth_stencil_attachment()` instead."] + pub fn depth_stencil_attachment( + &mut self, + val: &GpuRenderPassDepthStencilAttachment, + ) -> &mut Self { + self.set_depth_stencil_attachment(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_max_draw_count()` instead."] + pub fn max_draw_count(&mut self, val: f64) -> &mut Self { + self.set_max_draw_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQuerySet")] + #[deprecated = "Use `set_occlusion_query_set()` instead."] pub fn occlusion_query_set(&mut self, val: &GpuQuerySet) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("occlusionQuerySet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_occlusion_query_set(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuRenderPassTimestampWrites")] + #[deprecated = "Use `set_timestamp_writes()` instead."] + pub fn timestamp_writes(&mut self, val: &GpuRenderPassTimestampWrites) -> &mut Self { + self.set_timestamp_writes(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs b/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs index 3ae8e1f994f..b8451ad632d 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassEncoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuRenderPassEncoder) -> Option; + pub fn label(this: &GpuRenderPassEncoder) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPURenderPassEncoder" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,7 +37,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuRenderPassEncoder, value: Option<&str>); + pub fn set_label(this: &GpuRenderPassEncoder, value: &str); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = beginOcclusionQuery)] #[doc = "The `beginOcclusionQuery()` method."] @@ -49,21 +50,16 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn begin_occlusion_query(this: &GpuRenderPassEncoder, query_index: u32); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuQuerySet")] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = beginPipelineStatisticsQuery)] - #[doc = "The `beginPipelineStatisticsQuery()` method."] + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = end)] + #[doc = "The `end()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/beginPipelineStatisticsQuery)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/end)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn begin_pipeline_statistics_query( - this: &GpuRenderPassEncoder, - query_set: &GpuQuerySet, - query_index: u32, - ); + pub fn end(this: &GpuRenderPassEncoder); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = endOcclusionQuery)] #[doc = "The `endOcclusionQuery()` method."] @@ -76,28 +72,6 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn end_occlusion_query(this: &GpuRenderPassEncoder); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = endPass)] - #[doc = "The `endPass()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/endPass)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn end_pass(this: &GpuRenderPassEncoder); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = endPipelineStatisticsQuery)] - #[doc = "The `endPipelineStatisticsQuery()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/endPipelineStatisticsQuery)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn end_pipeline_statistics_query(this: &GpuRenderPassEncoder); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = executeBundles)] #[doc = "The `executeBundles()` method."] #[doc = ""] @@ -109,7 +83,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn execute_bundles(this: &GpuRenderPassEncoder, bundles: &::wasm_bindgen::JsValue); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] #[doc = "The `setBlendConstant()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBlendConstant)"] @@ -121,10 +95,10 @@ extern "C" { pub fn set_blend_constant_with_f64_sequence( this: &GpuRenderPassEncoder, color: &::wasm_bindgen::JsValue, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuColorDict")] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBlendConstant)] #[doc = "The `setBlendConstant()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBlendConstant)"] @@ -136,7 +110,7 @@ extern "C" { pub fn set_blend_constant_with_gpu_color_dict( this: &GpuRenderPassEncoder, color: &GpuColorDict, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setScissorRect)] #[doc = "The `setScissorRect()` method."] @@ -179,53 +153,41 @@ extern "C" { max_depth: f32, ); #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuQuerySet")] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = writeTimestamp)] - #[doc = "The `writeTimestamp()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/writeTimestamp)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn write_timestamp(this: &GpuRenderPassEncoder, query_set: &GpuQuerySet, query_index: u32); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = insertDebugMarker)] - #[doc = "The `insertDebugMarker()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/insertDebugMarker)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn insert_debug_marker(this: &GpuRenderPassEncoder, marker_label: &str); - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = popDebugGroup)] - #[doc = "The `popDebugGroup()` method."] + #[cfg(feature = "GpuBindGroup")] + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/popDebugGroup)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn pop_debug_group(this: &GpuRenderPassEncoder); + pub fn set_bind_group( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + ); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = pushDebugGroup)] - #[doc = "The `pushDebugGroup()` method."] + #[cfg(feature = "GpuBindGroup")] + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + #[doc = "The `setBindGroup()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/pushDebugGroup)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuBindGroup`, `GpuRenderPassEncoder`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn push_debug_group(this: &GpuRenderPassEncoder, group_label: &str); + pub fn set_bind_group_with_u32_sequence( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets: &::wasm_bindgen::JsValue, + ); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] @@ -234,10 +196,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group(this: &GpuRenderPassEncoder, index: u32, bind_group: &GpuBindGroup); + pub fn set_bind_group_with_u32_slice_and_u32_and_dynamic_offsets_data_length( + this: &GpuRenderPassEncoder, + index: u32, + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &[u32], + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] @@ -246,15 +215,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_sequence( + pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( this: &GpuRenderPassEncoder, index: u32, - bind_group: &GpuBindGroup, - dynamic_offsets: &::wasm_bindgen::JsValue, - ); + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, + dynamic_offsets_data_start: u32, + dynamic_offsets_data_length: u32, + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] @@ -263,17 +234,17 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_bind_group_with_u32_array_and_u32_and_dynamic_offsets_data_length( + pub fn set_bind_group_with_u32_slice_and_f64_and_dynamic_offsets_data_length( this: &GpuRenderPassEncoder, index: u32, - bind_group: &GpuBindGroup, + bind_group: Option<&GpuBindGroup>, dynamic_offsets_data: &[u32], - dynamic_offsets_data_start: u32, + dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroup")] - # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] + # [wasm_bindgen (catch , method , structural , js_class = "GPURenderPassEncoder" , js_name = setBindGroup)] #[doc = "The `setBindGroup()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/setBindGroup)"] @@ -285,11 +256,44 @@ extern "C" { pub fn set_bind_group_with_u32_array_and_f64_and_dynamic_offsets_data_length( this: &GpuRenderPassEncoder, index: u32, - bind_group: &GpuBindGroup, - dynamic_offsets_data: &[u32], + bind_group: Option<&GpuBindGroup>, + dynamic_offsets_data: &::js_sys::Uint32Array, dynamic_offsets_data_start: f64, dynamic_offsets_data_length: u32, - ); + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = insertDebugMarker)] + #[doc = "The `insertDebugMarker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/insertDebugMarker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn insert_debug_marker(this: &GpuRenderPassEncoder, marker_label: &str); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = popDebugGroup)] + #[doc = "The `popDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/popDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn pop_debug_group(this: &GpuRenderPassEncoder); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = pushDebugGroup)] + #[doc = "The `pushDebugGroup()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPURenderPassEncoder/pushDebugGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassEncoder`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn push_debug_group(this: &GpuRenderPassEncoder, group_label: &str); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = draw)] #[doc = "The `draw()` method."] @@ -635,7 +639,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_vertex_buffer(this: &GpuRenderPassEncoder, slot: u32, buffer: &GpuBuffer); + pub fn set_vertex_buffer(this: &GpuRenderPassEncoder, slot: u32, buffer: Option<&GpuBuffer>); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBuffer")] # [wasm_bindgen (method , structural , js_class = "GPURenderPassEncoder" , js_name = setVertexBuffer)] @@ -650,7 +654,7 @@ extern "C" { pub fn set_vertex_buffer_with_u32( this: &GpuRenderPassEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: u32, ); #[cfg(web_sys_unstable_apis)] @@ -667,7 +671,7 @@ extern "C" { pub fn set_vertex_buffer_with_f64( this: &GpuRenderPassEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: f64, ); #[cfg(web_sys_unstable_apis)] @@ -684,7 +688,7 @@ extern "C" { pub fn set_vertex_buffer_with_u32_and_u32( this: &GpuRenderPassEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: u32, size: u32, ); @@ -702,7 +706,7 @@ extern "C" { pub fn set_vertex_buffer_with_f64_and_u32( this: &GpuRenderPassEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: f64, size: u32, ); @@ -720,7 +724,7 @@ extern "C" { pub fn set_vertex_buffer_with_u32_and_f64( this: &GpuRenderPassEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: u32, size: f64, ); @@ -738,7 +742,7 @@ extern "C" { pub fn set_vertex_buffer_with_f64_and_f64( this: &GpuRenderPassEncoder, slot: u32, - buffer: &GpuBuffer, + buffer: Option<&GpuBuffer>, offset: f64, size: f64, ); diff --git a/crates/web-sys/src/features/gen_GpuRenderPassLayout.rs b/crates/web-sys/src/features/gen_GpuRenderPassLayout.rs index f583d10b341..0ff32c6eb0e 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPassLayout.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPassLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPassLayout; -} -#[cfg(web_sys_unstable_apis)] -impl GpuRenderPassLayout { - #[doc = "Construct a new `GpuRenderPassLayout`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(color_formats: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.color_formats(color_formats); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderPassLayout) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -35,16 +30,17 @@ impl GpuRenderPassLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderPassLayout, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `colorFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "colorFormats")] + pub fn get_color_formats(this: &GpuRenderPassLayout) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `colorFormats` field of this object."] #[doc = ""] @@ -52,20 +48,18 @@ impl GpuRenderPassLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorFormats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "colorFormats")] + pub fn set_color_formats(this: &GpuRenderPassLayout, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Get the `depthStencilFormat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStencilFormat")] + pub fn get_depth_stencil_format(this: &GpuRenderPassLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureFormat")] #[doc = "Change the `depthStencilFormat` field of this object."] @@ -74,20 +68,17 @@ impl GpuRenderPassLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencilFormat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthStencilFormat")] + pub fn set_depth_stencil_format(this: &GpuRenderPassLayout, val: GpuTextureFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleCount")] + pub fn get_sample_count(this: &GpuRenderPassLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `sampleCount` field of this object."] #[doc = ""] @@ -95,18 +86,46 @@ impl GpuRenderPassLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sampleCount")] + pub fn set_sample_count(this: &GpuRenderPassLayout, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuRenderPassLayout { + #[doc = "Construct a new `GpuRenderPassLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(color_formats: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_color_formats(color_formats); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_color_formats()` instead."] + pub fn color_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_color_formats(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[deprecated = "Use `set_depth_stencil_format()` instead."] + pub fn depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_depth_stencil_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sample_count()` instead."] pub fn sample_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sample_count(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRenderPassTimestampWrites.rs b/crates/web-sys/src/features/gen_GpuRenderPassTimestampWrites.rs new file mode 100644 index 00000000000..d7524eda362 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuRenderPassTimestampWrites.rs @@ -0,0 +1,108 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPURenderPassTimestampWrites)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuRenderPassTimestampWrites` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuRenderPassTimestampWrites; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `beginningOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "beginningOfPassWriteIndex")] + pub fn get_beginning_of_pass_write_index(this: &GpuRenderPassTimestampWrites) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `beginningOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "beginningOfPassWriteIndex")] + pub fn set_beginning_of_pass_write_index(this: &GpuRenderPassTimestampWrites, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `endOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "endOfPassWriteIndex")] + pub fn get_end_of_pass_write_index(this: &GpuRenderPassTimestampWrites) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `endOfPassWriteIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "endOfPassWriteIndex")] + pub fn set_end_of_pass_write_index(this: &GpuRenderPassTimestampWrites, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQuerySet")] + #[doc = "Get the `querySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "querySet")] + pub fn get_query_set(this: &GpuRenderPassTimestampWrites) -> GpuQuerySet; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQuerySet")] + #[doc = "Change the `querySet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "querySet")] + pub fn set_query_set(this: &GpuRenderPassTimestampWrites, val: &GpuQuerySet); +} +#[cfg(web_sys_unstable_apis)] +impl GpuRenderPassTimestampWrites { + #[cfg(feature = "GpuQuerySet")] + #[doc = "Construct a new `GpuRenderPassTimestampWrites`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuQuerySet`, `GpuRenderPassTimestampWrites`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(query_set: &GpuQuerySet) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_query_set(query_set); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_beginning_of_pass_write_index()` instead."] + pub fn beginning_of_pass_write_index(&mut self, val: u32) -> &mut Self { + self.set_beginning_of_pass_write_index(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_end_of_pass_write_index()` instead."] + pub fn end_of_pass_write_index(&mut self, val: u32) -> &mut Self { + self.set_end_of_pass_write_index(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuQuerySet")] + #[deprecated = "Use `set_query_set()` instead."] + pub fn query_set(&mut self, val: &GpuQuerySet) -> &mut Self { + self.set_query_set(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuRenderPipeline.rs b/crates/web-sys/src/features/gen_GpuRenderPipeline.rs index c9541566809..357a4107aaf 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPipeline.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPipeline.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuRenderPipeline) -> Option; + pub fn label(this: &GpuRenderPipeline) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPURenderPipeline" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,7 +37,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuRenderPipeline, value: Option<&str>); + pub fn set_label(this: &GpuRenderPipeline, value: &str); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuBindGroupLayout")] # [wasm_bindgen (method , structural , js_class = "GPURenderPipeline" , js_name = getBindGroupLayout)] diff --git a/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs b/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs index fcd35bbc57d..687439e5293 100644 --- a/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuRenderPipelineDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRenderPipelineDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuRenderPipelineDescriptor { - #[cfg(feature = "GpuVertexState")] - #[doc = "Construct a new `GpuRenderPipelineDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(vertex: &GpuVertexState) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.vertex(vertex); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuRenderPipelineDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -36,35 +30,36 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuRenderPipelineDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuRenderPipelineDescriptor) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuPipelineLayout")] #[doc = "Change the `layout` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuPipelineLayout`, `GpuRenderPipelineDescriptor`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn layout(&mut self, val: &GpuPipelineLayout) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuRenderPipelineDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuDepthStencilState")] + #[doc = "Get the `depthStencil` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuDepthStencilState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthStencil")] + pub fn get_depth_stencil(this: &GpuRenderPipelineDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuDepthStencilState")] #[doc = "Change the `depthStencil` field of this object."] @@ -73,20 +68,18 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_stencil(&mut self, val: &GpuDepthStencilState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthStencil"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthStencil")] + pub fn set_depth_stencil(this: &GpuRenderPipelineDescriptor, val: &GpuDepthStencilState); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuFragmentState")] + #[doc = "Get the `fragment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "fragment")] + pub fn get_fragment(this: &GpuRenderPipelineDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuFragmentState")] #[doc = "Change the `fragment` field of this object."] @@ -95,20 +88,18 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn fragment(&mut self, val: &GpuFragmentState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fragment"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "fragment")] + pub fn set_fragment(this: &GpuRenderPipelineDescriptor, val: &GpuFragmentState); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuMultisampleState")] + #[doc = "Get the `multisample` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMultisampleState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "multisample")] + pub fn get_multisample(this: &GpuRenderPipelineDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuMultisampleState")] #[doc = "Change the `multisample` field of this object."] @@ -117,20 +108,18 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn multisample(&mut self, val: &GpuMultisampleState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multisample"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "multisample")] + pub fn set_multisample(this: &GpuRenderPipelineDescriptor, val: &GpuMultisampleState); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPrimitiveState")] + #[doc = "Get the `primitive` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPrimitiveState`, `GpuRenderPipelineDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "primitive")] + pub fn get_primitive(this: &GpuRenderPipelineDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuPrimitiveState")] #[doc = "Change the `primitive` field of this object."] @@ -139,20 +128,18 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn primitive(&mut self, val: &GpuPrimitiveState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("primitive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "primitive")] + pub fn set_primitive(this: &GpuRenderPipelineDescriptor, val: &GpuPrimitiveState); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuVertexState")] + #[doc = "Get the `vertex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "vertex")] + pub fn get_vertex(this: &GpuRenderPipelineDescriptor) -> GpuVertexState; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuVertexState")] #[doc = "Change the `vertex` field of this object."] @@ -161,15 +148,70 @@ impl GpuRenderPipelineDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "vertex")] + pub fn set_vertex(this: &GpuRenderPipelineDescriptor, val: &GpuVertexState); +} +#[cfg(web_sys_unstable_apis)] +impl GpuRenderPipelineDescriptor { + #[cfg(feature = "GpuVertexState")] + #[doc = "Construct a new `GpuRenderPipelineDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRenderPipelineDescriptor`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(layout: &::wasm_bindgen::JsValue, vertex: &GpuVertexState) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_layout(layout); + ret.set_vertex(vertex); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_layout()` instead."] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_layout(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuDepthStencilState")] + #[deprecated = "Use `set_depth_stencil()` instead."] + pub fn depth_stencil(&mut self, val: &GpuDepthStencilState) -> &mut Self { + self.set_depth_stencil(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuFragmentState")] + #[deprecated = "Use `set_fragment()` instead."] + pub fn fragment(&mut self, val: &GpuFragmentState) -> &mut Self { + self.set_fragment(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuMultisampleState")] + #[deprecated = "Use `set_multisample()` instead."] + pub fn multisample(&mut self, val: &GpuMultisampleState) -> &mut Self { + self.set_multisample(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPrimitiveState")] + #[deprecated = "Use `set_primitive()` instead."] + pub fn primitive(&mut self, val: &GpuPrimitiveState) -> &mut Self { + self.set_primitive(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuVertexState")] + #[deprecated = "Use `set_vertex()` instead."] pub fn vertex(&mut self, val: &GpuVertexState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("vertex"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_vertex(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs b/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs index feb52b795b9..9148d88bf0e 100644 --- a/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs +++ b/crates/web-sys/src/features/gen_GpuRequestAdapterOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,41 +14,52 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuRequestAdapterOptions; -} -#[cfg(web_sys_unstable_apis)] -impl GpuRequestAdapterOptions { - #[doc = "Construct a new `GpuRequestAdapterOptions`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `featureLevel` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "featureLevel")] + pub fn get_feature_level(this: &GpuRequestAdapterOptions) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `forceSoftware` field of this object."] + #[doc = "Change the `featureLevel` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn force_software(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("forceSoftware"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "featureLevel")] + pub fn set_feature_level(this: &GpuRequestAdapterOptions, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `forceFallbackAdapter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "forceFallbackAdapter")] + pub fn get_force_fallback_adapter(this: &GpuRequestAdapterOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `forceFallbackAdapter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "forceFallbackAdapter")] + pub fn set_force_fallback_adapter(this: &GpuRequestAdapterOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPowerPreference")] + #[doc = "Get the `powerPreference` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuPowerPreference`, `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "powerPreference")] + pub fn get_power_preference(this: &GpuRequestAdapterOptions) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuPowerPreference")] #[doc = "Change the `powerPreference` field of this object."] @@ -56,18 +68,63 @@ impl GpuRequestAdapterOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "powerPreference")] + pub fn set_power_preference(this: &GpuRequestAdapterOptions, val: GpuPowerPreference); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `xrCompatible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "xrCompatible")] + pub fn get_xr_compatible(this: &GpuRequestAdapterOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `xrCompatible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "xrCompatible")] + pub fn set_xr_compatible(this: &GpuRequestAdapterOptions, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl GpuRequestAdapterOptions { + #[doc = "Construct a new `GpuRequestAdapterOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuRequestAdapterOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_feature_level()` instead."] + pub fn feature_level(&mut self, val: &str) -> &mut Self { + self.set_feature_level(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_force_fallback_adapter()` instead."] + pub fn force_fallback_adapter(&mut self, val: bool) -> &mut Self { + self.set_force_fallback_adapter(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuPowerPreference")] + #[deprecated = "Use `set_power_preference()` instead."] pub fn power_preference(&mut self, val: GpuPowerPreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("powerPreference"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_power_preference(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_xr_compatible()` instead."] + pub fn xr_compatible(&mut self, val: bool) -> &mut Self { + self.set_xr_compatible(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuSampler.rs b/crates/web-sys/src/features/gen_GpuSampler.rs index 42e389470ec..21a43a1c82d 100644 --- a/crates/web-sys/src/features/gen_GpuSampler.rs +++ b/crates/web-sys/src/features/gen_GpuSampler.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuSampler) -> Option; + pub fn label(this: &GpuSampler) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUSampler" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,5 +37,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuSampler, value: Option<&str>); + pub fn set_label(this: &GpuSampler, value: &str); } diff --git a/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs b/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs index aba8ea665c2..bfce5d945ee 100644 --- a/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuSamplerBindingLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,26 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuSamplerBindingLayout; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuSamplerBindingType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`, `GpuSamplerBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &GpuSamplerBindingLayout) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuSamplerBindingType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`, `GpuSamplerBindingType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &GpuSamplerBindingLayout, val: GpuSamplerBindingType); } #[cfg(web_sys_unstable_apis)] impl GpuSamplerBindingLayout { @@ -29,20 +50,9 @@ impl GpuSamplerBindingLayout { } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuSamplerBindingType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuSamplerBindingLayout`, `GpuSamplerBindingType`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: GpuSamplerBindingType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuSamplerBindingType.rs b/crates/web-sys/src/features/gen_GpuSamplerBindingType.rs index ea4a3c446dd..0b406c0d30e 100644 --- a/crates/web-sys/src/features/gen_GpuSamplerBindingType.rs +++ b/crates/web-sys/src/features/gen_GpuSamplerBindingType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs b/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs index 90f100f0905..6165b01c039 100644 --- a/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuSamplerDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuSamplerDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuSamplerDescriptor { - #[doc = "Construct a new `GpuSamplerDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuSamplerDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -34,16 +30,18 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuSamplerDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAddressMode")] + #[doc = "Get the `addressModeU` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "addressModeU")] + pub fn get_address_mode_u(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuAddressMode")] #[doc = "Change the `addressModeU` field of this object."] @@ -52,20 +50,18 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn address_mode_u(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeU"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "addressModeU")] + pub fn set_address_mode_u(this: &GpuSamplerDescriptor, val: GpuAddressMode); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAddressMode")] + #[doc = "Get the `addressModeV` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "addressModeV")] + pub fn get_address_mode_v(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuAddressMode")] #[doc = "Change the `addressModeV` field of this object."] @@ -74,20 +70,18 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn address_mode_v(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeV"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "addressModeV")] + pub fn set_address_mode_v(this: &GpuSamplerDescriptor, val: GpuAddressMode); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAddressMode")] + #[doc = "Get the `addressModeW` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuAddressMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "addressModeW")] + pub fn get_address_mode_w(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuAddressMode")] #[doc = "Change the `addressModeW` field of this object."] @@ -96,20 +90,18 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn address_mode_w(&mut self, val: GpuAddressMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressModeW"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "addressModeW")] + pub fn set_address_mode_w(this: &GpuSamplerDescriptor, val: GpuAddressMode); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCompareFunction")] + #[doc = "Get the `compare` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "compare")] + pub fn get_compare(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuCompareFunction")] #[doc = "Change the `compare` field of this object."] @@ -118,20 +110,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "compare")] + pub fn set_compare(this: &GpuSamplerDescriptor, val: GpuCompareFunction); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `lodMaxClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "lodMaxClamp")] + pub fn get_lod_max_clamp(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `lodMaxClamp` field of this object."] #[doc = ""] @@ -139,20 +128,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn lod_max_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lodMaxClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "lodMaxClamp")] + pub fn set_lod_max_clamp(this: &GpuSamplerDescriptor, val: f32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `lodMinClamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "lodMinClamp")] + pub fn get_lod_min_clamp(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `lodMinClamp` field of this object."] #[doc = ""] @@ -160,20 +146,18 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn lod_min_clamp(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lodMinClamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "lodMinClamp")] + pub fn set_lod_min_clamp(this: &GpuSamplerDescriptor, val: f32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuFilterMode")] + #[doc = "Get the `magFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "magFilter")] + pub fn get_mag_filter(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuFilterMode")] #[doc = "Change the `magFilter` field of this object."] @@ -182,20 +166,17 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mag_filter(&mut self, val: GpuFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("magFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "magFilter")] + pub fn set_mag_filter(this: &GpuSamplerDescriptor, val: GpuFilterMode); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `maxAnisotropy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "maxAnisotropy")] + pub fn get_max_anisotropy(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `maxAnisotropy` field of this object."] #[doc = ""] @@ -203,62 +184,133 @@ impl GpuSamplerDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_anisotropy(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxAnisotropy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "maxAnisotropy")] + pub fn set_max_anisotropy(this: &GpuSamplerDescriptor, val: u16); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuFilterMode")] - #[doc = "Change the `minFilter` field of this object."] + #[doc = "Get the `minFilter` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn min_filter(&mut self, val: GpuFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "minFilter")] + pub fn get_min_filter(this: &GpuSamplerDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuFilterMode")] - #[doc = "Change the `mipmapFilter` field of this object."] + #[doc = "Change the `minFilter` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuFilterMode`, `GpuSamplerDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mipmap_filter(&mut self, val: GpuFilterMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipmapFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + #[wasm_bindgen(method, setter = "minFilter")] + pub fn set_min_filter(this: &GpuSamplerDescriptor, val: GpuFilterMode); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuMipmapFilterMode")] + #[doc = "Get the `mipmapFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMipmapFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipmapFilter")] + pub fn get_mipmap_filter(this: &GpuSamplerDescriptor) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuMipmapFilterMode")] + #[doc = "Change the `mipmapFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuMipmapFilterMode`, `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mipmapFilter")] + pub fn set_mipmap_filter(this: &GpuSamplerDescriptor, val: GpuMipmapFilterMode); +} +#[cfg(web_sys_unstable_apis)] +impl GpuSamplerDescriptor { + #[doc = "Construct a new `GpuSamplerDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSamplerDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAddressMode")] + #[deprecated = "Use `set_address_mode_u()` instead."] + pub fn address_mode_u(&mut self, val: GpuAddressMode) -> &mut Self { + self.set_address_mode_u(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAddressMode")] + #[deprecated = "Use `set_address_mode_v()` instead."] + pub fn address_mode_v(&mut self, val: GpuAddressMode) -> &mut Self { + self.set_address_mode_v(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuAddressMode")] + #[deprecated = "Use `set_address_mode_w()` instead."] + pub fn address_mode_w(&mut self, val: GpuAddressMode) -> &mut Self { + self.set_address_mode_w(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCompareFunction")] + #[deprecated = "Use `set_compare()` instead."] + pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { + self.set_compare(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_lod_max_clamp()` instead."] + pub fn lod_max_clamp(&mut self, val: f32) -> &mut Self { + self.set_lod_max_clamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_lod_min_clamp()` instead."] + pub fn lod_min_clamp(&mut self, val: f32) -> &mut Self { + self.set_lod_min_clamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuFilterMode")] + #[deprecated = "Use `set_mag_filter()` instead."] + pub fn mag_filter(&mut self, val: GpuFilterMode) -> &mut Self { + self.set_mag_filter(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_max_anisotropy()` instead."] + pub fn max_anisotropy(&mut self, val: u16) -> &mut Self { + self.set_max_anisotropy(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuFilterMode")] + #[deprecated = "Use `set_min_filter()` instead."] + pub fn min_filter(&mut self, val: GpuFilterMode) -> &mut Self { + self.set_min_filter(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuMipmapFilterMode")] + #[deprecated = "Use `set_mipmap_filter()` instead."] + pub fn mipmap_filter(&mut self, val: GpuMipmapFilterMode) -> &mut Self { + self.set_mipmap_filter(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuShaderModule.rs b/crates/web-sys/src/features/gen_GpuShaderModule.rs index 7e35f25ecc4..caa0cfba4ff 100644 --- a/crates/web-sys/src/features/gen_GpuShaderModule.rs +++ b/crates/web-sys/src/features/gen_GpuShaderModule.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuShaderModule) -> Option; + pub fn label(this: &GpuShaderModule) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUShaderModule" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,16 +37,16 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuShaderModule, value: Option<&str>); + pub fn set_label(this: &GpuShaderModule, value: &str); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "GPUShaderModule" , js_name = compilationInfo)] - #[doc = "The `compilationInfo()` method."] + # [wasm_bindgen (method , structural , js_class = "GPUShaderModule" , js_name = getCompilationInfo)] + #[doc = "The `getCompilationInfo()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule/compilationInfo)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUShaderModule/getCompilationInfo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn compilation_info(this: &GpuShaderModule) -> ::js_sys::Promise; + pub fn get_compilation_info(this: &GpuShaderModule) -> ::js_sys::Promise; } diff --git a/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs b/crates/web-sys/src/features/gen_GpuShaderModuleCompilationHint.rs similarity index 51% rename from crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs rename to crates/web-sys/src/features/gen_GpuShaderModuleCompilationHint.rs index 150bc9dcd39..04c95923596 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyBuffer.rs +++ b/crates/web-sys/src/features/gen_GpuShaderModuleCompilationHint.rs @@ -1,111 +1,80 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyBuffer)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUShaderModuleCompilationHint)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyBuffer` dictionary."] + #[doc = "The `GpuShaderModuleCompilationHint` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleCompilationHint`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyBuffer; -} -#[cfg(web_sys_unstable_apis)] -impl GpuImageCopyBuffer { - #[cfg(feature = "GpuBuffer")] - #[doc = "Construct a new `GpuImageCopyBuffer`."] + pub type GpuShaderModuleCompilationHint; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `entryPoint` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleCompilationHint`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(buffer: &GpuBuffer) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.buffer(buffer); - ret - } + #[wasm_bindgen(method, getter = "entryPoint")] + pub fn get_entry_point(this: &GpuShaderModuleCompilationHint) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `bytesPerRow` field of this object."] + #[doc = "Change the `entryPoint` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleCompilationHint`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesPerRow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "entryPoint")] + pub fn set_entry_point(this: &GpuShaderModuleCompilationHint, val: &str); #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `offset` field of this object."] + #[doc = "Get the `layout` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleCompilationHint`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &GpuShaderModuleCompilationHint) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `rowsPerImage` field of this object."] + #[doc = "Change the `layout` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleCompilationHint`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn rows_per_image(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rowsPerImage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuBuffer")] - #[doc = "Change the `buffer` field of this object."] + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &GpuShaderModuleCompilationHint, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuShaderModuleCompilationHint { + #[doc = "Construct a new `GpuShaderModuleCompilationHint`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleCompilationHint`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn buffer(&mut self, val: &GpuBuffer) -> &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; + pub fn new(entry_point: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_entry_point(entry_point); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_entry_point()` instead."] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + self.set_entry_point(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_layout()` instead."] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_layout(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs b/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs index fcf1c978412..33291f08ab4 100644 --- a/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuShaderModuleDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuShaderModuleDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuShaderModuleDescriptor { - #[doc = "Construct a new `GpuShaderModuleDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(code: &str) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.code(code); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuShaderModuleDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -35,16 +30,17 @@ impl GpuShaderModuleDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuShaderModuleDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `code` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "code")] + pub fn get_code(this: &GpuShaderModuleDescriptor) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `code` field of this object."] #[doc = ""] @@ -52,35 +48,57 @@ impl GpuShaderModuleDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn code(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "code")] + pub fn set_code(this: &GpuShaderModuleDescriptor, val: &str); #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `sourceMap` field of this object."] + #[doc = "Get the `compilationHints` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn source_map(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sourceMap"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + #[wasm_bindgen(method, getter = "compilationHints")] + pub fn get_compilation_hints(this: &GpuShaderModuleDescriptor) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `compilationHints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "compilationHints")] + pub fn set_compilation_hints(this: &GpuShaderModuleDescriptor, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuShaderModuleDescriptor { + #[doc = "Construct a new `GpuShaderModuleDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(code: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_code(code); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_code()` instead."] + pub fn code(&mut self, val: &str) -> &mut Self { + self.set_code(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_compilation_hints()` instead."] + pub fn compilation_hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_compilation_hints(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuStencilFaceState.rs b/crates/web-sys/src/features/gen_GpuStencilFaceState.rs index 80b4e521203..8aba11bb319 100644 --- a/crates/web-sys/src/features/gen_GpuStencilFaceState.rs +++ b/crates/web-sys/src/features/gen_GpuStencilFaceState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuStencilFaceState; -} -#[cfg(web_sys_unstable_apis)] -impl GpuStencilFaceState { - #[doc = "Construct a new `GpuStencilFaceState`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCompareFunction")] + #[doc = "Get the `compare` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuCompareFunction`, `GpuStencilFaceState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "compare")] + pub fn get_compare(this: &GpuStencilFaceState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuCompareFunction")] #[doc = "Change the `compare` field of this object."] @@ -35,20 +32,18 @@ impl GpuStencilFaceState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("compare"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "compare")] + pub fn set_compare(this: &GpuStencilFaceState, val: GpuCompareFunction); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilOperation")] + #[doc = "Get the `depthFailOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthFailOp")] + pub fn get_depth_fail_op(this: &GpuStencilFaceState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStencilOperation")] #[doc = "Change the `depthFailOp` field of this object."] @@ -57,20 +52,18 @@ impl GpuStencilFaceState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthFailOp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthFailOp")] + pub fn set_depth_fail_op(this: &GpuStencilFaceState, val: GpuStencilOperation); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilOperation")] + #[doc = "Get the `failOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "failOp")] + pub fn get_fail_op(this: &GpuStencilFaceState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStencilOperation")] #[doc = "Change the `failOp` field of this object."] @@ -79,17 +72,18 @@ impl GpuStencilFaceState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("failOp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "failOp")] + pub fn set_fail_op(this: &GpuStencilFaceState, val: GpuStencilOperation); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilOperation")] + #[doc = "Get the `passOp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`, `GpuStencilOperation`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "passOp")] + pub fn get_pass_op(this: &GpuStencilFaceState) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStencilOperation")] #[doc = "Change the `passOp` field of this object."] @@ -98,15 +92,48 @@ impl GpuStencilFaceState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "passOp")] + pub fn set_pass_op(this: &GpuStencilFaceState, val: GpuStencilOperation); +} +#[cfg(web_sys_unstable_apis)] +impl GpuStencilFaceState { + #[doc = "Construct a new `GpuStencilFaceState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStencilFaceState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuCompareFunction")] + #[deprecated = "Use `set_compare()` instead."] + pub fn compare(&mut self, val: GpuCompareFunction) -> &mut Self { + self.set_compare(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilOperation")] + #[deprecated = "Use `set_depth_fail_op()` instead."] + pub fn depth_fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { + self.set_depth_fail_op(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilOperation")] + #[deprecated = "Use `set_fail_op()` instead."] + pub fn fail_op(&mut self, val: GpuStencilOperation) -> &mut Self { + self.set_fail_op(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStencilOperation")] + #[deprecated = "Use `set_pass_op()` instead."] pub fn pass_op(&mut self, val: GpuStencilOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("passOp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pass_op(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuStencilOperation.rs b/crates/web-sys/src/features/gen_GpuStencilOperation.rs index 6b9573f7217..6206b66c55d 100644 --- a/crates/web-sys/src/features/gen_GpuStencilOperation.rs +++ b/crates/web-sys/src/features/gen_GpuStencilOperation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuStorageTextureAccess.rs b/crates/web-sys/src/features/gen_GpuStorageTextureAccess.rs index e5dd0af1097..e0069d0992f 100644 --- a/crates/web-sys/src/features/gen_GpuStorageTextureAccess.rs +++ b/crates/web-sys/src/features/gen_GpuStorageTextureAccess.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -11,4 +12,6 @@ use wasm_bindgen::prelude::*; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuStorageTextureAccess { WriteOnly = "write-only", + ReadOnly = "read-only", + ReadWrite = "read-write", } diff --git a/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs b/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs index 90555a09b36..a95ad6cc1b8 100644 --- a/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuStorageTextureBindingLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuStorageTextureBindingLayout; -} -#[cfg(web_sys_unstable_apis)] -impl GpuStorageTextureBindingLayout { - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Construct a new `GpuStorageTextureBindingLayout`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStorageTextureAccess")] + #[doc = "Get the `access` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureAccess`, `GpuStorageTextureBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret - } + #[wasm_bindgen(method, getter = "access")] + pub fn get_access(this: &GpuStorageTextureBindingLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuStorageTextureAccess")] #[doc = "Change the `access` field of this object."] @@ -37,17 +32,18 @@ impl GpuStorageTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn access(&mut self, val: GpuStorageTextureAccess) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("access"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "access")] + pub fn set_access(this: &GpuStorageTextureBindingLayout, val: GpuStorageTextureAccess); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuStorageTextureBindingLayout) -> GpuTextureFormat; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureFormat")] #[doc = "Change the `format` field of this object."] @@ -56,17 +52,20 @@ impl GpuStorageTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuStorageTextureBindingLayout, val: GpuTextureFormat); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureViewDimension")] + #[doc = "Get the `viewDimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "viewDimension")] + pub fn get_view_dimension( + this: &GpuStorageTextureBindingLayout, + ) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureViewDimension")] #[doc = "Change the `viewDimension` field of this object."] @@ -75,18 +74,43 @@ impl GpuStorageTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "viewDimension")] + pub fn set_view_dimension(this: &GpuStorageTextureBindingLayout, val: GpuTextureViewDimension); +} +#[cfg(web_sys_unstable_apis)] +impl GpuStorageTextureBindingLayout { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuStorageTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuStorageTextureAccess")] + #[deprecated = "Use `set_access()` instead."] + pub fn access(&mut self, val: GpuStorageTextureAccess) -> &mut Self { + self.set_access(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureViewDimension")] + #[deprecated = "Use `set_view_dimension()` instead."] pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewDimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view_dimension(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuStoreOp.rs b/crates/web-sys/src/features/gen_GpuStoreOp.rs index d1e17849885..fc01989a1e6 100644 --- a/crates/web-sys/src/features/gen_GpuStoreOp.rs +++ b/crates/web-sys/src/features/gen_GpuStoreOp.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuSupportedFeatures.rs b/crates/web-sys/src/features/gen_GpuSupportedFeatures.rs index da11a61c5cd..0f14c56a460 100644 --- a/crates/web-sys/src/features/gen_GpuSupportedFeatures.rs +++ b/crates/web-sys/src/features/gen_GpuSupportedFeatures.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -15,4 +16,73 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuSupportedFeatures; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedFeatures" , 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/GPUSupportedFeatures/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &GpuSupportedFeatures) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUSupportedFeatures" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(this: &GpuSupportedFeatures) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUSupportedFeatures" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn for_each( + this: &GpuSupportedFeatures, + callback: &::js_sys::Function, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUSupportedFeatures" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn has(this: &GpuSupportedFeatures, value: &str) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUSupportedFeatures" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn keys(this: &GpuSupportedFeatures) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "GPUSupportedFeatures" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedFeatures/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn values(this: &GpuSupportedFeatures) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_GpuSupportedLimits.rs b/crates/web-sys/src/features/gen_GpuSupportedLimits.rs index 78c14a15f16..14ecf5c115a 100644 --- a/crates/web-sys/src/features/gen_GpuSupportedLimits.rs +++ b/crates/web-sys/src/features/gen_GpuSupportedLimits.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -71,6 +72,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn max_bind_groups(this: &GpuSupportedLimits) -> u32; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxBindGroupsPlusVertexBuffers)] + #[doc = "Getter for the `maxBindGroupsPlusVertexBuffers` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxBindGroupsPlusVertexBuffers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_bind_groups_plus_vertex_buffers(this: &GpuSupportedLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxBindingsPerBindGroup)] + #[doc = "Getter for the `maxBindingsPerBindGroup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxBindingsPerBindGroup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_bindings_per_bind_group(this: &GpuSupportedLimits) -> u32; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxDynamicUniformBuffersPerPipelineLayout)] #[doc = "Getter for the `maxDynamicUniformBuffersPerPipelineLayout` field of this object."] #[doc = ""] @@ -203,6 +226,17 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn max_vertex_buffers(this: &GpuSupportedLimits) -> u32; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxBufferSize)] + #[doc = "Getter for the `maxBufferSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxBufferSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_buffer_size(this: &GpuSupportedLimits) -> f64; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxVertexAttributes)] #[doc = "Getter for the `maxVertexAttributes` field of this object."] #[doc = ""] @@ -225,16 +259,38 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn max_vertex_buffer_array_stride(this: &GpuSupportedLimits) -> u32; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxInterStageShaderComponents)] - #[doc = "Getter for the `maxInterStageShaderComponents` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxInterStageShaderVariables)] + #[doc = "Getter for the `maxInterStageShaderVariables` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxInterStageShaderVariables)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_inter_stage_shader_variables(this: &GpuSupportedLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxColorAttachments)] + #[doc = "Getter for the `maxColorAttachments` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxColorAttachments)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_color_attachments(this: &GpuSupportedLimits) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxColorAttachmentBytesPerSample)] + #[doc = "Getter for the `maxColorAttachmentBytesPerSample` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxInterStageShaderComponents)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits/maxColorAttachmentBytesPerSample)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuSupportedLimits`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn max_inter_stage_shader_components(this: &GpuSupportedLimits) -> u32; + pub fn max_color_attachment_bytes_per_sample(this: &GpuSupportedLimits) -> u32; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUSupportedLimits" , js_name = maxComputeWorkgroupStorageSize)] #[doc = "Getter for the `maxComputeWorkgroupStorageSize` field of this object."] diff --git a/crates/web-sys/src/features/gen_GpuTexelCopyBufferInfo.rs b/crates/web-sys/src/features/gen_GpuTexelCopyBufferInfo.rs new file mode 100644 index 00000000000..c364ceb20c4 --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTexelCopyBufferInfo.rs @@ -0,0 +1,132 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyBufferInfo)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTexelCopyBufferInfo` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTexelCopyBufferInfo; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesPerRow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesPerRow")] + pub fn get_bytes_per_row(this: &GpuTexelCopyBufferInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesPerRow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesPerRow")] + pub fn set_bytes_per_row(this: &GpuTexelCopyBufferInfo, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &GpuTexelCopyBufferInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &GpuTexelCopyBufferInfo, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rowsPerImage")] + pub fn get_rows_per_image(this: &GpuTexelCopyBufferInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rowsPerImage")] + pub fn set_rows_per_image(this: &GpuTexelCopyBufferInfo, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + #[doc = "Get the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "buffer")] + pub fn get_buffer(this: &GpuTexelCopyBufferInfo) -> GpuBuffer; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + #[doc = "Change the `buffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "buffer")] + pub fn set_buffer(this: &GpuTexelCopyBufferInfo, val: &GpuBuffer); +} +#[cfg(web_sys_unstable_apis)] +impl GpuTexelCopyBufferInfo { + #[cfg(feature = "GpuBuffer")] + #[doc = "Construct a new `GpuTexelCopyBufferInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuTexelCopyBufferInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(buffer: &GpuBuffer) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_buffer(buffer); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_per_row()` instead."] + pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { + self.set_bytes_per_row(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: f64) -> &mut Self { + self.set_offset(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rows_per_image()` instead."] + pub fn rows_per_image(&mut self, val: u32) -> &mut Self { + self.set_rows_per_image(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuBuffer")] + #[deprecated = "Use `set_buffer()` instead."] + pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self { + self.set_buffer(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_GpuTexelCopyBufferLayout.rs b/crates/web-sys/src/features/gen_GpuTexelCopyBufferLayout.rs new file mode 100644 index 00000000000..20d5229944f --- /dev/null +++ b/crates/web-sys/src/features/gen_GpuTexelCopyBufferLayout.rs @@ -0,0 +1,109 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyBufferLayout)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `GpuTexelCopyBufferLayout` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type GpuTexelCopyBufferLayout; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesPerRow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesPerRow")] + pub fn get_bytes_per_row(this: &GpuTexelCopyBufferLayout) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesPerRow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesPerRow")] + pub fn set_bytes_per_row(this: &GpuTexelCopyBufferLayout, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &GpuTexelCopyBufferLayout) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &GpuTexelCopyBufferLayout, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rowsPerImage")] + pub fn get_rows_per_image(this: &GpuTexelCopyBufferLayout) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rowsPerImage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rowsPerImage")] + pub fn set_rows_per_image(this: &GpuTexelCopyBufferLayout, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuTexelCopyBufferLayout { + #[doc = "Construct a new `GpuTexelCopyBufferLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_per_row()` instead."] + pub fn bytes_per_row(&mut self, val: u32) -> &mut Self { + self.set_bytes_per_row(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: f64) -> &mut Self { + self.set_offset(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rows_per_image()` instead."] + pub fn rows_per_image(&mut self, val: u32) -> &mut Self { + self.set_rows_per_image(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for GpuTexelCopyBufferLayout { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs b/crates/web-sys/src/features/gen_GpuTexelCopyTextureInfo.rs similarity index 54% rename from crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs rename to crates/web-sys/src/features/gen_GpuTexelCopyTextureInfo.rs index 27e5a88317a..a2274cefc6e 100644 --- a/crates/web-sys/src/features/gen_GpuImageCopyTextureTagged.rs +++ b/crates/web-sys/src/features/gen_GpuTexelCopyTextureInfo.rs @@ -1,155 +1,135 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyTextureTagged)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTexelCopyTextureInfo)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuImageCopyTextureTagged` dictionary."] + #[doc = "The `GpuTexelCopyTextureInfo` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuImageCopyTextureTagged; -} -#[cfg(web_sys_unstable_apis)] -impl GpuImageCopyTextureTagged { - #[cfg(feature = "GpuTexture")] - #[doc = "Construct a new `GpuImageCopyTextureTagged`."] + pub type GpuTexelCopyTextureInfo; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureAspect")] + #[doc = "Get the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(texture: &GpuTexture) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.texture(texture); - ret - } + #[wasm_bindgen(method, getter = "aspect")] + pub fn get_aspect(this: &GpuTexelCopyTextureInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureAspect")] #[doc = "Change the `aspect` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTextureAspect`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTextureAspect`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "aspect")] + pub fn set_aspect(this: &GpuTexelCopyTextureInfo, val: GpuTextureAspect); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipLevel")] + pub fn get_mip_level(this: &GpuTexelCopyTextureInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `mipLevel` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "mipLevel")] + pub fn set_mip_level(this: &GpuTexelCopyTextureInfo, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &GpuTexelCopyTextureInfo) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `origin` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &GpuTexelCopyTextureInfo, val: &::wasm_bindgen::JsValue); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTexture")] - #[doc = "Change the `texture` field of this object."] + #[doc = "Get the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuTexture`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("texture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, getter = "texture")] + pub fn get_texture(this: &GpuTexelCopyTextureInfo) -> GpuTexture; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "GpuPredefinedColorSpace")] - #[doc = "Change the `colorSpace` field of this object."] + #[cfg(feature = "GpuTexture")] + #[doc = "Change the `texture` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`, `GpuPredefinedColorSpace`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_space(&mut self, val: GpuPredefinedColorSpace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `premultipliedAlpha` field of this object."] + #[wasm_bindgen(method, setter = "texture")] + pub fn set_texture(this: &GpuTexelCopyTextureInfo, val: &GpuTexture); +} +#[cfg(web_sys_unstable_apis)] +impl GpuTexelCopyTextureInfo { + #[cfg(feature = "GpuTexture")] + #[doc = "Construct a new `GpuTexelCopyTextureInfo`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTextureTagged`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTexelCopyTextureInfo`, `GpuTexture`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn premultiplied_alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("premultipliedAlpha"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + pub fn new(texture: &GpuTexture) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_texture(texture); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureAspect")] + #[deprecated = "Use `set_aspect()` instead."] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + self.set_aspect(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mip_level()` instead."] + pub fn mip_level(&mut self, val: u32) -> &mut Self { + self.set_mip_level(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_origin()` instead."] + pub fn origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_origin(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTexture")] + #[deprecated = "Use `set_texture()` instead."] + pub fn texture(&mut self, val: &GpuTexture) -> &mut Self { + self.set_texture(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuTexture.rs b/crates/web-sys/src/features/gen_GpuTexture.rs index ff9c31bd5bf..519516bbbf7 100644 --- a/crates/web-sys/src/features/gen_GpuTexture.rs +++ b/crates/web-sys/src/features/gen_GpuTexture.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,6 +17,96 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuTexture; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = width)] + #[doc = "Getter for the `width` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/width)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn width(this: &GpuTexture) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = height)] + #[doc = "Getter for the `height` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/height)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn height(this: &GpuTexture) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = depthOrArrayLayers)] + #[doc = "Getter for the `depthOrArrayLayers` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/depthOrArrayLayers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn depth_or_array_layers(this: &GpuTexture) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = mipLevelCount)] + #[doc = "Getter for the `mipLevelCount` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/mipLevelCount)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mip_level_count(this: &GpuTexture) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = sampleCount)] + #[doc = "Getter for the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/sampleCount)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn sample_count(this: &GpuTexture) -> u32; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureDimension")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = dimension)] + #[doc = "Getter for the `dimension` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/dimension)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn dimension(this: &GpuTexture) -> GpuTextureDimension; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = format)] + #[doc = "Getter for the `format` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/format)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn format(this: &GpuTexture) -> GpuTextureFormat; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = usage)] + #[doc = "Getter for the `usage` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/usage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTexture`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn usage(this: &GpuTexture) -> u32; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "GPUTexture" , js_name = label)] #[doc = "Getter for the `label` field of this object."] #[doc = ""] @@ -25,7 +116,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuTexture) -> Option; + pub fn label(this: &GpuTexture) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUTexture" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,10 +127,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuTexture, value: Option<&str>); + pub fn set_label(this: &GpuTexture, value: &str); #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureView")] - # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = createView)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUTexture" , js_name = createView)] #[doc = "The `createView()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/createView)"] @@ -48,10 +139,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn create_view(this: &GpuTexture) -> GpuTextureView; + pub fn create_view(this: &GpuTexture) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "GpuTextureView", feature = "GpuTextureViewDescriptor",))] - # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = createView)] + # [wasm_bindgen (catch , method , structural , js_class = "GPUTexture" , js_name = createView)] #[doc = "The `createView()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTexture/createView)"] @@ -63,7 +154,7 @@ extern "C" { pub fn create_view_with_descriptor( this: &GpuTexture, descriptor: &GpuTextureViewDescriptor, - ) -> GpuTextureView; + ) -> Result; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "GPUTexture" , js_name = destroy)] #[doc = "The `destroy()` method."] diff --git a/crates/web-sys/src/features/gen_GpuTextureAspect.rs b/crates/web-sys/src/features/gen_GpuTextureAspect.rs index 0a0742d5397..21216c326f6 100644 --- a/crates/web-sys/src/features/gen_GpuTextureAspect.rs +++ b/crates/web-sys/src/features/gen_GpuTextureAspect.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs b/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs index 621e6d23b65..1fd1ad710fb 100644 --- a/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs +++ b/crates/web-sys/src/features/gen_GpuTextureBindingLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuTextureBindingLayout; -} -#[cfg(web_sys_unstable_apis)] -impl GpuTextureBindingLayout { - #[doc = "Construct a new `GpuTextureBindingLayout`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `multisampled` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "multisampled")] + pub fn get_multisampled(this: &GpuTextureBindingLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `multisampled` field of this object."] #[doc = ""] @@ -34,20 +30,18 @@ impl GpuTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn multisampled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multisampled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "multisampled")] + pub fn set_multisampled(this: &GpuTextureBindingLayout, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureSampleType")] + #[doc = "Get the `sampleType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`, `GpuTextureSampleType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleType")] + pub fn get_sample_type(this: &GpuTextureBindingLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureSampleType")] #[doc = "Change the `sampleType` field of this object."] @@ -56,20 +50,18 @@ impl GpuTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sample_type(&mut self, val: GpuTextureSampleType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "sampleType")] + pub fn set_sample_type(this: &GpuTextureBindingLayout, val: GpuTextureSampleType); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureViewDimension")] + #[doc = "Get the `viewDimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "viewDimension")] + pub fn get_view_dimension(this: &GpuTextureBindingLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureViewDimension")] #[doc = "Change the `viewDimension` field of this object."] @@ -78,18 +70,40 @@ impl GpuTextureBindingLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "viewDimension")] + pub fn set_view_dimension(this: &GpuTextureBindingLayout, val: GpuTextureViewDimension); +} +#[cfg(web_sys_unstable_apis)] +impl GpuTextureBindingLayout { + #[doc = "Construct a new `GpuTextureBindingLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureBindingLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_multisampled()` instead."] + pub fn multisampled(&mut self, val: bool) -> &mut Self { + self.set_multisampled(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureSampleType")] + #[deprecated = "Use `set_sample_type()` instead."] + pub fn sample_type(&mut self, val: GpuTextureSampleType) -> &mut Self { + self.set_sample_type(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureViewDimension")] + #[deprecated = "Use `set_view_dimension()` instead."] pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewDimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view_dimension(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs b/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs index c46f8887850..3f6472ba5e6 100644 --- a/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuTextureDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,24 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuTextureDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuTextureDescriptor { - #[cfg(feature = "GpuTextureFormat")] - #[doc = "Construct a new `GpuTextureDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuTextureFormat, size: &::wasm_bindgen::JsValue, usage: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret.size(size); - ret.usage(usage); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuTextureDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -38,16 +30,18 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuTextureDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureDimension")] + #[doc = "Get the `dimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dimension")] + pub fn get_dimension(this: &GpuTextureDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureDimension")] #[doc = "Change the `dimension` field of this object."] @@ -56,20 +50,18 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dimension(&mut self, val: GpuTextureDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "dimension")] + pub fn set_dimension(this: &GpuTextureDescriptor, val: GpuTextureDimension); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuTextureDescriptor) -> GpuTextureFormat; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureFormat")] #[doc = "Change the `format` field of this object."] @@ -78,17 +70,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuTextureDescriptor, val: GpuTextureFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mipLevelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipLevelCount")] + pub fn get_mip_level_count(this: &GpuTextureDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `mipLevelCount` field of this object."] #[doc = ""] @@ -96,20 +88,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn mip_level_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "mipLevelCount")] + pub fn set_mip_level_count(this: &GpuTextureDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sampleCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleCount")] + pub fn get_sample_count(this: &GpuTextureDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `sampleCount` field of this object."] #[doc = ""] @@ -117,20 +106,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn sample_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "sampleCount")] + pub fn set_sample_count(this: &GpuTextureDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &GpuTextureDescriptor) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `size` field of this object."] #[doc = ""] @@ -138,16 +124,17 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn size(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &GpuTextureDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &GpuTextureDescriptor) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usage` field of this object."] #[doc = ""] @@ -155,14 +142,92 @@ impl GpuTextureDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &GpuTextureDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `viewFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "viewFormats")] + pub fn get_view_formats(this: &GpuTextureDescriptor) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `viewFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "viewFormats")] + pub fn set_view_formats(this: &GpuTextureDescriptor, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuTextureDescriptor { + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Construct a new `GpuTextureDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuTextureFormat, size: &::wasm_bindgen::JsValue, usage: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret.set_size(size); + ret.set_usage(usage); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureDimension")] + #[deprecated = "Use `set_dimension()` instead."] + pub fn dimension(&mut self, val: GpuTextureDimension) -> &mut Self { + self.set_dimension(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mip_level_count()` instead."] + pub fn mip_level_count(&mut self, val: u32) -> &mut Self { + self.set_mip_level_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sample_count()` instead."] + pub fn sample_count(&mut self, val: u32) -> &mut Self { + self.set_sample_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_size()` instead."] + pub fn size(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_size(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage()` instead."] pub fn usage(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_usage(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_view_formats()` instead."] + pub fn view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_view_formats(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuTextureDimension.rs b/crates/web-sys/src/features/gen_GpuTextureDimension.rs index 36367511717..a9676ac30fc 100644 --- a/crates/web-sys/src/features/gen_GpuTextureDimension.rs +++ b/crates/web-sys/src/features/gen_GpuTextureDimension.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuTextureFormat.rs b/crates/web-sys/src/features/gen_GpuTextureFormat.rs index 4f4417971bc..5b67dce2fdf 100644 --- a/crates/web-sys/src/features/gen_GpuTextureFormat.rs +++ b/crates/web-sys/src/features/gen_GpuTextureFormat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -35,6 +36,7 @@ pub enum GpuTextureFormat { Bgra8unorm = "bgra8unorm", Bgra8unormSrgb = "bgra8unorm-srgb", Rgb9e5ufloat = "rgb9e5ufloat", + Rgb10a2uint = "rgb10a2uint", Rgb10a2unorm = "rgb10a2unorm", Rg11b10ufloat = "rg11b10ufloat", Rg32uint = "rg32uint", @@ -51,6 +53,7 @@ pub enum GpuTextureFormat { Depth24plus = "depth24plus", Depth24plusStencil8 = "depth24plus-stencil8", Depth32float = "depth32float", + Depth32floatStencil8 = "depth32float-stencil8", Bc1RgbaUnorm = "bc1-rgba-unorm", Bc1RgbaUnormSrgb = "bc1-rgba-unorm-srgb", Bc2RgbaUnorm = "bc2-rgba-unorm", @@ -65,6 +68,42 @@ pub enum GpuTextureFormat { Bc6hRgbFloat = "bc6h-rgb-float", Bc7RgbaUnorm = "bc7-rgba-unorm", Bc7RgbaUnormSrgb = "bc7-rgba-unorm-srgb", - Depth24unormStencil8 = "depth24unorm-stencil8", - Depth32floatStencil8 = "depth32float-stencil8", + Etc2Rgb8unorm = "etc2-rgb8unorm", + Etc2Rgb8unormSrgb = "etc2-rgb8unorm-srgb", + Etc2Rgb8a1unorm = "etc2-rgb8a1unorm", + Etc2Rgb8a1unormSrgb = "etc2-rgb8a1unorm-srgb", + Etc2Rgba8unorm = "etc2-rgba8unorm", + Etc2Rgba8unormSrgb = "etc2-rgba8unorm-srgb", + EacR11unorm = "eac-r11unorm", + EacR11snorm = "eac-r11snorm", + EacRg11unorm = "eac-rg11unorm", + EacRg11snorm = "eac-rg11snorm", + Astc4x4Unorm = "astc-4x4-unorm", + Astc4x4UnormSrgb = "astc-4x4-unorm-srgb", + Astc5x4Unorm = "astc-5x4-unorm", + Astc5x4UnormSrgb = "astc-5x4-unorm-srgb", + Astc5x5Unorm = "astc-5x5-unorm", + Astc5x5UnormSrgb = "astc-5x5-unorm-srgb", + Astc6x5Unorm = "astc-6x5-unorm", + Astc6x5UnormSrgb = "astc-6x5-unorm-srgb", + Astc6x6Unorm = "astc-6x6-unorm", + Astc6x6UnormSrgb = "astc-6x6-unorm-srgb", + Astc8x5Unorm = "astc-8x5-unorm", + Astc8x5UnormSrgb = "astc-8x5-unorm-srgb", + Astc8x6Unorm = "astc-8x6-unorm", + Astc8x6UnormSrgb = "astc-8x6-unorm-srgb", + Astc8x8Unorm = "astc-8x8-unorm", + Astc8x8UnormSrgb = "astc-8x8-unorm-srgb", + Astc10x5Unorm = "astc-10x5-unorm", + Astc10x5UnormSrgb = "astc-10x5-unorm-srgb", + Astc10x6Unorm = "astc-10x6-unorm", + Astc10x6UnormSrgb = "astc-10x6-unorm-srgb", + Astc10x8Unorm = "astc-10x8-unorm", + Astc10x8UnormSrgb = "astc-10x8-unorm-srgb", + Astc10x10Unorm = "astc-10x10-unorm", + Astc10x10UnormSrgb = "astc-10x10-unorm-srgb", + Astc12x10Unorm = "astc-12x10-unorm", + Astc12x10UnormSrgb = "astc-12x10-unorm-srgb", + Astc12x12Unorm = "astc-12x12-unorm", + Astc12x12UnormSrgb = "astc-12x12-unorm-srgb", } diff --git a/crates/web-sys/src/features/gen_GpuTextureSampleType.rs b/crates/web-sys/src/features/gen_GpuTextureSampleType.rs index 6007e61c1ba..8c5a8f963cc 100644 --- a/crates/web-sys/src/features/gen_GpuTextureSampleType.rs +++ b/crates/web-sys/src/features/gen_GpuTextureSampleType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuTextureView.rs b/crates/web-sys/src/features/gen_GpuTextureView.rs index fceaf0e7ce0..1fcc6ff6cf5 100644 --- a/crates/web-sys/src/features/gen_GpuTextureView.rs +++ b/crates/web-sys/src/features/gen_GpuTextureView.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(this: &GpuTextureView) -> Option; + pub fn label(this: &GpuTextureView) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , setter , js_class = "GPUTextureView" , js_name = label)] #[doc = "Setter for the `label` field of this object."] @@ -36,5 +37,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_label(this: &GpuTextureView, value: Option<&str>); + pub fn set_label(this: &GpuTextureView, value: &str); } diff --git a/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs b/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs index acc8216ff5f..6668927eee0 100644 --- a/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs +++ b/crates/web-sys/src/features/gen_GpuTextureViewDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuTextureViewDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl GpuTextureViewDescriptor { - #[doc = "Construct a new `GpuTextureViewDescriptor`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `label` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &GpuTextureViewDescriptor) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `label` field of this object."] #[doc = ""] @@ -34,16 +30,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &GpuTextureViewDescriptor, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `arrayLayerCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "arrayLayerCount")] + pub fn get_array_layer_count(this: &GpuTextureViewDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `arrayLayerCount` field of this object."] #[doc = ""] @@ -51,20 +48,18 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn array_layer_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arrayLayerCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "arrayLayerCount")] + pub fn set_array_layer_count(this: &GpuTextureViewDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureAspect")] + #[doc = "Get the `aspect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureAspect`, `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "aspect")] + pub fn get_aspect(this: &GpuTextureViewDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureAspect")] #[doc = "Change the `aspect` field of this object."] @@ -73,17 +68,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "aspect")] + pub fn set_aspect(this: &GpuTextureViewDescriptor, val: GpuTextureAspect); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `baseArrayLayer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "baseArrayLayer")] + pub fn get_base_array_layer(this: &GpuTextureViewDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `baseArrayLayer` field of this object."] #[doc = ""] @@ -91,20 +86,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn base_array_layer(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baseArrayLayer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "baseArrayLayer")] + pub fn set_base_array_layer(this: &GpuTextureViewDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `baseMipLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "baseMipLevel")] + pub fn get_base_mip_level(this: &GpuTextureViewDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `baseMipLevel` field of this object."] #[doc = ""] @@ -112,20 +104,18 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn base_mip_level(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baseMipLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "baseMipLevel")] + pub fn set_base_mip_level(this: &GpuTextureViewDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureViewDimension")] + #[doc = "Get the `dimension` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`, `GpuTextureViewDimension`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dimension")] + pub fn get_dimension(this: &GpuTextureViewDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureViewDimension")] #[doc = "Change the `dimension` field of this object."] @@ -134,20 +124,18 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dimension"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "dimension")] + pub fn set_dimension(this: &GpuTextureViewDescriptor, val: GpuTextureViewDimension); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureFormat`, `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuTextureViewDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuTextureFormat")] #[doc = "Change the `format` field of this object."] @@ -156,17 +144,17 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuTextureViewDescriptor, val: GpuTextureFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mipLevelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mipLevelCount")] + pub fn get_mip_level_count(this: &GpuTextureViewDescriptor) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `mipLevelCount` field of this object."] #[doc = ""] @@ -174,18 +162,95 @@ impl GpuTextureViewDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mipLevelCount")] + pub fn set_mip_level_count(this: &GpuTextureViewDescriptor, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &GpuTextureViewDescriptor) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &GpuTextureViewDescriptor, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuTextureViewDescriptor { + #[doc = "Construct a new `GpuTextureViewDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_label()` instead."] + pub fn label(&mut self, val: &str) -> &mut Self { + self.set_label(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_array_layer_count()` instead."] + pub fn array_layer_count(&mut self, val: u32) -> &mut Self { + self.set_array_layer_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureAspect")] + #[deprecated = "Use `set_aspect()` instead."] + pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self { + self.set_aspect(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_base_array_layer()` instead."] + pub fn base_array_layer(&mut self, val: u32) -> &mut Self { + self.set_base_array_layer(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_base_mip_level()` instead."] + pub fn base_mip_level(&mut self, val: u32) -> &mut Self { + self.set_base_mip_level(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureViewDimension")] + #[deprecated = "Use `set_dimension()` instead."] + pub fn dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self { + self.set_dimension(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuTextureFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mip_level_count()` instead."] pub fn mip_level_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mipLevelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mip_level_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage()` instead."] + pub fn usage(&mut self, val: u32) -> &mut Self { + self.set_usage(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuTextureViewDimension.rs b/crates/web-sys/src/features/gen_GpuTextureViewDimension.rs index 77d8e5d1b01..8e341635f75 100644 --- a/crates/web-sys/src/features/gen_GpuTextureViewDimension.rs +++ b/crates/web-sys/src/features/gen_GpuTextureViewDimension.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GpuUncapturedErrorEvent.rs b/crates/web-sys/src/features/gen_GpuUncapturedErrorEvent.rs index f1a4e654958..37c29a02055 100644 --- a/crates/web-sys/src/features/gen_GpuUncapturedErrorEvent.rs +++ b/crates/web-sys/src/features/gen_GpuUncapturedErrorEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,16 +17,17 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuUncapturedErrorEvent; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuError")] # [wasm_bindgen (structural , method , getter , js_class = "GPUUncapturedErrorEvent" , js_name = error)] #[doc = "Getter for the `error` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent/error)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEvent`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEvent`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn error(this: &GpuUncapturedErrorEvent) -> ::js_sys::Object; + pub fn error(this: &GpuUncapturedErrorEvent) -> GpuError; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuUncapturedErrorEventInit")] #[wasm_bindgen(catch, constructor, js_class = "GPUUncapturedErrorEvent")] diff --git a/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs b/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs index b554bcb72f8..b439dcbc638 100644 --- a/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_GpuUncapturedErrorEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuUncapturedErrorEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl GpuUncapturedErrorEventInit { - #[doc = "Construct a new `GpuUncapturedErrorEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(error: &::js_sys::Object) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.error(error); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &GpuUncapturedErrorEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -35,20 +30,17 @@ impl GpuUncapturedErrorEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &GpuUncapturedErrorEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &GpuUncapturedErrorEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -56,20 +48,17 @@ impl GpuUncapturedErrorEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &GpuUncapturedErrorEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &GpuUncapturedErrorEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -77,35 +66,67 @@ impl GpuUncapturedErrorEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &GpuUncapturedErrorEventInit, val: bool); #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuError")] + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &GpuUncapturedErrorEventInit) -> GpuError; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuError")] #[doc = "Change the `error` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEventInit`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn error(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &GpuUncapturedErrorEventInit, val: &GpuError); +} +#[cfg(web_sys_unstable_apis)] +impl GpuUncapturedErrorEventInit { + #[cfg(feature = "GpuError")] + #[doc = "Construct a new `GpuUncapturedErrorEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuError`, `GpuUncapturedErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(error: &GpuError) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_error(error); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuError")] + #[deprecated = "Use `set_error()` instead."] + pub fn error(&mut self, val: &GpuError) -> &mut Self { + self.set_error(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuValidationError.rs b/crates/web-sys/src/features/gen_GpuValidationError.rs index 48f16949365..596f96d4f73 100644 --- a/crates/web-sys/src/features/gen_GpuValidationError.rs +++ b/crates/web-sys/src/features/gen_GpuValidationError.rs @@ -1,10 +1,11 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUValidationError , typescript_type = "GPUValidationError")] + # [wasm_bindgen (extends = GpuError , extends = :: js_sys :: Object , js_name = GPUValidationError , typescript_type = "GPUValidationError")] #[derive(Debug, Clone, PartialEq, Eq)] #[doc = "The `GpuValidationError` class."] #[doc = ""] @@ -16,17 +17,6 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuValidationError; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "GPUValidationError" , js_name = message)] - #[doc = "Getter for the `message` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUValidationError/message)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuValidationError`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn message(this: &GpuValidationError) -> String; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "GPUValidationError")] #[doc = "The `new GpuValidationError(..)` constructor, creating a new instance of `GpuValidationError`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_GpuVertexAttribute.rs b/crates/web-sys/src/features/gen_GpuVertexAttribute.rs index 2fde6d181dd..26a132fdb22 100644 --- a/crates/web-sys/src/features/gen_GpuVertexAttribute.rs +++ b/crates/web-sys/src/features/gen_GpuVertexAttribute.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,24 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuVertexAttribute; -} -#[cfg(web_sys_unstable_apis)] -impl GpuVertexAttribute { + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuVertexFormat")] - #[doc = "Construct a new `GpuVertexAttribute`."] + #[doc = "Get the `format` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(format: GpuVertexFormat, offset: f64, shader_location: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.format(format); - ret.offset(offset); - ret.shader_location(shader_location); - ret - } + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &GpuVertexAttribute) -> GpuVertexFormat; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuVertexFormat")] #[doc = "Change the `format` field of this object."] @@ -39,17 +32,17 @@ impl GpuVertexAttribute { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: GpuVertexFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &GpuVertexAttribute, val: GpuVertexFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `offset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &GpuVertexAttribute) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `offset` field of this object."] #[doc = ""] @@ -57,17 +50,17 @@ impl GpuVertexAttribute { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &GpuVertexAttribute, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `shaderLocation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "shaderLocation")] + pub fn get_shader_location(this: &GpuVertexAttribute) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `shaderLocation` field of this object."] #[doc = ""] @@ -75,18 +68,43 @@ impl GpuVertexAttribute { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "shaderLocation")] + pub fn set_shader_location(this: &GpuVertexAttribute, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl GpuVertexAttribute { + #[cfg(feature = "GpuVertexFormat")] + #[doc = "Construct a new `GpuVertexAttribute`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(format: GpuVertexFormat, offset: f64, shader_location: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_format(format); + ret.set_offset(offset); + ret.set_shader_location(shader_location); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuVertexFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: GpuVertexFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: f64) -> &mut Self { + self.set_offset(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_shader_location()` instead."] pub fn shader_location(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shaderLocation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shader_location(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs b/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs index e8843020fa2..102f7a24b33 100644 --- a/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs +++ b/crates/web-sys/src/features/gen_GpuVertexBufferLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuVertexBufferLayout; -} -#[cfg(web_sys_unstable_apis)] -impl GpuVertexBufferLayout { - #[doc = "Construct a new `GpuVertexBufferLayout`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `arrayStride` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(array_stride: f64, attributes: &::wasm_bindgen::JsValue) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.array_stride(array_stride); - ret.attributes(attributes); - ret - } + #[wasm_bindgen(method, getter = "arrayStride")] + pub fn get_array_stride(this: &GpuVertexBufferLayout) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `arrayStride` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl GpuVertexBufferLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn array_stride(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("arrayStride"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "arrayStride")] + pub fn set_array_stride(this: &GpuVertexBufferLayout, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attributes")] + pub fn get_attributes(this: &GpuVertexBufferLayout) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `attributes` field of this object."] #[doc = ""] @@ -57,20 +48,18 @@ impl GpuVertexBufferLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn attributes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "attributes")] + pub fn set_attributes(this: &GpuVertexBufferLayout, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuVertexStepMode")] + #[doc = "Get the `stepMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`, `GpuVertexStepMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stepMode")] + pub fn get_step_mode(this: &GpuVertexBufferLayout) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuVertexStepMode")] #[doc = "Change the `stepMode` field of this object."] @@ -79,18 +68,41 @@ impl GpuVertexBufferLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stepMode")] + pub fn set_step_mode(this: &GpuVertexBufferLayout, val: GpuVertexStepMode); +} +#[cfg(web_sys_unstable_apis)] +impl GpuVertexBufferLayout { + #[doc = "Construct a new `GpuVertexBufferLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(array_stride: f64, attributes: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_array_stride(array_stride); + ret.set_attributes(attributes); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_array_stride()` instead."] + pub fn array_stride(&mut self, val: f64) -> &mut Self { + self.set_array_stride(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attributes()` instead."] + pub fn attributes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_attributes(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuVertexStepMode")] + #[deprecated = "Use `set_step_mode()` instead."] pub fn step_mode(&mut self, val: GpuVertexStepMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stepMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_step_mode(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuVertexFormat.rs b/crates/web-sys/src/features/gen_GpuVertexFormat.rs index 07e4d22b587..9c380d45895 100644 --- a/crates/web-sys/src/features/gen_GpuVertexFormat.rs +++ b/crates/web-sys/src/features/gen_GpuVertexFormat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -10,22 +11,31 @@ use wasm_bindgen::prelude::*; #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum GpuVertexFormat { + Uint8 = "uint8", Uint8x2 = "uint8x2", Uint8x4 = "uint8x4", + Sint8 = "sint8", Sint8x2 = "sint8x2", Sint8x4 = "sint8x4", + Unorm8 = "unorm8", Unorm8x2 = "unorm8x2", Unorm8x4 = "unorm8x4", + Snorm8 = "snorm8", Snorm8x2 = "snorm8x2", Snorm8x4 = "snorm8x4", + Uint16 = "uint16", Uint16x2 = "uint16x2", Uint16x4 = "uint16x4", + Sint16 = "sint16", Sint16x2 = "sint16x2", Sint16x4 = "sint16x4", + Unorm16 = "unorm16", Unorm16x2 = "unorm16x2", Unorm16x4 = "unorm16x4", + Snorm16 = "snorm16", Snorm16x2 = "snorm16x2", Snorm16x4 = "snorm16x4", + Float16 = "float16", Float16x2 = "float16x2", Float16x4 = "float16x4", Float32 = "float32", @@ -40,4 +50,6 @@ pub enum GpuVertexFormat { Sint32x2 = "sint32x2", Sint32x3 = "sint32x3", Sint32x4 = "sint32x4", + Unorm1010102 = "unorm10-10-10-2", + Unorm8x4Bgra = "unorm8x4-bgra", } diff --git a/crates/web-sys/src/features/gen_GpuVertexState.rs b/crates/web-sys/src/features/gen_GpuVertexState.rs index 4086fe436a4..41bd609a2b3 100644 --- a/crates/web-sys/src/features/gen_GpuVertexState.rs +++ b/crates/web-sys/src/features/gen_GpuVertexState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,23 +14,33 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type GpuVertexState; -} -#[cfg(web_sys_unstable_apis)] -impl GpuVertexState { - #[cfg(feature = "GpuShaderModule")] - #[doc = "Construct a new `GpuVertexState`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `constants` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(entry_point: &str, module: &GpuShaderModule) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.entry_point(entry_point); - ret.module(module); - ret - } + #[wasm_bindgen(method, getter = "constants")] + pub fn get_constants(this: &GpuVertexState) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `constants` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "constants")] + pub fn set_constants(this: &GpuVertexState, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `entryPoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "entryPoint")] + pub fn get_entry_point(this: &GpuVertexState) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `entryPoint` field of this object."] #[doc = ""] @@ -37,20 +48,18 @@ impl GpuVertexState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn entry_point(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryPoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "entryPoint")] + pub fn set_entry_point(this: &GpuVertexState, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuShaderModule")] + #[doc = "Get the `module` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "module")] + pub fn get_module(this: &GpuVertexState) -> GpuShaderModule; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "GpuShaderModule")] #[doc = "Change the `module` field of this object."] @@ -59,17 +68,17 @@ impl GpuVertexState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "module")] + pub fn set_module(this: &GpuVertexState, val: &GpuShaderModule); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `buffers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "buffers")] + pub fn get_buffers(this: &GpuVertexState) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `buffers` field of this object."] #[doc = ""] @@ -77,18 +86,47 @@ impl GpuVertexState { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "buffers")] + pub fn set_buffers(this: &GpuVertexState, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl GpuVertexState { + #[cfg(feature = "GpuShaderModule")] + #[doc = "Construct a new `GpuVertexState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GpuShaderModule`, `GpuVertexState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(module: &GpuShaderModule) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_module(module); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_constants()` instead."] + pub fn constants(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_constants(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_entry_point()` instead."] + pub fn entry_point(&mut self, val: &str) -> &mut Self { + self.set_entry_point(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "GpuShaderModule")] + #[deprecated = "Use `set_module()` instead."] + pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self { + self.set_module(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_buffers()` instead."] pub fn buffers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buffers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_buffers(val); self } } diff --git a/crates/web-sys/src/features/gen_GpuVertexStepMode.rs b/crates/web-sys/src/features/gen_GpuVertexStepMode.rs index 49140a4b844..16552bbabea 100644 --- a/crates/web-sys/src/features/gen_GpuVertexStepMode.rs +++ b/crates/web-sys/src/features/gen_GpuVertexStepMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_GroupedHistoryEventInit.rs b/crates/web-sys/src/features/gen_GroupedHistoryEventInit.rs index c0e2441e7d4..42286df8af1 100644 --- a/crates/web-sys/src/features/gen_GroupedHistoryEventInit.rs +++ b/crates/web-sys/src/features/gen_GroupedHistoryEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] pub type GroupedHistoryEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &GroupedHistoryEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &GroupedHistoryEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &GroupedHistoryEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &GroupedHistoryEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &GroupedHistoryEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &GroupedHistoryEventInit, val: bool); + #[cfg(feature = "Element")] + #[doc = "Get the `otherBrowser` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `GroupedHistoryEventInit`*"] + #[wasm_bindgen(method, getter = "otherBrowser")] + pub fn get_other_browser(this: &GroupedHistoryEventInit) -> Option; + #[cfg(feature = "Element")] + #[doc = "Change the `otherBrowser` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `GroupedHistoryEventInit`*"] + #[wasm_bindgen(method, setter = "otherBrowser")] + pub fn set_other_browser(this: &GroupedHistoryEventInit, val: Option<&Element>); } impl GroupedHistoryEventInit { #[doc = "Construct a new `GroupedHistoryEventInit`."] @@ -19,73 +62,25 @@ impl GroupedHistoryEventInit { 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: `GroupedHistoryEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GroupedHistoryEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "Element")] - #[doc = "Change the `otherBrowser` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Element`, `GroupedHistoryEventInit`*"] + #[deprecated = "Use `set_other_browser()` instead."] pub fn other_browser(&mut self, val: Option<&Element>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("otherBrowser"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_other_browser(val); self } } diff --git a/crates/web-sys/src/features/gen_HalfOpenInfoDict.rs b/crates/web-sys/src/features/gen_HalfOpenInfoDict.rs index 6cef66fd8fc..bd9cdb24c04 100644 --- a/crates/web-sys/src/features/gen_HalfOpenInfoDict.rs +++ b/crates/web-sys/src/features/gen_HalfOpenInfoDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HalfOpenInfoDict`*"] pub type HalfOpenInfoDict; + #[doc = "Get the `speculative` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HalfOpenInfoDict`*"] + #[wasm_bindgen(method, getter = "speculative")] + pub fn get_speculative(this: &HalfOpenInfoDict) -> Option; + #[doc = "Change the `speculative` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HalfOpenInfoDict`*"] + #[wasm_bindgen(method, setter = "speculative")] + pub fn set_speculative(this: &HalfOpenInfoDict, val: bool); } impl HalfOpenInfoDict { #[doc = "Construct a new `HalfOpenInfoDict`."] @@ -19,21 +30,9 @@ impl HalfOpenInfoDict { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `speculative` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HalfOpenInfoDict`*"] + #[deprecated = "Use `set_speculative()` instead."] pub fn speculative(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("speculative"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_speculative(val); self } } diff --git a/crates/web-sys/src/features/gen_HardwareAcceleration.rs b/crates/web-sys/src/features/gen_HardwareAcceleration.rs index 6ca41d5b6ad..35320b3609a 100644 --- a/crates/web-sys/src/features/gen_HardwareAcceleration.rs +++ b/crates/web-sys/src/features/gen_HardwareAcceleration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HashChangeEvent.rs b/crates/web-sys/src/features/gen_HashChangeEvent.rs index 9623ed3338f..9e538f081cc 100644 --- a/crates/web-sys/src/features/gen_HashChangeEvent.rs +++ b/crates/web-sys/src/features/gen_HashChangeEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HashChangeEvent/oldURL)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEvent`*"] - pub fn old_url(this: &HashChangeEvent) -> String; + pub fn old_url(this: &HashChangeEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "HashChangeEvent" , js_name = newURL)] #[doc = "Getter for the `newURL` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HashChangeEvent/newURL)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEvent`*"] - pub fn new_url(this: &HashChangeEvent) -> String; + pub fn new_url(this: &HashChangeEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "HashChangeEvent")] #[doc = "The `new HashChangeEvent(..)` constructor, creating a new instance of `HashChangeEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HashChangeEventInit.rs b/crates/web-sys/src/features/gen_HashChangeEventInit.rs index 75e3f7f5cda..90bf0ee6b35 100644 --- a/crates/web-sys/src/features/gen_HashChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_HashChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] pub type HashChangeEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &HashChangeEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &HashChangeEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &HashChangeEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &HashChangeEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &HashChangeEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &HashChangeEventInit, val: bool); + #[doc = "Get the `newURL` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, getter = "newURL")] + pub fn get_new_url(this: &HashChangeEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `newURL` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, setter = "newURL")] + pub fn set_new_url(this: &HashChangeEventInit, val: &str); + #[doc = "Get the `oldURL` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, getter = "oldURL")] + pub fn get_old_url(this: &HashChangeEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `oldURL` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[wasm_bindgen(method, setter = "oldURL")] + pub fn set_old_url(this: &HashChangeEventInit, val: &str); } impl HashChangeEventInit { #[doc = "Construct a new `HashChangeEventInit`."] @@ -19,83 +70,29 @@ impl HashChangeEventInit { 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: `HashChangeEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `newURL` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[deprecated = "Use `set_new_url()` instead."] pub fn new_url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("newURL"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_new_url(val); self } - #[doc = "Change the `oldURL` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HashChangeEventInit`*"] + #[deprecated = "Use `set_old_url()` instead."] pub fn old_url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("oldURL"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_old_url(val); self } } diff --git a/crates/web-sys/src/features/gen_Headers.rs b/crates/web-sys/src/features/gen_Headers.rs index 47e0261ff01..bdf068dde31 100644 --- a/crates/web-sys/src/features/gen_Headers.rs +++ b/crates/web-sys/src/features/gen_Headers.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -34,6 +35,13 @@ extern "C" { pub fn new_with_str_sequence_sequence( init: &::wasm_bindgen::JsValue, ) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "Headers")] + #[doc = "The `new Headers(..)` constructor, creating a new instance of `Headers`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Headers/Headers)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Headers`*"] + pub fn new_with_record_from_str_to_str(init: &::js_sys::Object) -> Result; # [wasm_bindgen (catch , method , structural , js_class = "Headers" , js_name = append)] #[doc = "The `append()` method."] #[doc = ""] @@ -48,13 +56,27 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Headers`*"] pub fn delete(this: &Headers, name: &str) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "Headers" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Headers/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Headers`*"] + pub fn entries(this: &Headers) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "Headers" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Headers/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Headers`*"] + pub fn for_each(this: &Headers, callback: &::js_sys::Function) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Headers" , js_name = get)] #[doc = "The `get()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Headers/get)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Headers`*"] - pub fn get(this: &Headers, name: &str) -> Result, JsValue>; + pub fn get(this: &Headers, name: &str) -> Result, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Headers" , js_name = has)] #[doc = "The `has()` method."] #[doc = ""] @@ -62,6 +84,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Headers`*"] pub fn has(this: &Headers, name: &str) -> Result; + # [wasm_bindgen (method , structural , js_class = "Headers" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Headers/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Headers`*"] + pub fn keys(this: &Headers) -> ::js_sys::Iterator; # [wasm_bindgen (catch , method , structural , js_class = "Headers" , js_name = set)] #[doc = "The `set()` method."] #[doc = ""] @@ -69,4 +98,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Headers`*"] pub fn set(this: &Headers, name: &str, value: &str) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "Headers" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Headers/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Headers`*"] + pub fn values(this: &Headers) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_HeadersGuardEnum.rs b/crates/web-sys/src/features/gen_HeadersGuardEnum.rs index 0f5c714e4bc..130118979ec 100644 --- a/crates/web-sys/src/features/gen_HeadersGuardEnum.rs +++ b/crates/web-sys/src/features/gen_HeadersGuardEnum.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `HeadersGuardEnum` enum."] diff --git a/crates/web-sys/src/features/gen_Hid.rs b/crates/web-sys/src/features/gen_Hid.rs index 1980c6d6523..0b9e97cb3ec 100644 --- a/crates/web-sys/src/features/gen_Hid.rs +++ b/crates/web-sys/src/features/gen_Hid.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_HidCollectionInfo.rs b/crates/web-sys/src/features/gen_HidCollectionInfo.rs index 41af4f16c17..e151d69409d 100644 --- a/crates/web-sys/src/features/gen_HidCollectionInfo.rs +++ b/crates/web-sys/src/features/gen_HidCollectionInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type HidCollectionInfo; -} -#[cfg(web_sys_unstable_apis)] -impl HidCollectionInfo { - #[doc = "Construct a new `HidCollectionInfo`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `children` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "children")] + pub fn get_children(this: &HidCollectionInfo) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `children` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl HidCollectionInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn children(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("children"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "children")] + pub fn set_children(this: &HidCollectionInfo, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `featureReports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "featureReports")] + pub fn get_feature_reports(this: &HidCollectionInfo) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `featureReports` field of this object."] #[doc = ""] @@ -55,20 +48,17 @@ impl HidCollectionInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn feature_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("featureReports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "featureReports")] + pub fn set_feature_reports(this: &HidCollectionInfo, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `inputReports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "inputReports")] + pub fn get_input_reports(this: &HidCollectionInfo) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `inputReports` field of this object."] #[doc = ""] @@ -76,20 +66,17 @@ impl HidCollectionInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn input_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inputReports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "inputReports")] + pub fn set_input_reports(this: &HidCollectionInfo, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `outputReports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "outputReports")] + pub fn get_output_reports(this: &HidCollectionInfo) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `outputReports` field of this object."] #[doc = ""] @@ -97,20 +84,17 @@ impl HidCollectionInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn output_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("outputReports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "outputReports")] + pub fn set_output_reports(this: &HidCollectionInfo, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &HidCollectionInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `type` field of this object."] #[doc = ""] @@ -118,16 +102,17 @@ impl HidCollectionInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn type_(&mut self, val: u8) -> &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 - } + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &HidCollectionInfo, val: u8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &HidCollectionInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usage` field of this object."] #[doc = ""] @@ -135,16 +120,17 @@ impl HidCollectionInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn usage(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &HidCollectionInfo, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usagePage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usagePage")] + pub fn get_usage_page(this: &HidCollectionInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usagePage` field of this object."] #[doc = ""] @@ -152,18 +138,62 @@ impl HidCollectionInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usagePage")] + pub fn set_usage_page(this: &HidCollectionInfo, val: u16); +} +#[cfg(web_sys_unstable_apis)] +impl HidCollectionInfo { + #[doc = "Construct a new `HidCollectionInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidCollectionInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_children()` instead."] + pub fn children(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_children(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_feature_reports()` instead."] + pub fn feature_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_feature_reports(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_input_reports()` instead."] + pub fn input_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_input_reports(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_output_reports()` instead."] + pub fn output_reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_output_reports(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: u8) -> &mut Self { + self.set_type(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage()` instead."] + pub fn usage(&mut self, val: u16) -> &mut Self { + self.set_usage(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage_page()` instead."] pub fn usage_page(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usagePage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_usage_page(val); self } } diff --git a/crates/web-sys/src/features/gen_HidConnectionEvent.rs b/crates/web-sys/src/features/gen_HidConnectionEvent.rs index 87dae4e4b4c..f6fd8940105 100644 --- a/crates/web-sys/src/features/gen_HidConnectionEvent.rs +++ b/crates/web-sys/src/features/gen_HidConnectionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_HidConnectionEventInit.rs b/crates/web-sys/src/features/gen_HidConnectionEventInit.rs index 09e6261d37b..18f3f222a57 100644 --- a/crates/web-sys/src/features/gen_HidConnectionEventInit.rs +++ b/crates/web-sys/src/features/gen_HidConnectionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type HidConnectionEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl HidConnectionEventInit { - #[cfg(feature = "HidDevice")] - #[doc = "Construct a new `HidConnectionEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HidConnectionEventInit`, `HidDevice`*"] + #[doc = "*This API requires the following crate features to be activated: `HidConnectionEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(device: &HidDevice) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.device(device); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &HidConnectionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl HidConnectionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &HidConnectionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidConnectionEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &HidConnectionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -57,20 +48,17 @@ impl HidConnectionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &HidConnectionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidConnectionEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &HidConnectionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -78,20 +66,18 @@ impl HidConnectionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &HidConnectionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HidDevice")] + #[doc = "Get the `device` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidConnectionEventInit`, `HidDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "device")] + pub fn get_device(this: &HidConnectionEventInit) -> HidDevice; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "HidDevice")] #[doc = "Change the `device` field of this object."] @@ -100,15 +86,47 @@ impl HidConnectionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "device")] + pub fn set_device(this: &HidConnectionEventInit, val: &HidDevice); +} +#[cfg(web_sys_unstable_apis)] +impl HidConnectionEventInit { + #[cfg(feature = "HidDevice")] + #[doc = "Construct a new `HidConnectionEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidConnectionEventInit`, `HidDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(device: &HidDevice) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_device(device); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HidDevice")] + #[deprecated = "Use `set_device()` instead."] pub fn device(&mut self, val: &HidDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_device(val); self } } diff --git a/crates/web-sys/src/features/gen_HidDevice.rs b/crates/web-sys/src/features/gen_HidDevice.rs index 5416e544d0c..8a11a1bf741 100644 --- a/crates/web-sys/src/features/gen_HidDevice.rs +++ b/crates/web-sys/src/features/gen_HidDevice.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -80,7 +81,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn product_name(this: &HidDevice) -> String; + pub fn product_name(this: &HidDevice) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "HIDDevice" , js_name = collections)] #[doc = "Getter for the `collections` field of this object."] @@ -126,7 +127,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn receive_feature_report(this: &HidDevice, report_id: u8) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "HIDDevice" , js_name = sendFeatureReport)] + # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendFeatureReport)] #[doc = "The `sendFeatureReport()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendFeatureReport)"] @@ -139,9 +140,9 @@ extern "C" { this: &HidDevice, report_id: u8, data: &::js_sys::Object, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "HIDDevice" , js_name = sendFeatureReport)] + # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendFeatureReport)] #[doc = "The `sendFeatureReport()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendFeatureReport)"] @@ -150,13 +151,28 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn send_feature_report_with_u8_array( + pub fn send_feature_report_with_u8_slice( this: &HidDevice, report_id: u8, data: &mut [u8], - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendFeatureReport)] + #[doc = "The `sendFeatureReport()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendFeatureReport)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn send_feature_report_with_u8_array( + this: &HidDevice, + report_id: u8, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "HIDDevice" , js_name = sendReport)] + # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendReport)] #[doc = "The `sendReport()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendReport)"] @@ -169,9 +185,9 @@ extern "C" { this: &HidDevice, report_id: u8, data: &::js_sys::Object, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "HIDDevice" , js_name = sendReport)] + # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendReport)] #[doc = "The `sendReport()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendReport)"] @@ -180,9 +196,24 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn send_report_with_u8_array( + pub fn send_report_with_u8_slice( this: &HidDevice, report_id: u8, data: &mut [u8], - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "HIDDevice" , js_name = sendReport)] + #[doc = "The `sendReport()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDDevice/sendReport)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn send_report_with_u8_array( + this: &HidDevice, + report_id: u8, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; } diff --git a/crates/web-sys/src/features/gen_HidDeviceFilter.rs b/crates/web-sys/src/features/gen_HidDeviceFilter.rs index 48b756484ea..d7fd6c7e389 100644 --- a/crates/web-sys/src/features/gen_HidDeviceFilter.rs +++ b/crates/web-sys/src/features/gen_HidDeviceFilter.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type HidDeviceFilter; -} -#[cfg(web_sys_unstable_apis)] -impl HidDeviceFilter { - #[doc = "Construct a new `HidDeviceFilter`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `productId` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "productId")] + pub fn get_product_id(this: &HidDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `productId` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl HidDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn product_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("productId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "productId")] + pub fn set_product_id(this: &HidDeviceFilter, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &HidDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usage` field of this object."] #[doc = ""] @@ -55,16 +48,17 @@ impl HidDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn usage(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &HidDeviceFilter, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usagePage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usagePage")] + pub fn get_usage_page(this: &HidDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usagePage` field of this object."] #[doc = ""] @@ -72,20 +66,17 @@ impl HidDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn usage_page(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usagePage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "usagePage")] + pub fn set_usage_page(this: &HidDeviceFilter, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `vendorId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "vendorId")] + pub fn get_vendor_id(this: &HidDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `vendorId` field of this object."] #[doc = ""] @@ -93,18 +84,44 @@ impl HidDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "vendorId")] + pub fn set_vendor_id(this: &HidDeviceFilter, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl HidDeviceFilter { + #[doc = "Construct a new `HidDeviceFilter`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_product_id()` instead."] + pub fn product_id(&mut self, val: u16) -> &mut Self { + self.set_product_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage()` instead."] + pub fn usage(&mut self, val: u16) -> &mut Self { + self.set_usage(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage_page()` instead."] + pub fn usage_page(&mut self, val: u16) -> &mut Self { + self.set_usage_page(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_vendor_id()` instead."] pub fn vendor_id(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vendorId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_vendor_id(val); self } } diff --git a/crates/web-sys/src/features/gen_HidDeviceRequestOptions.rs b/crates/web-sys/src/features/gen_HidDeviceRequestOptions.rs index 0dfe5999b61..01af4b0e4a7 100644 --- a/crates/web-sys/src/features/gen_HidDeviceRequestOptions.rs +++ b/crates/web-sys/src/features/gen_HidDeviceRequestOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type HidDeviceRequestOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDeviceRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "filters")] + pub fn get_filters(this: &HidDeviceRequestOptions) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDeviceRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "filters")] + pub fn set_filters(this: &HidDeviceRequestOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl HidDeviceRequestOptions { @@ -25,28 +44,13 @@ impl HidDeviceRequestOptions { pub fn new(filters: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.filters(filters); + ret.set_filters(filters); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `filters` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HidDeviceRequestOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_filters()` instead."] pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_filters(val); self } } diff --git a/crates/web-sys/src/features/gen_HidInputReportEvent.rs b/crates/web-sys/src/features/gen_HidInputReportEvent.rs index 95e57da6aa8..43119f8e2f8 100644 --- a/crates/web-sys/src/features/gen_HidInputReportEvent.rs +++ b/crates/web-sys/src/features/gen_HidInputReportEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_HidInputReportEventInit.rs b/crates/web-sys/src/features/gen_HidInputReportEventInit.rs index 7b0c9b54d5e..83dfe976813 100644 --- a/crates/web-sys/src/features/gen_HidInputReportEventInit.rs +++ b/crates/web-sys/src/features/gen_HidInputReportEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,24 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type HidInputReportEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl HidInputReportEventInit { - #[cfg(feature = "HidDevice")] - #[doc = "Construct a new `HidInputReportEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HidDevice`, `HidInputReportEventInit`*"] + #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(data: &::js_sys::DataView, device: &HidDevice, report_id: u8) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.data(data); - ret.device(device); - ret.report_id(report_id); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &HidInputReportEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -38,20 +30,17 @@ impl HidInputReportEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &HidInputReportEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &HidInputReportEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -59,20 +48,17 @@ impl HidInputReportEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &HidInputReportEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &HidInputReportEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -80,20 +66,17 @@ impl HidInputReportEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &HidInputReportEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &HidInputReportEventInit) -> ::js_sys::DataView; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `data` field of this object."] #[doc = ""] @@ -101,16 +84,18 @@ impl HidInputReportEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn data(&mut self, val: &::js_sys::DataView) -> &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 - } + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &HidInputReportEventInit, val: &::js_sys::DataView); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HidDevice")] + #[doc = "Get the `device` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDevice`, `HidInputReportEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "device")] + pub fn get_device(this: &HidInputReportEventInit) -> HidDevice; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "HidDevice")] #[doc = "Change the `device` field of this object."] @@ -119,17 +104,17 @@ impl HidInputReportEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn device(&mut self, val: &HidDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "device")] + pub fn set_device(this: &HidInputReportEventInit, val: &HidDevice); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `reportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidInputReportEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "reportId")] + pub fn get_report_id(this: &HidInputReportEventInit) -> u8; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `reportId` field of this object."] #[doc = ""] @@ -137,18 +122,61 @@ impl HidInputReportEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "reportId")] + pub fn set_report_id(this: &HidInputReportEventInit, val: u8); +} +#[cfg(web_sys_unstable_apis)] +impl HidInputReportEventInit { + #[cfg(feature = "HidDevice")] + #[doc = "Construct a new `HidInputReportEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidDevice`, `HidInputReportEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(data: &::js_sys::DataView, device: &HidDevice, report_id: u8) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_data(data); + ret.set_device(device); + ret.set_report_id(report_id); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data()` instead."] + pub fn data(&mut self, val: &::js_sys::DataView) -> &mut Self { + self.set_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HidDevice")] + #[deprecated = "Use `set_device()` instead."] + pub fn device(&mut self, val: &HidDevice) -> &mut Self { + self.set_device(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_report_id()` instead."] pub fn report_id(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_report_id(val); self } } diff --git a/crates/web-sys/src/features/gen_HidReportInfo.rs b/crates/web-sys/src/features/gen_HidReportInfo.rs index 660093a8855..4da0d00dbcc 100644 --- a/crates/web-sys/src/features/gen_HidReportInfo.rs +++ b/crates/web-sys/src/features/gen_HidReportInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type HidReportInfo; -} -#[cfg(web_sys_unstable_apis)] -impl HidReportInfo { - #[doc = "Construct a new `HidReportInfo`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `items` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HidReportInfo`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "items")] + pub fn get_items(this: &HidReportInfo) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `items` field of this object."] #[doc = ""] @@ -34,16 +30,17 @@ impl HidReportInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn items(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("items"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "items")] + pub fn set_items(this: &HidReportInfo, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `reportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "reportId")] + pub fn get_report_id(this: &HidReportInfo) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `reportId` field of this object."] #[doc = ""] @@ -51,18 +48,32 @@ impl HidReportInfo { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "reportId")] + pub fn set_report_id(this: &HidReportInfo, val: u8); +} +#[cfg(web_sys_unstable_apis)] +impl HidReportInfo { + #[doc = "Construct a new `HidReportInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_items()` instead."] + pub fn items(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_items(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_report_id()` instead."] pub fn report_id(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_report_id(val); self } } diff --git a/crates/web-sys/src/features/gen_HidReportItem.rs b/crates/web-sys/src/features/gen_HidReportItem.rs index 51af5203b70..c483ecd5598 100644 --- a/crates/web-sys/src/features/gen_HidReportItem.rs +++ b/crates/web-sys/src/features/gen_HidReportItem.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type HidReportItem; -} -#[cfg(web_sys_unstable_apis)] -impl HidReportItem { - #[doc = "Construct a new `HidReportItem`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `hasNull` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "hasNull")] + pub fn get_has_null(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `hasNull` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn has_null(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hasNull"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "hasNull")] + pub fn set_has_null(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `hasPreferredState` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "hasPreferredState")] + pub fn get_has_preferred_state(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `hasPreferredState` field of this object."] #[doc = ""] @@ -55,20 +48,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn has_preferred_state(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hasPreferredState"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "hasPreferredState")] + pub fn set_has_preferred_state(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `isAbsolute` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "isAbsolute")] + pub fn get_is_absolute(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `isAbsolute` field of this object."] #[doc = ""] @@ -76,20 +66,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_absolute(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isAbsolute"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "isAbsolute")] + pub fn set_is_absolute(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `isArray` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "isArray")] + pub fn get_is_array(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `isArray` field of this object."] #[doc = ""] @@ -97,20 +84,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_array(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isArray"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "isArray")] + pub fn set_is_array(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `isBufferedBytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "isBufferedBytes")] + pub fn get_is_buffered_bytes(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `isBufferedBytes` field of this object."] #[doc = ""] @@ -118,20 +102,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_buffered_bytes(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isBufferedBytes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "isBufferedBytes")] + pub fn set_is_buffered_bytes(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `isConstant` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "isConstant")] + pub fn get_is_constant(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `isConstant` field of this object."] #[doc = ""] @@ -139,20 +120,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_constant(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isConstant"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "isConstant")] + pub fn set_is_constant(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `isLinear` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "isLinear")] + pub fn get_is_linear(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `isLinear` field of this object."] #[doc = ""] @@ -160,20 +138,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_linear(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isLinear"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "isLinear")] + pub fn set_is_linear(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `isRange` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "isRange")] + pub fn get_is_range(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `isRange` field of this object."] #[doc = ""] @@ -181,20 +156,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_range(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isRange"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "isRange")] + pub fn set_is_range(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `isVolatile` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "isVolatile")] + pub fn get_is_volatile(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `isVolatile` field of this object."] #[doc = ""] @@ -202,20 +174,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn is_volatile(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isVolatile"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "isVolatile")] + pub fn set_is_volatile(this: &HidReportItem, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `logicalMaximum` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "logicalMaximum")] + pub fn get_logical_maximum(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `logicalMaximum` field of this object."] #[doc = ""] @@ -223,20 +192,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn logical_maximum(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("logicalMaximum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "logicalMaximum")] + pub fn set_logical_maximum(this: &HidReportItem, val: i32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `logicalMinimum` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "logicalMinimum")] + pub fn get_logical_minimum(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `logicalMinimum` field of this object."] #[doc = ""] @@ -244,20 +210,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn logical_minimum(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("logicalMinimum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "logicalMinimum")] + pub fn set_logical_minimum(this: &HidReportItem, val: i32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `physicalMaximum` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "physicalMaximum")] + pub fn get_physical_maximum(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `physicalMaximum` field of this object."] #[doc = ""] @@ -265,20 +228,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn physical_maximum(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("physicalMaximum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "physicalMaximum")] + pub fn set_physical_maximum(this: &HidReportItem, val: i32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `physicalMinimum` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "physicalMinimum")] + pub fn get_physical_minimum(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `physicalMinimum` field of this object."] #[doc = ""] @@ -286,20 +246,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn physical_minimum(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("physicalMinimum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "physicalMinimum")] + pub fn set_physical_minimum(this: &HidReportItem, val: i32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `reportCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "reportCount")] + pub fn get_report_count(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `reportCount` field of this object."] #[doc = ""] @@ -307,20 +264,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn report_count(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reportCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "reportCount")] + pub fn set_report_count(this: &HidReportItem, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `reportSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "reportSize")] + pub fn get_report_size(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `reportSize` field of this object."] #[doc = ""] @@ -328,20 +282,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn report_size(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reportSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "reportSize")] + pub fn set_report_size(this: &HidReportItem, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `strings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "strings")] + pub fn get_strings(this: &HidReportItem) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `strings` field of this object."] #[doc = ""] @@ -349,20 +300,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn strings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("strings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "strings")] + pub fn set_strings(this: &HidReportItem, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unitExponent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unitExponent")] + pub fn get_unit_exponent(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `unitExponent` field of this object."] #[doc = ""] @@ -370,20 +318,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn unit_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "unitExponent")] + pub fn set_unit_exponent(this: &HidReportItem, val: i8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unitFactorCurrentExponent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unitFactorCurrentExponent")] + pub fn get_unit_factor_current_exponent(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `unitFactorCurrentExponent` field of this object."] #[doc = ""] @@ -391,20 +336,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn unit_factor_current_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorCurrentExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "unitFactorCurrentExponent")] + pub fn set_unit_factor_current_exponent(this: &HidReportItem, val: i8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unitFactorLengthExponent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unitFactorLengthExponent")] + pub fn get_unit_factor_length_exponent(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `unitFactorLengthExponent` field of this object."] #[doc = ""] @@ -412,20 +354,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn unit_factor_length_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorLengthExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "unitFactorLengthExponent")] + pub fn set_unit_factor_length_exponent(this: &HidReportItem, val: i8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unitFactorLuminousIntensityExponent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unitFactorLuminousIntensityExponent")] + pub fn get_unit_factor_luminous_intensity_exponent(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `unitFactorLuminousIntensityExponent` field of this object."] #[doc = ""] @@ -433,20 +372,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn unit_factor_luminous_intensity_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorLuminousIntensityExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "unitFactorLuminousIntensityExponent")] + pub fn set_unit_factor_luminous_intensity_exponent(this: &HidReportItem, val: i8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unitFactorMassExponent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unitFactorMassExponent")] + pub fn get_unit_factor_mass_exponent(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `unitFactorMassExponent` field of this object."] #[doc = ""] @@ -454,20 +390,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn unit_factor_mass_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorMassExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "unitFactorMassExponent")] + pub fn set_unit_factor_mass_exponent(this: &HidReportItem, val: i8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unitFactorTemperatureExponent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unitFactorTemperatureExponent")] + pub fn get_unit_factor_temperature_exponent(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `unitFactorTemperatureExponent` field of this object."] #[doc = ""] @@ -475,20 +408,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn unit_factor_temperature_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorTemperatureExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "unitFactorTemperatureExponent")] + pub fn set_unit_factor_temperature_exponent(this: &HidReportItem, val: i8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `unitFactorTimeExponent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unitFactorTimeExponent")] + pub fn get_unit_factor_time_exponent(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `unitFactorTimeExponent` field of this object."] #[doc = ""] @@ -496,20 +426,18 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn unit_factor_time_exponent(&mut self, val: i8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitFactorTimeExponent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "unitFactorTimeExponent")] + pub fn set_unit_factor_time_exponent(this: &HidReportItem, val: i8); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HidUnitSystem")] + #[doc = "Get the `unitSystem` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`, `HidUnitSystem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "unitSystem")] + pub fn get_unit_system(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "HidUnitSystem")] #[doc = "Change the `unitSystem` field of this object."] @@ -518,20 +446,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn unit_system(&mut self, val: HidUnitSystem) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unitSystem"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "unitSystem")] + pub fn set_unit_system(this: &HidReportItem, val: HidUnitSystem); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usageMaximum` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usageMaximum")] + pub fn get_usage_maximum(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usageMaximum` field of this object."] #[doc = ""] @@ -539,20 +464,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn usage_maximum(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usageMaximum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "usageMaximum")] + pub fn set_usage_maximum(this: &HidReportItem, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usageMinimum` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usageMinimum")] + pub fn get_usage_minimum(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usageMinimum` field of this object."] #[doc = ""] @@ -560,20 +482,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn usage_minimum(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usageMinimum"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "usageMinimum")] + pub fn set_usage_minimum(this: &HidReportItem, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usages` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usages")] + pub fn get_usages(this: &HidReportItem) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `usages` field of this object."] #[doc = ""] @@ -581,17 +500,17 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn usages(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usages"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "usages")] + pub fn set_usages(this: &HidReportItem, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `wrap` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "wrap")] + pub fn get_wrap(this: &HidReportItem) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `wrap` field of this object."] #[doc = ""] @@ -599,14 +518,189 @@ impl HidReportItem { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "wrap")] + pub fn set_wrap(this: &HidReportItem, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl HidReportItem { + #[doc = "Construct a new `HidReportItem`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HidReportItem`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_has_null()` instead."] + pub fn has_null(&mut self, val: bool) -> &mut Self { + self.set_has_null(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_has_preferred_state()` instead."] + pub fn has_preferred_state(&mut self, val: bool) -> &mut Self { + self.set_has_preferred_state(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_is_absolute()` instead."] + pub fn is_absolute(&mut self, val: bool) -> &mut Self { + self.set_is_absolute(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_is_array()` instead."] + pub fn is_array(&mut self, val: bool) -> &mut Self { + self.set_is_array(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_is_buffered_bytes()` instead."] + pub fn is_buffered_bytes(&mut self, val: bool) -> &mut Self { + self.set_is_buffered_bytes(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_is_constant()` instead."] + pub fn is_constant(&mut self, val: bool) -> &mut Self { + self.set_is_constant(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_is_linear()` instead."] + pub fn is_linear(&mut self, val: bool) -> &mut Self { + self.set_is_linear(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_is_range()` instead."] + pub fn is_range(&mut self, val: bool) -> &mut Self { + self.set_is_range(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_is_volatile()` instead."] + pub fn is_volatile(&mut self, val: bool) -> &mut Self { + self.set_is_volatile(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_logical_maximum()` instead."] + pub fn logical_maximum(&mut self, val: i32) -> &mut Self { + self.set_logical_maximum(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_logical_minimum()` instead."] + pub fn logical_minimum(&mut self, val: i32) -> &mut Self { + self.set_logical_minimum(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_physical_maximum()` instead."] + pub fn physical_maximum(&mut self, val: i32) -> &mut Self { + self.set_physical_maximum(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_physical_minimum()` instead."] + pub fn physical_minimum(&mut self, val: i32) -> &mut Self { + self.set_physical_minimum(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_report_count()` instead."] + pub fn report_count(&mut self, val: u16) -> &mut Self { + self.set_report_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_report_size()` instead."] + pub fn report_size(&mut self, val: u16) -> &mut Self { + self.set_report_size(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_strings()` instead."] + pub fn strings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_strings(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unit_exponent()` instead."] + pub fn unit_exponent(&mut self, val: i8) -> &mut Self { + self.set_unit_exponent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unit_factor_current_exponent()` instead."] + pub fn unit_factor_current_exponent(&mut self, val: i8) -> &mut Self { + self.set_unit_factor_current_exponent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unit_factor_length_exponent()` instead."] + pub fn unit_factor_length_exponent(&mut self, val: i8) -> &mut Self { + self.set_unit_factor_length_exponent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unit_factor_luminous_intensity_exponent()` instead."] + pub fn unit_factor_luminous_intensity_exponent(&mut self, val: i8) -> &mut Self { + self.set_unit_factor_luminous_intensity_exponent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unit_factor_mass_exponent()` instead."] + pub fn unit_factor_mass_exponent(&mut self, val: i8) -> &mut Self { + self.set_unit_factor_mass_exponent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unit_factor_temperature_exponent()` instead."] + pub fn unit_factor_temperature_exponent(&mut self, val: i8) -> &mut Self { + self.set_unit_factor_temperature_exponent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_unit_factor_time_exponent()` instead."] + pub fn unit_factor_time_exponent(&mut self, val: i8) -> &mut Self { + self.set_unit_factor_time_exponent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HidUnitSystem")] + #[deprecated = "Use `set_unit_system()` instead."] + pub fn unit_system(&mut self, val: HidUnitSystem) -> &mut Self { + self.set_unit_system(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage_maximum()` instead."] + pub fn usage_maximum(&mut self, val: u32) -> &mut Self { + self.set_usage_maximum(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usage_minimum()` instead."] + pub fn usage_minimum(&mut self, val: u32) -> &mut Self { + self.set_usage_minimum(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usages()` instead."] + pub fn usages(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_usages(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_wrap()` instead."] pub fn wrap(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("wrap"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_wrap(val); self } } diff --git a/crates/web-sys/src/features/gen_HidUnitSystem.rs b/crates/web-sys/src/features/gen_HidUnitSystem.rs index 866d3053648..4f9e39c5c5e 100644 --- a/crates/web-sys/src/features/gen_HidUnitSystem.rs +++ b/crates/web-sys/src/features/gen_HidUnitSystem.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HiddenPluginEventInit.rs b/crates/web-sys/src/features/gen_HiddenPluginEventInit.rs index 5ed75adecaf..07fcd66658b 100644 --- a/crates/web-sys/src/features/gen_HiddenPluginEventInit.rs +++ b/crates/web-sys/src/features/gen_HiddenPluginEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] pub type HiddenPluginEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &HiddenPluginEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &HiddenPluginEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &HiddenPluginEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &HiddenPluginEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &HiddenPluginEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &HiddenPluginEventInit, val: bool); } impl HiddenPluginEventInit { #[doc = "Construct a new `HiddenPluginEventInit`."] @@ -19,55 +50,19 @@ impl HiddenPluginEventInit { 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: `HiddenPluginEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HiddenPluginEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } } diff --git a/crates/web-sys/src/features/gen_History.rs b/crates/web-sys/src/features/gen_History.rs index 50d9b9ad0d1..5a950c140a7 100644 --- a/crates/web-sys/src/features/gen_History.rs +++ b/crates/web-sys/src/features/gen_History.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HitRegionOptions.rs b/crates/web-sys/src/features/gen_HitRegionOptions.rs index a065409906f..c8e6fbdd5c7 100644 --- a/crates/web-sys/src/features/gen_HitRegionOptions.rs +++ b/crates/web-sys/src/features/gen_HitRegionOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,40 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"] pub type HitRegionOptions; + #[cfg(feature = "Element")] + #[doc = "Get the `control` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `HitRegionOptions`*"] + #[wasm_bindgen(method, getter = "control")] + pub fn get_control(this: &HitRegionOptions) -> Option; + #[cfg(feature = "Element")] + #[doc = "Change the `control` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `HitRegionOptions`*"] + #[wasm_bindgen(method, setter = "control")] + pub fn set_control(this: &HitRegionOptions, val: Option<&Element>); + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &HitRegionOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &HitRegionOptions, val: &str); + #[cfg(feature = "Path2d")] + #[doc = "Get the `path` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`, `Path2d`*"] + #[wasm_bindgen(method, getter = "path")] + pub fn get_path(this: &HitRegionOptions) -> Option; + #[cfg(feature = "Path2d")] + #[doc = "Change the `path` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`, `Path2d`*"] + #[wasm_bindgen(method, setter = "path")] + pub fn set_path(this: &HitRegionOptions, val: Option<&Path2d>); } impl HitRegionOptions { #[doc = "Construct a new `HitRegionOptions`."] @@ -20,48 +55,20 @@ impl HitRegionOptions { ret } #[cfg(feature = "Element")] - #[doc = "Change the `control` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Element`, `HitRegionOptions`*"] + #[deprecated = "Use `set_control()` instead."] pub fn control(&mut self, val: Option<&Element>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("control"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_control(val); self } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } #[cfg(feature = "Path2d")] - #[doc = "Change the `path` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`, `Path2d`*"] + #[deprecated = "Use `set_path()` instead."] pub fn path(&mut self, val: Option<&Path2d>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("path"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_path(val); self } } diff --git a/crates/web-sys/src/features/gen_HkdfParams.rs b/crates/web-sys/src/features/gen_HkdfParams.rs index 059bbe35698..8222ac9e8e2 100644 --- a/crates/web-sys/src/features/gen_HkdfParams.rs +++ b/crates/web-sys/src/features/gen_HkdfParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] pub type HkdfParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &HkdfParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &HkdfParams, val: &str); + #[doc = "Get the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[wasm_bindgen(method, getter = "hash")] + pub fn get_hash(this: &HkdfParams) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[wasm_bindgen(method, setter = "hash")] + pub fn set_hash(this: &HkdfParams, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `info` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[wasm_bindgen(method, getter = "info")] + pub fn get_info(this: &HkdfParams) -> ::js_sys::Object; + #[doc = "Change the `info` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[wasm_bindgen(method, setter = "info")] + pub fn set_info(this: &HkdfParams, val: &::js_sys::Object); + #[doc = "Get the `salt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[wasm_bindgen(method, getter = "salt")] + pub fn get_salt(this: &HkdfParams) -> ::js_sys::Object; + #[doc = "Change the `salt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[wasm_bindgen(method, setter = "salt")] + pub fn set_salt(this: &HkdfParams, val: &::js_sys::Object); } impl HkdfParams { #[doc = "Construct a new `HkdfParams`."] @@ -22,62 +63,30 @@ impl HkdfParams { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.hash(hash); - ret.info(info); - ret.salt(salt); + ret.set_name(name); + ret.set_hash(hash); + ret.set_info(info); + ret.set_salt(salt); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[deprecated = "Use `set_hash()` instead."] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash(val); self } - #[doc = "Change the `info` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[deprecated = "Use `set_info()` instead."] pub fn info(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("info"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_info(val); self } - #[doc = "Change the `salt` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"] + #[deprecated = "Use `set_salt()` instead."] pub fn salt(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("salt"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_salt(val); self } } diff --git a/crates/web-sys/src/features/gen_HmacDerivedKeyParams.rs b/crates/web-sys/src/features/gen_HmacDerivedKeyParams.rs index b1708bcff53..a750e6e4695 100644 --- a/crates/web-sys/src/features/gen_HmacDerivedKeyParams.rs +++ b/crates/web-sys/src/features/gen_HmacDerivedKeyParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] pub type HmacDerivedKeyParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &HmacDerivedKeyParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &HmacDerivedKeyParams, val: &str); + #[doc = "Get the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[wasm_bindgen(method, getter = "hash")] + pub fn get_hash(this: &HmacDerivedKeyParams) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[wasm_bindgen(method, setter = "hash")] + pub fn set_hash(this: &HmacDerivedKeyParams, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &HmacDerivedKeyParams) -> Option; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &HmacDerivedKeyParams, val: u32); } impl HmacDerivedKeyParams { #[doc = "Construct a new `HmacDerivedKeyParams`."] @@ -17,48 +48,23 @@ impl HmacDerivedKeyParams { pub fn new(name: &str, hash: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.hash(hash); + ret.set_name(name); + ret.set_hash(hash); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[deprecated = "Use `set_hash()` instead."] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash(val); self } - #[doc = "Change the `length` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacDerivedKeyParams`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } } diff --git a/crates/web-sys/src/features/gen_HmacImportParams.rs b/crates/web-sys/src/features/gen_HmacImportParams.rs index eb9489c059b..8b53b90fa19 100644 --- a/crates/web-sys/src/features/gen_HmacImportParams.rs +++ b/crates/web-sys/src/features/gen_HmacImportParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] pub type HmacImportParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &HmacImportParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &HmacImportParams, val: &str); + #[doc = "Get the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] + #[wasm_bindgen(method, getter = "hash")] + pub fn get_hash(this: &HmacImportParams) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] + #[wasm_bindgen(method, setter = "hash")] + pub fn set_hash(this: &HmacImportParams, val: &::wasm_bindgen::JsValue); } impl HmacImportParams { #[doc = "Construct a new `HmacImportParams`."] @@ -17,34 +38,18 @@ impl HmacImportParams { pub fn new(name: &str, hash: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.hash(hash); + ret.set_name(name); + ret.set_hash(hash); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacImportParams`*"] + #[deprecated = "Use `set_hash()` instead."] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash(val); self } } diff --git a/crates/web-sys/src/features/gen_HmacKeyAlgorithm.rs b/crates/web-sys/src/features/gen_HmacKeyAlgorithm.rs index 5910552e337..9d8d531f280 100644 --- a/crates/web-sys/src/features/gen_HmacKeyAlgorithm.rs +++ b/crates/web-sys/src/features/gen_HmacKeyAlgorithm.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] pub type HmacKeyAlgorithm; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &HmacKeyAlgorithm) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &HmacKeyAlgorithm, val: &str); + #[cfg(feature = "KeyAlgorithm")] + #[doc = "Get the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`, `KeyAlgorithm`*"] + #[wasm_bindgen(method, getter = "hash")] + pub fn get_hash(this: &HmacKeyAlgorithm) -> KeyAlgorithm; + #[cfg(feature = "KeyAlgorithm")] + #[doc = "Change the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`, `KeyAlgorithm`*"] + #[wasm_bindgen(method, setter = "hash")] + pub fn set_hash(this: &HmacKeyAlgorithm, val: &KeyAlgorithm); + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &HmacKeyAlgorithm) -> u32; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &HmacKeyAlgorithm, val: u32); } impl HmacKeyAlgorithm { #[cfg(feature = "KeyAlgorithm")] @@ -18,50 +51,25 @@ impl HmacKeyAlgorithm { pub fn new(name: &str, hash: &KeyAlgorithm, length: u32) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.hash(hash); - ret.length(length); + ret.set_name(name); + ret.set_hash(hash); + ret.set_length(length); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } #[cfg(feature = "KeyAlgorithm")] - #[doc = "Change the `hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`, `KeyAlgorithm`*"] + #[deprecated = "Use `set_hash()` instead."] pub fn hash(&mut self, val: &KeyAlgorithm) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash(val); self } - #[doc = "Change the `length` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } } diff --git a/crates/web-sys/src/features/gen_HmacKeyGenParams.rs b/crates/web-sys/src/features/gen_HmacKeyGenParams.rs index 3903d71a727..8fa104cd5f1 100644 --- a/crates/web-sys/src/features/gen_HmacKeyGenParams.rs +++ b/crates/web-sys/src/features/gen_HmacKeyGenParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] pub type HmacKeyGenParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &HmacKeyGenParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &HmacKeyGenParams, val: &str); + #[doc = "Get the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[wasm_bindgen(method, getter = "hash")] + pub fn get_hash(this: &HmacKeyGenParams) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[wasm_bindgen(method, setter = "hash")] + pub fn set_hash(this: &HmacKeyGenParams, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &HmacKeyGenParams) -> Option; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &HmacKeyGenParams, val: u32); } impl HmacKeyGenParams { #[doc = "Construct a new `HmacKeyGenParams`."] @@ -17,48 +48,23 @@ impl HmacKeyGenParams { pub fn new(name: &str, hash: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.hash(hash); + ret.set_name(name); + ret.set_hash(hash); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[deprecated = "Use `set_hash()` instead."] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash(val); self } - #[doc = "Change the `length` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } } diff --git a/crates/web-sys/src/features/gen_HtmlAllCollection.rs b/crates/web-sys/src/features/gen_HtmlAllCollection.rs index 8510f7f4cf0..db390569ca1 100644 --- a/crates/web-sys/src/features/gen_HtmlAllCollection.rs +++ b/crates/web-sys/src/features/gen_HtmlAllCollection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -42,14 +43,14 @@ extern "C" { pub fn named_item(this: &HtmlAllCollection, name: &str) -> Option<::js_sys::Object>; #[cfg(feature = "Node")] #[wasm_bindgen(method, structural, js_class = "HTMLAllCollection", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAllCollection`, `Node`*"] pub fn get_with_index(this: &HtmlAllCollection, index: u32) -> Option; #[wasm_bindgen(method, structural, js_class = "HTMLAllCollection", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlAnchorElement.rs b/crates/web-sys/src/features/gen_HtmlAnchorElement.rs index 0b953108c1f..6fafd95835b 100644 --- a/crates/web-sys/src/features/gen_HtmlAnchorElement.rs +++ b/crates/web-sys/src/features/gen_HtmlAnchorElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/target)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn target(this: &HtmlAnchorElement) -> String; + pub fn target(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = target)] #[doc = "Setter for the `target` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/download)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn download(this: &HtmlAnchorElement) -> String; + pub fn download(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = download)] #[doc = "Setter for the `download` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/ping)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn ping(this: &HtmlAnchorElement) -> String; + pub fn ping(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = ping)] #[doc = "Setter for the `ping` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/rel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn rel(this: &HtmlAnchorElement) -> String; + pub fn rel(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = rel)] #[doc = "Setter for the `rel` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/referrerPolicy)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn referrer_policy(this: &HtmlAnchorElement) -> String; + pub fn referrer_policy(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = referrerPolicy)] #[doc = "Setter for the `referrerPolicy` field of this object."] #[doc = ""] @@ -95,7 +96,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/hreflang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn hreflang(this: &HtmlAnchorElement) -> String; + pub fn hreflang(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = hreflang)] #[doc = "Setter for the `hreflang` field of this object."] #[doc = ""] @@ -109,7 +110,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn type_(this: &HtmlAnchorElement) -> String; + pub fn type_(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -123,7 +124,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn text(this: &HtmlAnchorElement) -> Result; + pub fn text(this: &HtmlAnchorElement) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLAnchorElement" , js_name = text)] #[doc = "Setter for the `text` field of this object."] #[doc = ""] @@ -137,7 +138,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/coords)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn coords(this: &HtmlAnchorElement) -> String; + pub fn coords(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = coords)] #[doc = "Setter for the `coords` field of this object."] #[doc = ""] @@ -151,7 +152,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/charset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn charset(this: &HtmlAnchorElement) -> String; + pub fn charset(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = charset)] #[doc = "Setter for the `charset` field of this object."] #[doc = ""] @@ -165,7 +166,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn name(this: &HtmlAnchorElement) -> String; + pub fn name(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -179,7 +180,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/rev)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn rev(this: &HtmlAnchorElement) -> String; + pub fn rev(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = rev)] #[doc = "Setter for the `rev` field of this object."] #[doc = ""] @@ -193,7 +194,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/shape)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn shape(this: &HtmlAnchorElement) -> String; + pub fn shape(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = shape)] #[doc = "Setter for the `shape` field of this object."] #[doc = ""] @@ -207,7 +208,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn href(this: &HtmlAnchorElement) -> String; + pub fn href(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = href)] #[doc = "Setter for the `href` field of this object."] #[doc = ""] @@ -221,14 +222,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn origin(this: &HtmlAnchorElement) -> String; + pub fn origin(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "HTMLAnchorElement" , js_name = protocol)] #[doc = "Getter for the `protocol` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/protocol)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn protocol(this: &HtmlAnchorElement) -> String; + pub fn protocol(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = protocol)] #[doc = "Setter for the `protocol` field of this object."] #[doc = ""] @@ -242,7 +243,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/username)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn username(this: &HtmlAnchorElement) -> String; + pub fn username(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = username)] #[doc = "Setter for the `username` field of this object."] #[doc = ""] @@ -256,7 +257,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/password)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn password(this: &HtmlAnchorElement) -> String; + pub fn password(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = password)] #[doc = "Setter for the `password` field of this object."] #[doc = ""] @@ -270,7 +271,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/host)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn host(this: &HtmlAnchorElement) -> String; + pub fn host(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = host)] #[doc = "Setter for the `host` field of this object."] #[doc = ""] @@ -284,7 +285,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/hostname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn hostname(this: &HtmlAnchorElement) -> String; + pub fn hostname(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = hostname)] #[doc = "Setter for the `hostname` field of this object."] #[doc = ""] @@ -298,7 +299,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/port)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn port(this: &HtmlAnchorElement) -> String; + pub fn port(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = port)] #[doc = "Setter for the `port` field of this object."] #[doc = ""] @@ -312,7 +313,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/pathname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn pathname(this: &HtmlAnchorElement) -> String; + pub fn pathname(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = pathname)] #[doc = "Setter for the `pathname` field of this object."] #[doc = ""] @@ -326,7 +327,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/search)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn search(this: &HtmlAnchorElement) -> String; + pub fn search(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = search)] #[doc = "Setter for the `search` field of this object."] #[doc = ""] @@ -340,7 +341,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/hash)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAnchorElement`*"] - pub fn hash(this: &HtmlAnchorElement) -> String; + pub fn hash(this: &HtmlAnchorElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAnchorElement" , js_name = hash)] #[doc = "Setter for the `hash` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlAreaElement.rs b/crates/web-sys/src/features/gen_HtmlAreaElement.rs index 23a9ae2c757..2e4e2eee37e 100644 --- a/crates/web-sys/src/features/gen_HtmlAreaElement.rs +++ b/crates/web-sys/src/features/gen_HtmlAreaElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/alt)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn alt(this: &HtmlAreaElement) -> String; + pub fn alt(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = alt)] #[doc = "Setter for the `alt` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/coords)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn coords(this: &HtmlAreaElement) -> String; + pub fn coords(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = coords)] #[doc = "Setter for the `coords` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/shape)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn shape(this: &HtmlAreaElement) -> String; + pub fn shape(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = shape)] #[doc = "Setter for the `shape` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/target)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn target(this: &HtmlAreaElement) -> String; + pub fn target(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = target)] #[doc = "Setter for the `target` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/download)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn download(this: &HtmlAreaElement) -> String; + pub fn download(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = download)] #[doc = "Setter for the `download` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/ping)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn ping(this: &HtmlAreaElement) -> String; + pub fn ping(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = ping)] #[doc = "Setter for the `ping` field of this object."] #[doc = ""] @@ -101,7 +102,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/rel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn rel(this: &HtmlAreaElement) -> String; + pub fn rel(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = rel)] #[doc = "Setter for the `rel` field of this object."] #[doc = ""] @@ -115,7 +116,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/referrerPolicy)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn referrer_policy(this: &HtmlAreaElement) -> String; + pub fn referrer_policy(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = referrerPolicy)] #[doc = "Setter for the `referrerPolicy` field of this object."] #[doc = ""] @@ -151,7 +152,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn href(this: &HtmlAreaElement) -> String; + pub fn href(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = href)] #[doc = "Setter for the `href` field of this object."] #[doc = ""] @@ -165,14 +166,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn origin(this: &HtmlAreaElement) -> String; + pub fn origin(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "HTMLAreaElement" , js_name = protocol)] #[doc = "Getter for the `protocol` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/protocol)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn protocol(this: &HtmlAreaElement) -> String; + pub fn protocol(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = protocol)] #[doc = "Setter for the `protocol` field of this object."] #[doc = ""] @@ -186,7 +187,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/username)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn username(this: &HtmlAreaElement) -> String; + pub fn username(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = username)] #[doc = "Setter for the `username` field of this object."] #[doc = ""] @@ -200,7 +201,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/password)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn password(this: &HtmlAreaElement) -> String; + pub fn password(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = password)] #[doc = "Setter for the `password` field of this object."] #[doc = ""] @@ -214,7 +215,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/host)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn host(this: &HtmlAreaElement) -> String; + pub fn host(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = host)] #[doc = "Setter for the `host` field of this object."] #[doc = ""] @@ -228,7 +229,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/hostname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn hostname(this: &HtmlAreaElement) -> String; + pub fn hostname(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = hostname)] #[doc = "Setter for the `hostname` field of this object."] #[doc = ""] @@ -242,7 +243,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/port)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn port(this: &HtmlAreaElement) -> String; + pub fn port(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = port)] #[doc = "Setter for the `port` field of this object."] #[doc = ""] @@ -256,7 +257,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/pathname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn pathname(this: &HtmlAreaElement) -> String; + pub fn pathname(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = pathname)] #[doc = "Setter for the `pathname` field of this object."] #[doc = ""] @@ -270,7 +271,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/search)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn search(this: &HtmlAreaElement) -> String; + pub fn search(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = search)] #[doc = "Setter for the `search` field of this object."] #[doc = ""] @@ -284,7 +285,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/hash)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlAreaElement`*"] - pub fn hash(this: &HtmlAreaElement) -> String; + pub fn hash(this: &HtmlAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLAreaElement" , js_name = hash)] #[doc = "Setter for the `hash` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlAudioElement.rs b/crates/web-sys/src/features/gen_HtmlAudioElement.rs index 03ea58ccf05..0c8f44abd0c 100644 --- a/crates/web-sys/src/features/gen_HtmlAudioElement.rs +++ b/crates/web-sys/src/features/gen_HtmlAudioElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlBaseElement.rs b/crates/web-sys/src/features/gen_HtmlBaseElement.rs index d521cabb7d3..4f4aadc75a7 100644 --- a/crates/web-sys/src/features/gen_HtmlBaseElement.rs +++ b/crates/web-sys/src/features/gen_HtmlBaseElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBaseElement/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBaseElement`*"] - pub fn href(this: &HtmlBaseElement) -> String; + pub fn href(this: &HtmlBaseElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBaseElement" , js_name = href)] #[doc = "Setter for the `href` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBaseElement/target)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBaseElement`*"] - pub fn target(this: &HtmlBaseElement) -> String; + pub fn target(this: &HtmlBaseElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBaseElement" , js_name = target)] #[doc = "Setter for the `target` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlBodyElement.rs b/crates/web-sys/src/features/gen_HtmlBodyElement.rs index f7355c4c335..9b902aeb351 100644 --- a/crates/web-sys/src/features/gen_HtmlBodyElement.rs +++ b/crates/web-sys/src/features/gen_HtmlBodyElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] - pub fn text(this: &HtmlBodyElement) -> String; + pub fn text(this: &HtmlBodyElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBodyElement" , js_name = text)] #[doc = "Setter for the `text` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/link)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] - pub fn link(this: &HtmlBodyElement) -> String; + pub fn link(this: &HtmlBodyElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBodyElement" , js_name = link)] #[doc = "Setter for the `link` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/vLink)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] - pub fn v_link(this: &HtmlBodyElement) -> String; + pub fn v_link(this: &HtmlBodyElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBodyElement" , js_name = vLink)] #[doc = "Setter for the `vLink` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/aLink)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] - pub fn a_link(this: &HtmlBodyElement) -> String; + pub fn a_link(this: &HtmlBodyElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBodyElement" , js_name = aLink)] #[doc = "Setter for the `aLink` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/bgColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] - pub fn bg_color(this: &HtmlBodyElement) -> String; + pub fn bg_color(this: &HtmlBodyElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBodyElement" , js_name = bgColor)] #[doc = "Setter for the `bgColor` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/background)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] - pub fn background(this: &HtmlBodyElement) -> String; + pub fn background(this: &HtmlBodyElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBodyElement" , js_name = background)] #[doc = "Setter for the `background` field of this object."] #[doc = ""] @@ -291,4 +292,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] pub fn set_onunload(this: &HtmlBodyElement, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "HTMLBodyElement" , js_name = ongamepadconnected)] + #[doc = "Getter for the `ongamepadconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/ongamepadconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ongamepadconnected(this: &HtmlBodyElement) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "HTMLBodyElement" , js_name = ongamepadconnected)] + #[doc = "Setter for the `ongamepadconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/ongamepadconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ongamepadconnected(this: &HtmlBodyElement, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "HTMLBodyElement" , js_name = ongamepaddisconnected)] + #[doc = "Getter for the `ongamepaddisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/ongamepaddisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ongamepaddisconnected(this: &HtmlBodyElement) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "HTMLBodyElement" , js_name = ongamepaddisconnected)] + #[doc = "Setter for the `ongamepaddisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/ongamepaddisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlBodyElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ongamepaddisconnected(this: &HtmlBodyElement, value: Option<&::js_sys::Function>); } diff --git a/crates/web-sys/src/features/gen_HtmlBrElement.rs b/crates/web-sys/src/features/gen_HtmlBrElement.rs index aa332a90a5c..4e882f6f2eb 100644 --- a/crates/web-sys/src/features/gen_HtmlBrElement.rs +++ b/crates/web-sys/src/features/gen_HtmlBrElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBRElement/clear)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlBrElement`*"] - pub fn clear(this: &HtmlBrElement) -> String; + pub fn clear(this: &HtmlBrElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLBRElement" , js_name = clear)] #[doc = "Setter for the `clear` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlButtonElement.rs b/crates/web-sys/src/features/gen_HtmlButtonElement.rs index e8958b145f1..047b47bfdb5 100644 --- a/crates/web-sys/src/features/gen_HtmlButtonElement.rs +++ b/crates/web-sys/src/features/gen_HtmlButtonElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,6 +18,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/autofocus)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] + #[deprecated( + note = "Use `HtmlElement::autofocus()` or `HtmlElement::set_autofocus()` instead." + )] pub fn autofocus(this: &HtmlButtonElement) -> bool; # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = autofocus)] #[doc = "Setter for the `autofocus` field of this object."] @@ -24,6 +28,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/autofocus)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] + #[deprecated( + note = "Use `HtmlElement::autofocus()` or `HtmlElement::set_autofocus()` instead." + )] pub fn set_autofocus(this: &HtmlButtonElement, value: bool); # [wasm_bindgen (structural , method , getter , js_class = "HTMLButtonElement" , js_name = disabled)] #[doc = "Getter for the `disabled` field of this object."] @@ -53,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formAction)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] - pub fn form_action(this: &HtmlButtonElement) -> String; + pub fn form_action(this: &HtmlButtonElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = formAction)] #[doc = "Setter for the `formAction` field of this object."] #[doc = ""] @@ -67,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formEnctype)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] - pub fn form_enctype(this: &HtmlButtonElement) -> String; + pub fn form_enctype(this: &HtmlButtonElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = formEnctype)] #[doc = "Setter for the `formEnctype` field of this object."] #[doc = ""] @@ -81,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formMethod)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] - pub fn form_method(this: &HtmlButtonElement) -> String; + pub fn form_method(this: &HtmlButtonElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = formMethod)] #[doc = "Setter for the `formMethod` field of this object."] #[doc = ""] @@ -109,7 +116,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formTarget)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] - pub fn form_target(this: &HtmlButtonElement) -> String; + pub fn form_target(this: &HtmlButtonElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = formTarget)] #[doc = "Setter for the `formTarget` field of this object."] #[doc = ""] @@ -123,7 +130,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] - pub fn name(this: &HtmlButtonElement) -> String; + pub fn name(this: &HtmlButtonElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -137,7 +144,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] - pub fn type_(this: &HtmlButtonElement) -> String; + pub fn type_(this: &HtmlButtonElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -151,7 +158,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] - pub fn value(this: &HtmlButtonElement) -> String; + pub fn value(this: &HtmlButtonElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -180,7 +187,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/validationMessage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] - pub fn validation_message(this: &HtmlButtonElement) -> Result; + pub fn validation_message(this: &HtmlButtonElement) + -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "NodeList")] # [wasm_bindgen (structural , method , getter , js_class = "HTMLButtonElement" , js_name = labels)] #[doc = "Getter for the `labels` field of this object."] @@ -189,6 +197,34 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`, `NodeList`*"] pub fn labels(this: &HtmlButtonElement) -> NodeList; + # [wasm_bindgen (structural , method , getter , js_class = "HTMLButtonElement" , js_name = popoverTargetElement)] + #[doc = "Getter for the `popoverTargetElement` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/popoverTargetElement)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] + pub fn popover_target_element(this: &HtmlButtonElement) -> Option; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = popoverTargetElement)] + #[doc = "Setter for the `popoverTargetElement` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/popoverTargetElement)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] + pub fn set_popover_target_element(this: &HtmlButtonElement, value: Option<&Element>); + # [wasm_bindgen (structural , method , getter , js_class = "HTMLButtonElement" , js_name = popoverTargetAction)] + #[doc = "Getter for the `popoverTargetAction` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/popoverTargetAction)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] + pub fn popover_target_action(this: &HtmlButtonElement) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLButtonElement" , js_name = popoverTargetAction)] + #[doc = "Setter for the `popoverTargetAction` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/popoverTargetAction)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlButtonElement`*"] + pub fn set_popover_target_action(this: &HtmlButtonElement, value: &str); # [wasm_bindgen (method , structural , js_class = "HTMLButtonElement" , js_name = checkValidity)] #[doc = "The `checkValidity()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlCanvasElement.rs b/crates/web-sys/src/features/gen_HtmlCanvasElement.rs index ff8ab7e2dce..542e1dbf7ef 100644 --- a/crates/web-sys/src/features/gen_HtmlCanvasElement.rs +++ b/crates/web-sys/src/features/gen_HtmlCanvasElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -39,6 +40,25 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"] pub fn set_height(this: &HtmlCanvasElement, value: u32); + #[cfg(feature = "MediaStream")] + # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = captureStream)] + #[doc = "The `captureStream()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `MediaStream`*"] + pub fn capture_stream(this: &HtmlCanvasElement) -> Result; + #[cfg(feature = "MediaStream")] + # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = captureStream)] + #[doc = "The `captureStream()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `MediaStream`*"] + pub fn capture_stream_with_frame_request_rate( + this: &HtmlCanvasElement, + frame_request_rate: f64, + ) -> Result; # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = getContext)] #[doc = "The `getContext()` method."] #[doc = ""] @@ -96,14 +116,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"] - pub fn to_data_url(this: &HtmlCanvasElement) -> Result; + pub fn to_data_url(this: &HtmlCanvasElement) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = toDataURL)] #[doc = "The `toDataURL()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`*"] - pub fn to_data_url_with_type(this: &HtmlCanvasElement, type_: &str) -> Result; + pub fn to_data_url_with_type( + this: &HtmlCanvasElement, + type_: &str, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = toDataURL)] #[doc = "The `toDataURL()` method."] #[doc = ""] @@ -114,7 +137,7 @@ extern "C" { this: &HtmlCanvasElement, type_: &str, encoder_options: &::wasm_bindgen::JsValue, - ) -> Result; + ) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "OffscreenCanvas")] # [wasm_bindgen (catch , method , structural , js_class = "HTMLCanvasElement" , js_name = transferControlToOffscreen)] #[doc = "The `transferControlToOffscreen()` method."] diff --git a/crates/web-sys/src/features/gen_HtmlCollection.rs b/crates/web-sys/src/features/gen_HtmlCollection.rs index cf3ff4fbea6..d52876528c5 100644 --- a/crates/web-sys/src/features/gen_HtmlCollection.rs +++ b/crates/web-sys/src/features/gen_HtmlCollection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -36,7 +37,7 @@ extern "C" { pub fn named_item(this: &HtmlCollection, name: &str) -> Option; #[cfg(feature = "Element")] #[wasm_bindgen(method, structural, js_class = "HTMLCollection", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] @@ -44,7 +45,7 @@ extern "C" { pub fn get_with_index(this: &HtmlCollection, index: u32) -> Option; #[cfg(feature = "Element")] #[wasm_bindgen(method, structural, js_class = "HTMLCollection", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlDListElement.rs b/crates/web-sys/src/features/gen_HtmlDListElement.rs index 74fab306a26..6b54efdfba0 100644 --- a/crates/web-sys/src/features/gen_HtmlDListElement.rs +++ b/crates/web-sys/src/features/gen_HtmlDListElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlDataElement.rs b/crates/web-sys/src/features/gen_HtmlDataElement.rs index f43586af65f..c9569fbb6c6 100644 --- a/crates/web-sys/src/features/gen_HtmlDataElement.rs +++ b/crates/web-sys/src/features/gen_HtmlDataElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDataElement/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDataElement`*"] - pub fn value(this: &HtmlDataElement) -> String; + pub fn value(this: &HtmlDataElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDataElement" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlDataListElement.rs b/crates/web-sys/src/features/gen_HtmlDataListElement.rs index b19b0c19e98..6b7ce7a541f 100644 --- a/crates/web-sys/src/features/gen_HtmlDataListElement.rs +++ b/crates/web-sys/src/features/gen_HtmlDataListElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlDetailsElement.rs b/crates/web-sys/src/features/gen_HtmlDetailsElement.rs index a816f04e7ca..80f5eef0c3e 100644 --- a/crates/web-sys/src/features/gen_HtmlDetailsElement.rs +++ b/crates/web-sys/src/features/gen_HtmlDetailsElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlDialogElement.rs b/crates/web-sys/src/features/gen_HtmlDialogElement.rs index 9fda1ac7d15..100d491d135 100644 --- a/crates/web-sys/src/features/gen_HtmlDialogElement.rs +++ b/crates/web-sys/src/features/gen_HtmlDialogElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/returnValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDialogElement`*"] - pub fn return_value(this: &HtmlDialogElement) -> String; + pub fn return_value(this: &HtmlDialogElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDialogElement" , js_name = returnValue)] #[doc = "Setter for the `returnValue` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlDirectoryElement.rs b/crates/web-sys/src/features/gen_HtmlDirectoryElement.rs index 5302969c2b0..66ec50f0446 100644 --- a/crates/web-sys/src/features/gen_HtmlDirectoryElement.rs +++ b/crates/web-sys/src/features/gen_HtmlDirectoryElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlDivElement.rs b/crates/web-sys/src/features/gen_HtmlDivElement.rs index eadb4fb7db3..90faef9902d 100644 --- a/crates/web-sys/src/features/gen_HtmlDivElement.rs +++ b/crates/web-sys/src/features/gen_HtmlDivElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDivElement`*"] - pub fn align(this: &HtmlDivElement) -> String; + pub fn align(this: &HtmlDivElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDivElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlDocument.rs b/crates/web-sys/src/features/gen_HtmlDocument.rs index 94c2d0cdbb6..fb18ad852a6 100644 --- a/crates/web-sys/src/features/gen_HtmlDocument.rs +++ b/crates/web-sys/src/features/gen_HtmlDocument.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/domain)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn domain(this: &HtmlDocument) -> String; + pub fn domain(this: &HtmlDocument) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDocument" , js_name = domain)] #[doc = "Setter for the `domain` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/cookie)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn cookie(this: &HtmlDocument) -> Result; + pub fn cookie(this: &HtmlDocument) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLDocument" , js_name = cookie)] #[doc = "Setter for the `cookie` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/designMode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn design_mode(this: &HtmlDocument) -> String; + pub fn design_mode(this: &HtmlDocument) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDocument" , js_name = designMode)] #[doc = "Setter for the `designMode` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/fgColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn fg_color(this: &HtmlDocument) -> String; + pub fn fg_color(this: &HtmlDocument) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDocument" , js_name = fgColor)] #[doc = "Setter for the `fgColor` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/linkColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn link_color(this: &HtmlDocument) -> String; + pub fn link_color(this: &HtmlDocument) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDocument" , js_name = linkColor)] #[doc = "Setter for the `linkColor` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/vlinkColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn vlink_color(this: &HtmlDocument) -> String; + pub fn vlink_color(this: &HtmlDocument) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDocument" , js_name = vlinkColor)] #[doc = "Setter for the `vlinkColor` field of this object."] #[doc = ""] @@ -101,7 +102,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/alinkColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn alink_color(this: &HtmlDocument) -> String; + pub fn alink_color(this: &HtmlDocument) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDocument" , js_name = alinkColor)] #[doc = "Setter for the `alinkColor` field of this object."] #[doc = ""] @@ -115,7 +116,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/bgColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn bg_color(this: &HtmlDocument) -> String; + pub fn bg_color(this: &HtmlDocument) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLDocument" , js_name = bgColor)] #[doc = "Setter for the `bgColor` field of this object."] #[doc = ""] @@ -268,7 +269,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument/queryCommandValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlDocument`*"] - pub fn query_command_value(this: &HtmlDocument, command_id: &str) -> Result; + pub fn query_command_value( + this: &HtmlDocument, + command_id: &str, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (method , structural , js_class = "HTMLDocument" , js_name = releaseEvents)] #[doc = "The `releaseEvents()` method."] #[doc = ""] @@ -473,7 +477,7 @@ extern "C" { text_7: &str, ) -> Result<(), JsValue>; #[wasm_bindgen(catch, method, structural, js_class = "HTMLDocument", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlElement.rs b/crates/web-sys/src/features/gen_HtmlElement.rs index b7850a6fce3..c8995e759a1 100644 --- a/crates/web-sys/src/features/gen_HtmlElement.rs +++ b/crates/web-sys/src/features/gen_HtmlElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/title)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn title(this: &HtmlElement) -> String; + pub fn title(this: &HtmlElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = title)] #[doc = "Setter for the `title` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/lang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn lang(this: &HtmlElement) -> String; + pub fn lang(this: &HtmlElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = lang)] #[doc = "Setter for the `lang` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dir)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn dir(this: &HtmlElement) -> String; + pub fn dir(this: &HtmlElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = dir)] #[doc = "Setter for the `dir` field of this object."] #[doc = ""] @@ -81,21 +82,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] pub fn set_dir(this: &HtmlElement, value: &str); - #[cfg(feature = "DomStringMap")] - # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = dataset)] - #[doc = "Getter for the `dataset` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomStringMap`, `HtmlElement`*"] - pub fn dataset(this: &HtmlElement) -> DomStringMap; # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = innerText)] #[doc = "Getter for the `innerText` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn inner_text(this: &HtmlElement) -> String; + pub fn inner_text(this: &HtmlElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = innerText)] #[doc = "Setter for the `innerText` field of this object."] #[doc = ""] @@ -117,27 +110,27 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] pub fn set_hidden(this: &HtmlElement, value: bool); - # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = tabIndex)] - #[doc = "Getter for the `tabIndex` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = inert)] + #[doc = "Getter for the `inert` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/tabIndex)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn tab_index(this: &HtmlElement) -> i32; - # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = tabIndex)] - #[doc = "Setter for the `tabIndex` field of this object."] + pub fn inert(this: &HtmlElement) -> bool; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = inert)] + #[doc = "Setter for the `inert` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/tabIndex)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn set_tab_index(this: &HtmlElement, value: i32); + pub fn set_inert(this: &HtmlElement, value: bool); # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = accessKey)] #[doc = "Getter for the `accessKey` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/accessKey)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn access_key(this: &HtmlElement) -> String; + pub fn access_key(this: &HtmlElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = accessKey)] #[doc = "Setter for the `accessKey` field of this object."] #[doc = ""] @@ -151,7 +144,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/accessKeyLabel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn access_key_label(this: &HtmlElement) -> String; + pub fn access_key_label(this: &HtmlElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = draggable)] #[doc = "Getter for the `draggable` field of this object."] #[doc = ""] @@ -172,7 +165,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] - pub fn content_editable(this: &HtmlElement) -> String; + pub fn content_editable(this: &HtmlElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = contentEditable)] #[doc = "Setter for the `contentEditable` field of this object."] #[doc = ""] @@ -187,6 +180,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] pub fn is_content_editable(this: &HtmlElement) -> bool; + # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = popover)] + #[doc = "Getter for the `popover` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/popover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn popover(this: &HtmlElement) -> Option<::alloc::string::String>; + # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLElement" , js_name = popover)] + #[doc = "Setter for the `popover` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/popover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn set_popover(this: &HtmlElement, value: Option<&str>) -> Result<(), JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = spellcheck)] #[doc = "Getter for the `spellcheck` field of this object."] #[doc = ""] @@ -201,14 +208,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] pub fn set_spellcheck(this: &HtmlElement, value: bool); - #[cfg(feature = "CssStyleDeclaration")] - # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = style)] - #[doc = "Getter for the `style` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`, `HtmlElement`*"] - pub fn style(this: &HtmlElement) -> CssStyleDeclaration; # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = offsetParent)] #[doc = "Getter for the `offsetParent` field of this object."] #[doc = ""] @@ -286,6 +285,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] pub fn set_onpaste(this: &HtmlElement, value: Option<&::js_sys::Function>); + #[cfg(feature = "CssStyleDeclaration")] + # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = style)] + #[doc = "Getter for the `style` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`, `HtmlElement`*"] + pub fn style(this: &HtmlElement) -> CssStyleDeclaration; # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = onabort)] #[doc = "Getter for the `onabort` field of this object."] #[doc = ""] @@ -342,6 +349,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] pub fn set_onauxclick(this: &HtmlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = onbeforetoggle)] + #[doc = "Getter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn onbeforetoggle(this: &HtmlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = onbeforetoggle)] + #[doc = "Setter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn set_onbeforetoggle(this: &HtmlElement, value: Option<&::js_sys::Function>); # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = oncanplay)] #[doc = "Getter for the `oncanplay` field of this object."] #[doc = ""] @@ -1434,6 +1455,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] pub fn set_onwebkittransitionend(this: &HtmlElement, value: Option<&::js_sys::Function>); + #[cfg(feature = "DomStringMap")] + # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = dataset)] + #[doc = "Getter for the `dataset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomStringMap`, `HtmlElement`*"] + pub fn dataset(this: &HtmlElement) -> DomStringMap; + # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = nonce)] + #[doc = "Getter for the `nonce` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/nonce)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn nonce(this: &HtmlElement) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = nonce)] + #[doc = "Setter for the `nonce` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/nonce)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn set_nonce(this: &HtmlElement, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = autofocus)] + #[doc = "Getter for the `autofocus` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/autofocus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn autofocus(this: &HtmlElement) -> bool; + # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLElement" , js_name = autofocus)] + #[doc = "Setter for the `autofocus` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/autofocus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn set_autofocus(this: &HtmlElement, value: bool) -> Result<(), JsValue>; + # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = tabIndex)] + #[doc = "Getter for the `tabIndex` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/tabIndex)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn tab_index(this: &HtmlElement) -> i32; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLElement" , js_name = tabIndex)] + #[doc = "Setter for the `tabIndex` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/tabIndex)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn set_tab_index(this: &HtmlElement, value: i32); # [wasm_bindgen (structural , method , getter , js_class = "HTMLElement" , js_name = onerror)] #[doc = "Getter for the `onerror` field of this object."] #[doc = ""] @@ -1525,4 +1596,40 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] pub fn focus(this: &HtmlElement) -> Result<(), JsValue>; + #[cfg(feature = "FocusOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "HTMLElement" , js_name = focus)] + #[doc = "The `focus()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`, `HtmlElement`*"] + pub fn focus_with_options(this: &HtmlElement, options: &FocusOptions) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLElement" , js_name = hidePopover)] + #[doc = "The `hidePopover()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/hidePopover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn hide_popover(this: &HtmlElement) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLElement" , js_name = showPopover)] + #[doc = "The `showPopover()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/showPopover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn show_popover(this: &HtmlElement) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLElement" , js_name = togglePopover)] + #[doc = "The `togglePopover()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/togglePopover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn toggle_popover(this: &HtmlElement) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLElement" , js_name = togglePopover)] + #[doc = "The `togglePopover()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/togglePopover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`*"] + pub fn toggle_popover_with_force(this: &HtmlElement, force: bool) -> Result; } diff --git a/crates/web-sys/src/features/gen_HtmlEmbedElement.rs b/crates/web-sys/src/features/gen_HtmlEmbedElement.rs index 704b7d1257c..805ae985df3 100644 --- a/crates/web-sys/src/features/gen_HtmlEmbedElement.rs +++ b/crates/web-sys/src/features/gen_HtmlEmbedElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlEmbedElement`*"] - pub fn src(this: &HtmlEmbedElement) -> String; + pub fn src(this: &HtmlEmbedElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLEmbedElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlEmbedElement`*"] - pub fn type_(this: &HtmlEmbedElement) -> String; + pub fn type_(this: &HtmlEmbedElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLEmbedElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement/width)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlEmbedElement`*"] - pub fn width(this: &HtmlEmbedElement) -> String; + pub fn width(this: &HtmlEmbedElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLEmbedElement" , js_name = width)] #[doc = "Setter for the `width` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement/height)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlEmbedElement`*"] - pub fn height(this: &HtmlEmbedElement) -> String; + pub fn height(this: &HtmlEmbedElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLEmbedElement" , js_name = height)] #[doc = "Setter for the `height` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlEmbedElement`*"] - pub fn align(this: &HtmlEmbedElement) -> String; + pub fn align(this: &HtmlEmbedElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLEmbedElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlEmbedElement`*"] - pub fn name(this: &HtmlEmbedElement) -> String; + pub fn name(this: &HtmlEmbedElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLEmbedElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlFieldSetElement.rs b/crates/web-sys/src/features/gen_HtmlFieldSetElement.rs index 8c32c017118..79f533b6f49 100644 --- a/crates/web-sys/src/features/gen_HtmlFieldSetElement.rs +++ b/crates/web-sys/src/features/gen_HtmlFieldSetElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -39,7 +40,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFieldSetElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFieldSetElement`*"] - pub fn name(this: &HtmlFieldSetElement) -> String; + pub fn name(this: &HtmlFieldSetElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFieldSetElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -53,7 +54,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFieldSetElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFieldSetElement`*"] - pub fn type_(this: &HtmlFieldSetElement) -> String; + pub fn type_(this: &HtmlFieldSetElement) -> ::alloc::string::String; #[cfg(feature = "HtmlCollection")] # [wasm_bindgen (structural , method , getter , js_class = "HTMLFieldSetElement" , js_name = elements)] #[doc = "Getter for the `elements` field of this object."] @@ -83,7 +84,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFieldSetElement/validationMessage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFieldSetElement`*"] - pub fn validation_message(this: &HtmlFieldSetElement) -> Result; + pub fn validation_message( + this: &HtmlFieldSetElement, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (method , structural , js_class = "HTMLFieldSetElement" , js_name = checkValidity)] #[doc = "The `checkValidity()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlFontElement.rs b/crates/web-sys/src/features/gen_HtmlFontElement.rs index d12ce40cceb..40f4a144ec2 100644 --- a/crates/web-sys/src/features/gen_HtmlFontElement.rs +++ b/crates/web-sys/src/features/gen_HtmlFontElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFontElement/color)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFontElement`*"] - pub fn color(this: &HtmlFontElement) -> String; + pub fn color(this: &HtmlFontElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFontElement" , js_name = color)] #[doc = "Setter for the `color` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFontElement/face)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFontElement`*"] - pub fn face(this: &HtmlFontElement) -> String; + pub fn face(this: &HtmlFontElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFontElement" , js_name = face)] #[doc = "Setter for the `face` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFontElement/size)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFontElement`*"] - pub fn size(this: &HtmlFontElement) -> String; + pub fn size(this: &HtmlFontElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFontElement" , js_name = size)] #[doc = "Setter for the `size` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlFormControlsCollection.rs b/crates/web-sys/src/features/gen_HtmlFormControlsCollection.rs index 1972cc54b0f..2f488ddfe41 100644 --- a/crates/web-sys/src/features/gen_HtmlFormControlsCollection.rs +++ b/crates/web-sys/src/features/gen_HtmlFormControlsCollection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { js_class = "HTMLFormControlsCollection", indexing_getter )] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlFormElement.rs b/crates/web-sys/src/features/gen_HtmlFormElement.rs index 0b8e49735ab..9b3b03f4ea3 100644 --- a/crates/web-sys/src/features/gen_HtmlFormElement.rs +++ b/crates/web-sys/src/features/gen_HtmlFormElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/acceptCharset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] - pub fn accept_charset(this: &HtmlFormElement) -> String; + pub fn accept_charset(this: &HtmlFormElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFormElement" , js_name = acceptCharset)] #[doc = "Setter for the `acceptCharset` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/action)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] - pub fn action(this: &HtmlFormElement) -> String; + pub fn action(this: &HtmlFormElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFormElement" , js_name = action)] #[doc = "Setter for the `action` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/autocomplete)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] - pub fn autocomplete(this: &HtmlFormElement) -> String; + pub fn autocomplete(this: &HtmlFormElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFormElement" , js_name = autocomplete)] #[doc = "Setter for the `autocomplete` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/enctype)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] - pub fn enctype(this: &HtmlFormElement) -> String; + pub fn enctype(this: &HtmlFormElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFormElement" , js_name = enctype)] #[doc = "Setter for the `enctype` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/encoding)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] - pub fn encoding(this: &HtmlFormElement) -> String; + pub fn encoding(this: &HtmlFormElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFormElement" , js_name = encoding)] #[doc = "Setter for the `encoding` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/method)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] - pub fn method(this: &HtmlFormElement) -> String; + pub fn method(this: &HtmlFormElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFormElement" , js_name = method)] #[doc = "Setter for the `method` field of this object."] #[doc = ""] @@ -101,7 +102,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] - pub fn name(this: &HtmlFormElement) -> String; + pub fn name(this: &HtmlFormElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFormElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -129,7 +130,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/target)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] - pub fn target(this: &HtmlFormElement) -> String; + pub fn target(this: &HtmlFormElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFormElement" , js_name = target)] #[doc = "Setter for the `target` field of this object."] #[doc = ""] @@ -166,6 +167,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] pub fn report_validity(this: &HtmlFormElement) -> bool; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLFormElement" , js_name = requestSubmit)] + #[doc = "The `requestSubmit()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] + pub fn request_submit(this: &HtmlFormElement) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLFormElement" , js_name = requestSubmit)] + #[doc = "The `requestSubmit()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] + pub fn request_submit_with_submitter( + this: &HtmlFormElement, + submitter: Option<&HtmlElement>, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "HTMLFormElement" , js_name = reset)] #[doc = "The `reset()` method."] #[doc = ""] @@ -181,14 +199,14 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] pub fn submit(this: &HtmlFormElement) -> Result<(), JsValue>; #[wasm_bindgen(method, structural, js_class = "HTMLFormElement", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] pub fn get_with_index(this: &HtmlFormElement, index: u32) -> Option; #[wasm_bindgen(method, structural, js_class = "HTMLFormElement", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlFrameElement.rs b/crates/web-sys/src/features/gen_HtmlFrameElement.rs index 6f7b5afc430..3bb1c2e8f79 100644 --- a/crates/web-sys/src/features/gen_HtmlFrameElement.rs +++ b/crates/web-sys/src/features/gen_HtmlFrameElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameElement`*"] - pub fn name(this: &HtmlFrameElement) -> String; + pub fn name(this: &HtmlFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameElement/scrolling)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameElement`*"] - pub fn scrolling(this: &HtmlFrameElement) -> String; + pub fn scrolling(this: &HtmlFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameElement" , js_name = scrolling)] #[doc = "Setter for the `scrolling` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameElement`*"] - pub fn src(this: &HtmlFrameElement) -> String; + pub fn src(this: &HtmlFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameElement/frameBorder)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameElement`*"] - pub fn frame_border(this: &HtmlFrameElement) -> String; + pub fn frame_border(this: &HtmlFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameElement" , js_name = frameBorder)] #[doc = "Setter for the `frameBorder` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameElement/longDesc)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameElement`*"] - pub fn long_desc(this: &HtmlFrameElement) -> String; + pub fn long_desc(this: &HtmlFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameElement" , js_name = longDesc)] #[doc = "Setter for the `longDesc` field of this object."] #[doc = ""] @@ -117,7 +118,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameElement/marginHeight)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameElement`*"] - pub fn margin_height(this: &HtmlFrameElement) -> String; + pub fn margin_height(this: &HtmlFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameElement" , js_name = marginHeight)] #[doc = "Setter for the `marginHeight` field of this object."] #[doc = ""] @@ -131,7 +132,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameElement/marginWidth)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameElement`*"] - pub fn margin_width(this: &HtmlFrameElement) -> String; + pub fn margin_width(this: &HtmlFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameElement" , js_name = marginWidth)] #[doc = "Setter for the `marginWidth` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlFrameSetElement.rs b/crates/web-sys/src/features/gen_HtmlFrameSetElement.rs index eeda63cfabb..72a89f3d1ce 100644 --- a/crates/web-sys/src/features/gen_HtmlFrameSetElement.rs +++ b/crates/web-sys/src/features/gen_HtmlFrameSetElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameSetElement/cols)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameSetElement`*"] - pub fn cols(this: &HtmlFrameSetElement) -> String; + pub fn cols(this: &HtmlFrameSetElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameSetElement" , js_name = cols)] #[doc = "Setter for the `cols` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameSetElement/rows)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameSetElement`*"] - pub fn rows(this: &HtmlFrameSetElement) -> String; + pub fn rows(this: &HtmlFrameSetElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameSetElement" , js_name = rows)] #[doc = "Setter for the `rows` field of this object."] #[doc = ""] @@ -235,4 +236,51 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFrameSetElement`*"] pub fn set_onunload(this: &HtmlFrameSetElement, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "HTMLFrameSetElement" , js_name = ongamepadconnected)] + #[doc = "Getter for the `ongamepadconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameSetElement/ongamepadconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFrameSetElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ongamepadconnected(this: &HtmlFrameSetElement) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameSetElement" , js_name = ongamepadconnected)] + #[doc = "Setter for the `ongamepadconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameSetElement/ongamepadconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFrameSetElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ongamepadconnected(this: &HtmlFrameSetElement, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "HTMLFrameSetElement" , js_name = ongamepaddisconnected)] + #[doc = "Getter for the `ongamepaddisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameSetElement/ongamepaddisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFrameSetElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ongamepaddisconnected(this: &HtmlFrameSetElement) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "HTMLFrameSetElement" , js_name = ongamepaddisconnected)] + #[doc = "Setter for the `ongamepaddisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameSetElement/ongamepaddisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFrameSetElement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ongamepaddisconnected( + this: &HtmlFrameSetElement, + value: Option<&::js_sys::Function>, + ); } diff --git a/crates/web-sys/src/features/gen_HtmlHeadElement.rs b/crates/web-sys/src/features/gen_HtmlHeadElement.rs index 23fbca796fb..c0557b06197 100644 --- a/crates/web-sys/src/features/gen_HtmlHeadElement.rs +++ b/crates/web-sys/src/features/gen_HtmlHeadElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlHeadingElement.rs b/crates/web-sys/src/features/gen_HtmlHeadingElement.rs index 0819e7dd80e..7bf7f08dc3e 100644 --- a/crates/web-sys/src/features/gen_HtmlHeadingElement.rs +++ b/crates/web-sys/src/features/gen_HtmlHeadingElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHeadingElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlHeadingElement`*"] - pub fn align(this: &HtmlHeadingElement) -> String; + pub fn align(this: &HtmlHeadingElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLHeadingElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlHrElement.rs b/crates/web-sys/src/features/gen_HtmlHrElement.rs index 90b7b9b3523..9eb61fd2f95 100644 --- a/crates/web-sys/src/features/gen_HtmlHrElement.rs +++ b/crates/web-sys/src/features/gen_HtmlHrElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHRElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlHrElement`*"] - pub fn align(this: &HtmlHrElement) -> String; + pub fn align(this: &HtmlHrElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLHRElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHRElement/color)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlHrElement`*"] - pub fn color(this: &HtmlHrElement) -> String; + pub fn color(this: &HtmlHrElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLHRElement" , js_name = color)] #[doc = "Setter for the `color` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHRElement/size)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlHrElement`*"] - pub fn size(this: &HtmlHrElement) -> String; + pub fn size(this: &HtmlHrElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLHRElement" , js_name = size)] #[doc = "Setter for the `size` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHRElement/width)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlHrElement`*"] - pub fn width(this: &HtmlHrElement) -> String; + pub fn width(this: &HtmlHrElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLHRElement" , js_name = width)] #[doc = "Setter for the `width` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlHtmlElement.rs b/crates/web-sys/src/features/gen_HtmlHtmlElement.rs index f3f8c63e35d..9cb7b3a5111 100644 --- a/crates/web-sys/src/features/gen_HtmlHtmlElement.rs +++ b/crates/web-sys/src/features/gen_HtmlHtmlElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHtmlElement/version)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlHtmlElement`*"] - pub fn version(this: &HtmlHtmlElement) -> String; + pub fn version(this: &HtmlHtmlElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLHtmlElement" , js_name = version)] #[doc = "Setter for the `version` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlIFrameElement.rs b/crates/web-sys/src/features/gen_HtmlIFrameElement.rs index 5a284529311..ff4a1c8122e 100644 --- a/crates/web-sys/src/features/gen_HtmlIFrameElement.rs +++ b/crates/web-sys/src/features/gen_HtmlIFrameElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn src(this: &HtmlIFrameElement) -> String; + pub fn src(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/srcdoc)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn srcdoc(this: &HtmlIFrameElement) -> String; + pub fn srcdoc(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = srcdoc)] #[doc = "Setter for the `srcdoc` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn name(this: &HtmlIFrameElement) -> String; + pub fn name(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -95,7 +96,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/width)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn width(this: &HtmlIFrameElement) -> String; + pub fn width(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = width)] #[doc = "Setter for the `width` field of this object."] #[doc = ""] @@ -109,7 +110,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/height)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn height(this: &HtmlIFrameElement) -> String; + pub fn height(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = height)] #[doc = "Setter for the `height` field of this object."] #[doc = ""] @@ -123,7 +124,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn referrer_policy(this: &HtmlIFrameElement) -> String; + pub fn referrer_policy(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = referrerPolicy)] #[doc = "Setter for the `referrerPolicy` field of this object."] #[doc = ""] @@ -153,7 +154,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn align(this: &HtmlIFrameElement) -> String; + pub fn align(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -167,7 +168,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/scrolling)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn scrolling(this: &HtmlIFrameElement) -> String; + pub fn scrolling(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = scrolling)] #[doc = "Setter for the `scrolling` field of this object."] #[doc = ""] @@ -181,7 +182,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/frameBorder)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn frame_border(this: &HtmlIFrameElement) -> String; + pub fn frame_border(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = frameBorder)] #[doc = "Setter for the `frameBorder` field of this object."] #[doc = ""] @@ -195,7 +196,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/longDesc)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn long_desc(this: &HtmlIFrameElement) -> String; + pub fn long_desc(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = longDesc)] #[doc = "Setter for the `longDesc` field of this object."] #[doc = ""] @@ -209,7 +210,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/marginHeight)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn margin_height(this: &HtmlIFrameElement) -> String; + pub fn margin_height(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = marginHeight)] #[doc = "Setter for the `marginHeight` field of this object."] #[doc = ""] @@ -223,7 +224,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/marginWidth)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlIFrameElement`*"] - pub fn margin_width(this: &HtmlIFrameElement) -> String; + pub fn margin_width(this: &HtmlIFrameElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLIFrameElement" , js_name = marginWidth)] #[doc = "Setter for the `marginWidth` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlImageElement.rs b/crates/web-sys/src/features/gen_HtmlImageElement.rs index 692dc64b63b..4ac489fd9a6 100644 --- a/crates/web-sys/src/features/gen_HtmlImageElement.rs +++ b/crates/web-sys/src/features/gen_HtmlImageElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn alt(this: &HtmlImageElement) -> String; + pub fn alt(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = alt)] #[doc = "Setter for the `alt` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn src(this: &HtmlImageElement) -> String; + pub fn src(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn srcset(this: &HtmlImageElement) -> String; + pub fn srcset(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = srcset)] #[doc = "Setter for the `srcset` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn cross_origin(this: &HtmlImageElement) -> Option; + pub fn cross_origin(this: &HtmlImageElement) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = crossOrigin)] #[doc = "Setter for the `crossOrigin` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/useMap)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn use_map(this: &HtmlImageElement) -> String; + pub fn use_map(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = useMap)] #[doc = "Setter for the `useMap` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn referrer_policy(this: &HtmlImageElement) -> String; + pub fn referrer_policy(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = referrerPolicy)] #[doc = "Setter for the `referrerPolicy` field of this object."] #[doc = ""] @@ -143,7 +144,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn decoding(this: &HtmlImageElement) -> String; + pub fn decoding(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = decoding)] #[doc = "Setter for the `decoding` field of this object."] #[doc = ""] @@ -178,7 +179,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn name(this: &HtmlImageElement) -> String; + pub fn name(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -192,7 +193,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn align(this: &HtmlImageElement) -> String; + pub fn align(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -234,7 +235,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/longDesc)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn long_desc(this: &HtmlImageElement) -> String; + pub fn long_desc(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = longDesc)] #[doc = "Setter for the `longDesc` field of this object."] #[doc = ""] @@ -248,7 +249,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/border)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn border(this: &HtmlImageElement) -> String; + pub fn border(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = border)] #[doc = "Setter for the `border` field of this object."] #[doc = ""] @@ -262,7 +263,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn sizes(this: &HtmlImageElement) -> String; + pub fn sizes(this: &HtmlImageElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLImageElement" , js_name = sizes)] #[doc = "Setter for the `sizes` field of this object."] #[doc = ""] @@ -276,7 +277,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/currentSrc)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`*"] - pub fn current_src(this: &HtmlImageElement) -> String; + pub fn current_src(this: &HtmlImageElement) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "Image")] #[doc = "The `new HtmlImageElement(..)` constructor, creating a new instance of `HtmlImageElement`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlInputElement.rs b/crates/web-sys/src/features/gen_HtmlInputElement.rs index 4c51bf220a6..8d250cac379 100644 --- a/crates/web-sys/src/features/gen_HtmlInputElement.rs +++ b/crates/web-sys/src/features/gen_HtmlInputElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/accept)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn accept(this: &HtmlInputElement) -> String; + pub fn accept(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = accept)] #[doc = "Setter for the `accept` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/alt)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn alt(this: &HtmlInputElement) -> String; + pub fn alt(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = alt)] #[doc = "Setter for the `alt` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/autocomplete)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn autocomplete(this: &HtmlInputElement) -> String; + pub fn autocomplete(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = autocomplete)] #[doc = "Setter for the `autocomplete` field of this object."] #[doc = ""] @@ -59,6 +60,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/autofocus)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] + #[deprecated( + note = "Use `HtmlElement::autofocus()` or `HtmlElement::set_autofocus()` instead." + )] pub fn autofocus(this: &HtmlInputElement) -> bool; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = autofocus)] #[doc = "Setter for the `autofocus` field of this object."] @@ -66,6 +70,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/autofocus)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] + #[deprecated( + note = "Use `HtmlElement::autofocus()` or `HtmlElement::set_autofocus()` instead." + )] pub fn set_autofocus(this: &HtmlInputElement, value: bool); # [wasm_bindgen (structural , method , getter , js_class = "HTMLInputElement" , js_name = defaultChecked)] #[doc = "Getter for the `defaultChecked` field of this object."] @@ -139,7 +146,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/formAction)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn form_action(this: &HtmlInputElement) -> String; + pub fn form_action(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = formAction)] #[doc = "Setter for the `formAction` field of this object."] #[doc = ""] @@ -153,7 +160,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/formEnctype)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn form_enctype(this: &HtmlInputElement) -> String; + pub fn form_enctype(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = formEnctype)] #[doc = "Setter for the `formEnctype` field of this object."] #[doc = ""] @@ -167,7 +174,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/formMethod)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn form_method(this: &HtmlInputElement) -> String; + pub fn form_method(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = formMethod)] #[doc = "Setter for the `formMethod` field of this object."] #[doc = ""] @@ -195,7 +202,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/formTarget)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn form_target(this: &HtmlInputElement) -> String; + pub fn form_target(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = formTarget)] #[doc = "Setter for the `formTarget` field of this object."] #[doc = ""] @@ -237,7 +244,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/inputMode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn input_mode(this: &HtmlInputElement) -> String; + pub fn input_mode(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = inputMode)] #[doc = "Setter for the `inputMode` field of this object."] #[doc = ""] @@ -258,7 +265,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/max)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn max(this: &HtmlInputElement) -> String; + pub fn max(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = max)] #[doc = "Setter for the `max` field of this object."] #[doc = ""] @@ -286,7 +293,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/min)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn min(this: &HtmlInputElement) -> String; + pub fn min(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = min)] #[doc = "Setter for the `min` field of this object."] #[doc = ""] @@ -328,7 +335,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn name(this: &HtmlInputElement) -> String; + pub fn name(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -342,7 +349,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/pattern)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn pattern(this: &HtmlInputElement) -> String; + pub fn pattern(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = pattern)] #[doc = "Setter for the `pattern` field of this object."] #[doc = ""] @@ -356,7 +363,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/placeholder)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn placeholder(this: &HtmlInputElement) -> String; + pub fn placeholder(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = placeholder)] #[doc = "Setter for the `placeholder` field of this object."] #[doc = ""] @@ -412,7 +419,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn src(this: &HtmlInputElement) -> String; + pub fn src(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -426,7 +433,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/step)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn step(this: &HtmlInputElement) -> String; + pub fn step(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = step)] #[doc = "Setter for the `step` field of this object."] #[doc = ""] @@ -440,7 +447,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn type_(this: &HtmlInputElement) -> String; + pub fn type_(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -454,7 +461,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/defaultValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn default_value(this: &HtmlInputElement) -> String; + pub fn default_value(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = defaultValue)] #[doc = "Setter for the `defaultValue` field of this object."] #[doc = ""] @@ -468,7 +475,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn value(this: &HtmlInputElement) -> String; + pub fn value(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -525,7 +532,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/validationMessage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn validation_message(this: &HtmlInputElement) -> Result; + pub fn validation_message(this: &HtmlInputElement) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "NodeList")] # [wasm_bindgen (structural , method , getter , js_class = "HTMLInputElement" , js_name = labels)] #[doc = "Getter for the `labels` field of this object."] @@ -568,7 +575,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/selectionDirection)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn selection_direction(this: &HtmlInputElement) -> Result, JsValue>; + pub fn selection_direction( + this: &HtmlInputElement, + ) -> Result, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLInputElement" , js_name = selectionDirection)] #[doc = "Setter for the `selectionDirection` field of this object."] #[doc = ""] @@ -585,7 +594,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn align(this: &HtmlInputElement) -> String; + pub fn align(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -599,7 +608,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/useMap)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] - pub fn use_map(this: &HtmlInputElement) -> String; + pub fn use_map(this: &HtmlInputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = useMap)] #[doc = "Setter for the `useMap` field of this object."] #[doc = ""] @@ -628,6 +637,34 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] pub fn set_webkitdirectory(this: &HtmlInputElement, value: bool); + # [wasm_bindgen (structural , method , getter , js_class = "HTMLInputElement" , js_name = popoverTargetElement)] + #[doc = "Getter for the `popoverTargetElement` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetElement)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] + pub fn popover_target_element(this: &HtmlInputElement) -> Option; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = popoverTargetElement)] + #[doc = "Setter for the `popoverTargetElement` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetElement)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] + pub fn set_popover_target_element(this: &HtmlInputElement, value: Option<&Element>); + # [wasm_bindgen (structural , method , getter , js_class = "HTMLInputElement" , js_name = popoverTargetAction)] + #[doc = "Getter for the `popoverTargetAction` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetAction)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] + pub fn popover_target_action(this: &HtmlInputElement) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLInputElement" , js_name = popoverTargetAction)] + #[doc = "Setter for the `popoverTargetAction` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetAction)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] + pub fn set_popover_target_action(this: &HtmlInputElement, value: &str); # [wasm_bindgen (method , structural , js_class = "HTMLInputElement" , js_name = checkValidity)] #[doc = "The `checkValidity()` method."] #[doc = ""] @@ -675,6 +712,20 @@ extern "C" { start: u32, end: u32, ) -> Result<(), JsValue>; + #[cfg(feature = "SelectionMode")] + # [wasm_bindgen (catch , method , structural , js_class = "HTMLInputElement" , js_name = setRangeText)] + #[doc = "The `setRangeText()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setRangeText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`, `SelectionMode`*"] + pub fn set_range_text_with_start_and_end_and_selection_mode( + this: &HtmlInputElement, + replacement: &str, + start: u32, + end: u32, + selection_mode: SelectionMode, + ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "HTMLInputElement" , js_name = setSelectionRange)] #[doc = "The `setSelectionRange()` method."] #[doc = ""] @@ -698,4 +749,11 @@ extern "C" { end: u32, direction: &str, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLInputElement" , js_name = showPicker)] + #[doc = "The `showPicker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/showPicker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlInputElement`*"] + pub fn show_picker(this: &HtmlInputElement) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_HtmlLabelElement.rs b/crates/web-sys/src/features/gen_HtmlLabelElement.rs index 184ce648f6d..1c0bb33d08b 100644 --- a/crates/web-sys/src/features/gen_HtmlLabelElement.rs +++ b/crates/web-sys/src/features/gen_HtmlLabelElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/htmlFor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLabelElement`*"] - pub fn html_for(this: &HtmlLabelElement) -> String; + pub fn html_for(this: &HtmlLabelElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLabelElement" , js_name = htmlFor)] #[doc = "Setter for the `htmlFor` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlLegendElement.rs b/crates/web-sys/src/features/gen_HtmlLegendElement.rs index 36ce3bda001..d2fb9fede5a 100644 --- a/crates/web-sys/src/features/gen_HtmlLegendElement.rs +++ b/crates/web-sys/src/features/gen_HtmlLegendElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLegendElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLegendElement`*"] - pub fn align(this: &HtmlLegendElement) -> String; + pub fn align(this: &HtmlLegendElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLegendElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlLiElement.rs b/crates/web-sys/src/features/gen_HtmlLiElement.rs index 3a5db06c89d..dc41b1ddc8b 100644 --- a/crates/web-sys/src/features/gen_HtmlLiElement.rs +++ b/crates/web-sys/src/features/gen_HtmlLiElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLIElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLiElement`*"] - pub fn type_(this: &HtmlLiElement) -> String; + pub fn type_(this: &HtmlLiElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLIElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlLinkElement.rs b/crates/web-sys/src/features/gen_HtmlLinkElement.rs index c947f16c059..da121ef8b53 100644 --- a/crates/web-sys/src/features/gen_HtmlLinkElement.rs +++ b/crates/web-sys/src/features/gen_HtmlLinkElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn href(this: &HtmlLinkElement) -> String; + pub fn href(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = href)] #[doc = "Setter for the `href` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/crossOrigin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn cross_origin(this: &HtmlLinkElement) -> Option; + pub fn cross_origin(this: &HtmlLinkElement) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = crossOrigin)] #[doc = "Setter for the `crossOrigin` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn rel(this: &HtmlLinkElement) -> String; + pub fn rel(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = rel)] #[doc = "Setter for the `rel` field of this object."] #[doc = ""] @@ -81,7 +82,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/media)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn media(this: &HtmlLinkElement) -> String; + pub fn media(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = media)] #[doc = "Setter for the `media` field of this object."] #[doc = ""] @@ -95,7 +96,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/hreflang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn hreflang(this: &HtmlLinkElement) -> String; + pub fn hreflang(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = hreflang)] #[doc = "Setter for the `hreflang` field of this object."] #[doc = ""] @@ -109,7 +110,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn type_(this: &HtmlLinkElement) -> String; + pub fn type_(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -123,7 +124,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/referrerPolicy)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn referrer_policy(this: &HtmlLinkElement) -> String; + pub fn referrer_policy(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = referrerPolicy)] #[doc = "Setter for the `referrerPolicy` field of this object."] #[doc = ""] @@ -145,7 +146,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/charset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn charset(this: &HtmlLinkElement) -> String; + pub fn charset(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = charset)] #[doc = "Setter for the `charset` field of this object."] #[doc = ""] @@ -159,7 +160,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rev)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn rev(this: &HtmlLinkElement) -> String; + pub fn rev(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = rev)] #[doc = "Setter for the `rev` field of this object."] #[doc = ""] @@ -173,7 +174,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/target)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn target(this: &HtmlLinkElement) -> String; + pub fn target(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = target)] #[doc = "Setter for the `target` field of this object."] #[doc = ""] @@ -187,7 +188,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/integrity)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn integrity(this: &HtmlLinkElement) -> String; + pub fn integrity(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = integrity)] #[doc = "Setter for the `integrity` field of this object."] #[doc = ""] @@ -201,7 +202,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/as)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlLinkElement`*"] - pub fn as_(this: &HtmlLinkElement) -> String; + pub fn as_(this: &HtmlLinkElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLLinkElement" , js_name = as)] #[doc = "Setter for the `as` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlMapElement.rs b/crates/web-sys/src/features/gen_HtmlMapElement.rs index f7dcc17ce47..ce5b76b0a92 100644 --- a/crates/web-sys/src/features/gen_HtmlMapElement.rs +++ b/crates/web-sys/src/features/gen_HtmlMapElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMapElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMapElement`*"] - pub fn name(this: &HtmlMapElement) -> String; + pub fn name(this: &HtmlMapElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMapElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlMediaElement.rs b/crates/web-sys/src/features/gen_HtmlMediaElement.rs index 8fba170edf2..c4558a13a48 100644 --- a/crates/web-sys/src/features/gen_HtmlMediaElement.rs +++ b/crates/web-sys/src/features/gen_HtmlMediaElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`*"] - pub fn src(this: &HtmlMediaElement) -> String; + pub fn src(this: &HtmlMediaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMediaElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -39,7 +40,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentSrc)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`*"] - pub fn current_src(this: &HtmlMediaElement) -> String; + pub fn current_src(this: &HtmlMediaElement) -> ::alloc::string::String; #[cfg(feature = "MediaStream")] # [wasm_bindgen (structural , method , getter , js_class = "HTMLMediaElement" , js_name = srcObject)] #[doc = "Getter for the `srcObject` field of this object."] @@ -62,7 +63,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/crossOrigin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`*"] - pub fn cross_origin(this: &HtmlMediaElement) -> Option; + pub fn cross_origin(this: &HtmlMediaElement) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMediaElement" , js_name = crossOrigin)] #[doc = "Setter for the `crossOrigin` field of this object."] #[doc = ""] @@ -83,7 +84,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/preload)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`*"] - pub fn preload(this: &HtmlMediaElement) -> String; + pub fn preload(this: &HtmlMediaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMediaElement" , js_name = preload)] #[doc = "Setter for the `preload` field of this object."] #[doc = ""] @@ -375,7 +376,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`*"] - pub fn can_play_type(this: &HtmlMediaElement, type_: &str) -> String; + pub fn can_play_type(this: &HtmlMediaElement, type_: &str) -> ::alloc::string::String; # [wasm_bindgen (catch , method , structural , js_class = "HTMLMediaElement" , js_name = fastSeek)] #[doc = "The `fastSeek()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlMenuElement.rs b/crates/web-sys/src/features/gen_HtmlMenuElement.rs index a271be1fa99..983feb8c13c 100644 --- a/crates/web-sys/src/features/gen_HtmlMenuElement.rs +++ b/crates/web-sys/src/features/gen_HtmlMenuElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuElement`*"] - pub fn type_(this: &HtmlMenuElement) -> String; + pub fn type_(this: &HtmlMenuElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuElement/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuElement`*"] - pub fn label(this: &HtmlMenuElement) -> String; + pub fn label(this: &HtmlMenuElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuElement" , js_name = label)] #[doc = "Setter for the `label` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlMenuItemElement.rs b/crates/web-sys/src/features/gen_HtmlMenuItemElement.rs index 87a7753745d..6f98ed6b2e7 100644 --- a/crates/web-sys/src/features/gen_HtmlMenuItemElement.rs +++ b/crates/web-sys/src/features/gen_HtmlMenuItemElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -10,6 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub type HtmlMenuItemElement; # [wasm_bindgen (structural , method , getter , js_class = "HTMLMenuItemElement" , js_name = type)] #[doc = "Getter for the `type` field of this object."] @@ -17,13 +19,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] - pub fn type_(this: &HtmlMenuItemElement) -> String; + #[deprecated(note = "Absent in all major browsers")] + pub fn type_(this: &HtmlMenuItemElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuItemElement" , 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/HTMLMenuItemElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn set_type(this: &HtmlMenuItemElement, value: &str); # [wasm_bindgen (structural , method , getter , js_class = "HTMLMenuItemElement" , js_name = label)] #[doc = "Getter for the `label` field of this object."] @@ -31,13 +35,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] - pub fn label(this: &HtmlMenuItemElement) -> String; + #[deprecated(note = "Absent in all major browsers")] + pub fn label(this: &HtmlMenuItemElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuItemElement" , js_name = label)] #[doc = "Setter for the `label` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn set_label(this: &HtmlMenuItemElement, value: &str); # [wasm_bindgen (structural , method , getter , js_class = "HTMLMenuItemElement" , js_name = icon)] #[doc = "Getter for the `icon` field of this object."] @@ -45,13 +51,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/icon)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] - pub fn icon(this: &HtmlMenuItemElement) -> String; + #[deprecated(note = "Absent in all major browsers")] + pub fn icon(this: &HtmlMenuItemElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuItemElement" , js_name = icon)] #[doc = "Setter for the `icon` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/icon)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn set_icon(this: &HtmlMenuItemElement, value: &str); # [wasm_bindgen (structural , method , getter , js_class = "HTMLMenuItemElement" , js_name = disabled)] #[doc = "Getter for the `disabled` field of this object."] @@ -59,6 +67,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/disabled)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn disabled(this: &HtmlMenuItemElement) -> bool; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuItemElement" , js_name = disabled)] #[doc = "Setter for the `disabled` field of this object."] @@ -66,6 +75,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/disabled)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn set_disabled(this: &HtmlMenuItemElement, value: bool); # [wasm_bindgen (structural , method , getter , js_class = "HTMLMenuItemElement" , js_name = checked)] #[doc = "Getter for the `checked` field of this object."] @@ -73,6 +83,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/checked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn checked(this: &HtmlMenuItemElement) -> bool; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuItemElement" , js_name = checked)] #[doc = "Setter for the `checked` field of this object."] @@ -80,6 +91,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/checked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn set_checked(this: &HtmlMenuItemElement, value: bool); # [wasm_bindgen (structural , method , getter , js_class = "HTMLMenuItemElement" , js_name = radiogroup)] #[doc = "Getter for the `radiogroup` field of this object."] @@ -87,13 +99,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/radiogroup)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] - pub fn radiogroup(this: &HtmlMenuItemElement) -> String; + #[deprecated(note = "Absent in all major browsers")] + pub fn radiogroup(this: &HtmlMenuItemElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuItemElement" , js_name = radiogroup)] #[doc = "Setter for the `radiogroup` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/radiogroup)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn set_radiogroup(this: &HtmlMenuItemElement, value: &str); # [wasm_bindgen (structural , method , getter , js_class = "HTMLMenuItemElement" , js_name = defaultChecked)] #[doc = "Getter for the `defaultChecked` field of this object."] @@ -101,6 +115,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/defaultChecked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn default_checked(this: &HtmlMenuItemElement) -> bool; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMenuItemElement" , js_name = defaultChecked)] #[doc = "Setter for the `defaultChecked` field of this object."] @@ -108,5 +123,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuItemElement/defaultChecked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMenuItemElement`*"] + #[deprecated(note = "Absent in all major browsers")] pub fn set_default_checked(this: &HtmlMenuItemElement, value: bool); } diff --git a/crates/web-sys/src/features/gen_HtmlMetaElement.rs b/crates/web-sys/src/features/gen_HtmlMetaElement.rs index 5a1d570ea1d..d11561d4ea9 100644 --- a/crates/web-sys/src/features/gen_HtmlMetaElement.rs +++ b/crates/web-sys/src/features/gen_HtmlMetaElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMetaElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMetaElement`*"] - pub fn name(this: &HtmlMetaElement) -> String; + pub fn name(this: &HtmlMetaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMetaElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMetaElement/httpEquiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMetaElement`*"] - pub fn http_equiv(this: &HtmlMetaElement) -> String; + pub fn http_equiv(this: &HtmlMetaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMetaElement" , js_name = httpEquiv)] #[doc = "Setter for the `httpEquiv` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMetaElement/content)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMetaElement`*"] - pub fn content(this: &HtmlMetaElement) -> String; + pub fn content(this: &HtmlMetaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMetaElement" , js_name = content)] #[doc = "Setter for the `content` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMetaElement/scheme)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlMetaElement`*"] - pub fn scheme(this: &HtmlMetaElement) -> String; + pub fn scheme(this: &HtmlMetaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLMetaElement" , js_name = scheme)] #[doc = "Setter for the `scheme` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlMeterElement.rs b/crates/web-sys/src/features/gen_HtmlMeterElement.rs index 99724563621..0ec35cce9cd 100644 --- a/crates/web-sys/src/features/gen_HtmlMeterElement.rs +++ b/crates/web-sys/src/features/gen_HtmlMeterElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlModElement.rs b/crates/web-sys/src/features/gen_HtmlModElement.rs index 7ce1087a24b..07de5ebb2ca 100644 --- a/crates/web-sys/src/features/gen_HtmlModElement.rs +++ b/crates/web-sys/src/features/gen_HtmlModElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLModElement/cite)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlModElement`*"] - pub fn cite(this: &HtmlModElement) -> String; + pub fn cite(this: &HtmlModElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLModElement" , js_name = cite)] #[doc = "Setter for the `cite` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLModElement/dateTime)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlModElement`*"] - pub fn date_time(this: &HtmlModElement) -> String; + pub fn date_time(this: &HtmlModElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLModElement" , js_name = dateTime)] #[doc = "Setter for the `dateTime` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlOListElement.rs b/crates/web-sys/src/features/gen_HtmlOListElement.rs index d57eb9a3578..a4c50da984e 100644 --- a/crates/web-sys/src/features/gen_HtmlOListElement.rs +++ b/crates/web-sys/src/features/gen_HtmlOListElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOListElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOListElement`*"] - pub fn type_(this: &HtmlOListElement) -> String; + pub fn type_(this: &HtmlOListElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLOListElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlObjectElement.rs b/crates/web-sys/src/features/gen_HtmlObjectElement.rs index 8ef2219a708..1f14bea4bed 100644 --- a/crates/web-sys/src/features/gen_HtmlObjectElement.rs +++ b/crates/web-sys/src/features/gen_HtmlObjectElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/data)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn data(this: &HtmlObjectElement) -> String; + pub fn data(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = data)] #[doc = "Setter for the `data` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn type_(this: &HtmlObjectElement) -> String; + pub fn type_(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn name(this: &HtmlObjectElement) -> String; + pub fn name(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/useMap)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn use_map(this: &HtmlObjectElement) -> String; + pub fn use_map(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = useMap)] #[doc = "Setter for the `useMap` field of this object."] #[doc = ""] @@ -95,7 +96,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/width)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn width(this: &HtmlObjectElement) -> String; + pub fn width(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = width)] #[doc = "Setter for the `width` field of this object."] #[doc = ""] @@ -109,7 +110,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/height)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn height(this: &HtmlObjectElement) -> String; + pub fn height(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = height)] #[doc = "Setter for the `height` field of this object."] #[doc = ""] @@ -154,14 +155,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validationMessage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn validation_message(this: &HtmlObjectElement) -> Result; + pub fn validation_message(this: &HtmlObjectElement) + -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "HTMLObjectElement" , js_name = align)] #[doc = "Getter for the `align` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn align(this: &HtmlObjectElement) -> String; + pub fn align(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -175,7 +177,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/archive)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn archive(this: &HtmlObjectElement) -> String; + pub fn archive(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = archive)] #[doc = "Setter for the `archive` field of this object."] #[doc = ""] @@ -189,7 +191,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/code)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn code(this: &HtmlObjectElement) -> String; + pub fn code(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = code)] #[doc = "Setter for the `code` field of this object."] #[doc = ""] @@ -231,7 +233,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/standby)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn standby(this: &HtmlObjectElement) -> String; + pub fn standby(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = standby)] #[doc = "Setter for the `standby` field of this object."] #[doc = ""] @@ -259,7 +261,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/codeBase)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn code_base(this: &HtmlObjectElement) -> String; + pub fn code_base(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = codeBase)] #[doc = "Setter for the `codeBase` field of this object."] #[doc = ""] @@ -273,7 +275,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/codeType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn code_type(this: &HtmlObjectElement) -> String; + pub fn code_type(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = codeType)] #[doc = "Setter for the `codeType` field of this object."] #[doc = ""] @@ -287,7 +289,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/border)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlObjectElement`*"] - pub fn border(this: &HtmlObjectElement) -> String; + pub fn border(this: &HtmlObjectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLObjectElement" , js_name = border)] #[doc = "Setter for the `border` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlOptGroupElement.rs b/crates/web-sys/src/features/gen_HtmlOptGroupElement.rs index a6510ff5be7..025d700f59d 100644 --- a/crates/web-sys/src/features/gen_HtmlOptGroupElement.rs +++ b/crates/web-sys/src/features/gen_HtmlOptGroupElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptGroupElement/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOptGroupElement`*"] - pub fn label(this: &HtmlOptGroupElement) -> String; + pub fn label(this: &HtmlOptGroupElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLOptGroupElement" , js_name = label)] #[doc = "Setter for the `label` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlOptionElement.rs b/crates/web-sys/src/features/gen_HtmlOptionElement.rs index 5d34d0dc25a..68b864ef567 100644 --- a/crates/web-sys/src/features/gen_HtmlOptionElement.rs +++ b/crates/web-sys/src/features/gen_HtmlOptionElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -39,7 +40,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionElement/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOptionElement`*"] - pub fn label(this: &HtmlOptionElement) -> String; + pub fn label(this: &HtmlOptionElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLOptionElement" , js_name = label)] #[doc = "Setter for the `label` field of this object."] #[doc = ""] @@ -81,7 +82,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionElement/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOptionElement`*"] - pub fn value(this: &HtmlOptionElement) -> String; + pub fn value(this: &HtmlOptionElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLOptionElement" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -95,7 +96,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionElement/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOptionElement`*"] - pub fn text(this: &HtmlOptionElement) -> String; + pub fn text(this: &HtmlOptionElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLOptionElement" , js_name = text)] #[doc = "Setter for the `text` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlOptionsCollection.rs b/crates/web-sys/src/features/gen_HtmlOptionsCollection.rs index 2dca06380a6..403ce5b36e7 100644 --- a/crates/web-sys/src/features/gen_HtmlOptionsCollection.rs +++ b/crates/web-sys/src/features/gen_HtmlOptionsCollection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -124,7 +125,7 @@ extern "C" { js_class = "HTMLOptionsCollection", indexing_setter )] - #[doc = "Indexing setter."] + #[doc = "Indexing setter. As in the literal Javascript `this[key] = value`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlOutputElement.rs b/crates/web-sys/src/features/gen_HtmlOutputElement.rs index 8cb89808001..4e26e222ec9 100644 --- a/crates/web-sys/src/features/gen_HtmlOutputElement.rs +++ b/crates/web-sys/src/features/gen_HtmlOutputElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -33,7 +34,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOutputElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOutputElement`*"] - pub fn name(this: &HtmlOutputElement) -> String; + pub fn name(this: &HtmlOutputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLOutputElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -47,14 +48,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOutputElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOutputElement`*"] - pub fn type_(this: &HtmlOutputElement) -> String; + pub fn type_(this: &HtmlOutputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "HTMLOutputElement" , 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/HTMLOutputElement/defaultValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOutputElement`*"] - pub fn default_value(this: &HtmlOutputElement) -> String; + pub fn default_value(this: &HtmlOutputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLOutputElement" , js_name = defaultValue)] #[doc = "Setter for the `defaultValue` field of this object."] #[doc = ""] @@ -68,7 +69,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOutputElement/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOutputElement`*"] - pub fn value(this: &HtmlOutputElement) -> String; + pub fn value(this: &HtmlOutputElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLOutputElement" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -97,7 +98,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOutputElement/validationMessage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlOutputElement`*"] - pub fn validation_message(this: &HtmlOutputElement) -> Result; + pub fn validation_message(this: &HtmlOutputElement) + -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "NodeList")] # [wasm_bindgen (structural , method , getter , js_class = "HTMLOutputElement" , js_name = labels)] #[doc = "Getter for the `labels` field of this object."] diff --git a/crates/web-sys/src/features/gen_HtmlParagraphElement.rs b/crates/web-sys/src/features/gen_HtmlParagraphElement.rs index 51e139c1c59..905e8735b01 100644 --- a/crates/web-sys/src/features/gen_HtmlParagraphElement.rs +++ b/crates/web-sys/src/features/gen_HtmlParagraphElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLParagraphElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlParagraphElement`*"] - pub fn align(this: &HtmlParagraphElement) -> String; + pub fn align(this: &HtmlParagraphElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLParagraphElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlParamElement.rs b/crates/web-sys/src/features/gen_HtmlParamElement.rs index a6ea0d41118..88d3136bfc8 100644 --- a/crates/web-sys/src/features/gen_HtmlParamElement.rs +++ b/crates/web-sys/src/features/gen_HtmlParamElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLParamElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlParamElement`*"] - pub fn name(this: &HtmlParamElement) -> String; + pub fn name(this: &HtmlParamElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLParamElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLParamElement/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlParamElement`*"] - pub fn value(this: &HtmlParamElement) -> String; + pub fn value(this: &HtmlParamElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLParamElement" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLParamElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlParamElement`*"] - pub fn type_(this: &HtmlParamElement) -> String; + pub fn type_(this: &HtmlParamElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLParamElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLParamElement/valueType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlParamElement`*"] - pub fn value_type(this: &HtmlParamElement) -> String; + pub fn value_type(this: &HtmlParamElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLParamElement" , js_name = valueType)] #[doc = "Setter for the `valueType` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlPictureElement.rs b/crates/web-sys/src/features/gen_HtmlPictureElement.rs index 26112ae99ad..f3ae3e0b33b 100644 --- a/crates/web-sys/src/features/gen_HtmlPictureElement.rs +++ b/crates/web-sys/src/features/gen_HtmlPictureElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlPreElement.rs b/crates/web-sys/src/features/gen_HtmlPreElement.rs index 5ce97ef3f1c..74f8f0d70cd 100644 --- a/crates/web-sys/src/features/gen_HtmlPreElement.rs +++ b/crates/web-sys/src/features/gen_HtmlPreElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlProgressElement.rs b/crates/web-sys/src/features/gen_HtmlProgressElement.rs index ba5c6a7caf0..a6fdc916ba3 100644 --- a/crates/web-sys/src/features/gen_HtmlProgressElement.rs +++ b/crates/web-sys/src/features/gen_HtmlProgressElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlQuoteElement.rs b/crates/web-sys/src/features/gen_HtmlQuoteElement.rs index 9d18e13826e..3e21831ee83 100644 --- a/crates/web-sys/src/features/gen_HtmlQuoteElement.rs +++ b/crates/web-sys/src/features/gen_HtmlQuoteElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLQuoteElement/cite)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlQuoteElement`*"] - pub fn cite(this: &HtmlQuoteElement) -> String; + pub fn cite(this: &HtmlQuoteElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLQuoteElement" , js_name = cite)] #[doc = "Setter for the `cite` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlScriptElement.rs b/crates/web-sys/src/features/gen_HtmlScriptElement.rs index 21198eb7949..d044c1ea6c0 100644 --- a/crates/web-sys/src/features/gen_HtmlScriptElement.rs +++ b/crates/web-sys/src/features/gen_HtmlScriptElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlScriptElement`*"] - pub fn src(this: &HtmlScriptElement) -> String; + pub fn src(this: &HtmlScriptElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLScriptElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlScriptElement`*"] - pub fn type_(this: &HtmlScriptElement) -> String; + pub fn type_(this: &HtmlScriptElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLScriptElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/charset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlScriptElement`*"] - pub fn charset(this: &HtmlScriptElement) -> String; + pub fn charset(this: &HtmlScriptElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLScriptElement" , js_name = charset)] #[doc = "Setter for the `charset` field of this object."] #[doc = ""] @@ -101,7 +102,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/crossOrigin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlScriptElement`*"] - pub fn cross_origin(this: &HtmlScriptElement) -> Option; + pub fn cross_origin(this: &HtmlScriptElement) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "HTMLScriptElement" , js_name = crossOrigin)] #[doc = "Setter for the `crossOrigin` field of this object."] #[doc = ""] @@ -115,7 +116,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlScriptElement`*"] - pub fn text(this: &HtmlScriptElement) -> Result; + pub fn text(this: &HtmlScriptElement) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLScriptElement" , js_name = text)] #[doc = "Setter for the `text` field of this object."] #[doc = ""] @@ -129,7 +130,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/event)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlScriptElement`*"] - pub fn event(this: &HtmlScriptElement) -> String; + pub fn event(this: &HtmlScriptElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLScriptElement" , js_name = event)] #[doc = "Setter for the `event` field of this object."] #[doc = ""] @@ -143,7 +144,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/htmlFor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlScriptElement`*"] - pub fn html_for(this: &HtmlScriptElement) -> String; + pub fn html_for(this: &HtmlScriptElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLScriptElement" , js_name = htmlFor)] #[doc = "Setter for the `htmlFor` field of this object."] #[doc = ""] @@ -157,7 +158,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/integrity)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlScriptElement`*"] - pub fn integrity(this: &HtmlScriptElement) -> String; + pub fn integrity(this: &HtmlScriptElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLScriptElement" , js_name = integrity)] #[doc = "Setter for the `integrity` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlSelectElement.rs b/crates/web-sys/src/features/gen_HtmlSelectElement.rs index 87f3ddd7abd..67d30eb6e72 100644 --- a/crates/web-sys/src/features/gen_HtmlSelectElement.rs +++ b/crates/web-sys/src/features/gen_HtmlSelectElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,6 +18,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/autofocus)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSelectElement`*"] + #[deprecated( + note = "Use `HtmlElement::autofocus()` or `HtmlElement::set_autofocus()` instead." + )] pub fn autofocus(this: &HtmlSelectElement) -> bool; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSelectElement" , js_name = autofocus)] #[doc = "Setter for the `autofocus` field of this object."] @@ -24,6 +28,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/autofocus)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSelectElement`*"] + #[deprecated( + note = "Use `HtmlElement::autofocus()` or `HtmlElement::set_autofocus()` instead." + )] pub fn set_autofocus(this: &HtmlSelectElement, value: bool); # [wasm_bindgen (structural , method , getter , js_class = "HTMLSelectElement" , js_name = autocomplete)] #[doc = "Getter for the `autocomplete` field of this object."] @@ -31,7 +38,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/autocomplete)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSelectElement`*"] - pub fn autocomplete(this: &HtmlSelectElement) -> String; + pub fn autocomplete(this: &HtmlSelectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSelectElement" , js_name = autocomplete)] #[doc = "Setter for the `autocomplete` field of this object."] #[doc = ""] @@ -81,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSelectElement`*"] - pub fn name(this: &HtmlSelectElement) -> String; + pub fn name(this: &HtmlSelectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSelectElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -123,7 +130,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSelectElement`*"] - pub fn type_(this: &HtmlSelectElement) -> String; + pub fn type_(this: &HtmlSelectElement) -> ::alloc::string::String; #[cfg(feature = "HtmlOptionsCollection")] # [wasm_bindgen (structural , method , getter , js_class = "HTMLSelectElement" , js_name = options)] #[doc = "Getter for the `options` field of this object."] @@ -174,7 +181,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSelectElement`*"] - pub fn value(this: &HtmlSelectElement) -> String; + pub fn value(this: &HtmlSelectElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSelectElement" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -203,7 +210,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/validationMessage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSelectElement`*"] - pub fn validation_message(this: &HtmlSelectElement) -> Result; + pub fn validation_message(this: &HtmlSelectElement) + -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "NodeList")] # [wasm_bindgen (structural , method , getter , js_class = "HTMLSelectElement" , js_name = labels)] #[doc = "Getter for the `labels` field of this object."] @@ -333,7 +341,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `HtmlSelectElement`*"] pub fn set_custom_validity(this: &HtmlSelectElement, error: &str); #[wasm_bindgen(method, structural, js_class = "HTMLSelectElement", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] @@ -347,7 +355,7 @@ extern "C" { js_class = "HTMLSelectElement", indexing_setter )] - #[doc = "Indexing setter."] + #[doc = "Indexing setter. As in the literal Javascript `this[key] = value`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlSlotElement.rs b/crates/web-sys/src/features/gen_HtmlSlotElement.rs index c822a2ee4cf..2924e7be8b9 100644 --- a/crates/web-sys/src/features/gen_HtmlSlotElement.rs +++ b/crates/web-sys/src/features/gen_HtmlSlotElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSlotElement`*"] - pub fn name(this: &HtmlSlotElement) -> String; + pub fn name(this: &HtmlSlotElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSlotElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlSourceElement.rs b/crates/web-sys/src/features/gen_HtmlSourceElement.rs index fd01150d9a2..b37d1d14719 100644 --- a/crates/web-sys/src/features/gen_HtmlSourceElement.rs +++ b/crates/web-sys/src/features/gen_HtmlSourceElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSourceElement`*"] - pub fn src(this: &HtmlSourceElement) -> String; + pub fn src(this: &HtmlSourceElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSourceElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSourceElement`*"] - pub fn type_(this: &HtmlSourceElement) -> String; + pub fn type_(this: &HtmlSourceElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSourceElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/srcset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSourceElement`*"] - pub fn srcset(this: &HtmlSourceElement) -> String; + pub fn srcset(this: &HtmlSourceElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSourceElement" , js_name = srcset)] #[doc = "Setter for the `srcset` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/sizes)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSourceElement`*"] - pub fn sizes(this: &HtmlSourceElement) -> String; + pub fn sizes(this: &HtmlSourceElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSourceElement" , js_name = sizes)] #[doc = "Setter for the `sizes` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/media)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlSourceElement`*"] - pub fn media(this: &HtmlSourceElement) -> String; + pub fn media(this: &HtmlSourceElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLSourceElement" , js_name = media)] #[doc = "Setter for the `media` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlSpanElement.rs b/crates/web-sys/src/features/gen_HtmlSpanElement.rs index fee20cc82fe..e050b625da3 100644 --- a/crates/web-sys/src/features/gen_HtmlSpanElement.rs +++ b/crates/web-sys/src/features/gen_HtmlSpanElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlStyleElement.rs b/crates/web-sys/src/features/gen_HtmlStyleElement.rs index a8082b11cdb..57530860a64 100644 --- a/crates/web-sys/src/features/gen_HtmlStyleElement.rs +++ b/crates/web-sys/src/features/gen_HtmlStyleElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement/media)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlStyleElement`*"] - pub fn media(this: &HtmlStyleElement) -> String; + pub fn media(this: &HtmlStyleElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLStyleElement" , js_name = media)] #[doc = "Setter for the `media` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlStyleElement`*"] - pub fn type_(this: &HtmlStyleElement) -> String; + pub fn type_(this: &HtmlStyleElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLStyleElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTableCaptionElement.rs b/crates/web-sys/src/features/gen_HtmlTableCaptionElement.rs index a3051b715b3..d6eef313db1 100644 --- a/crates/web-sys/src/features/gen_HtmlTableCaptionElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTableCaptionElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCaptionElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCaptionElement`*"] - pub fn align(this: &HtmlTableCaptionElement) -> String; + pub fn align(this: &HtmlTableCaptionElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCaptionElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTableCellElement.rs b/crates/web-sys/src/features/gen_HtmlTableCellElement.rs index 343b94349d1..a1c998d5599 100644 --- a/crates/web-sys/src/features/gen_HtmlTableCellElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTableCellElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/headers)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn headers(this: &HtmlTableCellElement) -> String; + pub fn headers(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = headers)] #[doc = "Setter for the `headers` field of this object."] #[doc = ""] @@ -60,13 +61,41 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] pub fn cell_index(this: &HtmlTableCellElement) -> i32; + # [wasm_bindgen (structural , method , getter , js_class = "HTMLTableCellElement" , js_name = abbr)] + #[doc = "Getter for the `abbr` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/abbr)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] + pub fn abbr(this: &HtmlTableCellElement) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = abbr)] + #[doc = "Setter for the `abbr` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/abbr)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] + pub fn set_abbr(this: &HtmlTableCellElement, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "HTMLTableCellElement" , js_name = scope)] + #[doc = "Getter for the `scope` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/scope)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] + pub fn scope(this: &HtmlTableCellElement) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = scope)] + #[doc = "Setter for the `scope` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/scope)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] + pub fn set_scope(this: &HtmlTableCellElement, value: &str); # [wasm_bindgen (structural , method , getter , js_class = "HTMLTableCellElement" , js_name = align)] #[doc = "Getter for the `align` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn align(this: &HtmlTableCellElement) -> String; + pub fn align(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -80,7 +109,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/axis)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn axis(this: &HtmlTableCellElement) -> String; + pub fn axis(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = axis)] #[doc = "Setter for the `axis` field of this object."] #[doc = ""] @@ -94,7 +123,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/height)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn height(this: &HtmlTableCellElement) -> String; + pub fn height(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = height)] #[doc = "Setter for the `height` field of this object."] #[doc = ""] @@ -108,7 +137,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/width)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn width(this: &HtmlTableCellElement) -> String; + pub fn width(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = width)] #[doc = "Setter for the `width` field of this object."] #[doc = ""] @@ -122,7 +151,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/ch)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn ch(this: &HtmlTableCellElement) -> String; + pub fn ch(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = ch)] #[doc = "Setter for the `ch` field of this object."] #[doc = ""] @@ -136,7 +165,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/chOff)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn ch_off(this: &HtmlTableCellElement) -> String; + pub fn ch_off(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = chOff)] #[doc = "Setter for the `chOff` field of this object."] #[doc = ""] @@ -164,7 +193,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/vAlign)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn v_align(this: &HtmlTableCellElement) -> String; + pub fn v_align(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = vAlign)] #[doc = "Setter for the `vAlign` field of this object."] #[doc = ""] @@ -178,7 +207,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement/bgColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableCellElement`*"] - pub fn bg_color(this: &HtmlTableCellElement) -> String; + pub fn bg_color(this: &HtmlTableCellElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableCellElement" , js_name = bgColor)] #[doc = "Setter for the `bgColor` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTableColElement.rs b/crates/web-sys/src/features/gen_HtmlTableColElement.rs index d2e4e771ae1..0319ad7aef0 100644 --- a/crates/web-sys/src/features/gen_HtmlTableColElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTableColElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableColElement`*"] - pub fn align(this: &HtmlTableColElement) -> String; + pub fn align(this: &HtmlTableColElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableColElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/ch)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableColElement`*"] - pub fn ch(this: &HtmlTableColElement) -> String; + pub fn ch(this: &HtmlTableColElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableColElement" , js_name = ch)] #[doc = "Setter for the `ch` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/chOff)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableColElement`*"] - pub fn ch_off(this: &HtmlTableColElement) -> String; + pub fn ch_off(this: &HtmlTableColElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableColElement" , js_name = chOff)] #[doc = "Setter for the `chOff` field of this object."] #[doc = ""] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/vAlign)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableColElement`*"] - pub fn v_align(this: &HtmlTableColElement) -> String; + pub fn v_align(this: &HtmlTableColElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableColElement" , js_name = vAlign)] #[doc = "Setter for the `vAlign` field of this object."] #[doc = ""] @@ -87,7 +88,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/width)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableColElement`*"] - pub fn width(this: &HtmlTableColElement) -> String; + pub fn width(this: &HtmlTableColElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableColElement" , js_name = width)] #[doc = "Setter for the `width` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTableElement.rs b/crates/web-sys/src/features/gen_HtmlTableElement.rs index 036e2ab88c2..4f05718b8a4 100644 --- a/crates/web-sys/src/features/gen_HtmlTableElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTableElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -81,7 +82,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn align(this: &HtmlTableElement) -> String; + pub fn align(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -95,7 +96,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/border)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn border(this: &HtmlTableElement) -> String; + pub fn border(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = border)] #[doc = "Setter for the `border` field of this object."] #[doc = ""] @@ -109,7 +110,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/frame)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn frame(this: &HtmlTableElement) -> String; + pub fn frame(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = frame)] #[doc = "Setter for the `frame` field of this object."] #[doc = ""] @@ -123,7 +124,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/rules)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn rules(this: &HtmlTableElement) -> String; + pub fn rules(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = rules)] #[doc = "Setter for the `rules` field of this object."] #[doc = ""] @@ -137,7 +138,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/summary)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn summary(this: &HtmlTableElement) -> String; + pub fn summary(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = summary)] #[doc = "Setter for the `summary` field of this object."] #[doc = ""] @@ -151,7 +152,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/width)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn width(this: &HtmlTableElement) -> String; + pub fn width(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = width)] #[doc = "Setter for the `width` field of this object."] #[doc = ""] @@ -165,7 +166,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/bgColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn bg_color(this: &HtmlTableElement) -> String; + pub fn bg_color(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = bgColor)] #[doc = "Setter for the `bgColor` field of this object."] #[doc = ""] @@ -179,7 +180,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/cellPadding)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn cell_padding(this: &HtmlTableElement) -> String; + pub fn cell_padding(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = cellPadding)] #[doc = "Setter for the `cellPadding` field of this object."] #[doc = ""] @@ -193,7 +194,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/cellSpacing)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableElement`*"] - pub fn cell_spacing(this: &HtmlTableElement) -> String; + pub fn cell_spacing(this: &HtmlTableElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableElement" , js_name = cellSpacing)] #[doc = "Setter for the `cellSpacing` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTableRowElement.rs b/crates/web-sys/src/features/gen_HtmlTableRowElement.rs index 222d7b0df84..71124635d98 100644 --- a/crates/web-sys/src/features/gen_HtmlTableRowElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTableRowElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -39,7 +40,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableRowElement`*"] - pub fn align(this: &HtmlTableRowElement) -> String; + pub fn align(this: &HtmlTableRowElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableRowElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -53,7 +54,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/ch)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableRowElement`*"] - pub fn ch(this: &HtmlTableRowElement) -> String; + pub fn ch(this: &HtmlTableRowElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableRowElement" , js_name = ch)] #[doc = "Setter for the `ch` field of this object."] #[doc = ""] @@ -67,7 +68,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/chOff)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableRowElement`*"] - pub fn ch_off(this: &HtmlTableRowElement) -> String; + pub fn ch_off(this: &HtmlTableRowElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableRowElement" , js_name = chOff)] #[doc = "Setter for the `chOff` field of this object."] #[doc = ""] @@ -81,7 +82,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/vAlign)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableRowElement`*"] - pub fn v_align(this: &HtmlTableRowElement) -> String; + pub fn v_align(this: &HtmlTableRowElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableRowElement" , js_name = vAlign)] #[doc = "Setter for the `vAlign` field of this object."] #[doc = ""] @@ -95,7 +96,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/bgColor)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableRowElement`*"] - pub fn bg_color(this: &HtmlTableRowElement) -> String; + pub fn bg_color(this: &HtmlTableRowElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableRowElement" , js_name = bgColor)] #[doc = "Setter for the `bgColor` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTableSectionElement.rs b/crates/web-sys/src/features/gen_HtmlTableSectionElement.rs index 503f2245ed9..1c820e814a5 100644 --- a/crates/web-sys/src/features/gen_HtmlTableSectionElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTableSectionElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableSectionElement/align)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableSectionElement`*"] - pub fn align(this: &HtmlTableSectionElement) -> String; + pub fn align(this: &HtmlTableSectionElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableSectionElement" , js_name = align)] #[doc = "Setter for the `align` field of this object."] #[doc = ""] @@ -39,7 +40,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableSectionElement/ch)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableSectionElement`*"] - pub fn ch(this: &HtmlTableSectionElement) -> String; + pub fn ch(this: &HtmlTableSectionElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableSectionElement" , js_name = ch)] #[doc = "Setter for the `ch` field of this object."] #[doc = ""] @@ -53,7 +54,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableSectionElement/chOff)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableSectionElement`*"] - pub fn ch_off(this: &HtmlTableSectionElement) -> String; + pub fn ch_off(this: &HtmlTableSectionElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableSectionElement" , js_name = chOff)] #[doc = "Setter for the `chOff` field of this object."] #[doc = ""] @@ -67,7 +68,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableSectionElement/vAlign)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTableSectionElement`*"] - pub fn v_align(this: &HtmlTableSectionElement) -> String; + pub fn v_align(this: &HtmlTableSectionElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTableSectionElement" , js_name = vAlign)] #[doc = "Setter for the `vAlign` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTemplateElement.rs b/crates/web-sys/src/features/gen_HtmlTemplateElement.rs index dba10b0c044..b8b153eef24 100644 --- a/crates/web-sys/src/features/gen_HtmlTemplateElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTemplateElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlTextAreaElement.rs b/crates/web-sys/src/features/gen_HtmlTextAreaElement.rs index b21d4758a52..d954e7887b3 100644 --- a/crates/web-sys/src/features/gen_HtmlTextAreaElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTextAreaElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/autocomplete)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn autocomplete(this: &HtmlTextAreaElement) -> String; + pub fn autocomplete(this: &HtmlTextAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTextAreaElement" , js_name = autocomplete)] #[doc = "Setter for the `autocomplete` field of this object."] #[doc = ""] @@ -31,6 +32,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/autofocus)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] + #[deprecated( + note = "Use `HtmlElement::autofocus()` or `HtmlElement::set_autofocus()` instead." + )] pub fn autofocus(this: &HtmlTextAreaElement) -> bool; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTextAreaElement" , js_name = autofocus)] #[doc = "Setter for the `autofocus` field of this object."] @@ -38,6 +42,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/autofocus)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] + #[deprecated( + note = "Use `HtmlElement::autofocus()` or `HtmlElement::set_autofocus()` instead." + )] pub fn set_autofocus(this: &HtmlTextAreaElement, value: bool); # [wasm_bindgen (structural , method , getter , js_class = "HTMLTextAreaElement" , js_name = cols)] #[doc = "Getter for the `cols` field of this object."] @@ -109,7 +116,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn name(this: &HtmlTextAreaElement) -> String; + pub fn name(this: &HtmlTextAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTextAreaElement" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -123,7 +130,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/placeholder)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn placeholder(this: &HtmlTextAreaElement) -> String; + pub fn placeholder(this: &HtmlTextAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTextAreaElement" , js_name = placeholder)] #[doc = "Setter for the `placeholder` field of this object."] #[doc = ""] @@ -179,7 +186,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/wrap)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn wrap(this: &HtmlTextAreaElement) -> String; + pub fn wrap(this: &HtmlTextAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTextAreaElement" , js_name = wrap)] #[doc = "Setter for the `wrap` field of this object."] #[doc = ""] @@ -193,14 +200,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn type_(this: &HtmlTextAreaElement) -> String; + pub fn type_(this: &HtmlTextAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , catch , method , getter , js_class = "HTMLTextAreaElement" , 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/HTMLTextAreaElement/defaultValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn default_value(this: &HtmlTextAreaElement) -> Result; + pub fn default_value(this: &HtmlTextAreaElement) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLTextAreaElement" , js_name = defaultValue)] #[doc = "Setter for the `defaultValue` field of this object."] #[doc = ""] @@ -214,7 +221,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn value(this: &HtmlTextAreaElement) -> String; + pub fn value(this: &HtmlTextAreaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTextAreaElement" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] @@ -250,7 +257,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/validationMessage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn validation_message(this: &HtmlTextAreaElement) -> Result; + pub fn validation_message( + this: &HtmlTextAreaElement, + ) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "NodeList")] # [wasm_bindgen (structural , method , getter , js_class = "HTMLTextAreaElement" , js_name = labels)] #[doc = "Getter for the `labels` field of this object."] @@ -297,7 +306,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/selectionDirection)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] - pub fn selection_direction(this: &HtmlTextAreaElement) -> Result, JsValue>; + pub fn selection_direction( + this: &HtmlTextAreaElement, + ) -> Result, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLTextAreaElement" , js_name = selectionDirection)] #[doc = "Setter for the `selectionDirection` field of this object."] #[doc = ""] @@ -355,6 +366,19 @@ extern "C" { start: u32, end: u32, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLTextAreaElement" , js_name = setRangeText)] + #[doc = "The `setRangeText()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/setRangeText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlTextAreaElement`*"] + pub fn set_range_text_with_start_and_end_and_mode( + this: &HtmlTextAreaElement, + replacement: &str, + start: u32, + end: u32, + mode: &str, + ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "HTMLTextAreaElement" , js_name = setSelectionRange)] #[doc = "The `setSelectionRange()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTimeElement.rs b/crates/web-sys/src/features/gen_HtmlTimeElement.rs index 58b916fb692..fdf149a9c5a 100644 --- a/crates/web-sys/src/features/gen_HtmlTimeElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTimeElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTimeElement/dateTime)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTimeElement`*"] - pub fn date_time(this: &HtmlTimeElement) -> String; + pub fn date_time(this: &HtmlTimeElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTimeElement" , js_name = dateTime)] #[doc = "Setter for the `dateTime` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTitleElement.rs b/crates/web-sys/src/features/gen_HtmlTitleElement.rs index 7c3f6e78bb1..93c7797da4c 100644 --- a/crates/web-sys/src/features/gen_HtmlTitleElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTitleElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTitleElement/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTitleElement`*"] - pub fn text(this: &HtmlTitleElement) -> Result; + pub fn text(this: &HtmlTitleElement) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "HTMLTitleElement" , js_name = text)] #[doc = "Setter for the `text` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlTrackElement.rs b/crates/web-sys/src/features/gen_HtmlTrackElement.rs index e1dbf4b5ab0..f61b159b8ca 100644 --- a/crates/web-sys/src/features/gen_HtmlTrackElement.rs +++ b/crates/web-sys/src/features/gen_HtmlTrackElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTrackElement/kind)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTrackElement`*"] - pub fn kind(this: &HtmlTrackElement) -> String; + pub fn kind(this: &HtmlTrackElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTrackElement" , js_name = kind)] #[doc = "Setter for the `kind` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTrackElement/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTrackElement`*"] - pub fn src(this: &HtmlTrackElement) -> String; + pub fn src(this: &HtmlTrackElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTrackElement" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTrackElement/srclang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTrackElement`*"] - pub fn srclang(this: &HtmlTrackElement) -> String; + pub fn srclang(this: &HtmlTrackElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTrackElement" , js_name = srclang)] #[doc = "Setter for the `srclang` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTrackElement/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlTrackElement`*"] - pub fn label(this: &HtmlTrackElement) -> String; + pub fn label(this: &HtmlTrackElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLTrackElement" , js_name = label)] #[doc = "Setter for the `label` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlUListElement.rs b/crates/web-sys/src/features/gen_HtmlUListElement.rs index 484925a6c46..7aa4b93ae66 100644 --- a/crates/web-sys/src/features/gen_HtmlUListElement.rs +++ b/crates/web-sys/src/features/gen_HtmlUListElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLUListElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlUListElement`*"] - pub fn type_(this: &HtmlUListElement) -> String; + pub fn type_(this: &HtmlUListElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLUListElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HtmlUnknownElement.rs b/crates/web-sys/src/features/gen_HtmlUnknownElement.rs index 63a86e4e532..2405844f5c8 100644 --- a/crates/web-sys/src/features/gen_HtmlUnknownElement.rs +++ b/crates/web-sys/src/features/gen_HtmlUnknownElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_HtmlVideoElement.rs b/crates/web-sys/src/features/gen_HtmlVideoElement.rs index 3301d64f582..3aa5cf6e175 100644 --- a/crates/web-sys/src/features/gen_HtmlVideoElement.rs +++ b/crates/web-sys/src/features/gen_HtmlVideoElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement/poster)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`*"] - pub fn poster(this: &HtmlVideoElement) -> String; + pub fn poster(this: &HtmlVideoElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "HTMLVideoElement" , js_name = poster)] #[doc = "Setter for the `poster` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_HttpConnDict.rs b/crates/web-sys/src/features/gen_HttpConnDict.rs index 87eea9edc9a..754d2fe96e0 100644 --- a/crates/web-sys/src/features/gen_HttpConnDict.rs +++ b/crates/web-sys/src/features/gen_HttpConnDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnDict`*"] pub type HttpConnDict; + #[doc = "Get the `connections` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnDict`*"] + #[wasm_bindgen(method, getter = "connections")] + pub fn get_connections(this: &HttpConnDict) -> Option<::js_sys::Array>; + #[doc = "Change the `connections` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnDict`*"] + #[wasm_bindgen(method, setter = "connections")] + pub fn set_connections(this: &HttpConnDict, val: &::wasm_bindgen::JsValue); } impl HttpConnDict { #[doc = "Construct a new `HttpConnDict`."] @@ -19,21 +30,9 @@ impl HttpConnDict { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `connections` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnDict`*"] + #[deprecated = "Use `set_connections()` instead."] pub fn connections(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("connections"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_connections(val); self } } diff --git a/crates/web-sys/src/features/gen_HttpConnInfo.rs b/crates/web-sys/src/features/gen_HttpConnInfo.rs index 987420ebc1b..59d9539ce6a 100644 --- a/crates/web-sys/src/features/gen_HttpConnInfo.rs +++ b/crates/web-sys/src/features/gen_HttpConnInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] pub type HttpConnInfo; + #[doc = "Get the `protocolVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[wasm_bindgen(method, getter = "protocolVersion")] + pub fn get_protocol_version(this: &HttpConnInfo) -> Option<::alloc::string::String>; + #[doc = "Change the `protocolVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[wasm_bindgen(method, setter = "protocolVersion")] + pub fn set_protocol_version(this: &HttpConnInfo, val: &str); + #[doc = "Get the `rtt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[wasm_bindgen(method, getter = "rtt")] + pub fn get_rtt(this: &HttpConnInfo) -> Option; + #[doc = "Change the `rtt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[wasm_bindgen(method, setter = "rtt")] + pub fn set_rtt(this: &HttpConnInfo, val: u32); + #[doc = "Get the `ttl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[wasm_bindgen(method, getter = "ttl")] + pub fn get_ttl(this: &HttpConnInfo) -> Option; + #[doc = "Change the `ttl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[wasm_bindgen(method, setter = "ttl")] + pub fn set_ttl(this: &HttpConnInfo, val: u32); } impl HttpConnInfo { #[doc = "Construct a new `HttpConnInfo`."] @@ -19,47 +50,19 @@ impl HttpConnInfo { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `protocolVersion` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[deprecated = "Use `set_protocol_version()` instead."] pub fn protocol_version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocolVersion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_protocol_version(val); self } - #[doc = "Change the `rtt` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[deprecated = "Use `set_rtt()` instead."] pub fn rtt(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rtt"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rtt(val); self } - #[doc = "Change the `ttl` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnInfo`*"] + #[deprecated = "Use `set_ttl()` instead."] pub fn ttl(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ttl"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ttl(val); self } } diff --git a/crates/web-sys/src/features/gen_HttpConnectionElement.rs b/crates/web-sys/src/features/gen_HttpConnectionElement.rs index 5fef1331ae6..c9efd25a24f 100644 --- a/crates/web-sys/src/features/gen_HttpConnectionElement.rs +++ b/crates/web-sys/src/features/gen_HttpConnectionElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,76 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] pub type HttpConnectionElement; + #[doc = "Get the `active` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, getter = "active")] + pub fn get_active(this: &HttpConnectionElement) -> Option<::js_sys::Array>; + #[doc = "Change the `active` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, setter = "active")] + pub fn set_active(this: &HttpConnectionElement, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `halfOpens` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, getter = "halfOpens")] + pub fn get_half_opens(this: &HttpConnectionElement) -> Option<::js_sys::Array>; + #[doc = "Change the `halfOpens` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, setter = "halfOpens")] + pub fn set_half_opens(this: &HttpConnectionElement, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `host` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, getter = "host")] + pub fn get_host(this: &HttpConnectionElement) -> Option<::alloc::string::String>; + #[doc = "Change the `host` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, setter = "host")] + pub fn set_host(this: &HttpConnectionElement, val: &str); + #[doc = "Get the `idle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, getter = "idle")] + pub fn get_idle(this: &HttpConnectionElement) -> Option<::js_sys::Array>; + #[doc = "Change the `idle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, setter = "idle")] + pub fn set_idle(this: &HttpConnectionElement, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `port` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, getter = "port")] + pub fn get_port(this: &HttpConnectionElement) -> Option; + #[doc = "Change the `port` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, setter = "port")] + pub fn set_port(this: &HttpConnectionElement, val: u32); + #[doc = "Get the `spdy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, getter = "spdy")] + pub fn get_spdy(this: &HttpConnectionElement) -> Option; + #[doc = "Change the `spdy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, setter = "spdy")] + pub fn set_spdy(this: &HttpConnectionElement, val: bool); + #[doc = "Get the `ssl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, getter = "ssl")] + pub fn get_ssl(this: &HttpConnectionElement) -> Option; + #[doc = "Change the `ssl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[wasm_bindgen(method, setter = "ssl")] + pub fn set_ssl(this: &HttpConnectionElement, val: bool); } impl HttpConnectionElement { #[doc = "Construct a new `HttpConnectionElement`."] @@ -19,100 +90,39 @@ impl HttpConnectionElement { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `active` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[deprecated = "Use `set_active()` instead."] pub fn active(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("active"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_active(val); self } - #[doc = "Change the `halfOpens` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[deprecated = "Use `set_half_opens()` instead."] pub fn half_opens(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("halfOpens"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_half_opens(val); self } - #[doc = "Change the `host` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[deprecated = "Use `set_host()` instead."] pub fn host(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("host"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_host(val); self } - #[doc = "Change the `idle` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[deprecated = "Use `set_idle()` instead."] pub fn idle(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("idle"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_idle(val); self } - #[doc = "Change the `port` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[deprecated = "Use `set_port()` instead."] pub fn port(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("port"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_port(val); self } - #[doc = "Change the `spdy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[deprecated = "Use `set_spdy()` instead."] pub fn spdy(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("spdy"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_spdy(val); self } - #[doc = "Change the `ssl` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HttpConnectionElement`*"] + #[deprecated = "Use `set_ssl()` instead."] pub fn ssl(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssl"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssl(val); self } } diff --git a/crates/web-sys/src/features/gen_IdbCursor.rs b/crates/web-sys/src/features/gen_IdbCursor.rs index f7d124d03e7..e4e98ed9f7e 100644 --- a/crates/web-sys/src/features/gen_IdbCursor.rs +++ b/crates/web-sys/src/features/gen_IdbCursor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -47,6 +48,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/request)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbCursor`, `IdbRequest`*"] + #[deprecated] pub fn request(this: &IdbCursor) -> IdbRequest; # [wasm_bindgen (catch , method , structural , js_class = "IDBCursor" , js_name = advance)] #[doc = "The `advance()` method."] diff --git a/crates/web-sys/src/features/gen_IdbCursorDirection.rs b/crates/web-sys/src/features/gen_IdbCursorDirection.rs index c01fef471f0..1013cf5db2d 100644 --- a/crates/web-sys/src/features/gen_IdbCursorDirection.rs +++ b/crates/web-sys/src/features/gen_IdbCursorDirection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `IdbCursorDirection` enum."] diff --git a/crates/web-sys/src/features/gen_IdbCursorWithValue.rs b/crates/web-sys/src/features/gen_IdbCursorWithValue.rs index 2f66c5a93aa..b337692eb00 100644 --- a/crates/web-sys/src/features/gen_IdbCursorWithValue.rs +++ b/crates/web-sys/src/features/gen_IdbCursorWithValue.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_IdbDatabase.rs b/crates/web-sys/src/features/gen_IdbDatabase.rs index ebcb2f62757..b0460f925ad 100644 --- a/crates/web-sys/src/features/gen_IdbDatabase.rs +++ b/crates/web-sys/src/features/gen_IdbDatabase.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"] - pub fn name(this: &IdbDatabase) -> String; + pub fn name(this: &IdbDatabase) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "IDBDatabase" , js_name = version)] #[doc = "Getter for the `version` field of this object."] #[doc = ""] @@ -96,6 +97,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/storage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `StorageType`*"] + #[deprecated] pub fn storage(this: &IdbDatabase) -> StorageType; # [wasm_bindgen (method , structural , js_class = "IDBDatabase" , js_name = close)] #[doc = "The `close()` method."] @@ -111,6 +113,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createMutableFile)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbRequest`*"] + #[deprecated] pub fn create_mutable_file(this: &IdbDatabase, name: &str) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBDatabase" , js_name = createMutableFile)] @@ -119,6 +122,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createMutableFile)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbRequest`*"] + #[deprecated] pub fn create_mutable_file_with_type( this: &IdbDatabase, name: &str, @@ -142,7 +146,7 @@ extern "C" { pub fn create_object_store_with_optional_parameters( this: &IdbDatabase, name: &str, - optional_parameters: &IdbObjectStoreParameters, + options: &IdbObjectStoreParameters, ) -> Result; # [wasm_bindgen (catch , method , structural , js_class = "IDBDatabase" , js_name = deleteObjectStore)] #[doc = "The `deleteObjectStore()` method."] @@ -197,4 +201,46 @@ extern "C" { store_names: &::wasm_bindgen::JsValue, mode: IdbTransactionMode, ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(all( + feature = "IdbTransaction", + feature = "IdbTransactionMode", + feature = "IdbTransactionOptions", + ))] + # [wasm_bindgen (catch , method , structural , js_class = "IDBDatabase" , js_name = transaction)] + #[doc = "The `transaction()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbTransaction`, `IdbTransactionMode`, `IdbTransactionOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn transaction_with_str_and_mode_and_options( + this: &IdbDatabase, + store_names: &str, + mode: IdbTransactionMode, + options: &IdbTransactionOptions, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(all( + feature = "IdbTransaction", + feature = "IdbTransactionMode", + feature = "IdbTransactionOptions", + ))] + # [wasm_bindgen (catch , method , structural , js_class = "IDBDatabase" , js_name = transaction)] + #[doc = "The `transaction()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbTransaction`, `IdbTransactionMode`, `IdbTransactionOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn transaction_with_str_sequence_and_mode_and_options( + this: &IdbDatabase, + store_names: &::wasm_bindgen::JsValue, + mode: IdbTransactionMode, + options: &IdbTransactionOptions, + ) -> Result; } diff --git a/crates/web-sys/src/features/gen_IdbFactory.rs b/crates/web-sys/src/features/gen_IdbFactory.rs index 30fac16d7a0..023c786d060 100644 --- a/crates/web-sys/src/features/gen_IdbFactory.rs +++ b/crates/web-sys/src/features/gen_IdbFactory.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -37,6 +38,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/deleteDatabase)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `IdbOpenDbOptions`, `IdbOpenDbRequest`*"] + #[deprecated] pub fn delete_database_with_options( this: &IdbFactory, name: &str, @@ -49,11 +51,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `IdbOpenDbRequest`*"] - pub fn open_with_u32( - this: &IdbFactory, - name: &str, - version: u32, - ) -> Result; + pub fn open(this: &IdbFactory, name: &str) -> Result; #[cfg(feature = "IdbOpenDbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBFactory" , js_name = open)] #[doc = "The `open()` method."] @@ -61,10 +59,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `IdbOpenDbRequest`*"] - pub fn open_with_f64( + pub fn open_with_u32( this: &IdbFactory, name: &str, - version: f64, + version: u32, ) -> Result; #[cfg(feature = "IdbOpenDbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBFactory" , js_name = open)] @@ -73,7 +71,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `IdbOpenDbRequest`*"] - pub fn open(this: &IdbFactory, name: &str) -> Result; + pub fn open_with_f64( + this: &IdbFactory, + name: &str, + version: f64, + ) -> Result; #[cfg(all(feature = "IdbOpenDbOptions", feature = "IdbOpenDbRequest",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBFactory" , js_name = open)] #[doc = "The `open()` method."] @@ -81,6 +83,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `IdbOpenDbOptions`, `IdbOpenDbRequest`*"] + #[deprecated] pub fn open_with_idb_open_db_options( this: &IdbFactory, name: &str, diff --git a/crates/web-sys/src/features/gen_IdbFileHandle.rs b/crates/web-sys/src/features/gen_IdbFileHandle.rs index 0e395303bf5..6c1b4e10a23 100644 --- a/crates/web-sys/src/features/gen_IdbFileHandle.rs +++ b/crates/web-sys/src/features/gen_IdbFileHandle.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -10,6 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub type IdbFileHandle; #[cfg(feature = "IdbMutableFile")] # [wasm_bindgen (structural , method , getter , js_class = "IDBFileHandle" , js_name = mutableFile)] @@ -18,6 +20,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/mutableFile)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbMutableFile`*"] + #[deprecated] pub fn mutable_file(this: &IdbFileHandle) -> Option; #[cfg(feature = "IdbMutableFile")] # [wasm_bindgen (structural , method , getter , js_class = "IDBFileHandle" , js_name = fileHandle)] @@ -26,6 +29,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/fileHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbMutableFile`*"] + #[deprecated] pub fn file_handle(this: &IdbFileHandle) -> Option; # [wasm_bindgen (structural , method , getter , js_class = "IDBFileHandle" , js_name = active)] #[doc = "Getter for the `active` field of this object."] @@ -33,6 +37,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/active)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn active(this: &IdbFileHandle) -> bool; # [wasm_bindgen (structural , method , getter , js_class = "IDBFileHandle" , js_name = location)] #[doc = "Getter for the `location` field of this object."] @@ -40,6 +45,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/location)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn location(this: &IdbFileHandle) -> Option; # [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = location)] #[doc = "Setter for the `location` field of this object."] @@ -47,13 +53,31 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/location)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn set_location(this: &IdbFileHandle, value: Option); + # [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = location)] + #[doc = "Setter for the `location` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/location)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] + pub fn set_location_opt_u32(this: &IdbFileHandle, value: Option); + # [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = location)] + #[doc = "Setter for the `location` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/location)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] + pub fn set_location_opt_f64(this: &IdbFileHandle, value: Option); # [wasm_bindgen (structural , method , getter , js_class = "IDBFileHandle" , js_name = oncomplete)] #[doc = "Getter for the `oncomplete` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/oncomplete)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn oncomplete(this: &IdbFileHandle) -> Option<::js_sys::Function>; # [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = oncomplete)] #[doc = "Setter for the `oncomplete` field of this object."] @@ -61,6 +85,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/oncomplete)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn set_oncomplete(this: &IdbFileHandle, value: Option<&::js_sys::Function>); # [wasm_bindgen (structural , method , getter , js_class = "IDBFileHandle" , js_name = onabort)] #[doc = "Getter for the `onabort` field of this object."] @@ -68,6 +93,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/onabort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn onabort(this: &IdbFileHandle) -> Option<::js_sys::Function>; # [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = onabort)] #[doc = "Setter for the `onabort` field of this object."] @@ -75,6 +101,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/onabort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn set_onabort(this: &IdbFileHandle, value: Option<&::js_sys::Function>); # [wasm_bindgen (structural , method , getter , js_class = "IDBFileHandle" , js_name = onerror)] #[doc = "Getter for the `onerror` field of this object."] @@ -82,6 +109,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/onerror)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn onerror(this: &IdbFileHandle) -> Option<::js_sys::Function>; # [wasm_bindgen (structural , method , setter , js_class = "IDBFileHandle" , js_name = onerror)] #[doc = "Setter for the `onerror` field of this object."] @@ -89,6 +117,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/onerror)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn set_onerror(this: &IdbFileHandle, value: Option<&::js_sys::Function>); # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = abort)] #[doc = "The `abort()` method."] @@ -96,6 +125,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`*"] + #[deprecated] pub fn abort(this: &IdbFileHandle) -> Result<(), JsValue>; #[cfg(feature = "IdbFileRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = append)] @@ -104,6 +134,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/append)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn append_with_str( this: &IdbFileHandle, value: &str, @@ -115,6 +146,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/append)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn append_with_array_buffer( this: &IdbFileHandle, value: &::js_sys::ArrayBuffer, @@ -126,6 +158,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/append)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn append_with_array_buffer_view( this: &IdbFileHandle, value: &::js_sys::Object, @@ -137,10 +170,23 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/append)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn append_with_u8_array( this: &IdbFileHandle, value: &mut [u8], ) -> Result, JsValue>; + #[cfg(feature = "IdbFileRequest")] + # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = append)] + #[doc = "The `append()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/append)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] + pub fn append_with_js_u8_array( + this: &IdbFileHandle, + value: &::js_sys::Uint8Array, + ) -> Result, JsValue>; #[cfg(all(feature = "Blob", feature = "IdbFileRequest",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = append)] #[doc = "The `append()` method."] @@ -148,6 +194,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/append)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Blob`, `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn append_with_blob( this: &IdbFileHandle, value: &Blob, @@ -159,6 +206,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/flush)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn flush(this: &IdbFileHandle) -> Result, JsValue>; #[cfg(feature = "IdbFileRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = getMetadata)] @@ -167,6 +215,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/getMetadata)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn get_metadata(this: &IdbFileHandle) -> Result, JsValue>; #[cfg(all(feature = "IdbFileMetadataParameters", feature = "IdbFileRequest",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = getMetadata)] @@ -175,6 +224,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/getMetadata)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileMetadataParameters`, `IdbFileRequest`*"] + #[deprecated] pub fn get_metadata_with_parameters( this: &IdbFileHandle, parameters: &IdbFileMetadataParameters, @@ -186,6 +236,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/readAsArrayBuffer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn read_as_array_buffer_with_u32( this: &IdbFileHandle, size: u32, @@ -197,6 +248,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/readAsArrayBuffer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn read_as_array_buffer_with_f64( this: &IdbFileHandle, size: f64, @@ -208,6 +260,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/readAsText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn read_as_text_with_u32( this: &IdbFileHandle, size: u32, @@ -219,6 +272,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/readAsText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn read_as_text_with_f64( this: &IdbFileHandle, size: f64, @@ -230,6 +284,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/readAsText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn read_as_text_with_u32_and_encoding( this: &IdbFileHandle, size: u32, @@ -242,6 +297,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/readAsText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn read_as_text_with_f64_and_encoding( this: &IdbFileHandle, size: f64, @@ -254,6 +310,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/truncate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn truncate(this: &IdbFileHandle) -> Result, JsValue>; #[cfg(feature = "IdbFileRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = truncate)] @@ -262,6 +319,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/truncate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn truncate_with_u32( this: &IdbFileHandle, size: u32, @@ -273,6 +331,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/truncate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn truncate_with_f64( this: &IdbFileHandle, size: f64, @@ -284,6 +343,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn write_with_str( this: &IdbFileHandle, value: &str, @@ -295,6 +355,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn write_with_array_buffer( this: &IdbFileHandle, value: &::js_sys::ArrayBuffer, @@ -306,6 +367,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn write_with_array_buffer_view( this: &IdbFileHandle, value: &::js_sys::Object, @@ -317,9 +379,22 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn write_with_u8_array( this: &IdbFileHandle, - value: &mut [u8], + value: &[u8], + ) -> Result, JsValue>; + #[cfg(feature = "IdbFileRequest")] + # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = write)] + #[doc = "The `write()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/write)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] + pub fn write_with_js_u8_array( + this: &IdbFileHandle, + value: &::js_sys::Uint8Array, ) -> Result, JsValue>; #[cfg(all(feature = "Blob", feature = "IdbFileRequest",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBFileHandle" , js_name = write)] @@ -328,6 +403,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileHandle/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Blob`, `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn write_with_blob( this: &IdbFileHandle, value: &Blob, diff --git a/crates/web-sys/src/features/gen_IdbFileMetadataParameters.rs b/crates/web-sys/src/features/gen_IdbFileMetadataParameters.rs index 48e322cf182..5f7a67999a1 100644 --- a/crates/web-sys/src/features/gen_IdbFileMetadataParameters.rs +++ b/crates/web-sys/src/features/gen_IdbFileMetadataParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -8,45 +9,51 @@ extern "C" { #[doc = "The `IdbFileMetadataParameters` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] + #[deprecated] pub type IdbFileMetadataParameters; + #[doc = "Get the `lastModified` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "lastModified")] + pub fn get_last_modified(this: &IdbFileMetadataParameters) -> Option; + #[doc = "Change the `lastModified` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "lastModified")] + pub fn set_last_modified(this: &IdbFileMetadataParameters, val: bool); + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &IdbFileMetadataParameters) -> Option; + #[doc = "Change the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &IdbFileMetadataParameters, val: bool); } impl IdbFileMetadataParameters { #[doc = "Construct a new `IdbFileMetadataParameters`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] + #[deprecated] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `lastModified` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] + #[deprecated = "Use `set_last_modified()` instead."] pub fn last_modified(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastModified"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_last_modified(val); self } - #[doc = "Change the `size` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbFileMetadataParameters`*"] + #[deprecated = "Use `set_size()` instead."] pub fn size(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_size(val); self } } diff --git a/crates/web-sys/src/features/gen_IdbFileRequest.rs b/crates/web-sys/src/features/gen_IdbFileRequest.rs index e228c1a79d9..0fb917b9b80 100644 --- a/crates/web-sys/src/features/gen_IdbFileRequest.rs +++ b/crates/web-sys/src/features/gen_IdbFileRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -10,6 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileRequest)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileRequest`*"] + #[deprecated] pub type IdbFileRequest; #[cfg(feature = "IdbFileHandle")] # [wasm_bindgen (structural , method , getter , js_class = "IDBFileRequest" , js_name = fileHandle)] @@ -18,6 +20,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileRequest/fileHandle)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn file_handle(this: &IdbFileRequest) -> Option; #[cfg(feature = "IdbFileHandle")] # [wasm_bindgen (structural , method , getter , js_class = "IDBFileRequest" , js_name = lockedFile)] @@ -26,6 +29,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileRequest/lockedFile)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbFileRequest`*"] + #[deprecated] pub fn locked_file(this: &IdbFileRequest) -> Option; # [wasm_bindgen (structural , method , getter , js_class = "IDBFileRequest" , js_name = onprogress)] #[doc = "Getter for the `onprogress` field of this object."] @@ -33,6 +37,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileRequest/onprogress)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileRequest`*"] + #[deprecated] pub fn onprogress(this: &IdbFileRequest) -> Option<::js_sys::Function>; # [wasm_bindgen (structural , method , setter , js_class = "IDBFileRequest" , js_name = onprogress)] #[doc = "Setter for the `onprogress` field of this object."] @@ -40,5 +45,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBFileRequest/onprogress)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileRequest`*"] + #[deprecated] pub fn set_onprogress(this: &IdbFileRequest, value: Option<&::js_sys::Function>); } diff --git a/crates/web-sys/src/features/gen_IdbIndex.rs b/crates/web-sys/src/features/gen_IdbIndex.rs index 98a76e657e8..f2689e4cbf2 100644 --- a/crates/web-sys/src/features/gen_IdbIndex.rs +++ b/crates/web-sys/src/features/gen_IdbIndex.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndex`*"] - pub fn name(this: &IdbIndex) -> String; + pub fn name(this: &IdbIndex) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "IDBIndex" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -60,13 +61,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/locale)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndex`*"] - pub fn locale(this: &IdbIndex) -> Option; + #[deprecated] + pub fn locale(this: &IdbIndex) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "IDBIndex" , js_name = isAutoLocale)] #[doc = "Getter for the `isAutoLocale` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/isAutoLocale)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndex`*"] + #[deprecated] pub fn is_auto_locale(this: &IdbIndex) -> bool; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = count)] @@ -85,7 +88,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] pub fn count_with_key( this: &IdbIndex, - key: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = get)] @@ -94,7 +97,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/get)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] - pub fn get(this: &IdbIndex, key: &::wasm_bindgen::JsValue) -> Result; + pub fn get(this: &IdbIndex, query: &::wasm_bindgen::JsValue) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = getAll)] #[doc = "The `getAll()` method."] @@ -112,7 +115,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] pub fn get_all_with_key( this: &IdbIndex, - key: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = getAll)] @@ -123,8 +126,8 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] pub fn get_all_with_key_and_limit( this: &IdbIndex, - key: &::wasm_bindgen::JsValue, - limit: u32, + query: &::wasm_bindgen::JsValue, + count: u32, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = getAllKeys)] @@ -143,7 +146,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] pub fn get_all_keys_with_key( this: &IdbIndex, - key: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = getAllKeys)] @@ -154,8 +157,8 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] pub fn get_all_keys_with_key_and_limit( this: &IdbIndex, - key: &::wasm_bindgen::JsValue, - limit: u32, + query: &::wasm_bindgen::JsValue, + count: u32, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = getKey)] @@ -164,7 +167,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/getKey)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] - pub fn get_key(this: &IdbIndex, key: &::wasm_bindgen::JsValue) -> Result; + pub fn get_key(this: &IdbIndex, query: &::wasm_bindgen::JsValue) + -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = openCursor)] #[doc = "The `openCursor()` method."] @@ -182,7 +186,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] pub fn open_cursor_with_range( this: &IdbIndex, - range: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(all(feature = "IdbCursorDirection", feature = "IdbRequest",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = openCursor)] @@ -193,7 +197,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbCursorDirection`, `IdbIndex`, `IdbRequest`*"] pub fn open_cursor_with_range_and_direction( this: &IdbIndex, - range: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, direction: IdbCursorDirection, ) -> Result; #[cfg(feature = "IdbRequest")] @@ -213,7 +217,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbIndex`, `IdbRequest`*"] pub fn open_key_cursor_with_range( this: &IdbIndex, - range: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(all(feature = "IdbCursorDirection", feature = "IdbRequest",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBIndex" , js_name = openKeyCursor)] @@ -224,7 +228,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbCursorDirection`, `IdbIndex`, `IdbRequest`*"] pub fn open_key_cursor_with_range_and_direction( this: &IdbIndex, - range: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, direction: IdbCursorDirection, ) -> Result; } diff --git a/crates/web-sys/src/features/gen_IdbIndexParameters.rs b/crates/web-sys/src/features/gen_IdbIndexParameters.rs index 7da00bccfc4..a505954bc37 100644 --- a/crates/web-sys/src/features/gen_IdbIndexParameters.rs +++ b/crates/web-sys/src/features/gen_IdbIndexParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] pub type IdbIndexParameters; + #[doc = "Get the `locale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "locale")] + pub fn get_locale(this: &IdbIndexParameters) -> Option<::alloc::string::String>; + #[doc = "Change the `locale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "locale")] + pub fn set_locale(this: &IdbIndexParameters, val: Option<&str>); + #[doc = "Get the `multiEntry` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[wasm_bindgen(method, getter = "multiEntry")] + pub fn get_multi_entry(this: &IdbIndexParameters) -> Option; + #[doc = "Change the `multiEntry` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[wasm_bindgen(method, setter = "multiEntry")] + pub fn set_multi_entry(this: &IdbIndexParameters, val: bool); + #[doc = "Get the `unique` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[wasm_bindgen(method, getter = "unique")] + pub fn get_unique(this: &IdbIndexParameters) -> Option; + #[doc = "Change the `unique` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[wasm_bindgen(method, setter = "unique")] + pub fn set_unique(this: &IdbIndexParameters, val: bool); } impl IdbIndexParameters { #[doc = "Construct a new `IdbIndexParameters`."] @@ -19,49 +52,19 @@ impl IdbIndexParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `locale` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[deprecated = "Use `set_locale()` instead."] pub fn locale(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("locale"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_locale(val); self } - #[doc = "Change the `multiEntry` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[deprecated = "Use `set_multi_entry()` instead."] pub fn multi_entry(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("multiEntry"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_multi_entry(val); self } - #[doc = "Change the `unique` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbIndexParameters`*"] + #[deprecated = "Use `set_unique()` instead."] pub fn unique(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("unique"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_unique(val); self } } diff --git a/crates/web-sys/src/features/gen_IdbKeyRange.rs b/crates/web-sys/src/features/gen_IdbKeyRange.rs index 6a9841624e1..b37d5b243ab 100644 --- a/crates/web-sys/src/features/gen_IdbKeyRange.rs +++ b/crates/web-sys/src/features/gen_IdbKeyRange.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -42,7 +43,7 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = IdbKeyRange , js_class = "IDBKeyRange" , js_name = bound)] #[doc = "The `bound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/bound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/bound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbKeyRange`*"] pub fn bound( @@ -52,7 +53,7 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = IdbKeyRange , js_class = "IDBKeyRange" , js_name = bound)] #[doc = "The `bound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/bound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/bound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbKeyRange`*"] pub fn bound_with_lower_open( @@ -63,7 +64,7 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = IdbKeyRange , js_class = "IDBKeyRange" , js_name = bound)] #[doc = "The `bound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/bound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/bound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbKeyRange`*"] pub fn bound_with_lower_open_and_upper_open( @@ -82,14 +83,14 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = IdbKeyRange , js_class = "IDBKeyRange" , js_name = lowerBound)] #[doc = "The `lowerBound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/lowerBound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/lowerBound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbKeyRange`*"] pub fn lower_bound(lower: &::wasm_bindgen::JsValue) -> Result; # [wasm_bindgen (catch , static_method_of = IdbKeyRange , js_class = "IDBKeyRange" , js_name = lowerBound)] #[doc = "The `lowerBound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/lowerBound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/lowerBound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbKeyRange`*"] pub fn lower_bound_with_open( @@ -99,21 +100,21 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = IdbKeyRange , js_class = "IDBKeyRange" , js_name = only)] #[doc = "The `only()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/only)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/only_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbKeyRange`*"] pub fn only(value: &::wasm_bindgen::JsValue) -> Result; # [wasm_bindgen (catch , static_method_of = IdbKeyRange , js_class = "IDBKeyRange" , js_name = upperBound)] #[doc = "The `upperBound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/upperBound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/upperBound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbKeyRange`*"] pub fn upper_bound(upper: &::wasm_bindgen::JsValue) -> Result; # [wasm_bindgen (catch , static_method_of = IdbKeyRange , js_class = "IDBKeyRange" , js_name = upperBound)] #[doc = "The `upperBound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/upperBound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/upperBound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbKeyRange`*"] pub fn upper_bound_with_open( diff --git a/crates/web-sys/src/features/gen_IdbLocaleAwareKeyRange.rs b/crates/web-sys/src/features/gen_IdbLocaleAwareKeyRange.rs index 09420bd3bf0..ca0dae2f914 100644 --- a/crates/web-sys/src/features/gen_IdbLocaleAwareKeyRange.rs +++ b/crates/web-sys/src/features/gen_IdbLocaleAwareKeyRange.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -10,13 +11,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBLocaleAwareKeyRange)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbLocaleAwareKeyRange`*"] + #[deprecated] pub type IdbLocaleAwareKeyRange; # [wasm_bindgen (catch , static_method_of = IdbLocaleAwareKeyRange , js_class = "IDBLocaleAwareKeyRange" , js_name = bound)] #[doc = "The `bound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBLocaleAwareKeyRange/bound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBLocaleAwareKeyRange/bound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbLocaleAwareKeyRange`*"] + #[deprecated] pub fn bound( lower: &::wasm_bindgen::JsValue, upper: &::wasm_bindgen::JsValue, @@ -24,9 +27,10 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = IdbLocaleAwareKeyRange , js_class = "IDBLocaleAwareKeyRange" , js_name = bound)] #[doc = "The `bound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBLocaleAwareKeyRange/bound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBLocaleAwareKeyRange/bound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbLocaleAwareKeyRange`*"] + #[deprecated] pub fn bound_with_lower_open( lower: &::wasm_bindgen::JsValue, upper: &::wasm_bindgen::JsValue, @@ -35,9 +39,10 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = IdbLocaleAwareKeyRange , js_class = "IDBLocaleAwareKeyRange" , js_name = bound)] #[doc = "The `bound()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBLocaleAwareKeyRange/bound)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBLocaleAwareKeyRange/bound_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbLocaleAwareKeyRange`*"] + #[deprecated] pub fn bound_with_lower_open_and_upper_open( lower: &::wasm_bindgen::JsValue, upper: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_IdbMutableFile.rs b/crates/web-sys/src/features/gen_IdbMutableFile.rs index 47284d12141..13a46d5ee34 100644 --- a/crates/web-sys/src/features/gen_IdbMutableFile.rs +++ b/crates/web-sys/src/features/gen_IdbMutableFile.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -10,6 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbMutableFile`*"] + #[deprecated] pub type IdbMutableFile; # [wasm_bindgen (structural , method , getter , js_class = "IDBMutableFile" , js_name = name)] #[doc = "Getter for the `name` field of this object."] @@ -17,14 +19,16 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbMutableFile`*"] - pub fn name(this: &IdbMutableFile) -> String; + #[deprecated] + pub fn name(this: &IdbMutableFile) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "IDBMutableFile" , 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/IDBMutableFile/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbMutableFile`*"] - pub fn type_(this: &IdbMutableFile) -> String; + #[deprecated] + pub fn type_(this: &IdbMutableFile) -> ::alloc::string::String; #[cfg(feature = "IdbDatabase")] # [wasm_bindgen (structural , method , getter , js_class = "IDBMutableFile" , js_name = database)] #[doc = "Getter for the `database` field of this object."] @@ -32,6 +36,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile/database)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbMutableFile`*"] + #[deprecated] pub fn database(this: &IdbMutableFile) -> IdbDatabase; # [wasm_bindgen (structural , method , getter , js_class = "IDBMutableFile" , js_name = onabort)] #[doc = "Getter for the `onabort` field of this object."] @@ -39,6 +44,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile/onabort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbMutableFile`*"] + #[deprecated] pub fn onabort(this: &IdbMutableFile) -> Option<::js_sys::Function>; # [wasm_bindgen (structural , method , setter , js_class = "IDBMutableFile" , js_name = onabort)] #[doc = "Setter for the `onabort` field of this object."] @@ -46,6 +52,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile/onabort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbMutableFile`*"] + #[deprecated] pub fn set_onabort(this: &IdbMutableFile, value: Option<&::js_sys::Function>); # [wasm_bindgen (structural , method , getter , js_class = "IDBMutableFile" , js_name = onerror)] #[doc = "Getter for the `onerror` field of this object."] @@ -53,6 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile/onerror)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbMutableFile`*"] + #[deprecated] pub fn onerror(this: &IdbMutableFile) -> Option<::js_sys::Function>; # [wasm_bindgen (structural , method , setter , js_class = "IDBMutableFile" , js_name = onerror)] #[doc = "Setter for the `onerror` field of this object."] @@ -60,6 +68,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile/onerror)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbMutableFile`*"] + #[deprecated] pub fn set_onerror(this: &IdbMutableFile, value: Option<&::js_sys::Function>); #[cfg(feature = "DomRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBMutableFile" , js_name = getFile)] @@ -68,6 +77,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile/getFile)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRequest`, `IdbMutableFile`*"] + #[deprecated] pub fn get_file(this: &IdbMutableFile) -> Result; #[cfg(feature = "IdbFileHandle")] # [wasm_bindgen (catch , method , structural , js_class = "IDBMutableFile" , js_name = open)] @@ -76,5 +86,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile/open)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbFileHandle`, `IdbMutableFile`*"] + #[deprecated] pub fn open(this: &IdbMutableFile) -> Result; } diff --git a/crates/web-sys/src/features/gen_IdbObjectStore.rs b/crates/web-sys/src/features/gen_IdbObjectStore.rs index b662f01fb4a..cc48afb53e5 100644 --- a/crates/web-sys/src/features/gen_IdbObjectStore.rs +++ b/crates/web-sys/src/features/gen_IdbObjectStore.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`*"] - pub fn name(this: &IdbObjectStore) -> String; + pub fn name(this: &IdbObjectStore) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "IDBObjectStore" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -103,7 +104,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn count_with_key( this: &IdbObjectStore, - key: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(feature = "IdbIndex")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = createIndex)] @@ -140,7 +141,7 @@ extern "C" { this: &IdbObjectStore, name: &str, key_path: &str, - optional_parameters: &IdbIndexParameters, + options: &IdbIndexParameters, ) -> Result; #[cfg(all(feature = "IdbIndex", feature = "IdbIndexParameters",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = createIndex)] @@ -153,7 +154,7 @@ extern "C" { this: &IdbObjectStore, name: &str, key_path: &::wasm_bindgen::JsValue, - optional_parameters: &IdbIndexParameters, + options: &IdbIndexParameters, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = delete)] @@ -164,7 +165,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn delete( this: &IdbObjectStore, - key: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = deleteIndex)] #[doc = "The `deleteIndex()` method."] @@ -172,7 +173,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/deleteIndex)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`*"] - pub fn delete_index(this: &IdbObjectStore, index_name: &str) -> Result<(), JsValue>; + pub fn delete_index(this: &IdbObjectStore, name: &str) -> Result<(), JsValue>; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = get)] #[doc = "The `get()` method."] @@ -180,8 +181,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/get)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] - pub fn get(this: &IdbObjectStore, key: &::wasm_bindgen::JsValue) - -> Result; + pub fn get( + this: &IdbObjectStore, + query: &::wasm_bindgen::JsValue, + ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = getAll)] #[doc = "The `getAll()` method."] @@ -199,7 +202,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn get_all_with_key( this: &IdbObjectStore, - key: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = getAll)] @@ -210,8 +213,8 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn get_all_with_key_and_limit( this: &IdbObjectStore, - key: &::wasm_bindgen::JsValue, - limit: u32, + query: &::wasm_bindgen::JsValue, + count: u32, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = getAllKeys)] @@ -230,7 +233,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn get_all_keys_with_key( this: &IdbObjectStore, - key: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = getAllKeys)] @@ -241,8 +244,8 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn get_all_keys_with_key_and_limit( this: &IdbObjectStore, - key: &::wasm_bindgen::JsValue, - limit: u32, + query: &::wasm_bindgen::JsValue, + count: u32, ) -> Result; #[cfg(feature = "IdbRequest")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = getKey)] @@ -253,7 +256,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn get_key( this: &IdbObjectStore, - key: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(feature = "IdbIndex")] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = index)] @@ -280,7 +283,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn open_cursor_with_range( this: &IdbObjectStore, - range: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(all(feature = "IdbCursorDirection", feature = "IdbRequest",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = openCursor)] @@ -291,7 +294,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbCursorDirection`, `IdbObjectStore`, `IdbRequest`*"] pub fn open_cursor_with_range_and_direction( this: &IdbObjectStore, - range: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, direction: IdbCursorDirection, ) -> Result; #[cfg(feature = "IdbRequest")] @@ -311,7 +314,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbObjectStore`, `IdbRequest`*"] pub fn open_key_cursor_with_range( this: &IdbObjectStore, - range: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, ) -> Result; #[cfg(all(feature = "IdbCursorDirection", feature = "IdbRequest",))] # [wasm_bindgen (catch , method , structural , js_class = "IDBObjectStore" , js_name = openKeyCursor)] @@ -322,7 +325,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `IdbCursorDirection`, `IdbObjectStore`, `IdbRequest`*"] pub fn open_key_cursor_with_range_and_direction( this: &IdbObjectStore, - range: &::wasm_bindgen::JsValue, + query: &::wasm_bindgen::JsValue, direction: IdbCursorDirection, ) -> Result; #[cfg(feature = "IdbRequest")] diff --git a/crates/web-sys/src/features/gen_IdbObjectStoreParameters.rs b/crates/web-sys/src/features/gen_IdbObjectStoreParameters.rs index d151ccc213f..03ce907e3c8 100644 --- a/crates/web-sys/src/features/gen_IdbObjectStoreParameters.rs +++ b/crates/web-sys/src/features/gen_IdbObjectStoreParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] pub type IdbObjectStoreParameters; + #[doc = "Get the `autoIncrement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] + #[wasm_bindgen(method, getter = "autoIncrement")] + pub fn get_auto_increment(this: &IdbObjectStoreParameters) -> Option; + #[doc = "Change the `autoIncrement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] + #[wasm_bindgen(method, setter = "autoIncrement")] + pub fn set_auto_increment(this: &IdbObjectStoreParameters, val: bool); + #[doc = "Get the `keyPath` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] + #[wasm_bindgen(method, getter = "keyPath")] + pub fn get_key_path(this: &IdbObjectStoreParameters) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `keyPath` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] + #[wasm_bindgen(method, setter = "keyPath")] + pub fn set_key_path(this: &IdbObjectStoreParameters, val: &::wasm_bindgen::JsValue); } impl IdbObjectStoreParameters { #[doc = "Construct a new `IdbObjectStoreParameters`."] @@ -19,38 +40,14 @@ impl IdbObjectStoreParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `autoIncrement` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] + #[deprecated = "Use `set_auto_increment()` instead."] pub fn auto_increment(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoIncrement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_auto_increment(val); self } - #[doc = "Change the `keyPath` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbObjectStoreParameters`*"] + #[deprecated = "Use `set_key_path()` instead."] pub fn key_path(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyPath"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key_path(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } } diff --git a/crates/web-sys/src/features/gen_IdbOpenDbOptions.rs b/crates/web-sys/src/features/gen_IdbOpenDbOptions.rs index 57ded3a72f8..b9fc6f4eb2b 100644 --- a/crates/web-sys/src/features/gen_IdbOpenDbOptions.rs +++ b/crates/web-sys/src/features/gen_IdbOpenDbOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -8,50 +9,54 @@ extern "C" { #[doc = "The `IdbOpenDbOptions` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`*"] + #[deprecated] pub type IdbOpenDbOptions; + #[cfg(feature = "StorageType")] + #[doc = "Get the `storage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`, `StorageType`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "storage")] + pub fn get_storage(this: &IdbOpenDbOptions) -> Option; + #[cfg(feature = "StorageType")] + #[doc = "Change the `storage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`, `StorageType`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "storage")] + pub fn set_storage(this: &IdbOpenDbOptions, val: StorageType); + #[doc = "Get the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "version")] + pub fn get_version(this: &IdbOpenDbOptions) -> Option; + #[doc = "Change the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "version")] + pub fn set_version(this: &IdbOpenDbOptions, val: f64); } impl IdbOpenDbOptions { #[doc = "Construct a new `IdbOpenDbOptions`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`*"] + #[deprecated] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } #[cfg(feature = "StorageType")] - #[doc = "Change the `storage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`, `StorageType`*"] + #[deprecated = "Use `set_storage()` instead."] pub fn storage(&mut self, val: StorageType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_storage(val); self } - #[doc = "Change the `version` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbOpenDbOptions`*"] + #[deprecated = "Use `set_version()` instead."] pub fn version(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_version(val); self } } diff --git a/crates/web-sys/src/features/gen_IdbOpenDbRequest.rs b/crates/web-sys/src/features/gen_IdbOpenDbRequest.rs index 2810085daff..5be55d72d71 100644 --- a/crates/web-sys/src/features/gen_IdbOpenDbRequest.rs +++ b/crates/web-sys/src/features/gen_IdbOpenDbRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_IdbRequest.rs b/crates/web-sys/src/features/gen_IdbRequest.rs index e6f54e2ea84..34007389821 100644 --- a/crates/web-sys/src/features/gen_IdbRequest.rs +++ b/crates/web-sys/src/features/gen_IdbRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_IdbRequestReadyState.rs b/crates/web-sys/src/features/gen_IdbRequestReadyState.rs index bd5a50e69f8..49644e6e6ba 100644 --- a/crates/web-sys/src/features/gen_IdbRequestReadyState.rs +++ b/crates/web-sys/src/features/gen_IdbRequestReadyState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `IdbRequestReadyState` enum."] diff --git a/crates/web-sys/src/features/gen_IdbTransaction.rs b/crates/web-sys/src/features/gen_IdbTransaction.rs index 9e10c9295d1..cf83d06efd2 100644 --- a/crates/web-sys/src/features/gen_IdbTransaction.rs +++ b/crates/web-sys/src/features/gen_IdbTransaction.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -11,6 +12,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbTransaction`*"] pub type IdbTransaction; + #[cfg(feature = "DomStringList")] + # [wasm_bindgen (structural , method , getter , js_class = "IDBTransaction" , js_name = objectStoreNames)] + #[doc = "Getter for the `objectStoreNames` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/objectStoreNames)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomStringList`, `IdbTransaction`*"] + pub fn object_store_names(this: &IdbTransaction) -> DomStringList; #[cfg(feature = "IdbTransactionMode")] # [wasm_bindgen (structural , catch , method , getter , js_class = "IDBTransaction" , js_name = mode)] #[doc = "Getter for the `mode` field of this object."] @@ -77,14 +86,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbTransaction`*"] pub fn set_onerror(this: &IdbTransaction, value: Option<&::js_sys::Function>); - #[cfg(feature = "DomStringList")] - # [wasm_bindgen (structural , method , getter , js_class = "IDBTransaction" , js_name = objectStoreNames)] - #[doc = "Getter for the `objectStoreNames` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/objectStoreNames)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomStringList`, `IdbTransaction`*"] - pub fn object_store_names(this: &IdbTransaction) -> DomStringList; # [wasm_bindgen (catch , method , structural , js_class = "IDBTransaction" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] @@ -98,6 +99,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/commit)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbTransaction`*"] + #[deprecated] pub fn commit(this: &IdbTransaction) -> Result<(), JsValue>; #[cfg(feature = "IdbObjectStore")] # [wasm_bindgen (catch , method , structural , js_class = "IDBTransaction" , js_name = objectStore)] diff --git a/crates/web-sys/src/features/gen_IdbTransactionDurability.rs b/crates/web-sys/src/features/gen_IdbTransactionDurability.rs new file mode 100644 index 00000000000..756fac38578 --- /dev/null +++ b/crates/web-sys/src/features/gen_IdbTransactionDurability.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `IdbTransactionDurability` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `IdbTransactionDurability`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum IdbTransactionDurability { + Default = "default", + Strict = "strict", + Relaxed = "relaxed", +} diff --git a/crates/web-sys/src/features/gen_IdbTransactionMode.rs b/crates/web-sys/src/features/gen_IdbTransactionMode.rs index 8f0eb76476d..e0886c5284e 100644 --- a/crates/web-sys/src/features/gen_IdbTransactionMode.rs +++ b/crates/web-sys/src/features/gen_IdbTransactionMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `IdbTransactionMode` enum."] @@ -8,7 +9,7 @@ use wasm_bindgen::prelude::*; pub enum IdbTransactionMode { Readonly = "readonly", Readwrite = "readwrite", + Versionchange = "versionchange", Readwriteflush = "readwriteflush", Cleanup = "cleanup", - Versionchange = "versionchange", } diff --git a/crates/web-sys/src/features/gen_IdbTransactionOptions.rs b/crates/web-sys/src/features/gen_IdbTransactionOptions.rs new file mode 100644 index 00000000000..5f4ac1cd485 --- /dev/null +++ b/crates/web-sys/src/features/gen_IdbTransactionOptions.rs @@ -0,0 +1,64 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = IDBTransactionOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `IdbTransactionOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbTransactionOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type IdbTransactionOptions; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "IdbTransactionDurability")] + #[doc = "Get the `durability` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbTransactionDurability`, `IdbTransactionOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "durability")] + pub fn get_durability(this: &IdbTransactionOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "IdbTransactionDurability")] + #[doc = "Change the `durability` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbTransactionDurability`, `IdbTransactionOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "durability")] + pub fn set_durability(this: &IdbTransactionOptions, val: IdbTransactionDurability); +} +#[cfg(web_sys_unstable_apis)] +impl IdbTransactionOptions { + #[doc = "Construct a new `IdbTransactionOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbTransactionOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "IdbTransactionDurability")] + #[deprecated = "Use `set_durability()` instead."] + pub fn durability(&mut self, val: IdbTransactionDurability) -> &mut Self { + self.set_durability(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for IdbTransactionOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_IdbVersionChangeEvent.rs b/crates/web-sys/src/features/gen_IdbVersionChangeEvent.rs index 32348fce7f4..7e6892ab250 100644 --- a/crates/web-sys/src/features/gen_IdbVersionChangeEvent.rs +++ b/crates/web-sys/src/features/gen_IdbVersionChangeEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_IdbVersionChangeEventInit.rs b/crates/web-sys/src/features/gen_IdbVersionChangeEventInit.rs index 5ec7d76eb5c..ccd13f69620 100644 --- a/crates/web-sys/src/features/gen_IdbVersionChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_IdbVersionChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] pub type IdbVersionChangeEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &IdbVersionChangeEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &IdbVersionChangeEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &IdbVersionChangeEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &IdbVersionChangeEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &IdbVersionChangeEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &IdbVersionChangeEventInit, val: bool); + #[doc = "Get the `newVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, getter = "newVersion")] + pub fn get_new_version(this: &IdbVersionChangeEventInit) -> Option; + #[doc = "Change the `newVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, setter = "newVersion")] + pub fn set_new_version(this: &IdbVersionChangeEventInit, val: Option); + #[doc = "Get the `oldVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, getter = "oldVersion")] + pub fn get_old_version(this: &IdbVersionChangeEventInit) -> Option; + #[doc = "Change the `oldVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[wasm_bindgen(method, setter = "oldVersion")] + pub fn set_old_version(this: &IdbVersionChangeEventInit, val: f64); } impl IdbVersionChangeEventInit { #[doc = "Construct a new `IdbVersionChangeEventInit`."] @@ -19,89 +70,29 @@ impl IdbVersionChangeEventInit { 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: `IdbVersionChangeEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `newVersion` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[deprecated = "Use `set_new_version()` instead."] pub fn new_version(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("newVersion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_new_version(val); self } - #[doc = "Change the `oldVersion` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbVersionChangeEventInit`*"] + #[deprecated = "Use `set_old_version()` instead."] pub fn old_version(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("oldVersion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_old_version(val); self } } diff --git a/crates/web-sys/src/features/gen_IdleDeadline.rs b/crates/web-sys/src/features/gen_IdleDeadline.rs index d79f9ae5e98..6776e6b1ebc 100644 --- a/crates/web-sys/src/features/gen_IdleDeadline.rs +++ b/crates/web-sys/src/features/gen_IdleDeadline.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_IdleRequestOptions.rs b/crates/web-sys/src/features/gen_IdleRequestOptions.rs index 06abc336e72..cd5e78a4b18 100644 --- a/crates/web-sys/src/features/gen_IdleRequestOptions.rs +++ b/crates/web-sys/src/features/gen_IdleRequestOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IdleRequestOptions`*"] pub type IdleRequestOptions; + #[doc = "Get the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdleRequestOptions`*"] + #[wasm_bindgen(method, getter = "timeout")] + pub fn get_timeout(this: &IdleRequestOptions) -> Option; + #[doc = "Change the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdleRequestOptions`*"] + #[wasm_bindgen(method, setter = "timeout")] + pub fn set_timeout(this: &IdleRequestOptions, val: u32); } impl IdleRequestOptions { #[doc = "Construct a new `IdleRequestOptions`."] @@ -19,21 +30,9 @@ impl IdleRequestOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `timeout` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdleRequestOptions`*"] + #[deprecated = "Use `set_timeout()` instead."] pub fn timeout(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeout"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timeout(val); self } } diff --git a/crates/web-sys/src/features/gen_IirFilterNode.rs b/crates/web-sys/src/features/gen_IirFilterNode.rs index 833bd3073c3..90fa7b187d6 100644 --- a/crates/web-sys/src/features/gen_IirFilterNode.rs +++ b/crates/web-sys/src/features/gen_IirFilterNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -34,4 +35,88 @@ extern "C" { mag_response: &mut [f32], phase_response: &mut [f32], ); + # [wasm_bindgen (method , structural , js_class = "IIRFilterNode" , js_name = getFrequencyResponse)] + #[doc = "The `getFrequencyResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IIRFilterNode/getFrequencyResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterNode`*"] + pub fn get_frequency_response_with_f32_array_and_f32_slice_and_f32_slice( + this: &IirFilterNode, + frequency_hz: &::js_sys::Float32Array, + mag_response: &mut [f32], + phase_response: &mut [f32], + ); + # [wasm_bindgen (method , structural , js_class = "IIRFilterNode" , js_name = getFrequencyResponse)] + #[doc = "The `getFrequencyResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IIRFilterNode/getFrequencyResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterNode`*"] + pub fn get_frequency_response_with_f32_slice_and_f32_array_and_f32_slice( + this: &IirFilterNode, + frequency_hz: &mut [f32], + mag_response: &::js_sys::Float32Array, + phase_response: &mut [f32], + ); + # [wasm_bindgen (method , structural , js_class = "IIRFilterNode" , js_name = getFrequencyResponse)] + #[doc = "The `getFrequencyResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IIRFilterNode/getFrequencyResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterNode`*"] + pub fn get_frequency_response_with_f32_array_and_f32_array_and_f32_slice( + this: &IirFilterNode, + frequency_hz: &::js_sys::Float32Array, + mag_response: &::js_sys::Float32Array, + phase_response: &mut [f32], + ); + # [wasm_bindgen (method , structural , js_class = "IIRFilterNode" , js_name = getFrequencyResponse)] + #[doc = "The `getFrequencyResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IIRFilterNode/getFrequencyResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterNode`*"] + pub fn get_frequency_response_with_f32_slice_and_f32_slice_and_f32_array( + this: &IirFilterNode, + frequency_hz: &mut [f32], + mag_response: &mut [f32], + phase_response: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "IIRFilterNode" , js_name = getFrequencyResponse)] + #[doc = "The `getFrequencyResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IIRFilterNode/getFrequencyResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterNode`*"] + pub fn get_frequency_response_with_f32_array_and_f32_slice_and_f32_array( + this: &IirFilterNode, + frequency_hz: &::js_sys::Float32Array, + mag_response: &mut [f32], + phase_response: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "IIRFilterNode" , js_name = getFrequencyResponse)] + #[doc = "The `getFrequencyResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IIRFilterNode/getFrequencyResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterNode`*"] + pub fn get_frequency_response_with_f32_slice_and_f32_array_and_f32_array( + this: &IirFilterNode, + frequency_hz: &mut [f32], + mag_response: &::js_sys::Float32Array, + phase_response: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "IIRFilterNode" , js_name = getFrequencyResponse)] + #[doc = "The `getFrequencyResponse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IIRFilterNode/getFrequencyResponse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterNode`*"] + pub fn get_frequency_response_with_f32_array_and_f32_array_and_f32_array( + this: &IirFilterNode, + frequency_hz: &::js_sys::Float32Array, + mag_response: &::js_sys::Float32Array, + phase_response: &::js_sys::Float32Array, + ); } diff --git a/crates/web-sys/src/features/gen_IirFilterOptions.rs b/crates/web-sys/src/features/gen_IirFilterOptions.rs index 2961ffc0c81..c59d296f33f 100644 --- a/crates/web-sys/src/features/gen_IirFilterOptions.rs +++ b/crates/web-sys/src/features/gen_IirFilterOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,60 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] pub type IirFilterOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &IirFilterOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &IirFilterOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `IirFilterOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &IirFilterOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `IirFilterOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &IirFilterOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `IirFilterOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &IirFilterOptions) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `IirFilterOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &IirFilterOptions, val: ChannelInterpretation); + #[doc = "Get the `feedback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[wasm_bindgen(method, getter = "feedback")] + pub fn get_feedback(this: &IirFilterOptions) -> ::js_sys::Array; + #[doc = "Change the `feedback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[wasm_bindgen(method, setter = "feedback")] + pub fn set_feedback(this: &IirFilterOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `feedforward` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[wasm_bindgen(method, getter = "feedforward")] + pub fn get_feedforward(this: &IirFilterOptions) -> ::js_sys::Array; + #[doc = "Change the `feedforward` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[wasm_bindgen(method, setter = "feedforward")] + pub fn set_feedforward(this: &IirFilterOptions, val: &::wasm_bindgen::JsValue); } impl IirFilterOptions { #[doc = "Construct a new `IirFilterOptions`."] @@ -17,95 +72,35 @@ impl IirFilterOptions { pub fn new(feedback: &::wasm_bindgen::JsValue, feedforward: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.feedback(feedback); - ret.feedforward(feedforward); + ret.set_feedback(feedback); + ret.set_feedforward(feedforward); ret } - #[doc = "Change the `channelCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `IirFilterOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `IirFilterOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `feedback` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[deprecated = "Use `set_feedback()` instead."] pub fn feedback(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("feedback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_feedback(val); self } - #[doc = "Change the `feedforward` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IirFilterOptions`*"] + #[deprecated = "Use `set_feedforward()` instead."] pub fn feedforward(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("feedforward"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_feedforward(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageBitmap.rs b/crates/web-sys/src/features/gen_ImageBitmap.rs index c400d2f813d..4a08e980d6c 100644 --- a/crates/web-sys/src/features/gen_ImageBitmap.rs +++ b/crates/web-sys/src/features/gen_ImageBitmap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -32,60 +33,4 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`*"] pub fn close(this: &ImageBitmap); - #[cfg(feature = "ImageBitmapFormat")] - # [wasm_bindgen (catch , method , structural , js_class = "ImageBitmap" , js_name = findOptimalFormat)] - #[doc = "The `findOptimalFormat()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap/findOptimalFormat)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapFormat`*"] - pub fn find_optimal_format(this: &ImageBitmap) -> Result; - #[cfg(feature = "ImageBitmapFormat")] - # [wasm_bindgen (catch , method , structural , js_class = "ImageBitmap" , js_name = findOptimalFormat)] - #[doc = "The `findOptimalFormat()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap/findOptimalFormat)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapFormat`*"] - pub fn find_optimal_format_with_a_possible_formats( - this: &ImageBitmap, - a_possible_formats: &::wasm_bindgen::JsValue, - ) -> Result; - #[cfg(feature = "ImageBitmapFormat")] - # [wasm_bindgen (catch , method , structural , js_class = "ImageBitmap" , js_name = mapDataInto)] - #[doc = "The `mapDataInto()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap/mapDataInto)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapFormat`*"] - pub fn map_data_into_with_buffer_source( - this: &ImageBitmap, - a_format: ImageBitmapFormat, - a_buffer: &::js_sys::Object, - a_offset: i32, - ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "ImageBitmapFormat")] - # [wasm_bindgen (catch , method , structural , js_class = "ImageBitmap" , js_name = mapDataInto)] - #[doc = "The `mapDataInto()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap/mapDataInto)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapFormat`*"] - pub fn map_data_into_with_u8_array( - this: &ImageBitmap, - a_format: ImageBitmapFormat, - a_buffer: &mut [u8], - a_offset: i32, - ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "ImageBitmapFormat")] - # [wasm_bindgen (catch , method , structural , js_class = "ImageBitmap" , js_name = mappedDataLength)] - #[doc = "The `mappedDataLength()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap/mappedDataLength)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapFormat`*"] - pub fn mapped_data_length( - this: &ImageBitmap, - a_format: ImageBitmapFormat, - ) -> Result; } diff --git a/crates/web-sys/src/features/gen_ImageBitmapFormat.rs b/crates/web-sys/src/features/gen_ImageBitmapFormat.rs deleted file mode 100644 index e3d63c57376..00000000000 --- a/crates/web-sys/src/features/gen_ImageBitmapFormat.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![allow(unused_imports)] -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -#[doc = "The `ImageBitmapFormat` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `ImageBitmapFormat`*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum ImageBitmapFormat { - Rgba32 = "RGBA32", - Bgra32 = "BGRA32", - Rgb24 = "RGB24", - Bgr24 = "BGR24", - Gray8 = "GRAY8", - Yuv444p = "YUV444P", - Yuv422p = "YUV422P", - Yuv420p = "YUV420P", - Yuv420spNv12 = "YUV420SP_NV12", - Yuv420spNv21 = "YUV420SP_NV21", - Hsv = "HSV", - Lab = "Lab", - Depth = "DEPTH", -} diff --git a/crates/web-sys/src/features/gen_ImageBitmapOptions.rs b/crates/web-sys/src/features/gen_ImageBitmapOptions.rs new file mode 100644 index 00000000000..2c641c50b29 --- /dev/null +++ b/crates/web-sys/src/features/gen_ImageBitmapOptions.rs @@ -0,0 +1,130 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ImageBitmapOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ImageBitmapOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] + pub type ImageBitmapOptions; + #[cfg(feature = "ColorSpaceConversion")] + #[doc = "Get the `colorSpaceConversion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageBitmapOptions`*"] + #[wasm_bindgen(method, getter = "colorSpaceConversion")] + pub fn get_color_space_conversion(this: &ImageBitmapOptions) -> Option; + #[cfg(feature = "ColorSpaceConversion")] + #[doc = "Change the `colorSpaceConversion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageBitmapOptions`*"] + #[wasm_bindgen(method, setter = "colorSpaceConversion")] + pub fn set_color_space_conversion(this: &ImageBitmapOptions, val: ColorSpaceConversion); + #[cfg(feature = "ImageOrientation")] + #[doc = "Get the `imageOrientation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ImageOrientation`*"] + #[wasm_bindgen(method, getter = "imageOrientation")] + pub fn get_image_orientation(this: &ImageBitmapOptions) -> Option; + #[cfg(feature = "ImageOrientation")] + #[doc = "Change the `imageOrientation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ImageOrientation`*"] + #[wasm_bindgen(method, setter = "imageOrientation")] + pub fn set_image_orientation(this: &ImageBitmapOptions, val: ImageOrientation); + #[cfg(feature = "PremultiplyAlpha")] + #[doc = "Get the `premultiplyAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `PremultiplyAlpha`*"] + #[wasm_bindgen(method, getter = "premultiplyAlpha")] + pub fn get_premultiply_alpha(this: &ImageBitmapOptions) -> Option; + #[cfg(feature = "PremultiplyAlpha")] + #[doc = "Change the `premultiplyAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `PremultiplyAlpha`*"] + #[wasm_bindgen(method, setter = "premultiplyAlpha")] + pub fn set_premultiply_alpha(this: &ImageBitmapOptions, val: PremultiplyAlpha); + #[doc = "Get the `resizeHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] + #[wasm_bindgen(method, getter = "resizeHeight")] + pub fn get_resize_height(this: &ImageBitmapOptions) -> Option; + #[doc = "Change the `resizeHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] + #[wasm_bindgen(method, setter = "resizeHeight")] + pub fn set_resize_height(this: &ImageBitmapOptions, val: u32); + #[cfg(feature = "ResizeQuality")] + #[doc = "Get the `resizeQuality` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ResizeQuality`*"] + #[wasm_bindgen(method, getter = "resizeQuality")] + pub fn get_resize_quality(this: &ImageBitmapOptions) -> Option; + #[cfg(feature = "ResizeQuality")] + #[doc = "Change the `resizeQuality` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ResizeQuality`*"] + #[wasm_bindgen(method, setter = "resizeQuality")] + pub fn set_resize_quality(this: &ImageBitmapOptions, val: ResizeQuality); + #[doc = "Get the `resizeWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] + #[wasm_bindgen(method, getter = "resizeWidth")] + pub fn get_resize_width(this: &ImageBitmapOptions) -> Option; + #[doc = "Change the `resizeWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] + #[wasm_bindgen(method, setter = "resizeWidth")] + pub fn set_resize_width(this: &ImageBitmapOptions, val: u32); +} +impl ImageBitmapOptions { + #[doc = "Construct a new `ImageBitmapOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(feature = "ColorSpaceConversion")] + #[deprecated = "Use `set_color_space_conversion()` instead."] + pub fn color_space_conversion(&mut self, val: ColorSpaceConversion) -> &mut Self { + self.set_color_space_conversion(val); + self + } + #[cfg(feature = "ImageOrientation")] + #[deprecated = "Use `set_image_orientation()` instead."] + pub fn image_orientation(&mut self, val: ImageOrientation) -> &mut Self { + self.set_image_orientation(val); + self + } + #[cfg(feature = "PremultiplyAlpha")] + #[deprecated = "Use `set_premultiply_alpha()` instead."] + pub fn premultiply_alpha(&mut self, val: PremultiplyAlpha) -> &mut Self { + self.set_premultiply_alpha(val); + self + } + #[deprecated = "Use `set_resize_height()` instead."] + pub fn resize_height(&mut self, val: u32) -> &mut Self { + self.set_resize_height(val); + self + } + #[cfg(feature = "ResizeQuality")] + #[deprecated = "Use `set_resize_quality()` instead."] + pub fn resize_quality(&mut self, val: ResizeQuality) -> &mut Self { + self.set_resize_quality(val); + self + } + #[deprecated = "Use `set_resize_width()` instead."] + pub fn resize_width(&mut self, val: u32) -> &mut Self { + self.set_resize_width(val); + self + } +} +impl Default for ImageBitmapOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ImageBitmapRenderingContext.rs b/crates/web-sys/src/features/gen_ImageBitmapRenderingContext.rs index 33cc46f029f..b0aeb6174c9 100644 --- a/crates/web-sys/src/features/gen_ImageBitmapRenderingContext.rs +++ b/crates/web-sys/src/features/gen_ImageBitmapRenderingContext.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ImageCapture.rs b/crates/web-sys/src/features/gen_ImageCapture.rs index 4bf2d71ccab..d435c4c4571 100644 --- a/crates/web-sys/src/features/gen_ImageCapture.rs +++ b/crates/web-sys/src/features/gen_ImageCapture.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_ImageCaptureError.rs b/crates/web-sys/src/features/gen_ImageCaptureError.rs index e04c915d1c7..35877f2b025 100644 --- a/crates/web-sys/src/features/gen_ImageCaptureError.rs +++ b/crates/web-sys/src/features/gen_ImageCaptureError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCaptureError/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageCaptureError`*"] - pub fn message(this: &ImageCaptureError) -> String; + pub fn message(this: &ImageCaptureError) -> ::alloc::string::String; } impl ImageCaptureError { #[doc = "The `ImageCaptureError.FRAME_GRAB_ERROR` const."] diff --git a/crates/web-sys/src/features/gen_ImageCaptureErrorEvent.rs b/crates/web-sys/src/features/gen_ImageCaptureErrorEvent.rs index d51297ae9cf..b873e01bbb8 100644 --- a/crates/web-sys/src/features/gen_ImageCaptureErrorEvent.rs +++ b/crates/web-sys/src/features/gen_ImageCaptureErrorEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ImageCaptureErrorEventInit.rs b/crates/web-sys/src/features/gen_ImageCaptureErrorEventInit.rs index b6287188b8e..9edf1b2a999 100644 --- a/crates/web-sys/src/features/gen_ImageCaptureErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_ImageCaptureErrorEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,51 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] pub type ImageCaptureErrorEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ImageCaptureErrorEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ImageCaptureErrorEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ImageCaptureErrorEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ImageCaptureErrorEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ImageCaptureErrorEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ImageCaptureErrorEventInit, val: bool); + #[cfg(feature = "ImageCaptureError")] + #[doc = "Get the `imageCaptureError` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageCaptureError`, `ImageCaptureErrorEventInit`*"] + #[wasm_bindgen(method, getter = "imageCaptureError")] + pub fn get_image_capture_error(this: &ImageCaptureErrorEventInit) -> Option; + #[cfg(feature = "ImageCaptureError")] + #[doc = "Change the `imageCaptureError` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageCaptureError`, `ImageCaptureErrorEventInit`*"] + #[wasm_bindgen(method, setter = "imageCaptureError")] + pub fn set_image_capture_error( + this: &ImageCaptureErrorEventInit, + val: Option<&ImageCaptureError>, + ); } impl ImageCaptureErrorEventInit { #[doc = "Construct a new `ImageCaptureErrorEventInit`."] @@ -19,73 +65,25 @@ impl ImageCaptureErrorEventInit { 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: `ImageCaptureErrorEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageCaptureErrorEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "ImageCaptureError")] - #[doc = "Change the `imageCaptureError` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageCaptureError`, `ImageCaptureErrorEventInit`*"] + #[deprecated = "Use `set_image_capture_error()` instead."] pub fn image_capture_error(&mut self, val: Option<&ImageCaptureError>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("imageCaptureError"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_image_capture_error(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageData.rs b/crates/web-sys/src/features/gen_ImageData.rs index 60b95675d38..eed063ae96f 100644 --- a/crates/web-sys/src/features/gen_ImageData.rs +++ b/crates/web-sys/src/features/gen_ImageData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/data)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageData`*"] - pub fn data(this: &ImageData) -> ::wasm_bindgen::Clamped>; + pub fn data(this: &ImageData) -> ::wasm_bindgen::Clamped<::alloc::vec::Vec>; #[wasm_bindgen(catch, constructor, js_class = "ImageData")] #[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."] #[doc = ""] @@ -55,9 +56,30 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageData`*"] + pub fn new_with_js_u8_clamped_array( + data: &::js_sys::Uint8ClampedArray, + sw: u32, + ) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "ImageData")] + #[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageData`*"] pub fn new_with_u8_clamped_array_and_sh( data: ::wasm_bindgen::Clamped<&[u8]>, sw: u32, sh: u32, ) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "ImageData")] + #[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageData`*"] + pub fn new_with_js_u8_clamped_array_and_sh( + data: &::js_sys::Uint8ClampedArray, + sw: u32, + sh: u32, + ) -> Result; } diff --git a/crates/web-sys/src/features/gen_ImageDecodeOptions.rs b/crates/web-sys/src/features/gen_ImageDecodeOptions.rs index b23963c2a97..3b4893ec923 100644 --- a/crates/web-sys/src/features/gen_ImageDecodeOptions.rs +++ b/crates/web-sys/src/features/gen_ImageDecodeOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ImageDecodeOptions; -} -#[cfg(web_sys_unstable_apis)] -impl ImageDecodeOptions { - #[doc = "Construct a new `ImageDecodeOptions`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `completeFramesOnly` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageDecodeOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "completeFramesOnly")] + pub fn get_complete_frames_only(this: &ImageDecodeOptions) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `completeFramesOnly` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl ImageDecodeOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn complete_frames_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("completeFramesOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "completeFramesOnly")] + pub fn set_complete_frames_only(this: &ImageDecodeOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `frameIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecodeOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "frameIndex")] + pub fn get_frame_index(this: &ImageDecodeOptions) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `frameIndex` field of this object."] #[doc = ""] @@ -55,18 +48,32 @@ impl ImageDecodeOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "frameIndex")] + pub fn set_frame_index(this: &ImageDecodeOptions, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl ImageDecodeOptions { + #[doc = "Construct a new `ImageDecodeOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecodeOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_complete_frames_only()` instead."] + pub fn complete_frames_only(&mut self, val: bool) -> &mut Self { + self.set_complete_frames_only(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_frame_index()` instead."] pub fn frame_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frame_index(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageDecodeResult.rs b/crates/web-sys/src/features/gen_ImageDecodeResult.rs index 2af1bf5b983..69eae0cce5f 100644 --- a/crates/web-sys/src/features/gen_ImageDecodeResult.rs +++ b/crates/web-sys/src/features/gen_ImageDecodeResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,44 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ImageDecodeResult; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `complete` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "complete")] + pub fn get_complete(this: &ImageDecodeResult) -> bool; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `complete` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "complete")] + pub fn set_complete(this: &ImageDecodeResult, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + #[doc = "Get the `image` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "image")] + pub fn get_image(this: &ImageDecodeResult) -> VideoFrame; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + #[doc = "Change the `image` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "image")] + pub fn set_image(this: &ImageDecodeResult, val: &VideoFrame); } #[cfg(web_sys_unstable_apis)] impl ImageDecodeResult { @@ -26,47 +65,21 @@ impl ImageDecodeResult { pub fn new(complete: bool, image: &VideoFrame) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.complete(complete); - ret.image(image); + ret.set_complete(complete); + ret.set_image(image); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `complete` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_complete()` instead."] pub fn complete(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("complete"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_complete(val); self } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoFrame")] - #[doc = "Change the `image` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`, `VideoFrame`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_image()` instead."] pub fn image(&mut self, val: &VideoFrame) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("image"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_image(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageDecoder.rs b/crates/web-sys/src/features/gen_ImageDecoder.rs index 2dae3f0514b..202451a030a 100644 --- a/crates/web-sys/src/features/gen_ImageDecoder.rs +++ b/crates/web-sys/src/features/gen_ImageDecoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -25,7 +26,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn type_(this: &ImageDecoder) -> String; + pub fn type_(this: &ImageDecoder) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ImageDecoder" , js_name = complete)] #[doc = "Getter for the `complete` field of this object."] @@ -113,7 +114,7 @@ extern "C" { # [wasm_bindgen (static_method_of = ImageDecoder , js_class = "ImageDecoder" , js_name = isTypeSupported)] #[doc = "The `isTypeSupported()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder/isTypeSupported)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder/isTypeSupported_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageDecoder`*"] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_ImageDecoderInit.rs b/crates/web-sys/src/features/gen_ImageDecoderInit.rs index 87bd70c957b..8347a669e0e 100644 --- a/crates/web-sys/src/features/gen_ImageDecoderInit.rs +++ b/crates/web-sys/src/features/gen_ImageDecoderInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,35 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ImageDecoderInit; -} -#[cfg(web_sys_unstable_apis)] -impl ImageDecoderInit { - #[doc = "Construct a new `ImageDecoderInit`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ColorSpaceConversion")] + #[doc = "Get the `colorSpaceConversion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "colorSpaceConversion")] + pub fn get_color_space_conversion(this: &ImageDecoderInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ColorSpaceConversion")] + #[doc = "Change the `colorSpaceConversion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "colorSpaceConversion")] + pub fn set_color_space_conversion(this: &ImageDecoderInit, val: ColorSpaceConversion); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `data` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(data: &::wasm_bindgen::JsValue, type_: &str) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.data(data); - ret.type_(type_); - ret - } + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &ImageDecoderInit) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `data` field of this object."] #[doc = ""] @@ -36,16 +50,17 @@ impl ImageDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &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 - } + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &ImageDecoderInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `desiredHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "desiredHeight")] + pub fn get_desired_height(this: &ImageDecoderInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `desiredHeight` field of this object."] #[doc = ""] @@ -53,20 +68,17 @@ impl ImageDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn desired_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("desiredHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "desiredHeight")] + pub fn set_desired_height(this: &ImageDecoderInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `desiredWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "desiredWidth")] + pub fn get_desired_width(this: &ImageDecoderInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `desiredWidth` field of this object."] #[doc = ""] @@ -74,20 +86,17 @@ impl ImageDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn desired_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("desiredWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "desiredWidth")] + pub fn set_desired_width(this: &ImageDecoderInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `preferAnimation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "preferAnimation")] + pub fn get_prefer_animation(this: &ImageDecoderInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `preferAnimation` field of this object."] #[doc = ""] @@ -95,20 +104,37 @@ impl ImageDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn prefer_animation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preferAnimation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "preferAnimation")] + pub fn set_prefer_animation(this: &ImageDecoderInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PremultiplyAlpha")] + #[doc = "Get the `premultiplyAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`, `PremultiplyAlpha`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "premultiplyAlpha")] + pub fn get_premultiply_alpha(this: &ImageDecoderInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PremultiplyAlpha")] + #[doc = "Change the `premultiplyAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`, `PremultiplyAlpha`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "premultiplyAlpha")] + pub fn set_premultiply_alpha(this: &ImageDecoderInit, val: PremultiplyAlpha); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &ImageDecoderInit) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `type` field of this object."] #[doc = ""] @@ -116,14 +142,66 @@ impl ImageDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &ImageDecoderInit, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl ImageDecoderInit { + #[doc = "Construct a new `ImageDecoderInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(data: &::wasm_bindgen::JsValue, type_: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_data(data); + ret.set_type(type_); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ColorSpaceConversion")] + #[deprecated = "Use `set_color_space_conversion()` instead."] + pub fn color_space_conversion(&mut self, val: ColorSpaceConversion) -> &mut Self { + self.set_color_space_conversion(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data()` instead."] + pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_data(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_desired_height()` instead."] + pub fn desired_height(&mut self, val: u32) -> &mut Self { + self.set_desired_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_desired_width()` instead."] + pub fn desired_width(&mut self, val: u32) -> &mut Self { + self.set_desired_width(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_prefer_animation()` instead."] + pub fn prefer_animation(&mut self, val: bool) -> &mut Self { + self.set_prefer_animation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PremultiplyAlpha")] + #[deprecated = "Use `set_premultiply_alpha()` instead."] + pub fn premultiply_alpha(&mut self, val: PremultiplyAlpha) -> &mut Self { + self.set_premultiply_alpha(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_ImageEncodeOptions.rs b/crates/web-sys/src/features/gen_ImageEncodeOptions.rs new file mode 100644 index 00000000000..943ba8fa089 --- /dev/null +++ b/crates/web-sys/src/features/gen_ImageEncodeOptions.rs @@ -0,0 +1,58 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ImageEncodeOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ImageEncodeOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] + pub type ImageEncodeOptions; + #[doc = "Get the `quality` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] + #[wasm_bindgen(method, getter = "quality")] + pub fn get_quality(this: &ImageEncodeOptions) -> Option; + #[doc = "Change the `quality` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] + #[wasm_bindgen(method, setter = "quality")] + pub fn set_quality(this: &ImageEncodeOptions, val: f64); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &ImageEncodeOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &ImageEncodeOptions, val: &str); +} +impl ImageEncodeOptions { + #[doc = "Construct a new `ImageEncodeOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_quality()` instead."] + pub fn quality(&mut self, val: f64) -> &mut Self { + self.set_quality(val); + self + } + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: &str) -> &mut Self { + self.set_type(val); + self + } +} +impl Default for ImageEncodeOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_GridTrackState.rs b/crates/web-sys/src/features/gen_ImageOrientation.rs similarity index 52% rename from crates/web-sys/src/features/gen_GridTrackState.rs rename to crates/web-sys/src/features/gen_ImageOrientation.rs index 0ff0ee27ecb..1fe8d731f7f 100644 --- a/crates/web-sys/src/features/gen_GridTrackState.rs +++ b/crates/web-sys/src/features/gen_ImageOrientation.rs @@ -1,12 +1,12 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] -#[doc = "The `GridTrackState` enum."] +#[doc = "The `ImageOrientation` enum."] #[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `GridTrackState`*"] +#[doc = "*This API requires the following crate features to be activated: `ImageOrientation`*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GridTrackState { - Static = "static", - Repeat = "repeat", - Removed = "removed", +pub enum ImageOrientation { + FromImage = "from-image", + FlipY = "flipY", } diff --git a/crates/web-sys/src/features/gen_ImageTrack.rs b/crates/web-sys/src/features/gen_ImageTrack.rs index a710c4776ec..66aa5ac4c9b 100644 --- a/crates/web-sys/src/features/gen_ImageTrack.rs +++ b/crates/web-sys/src/features/gen_ImageTrack.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_ImageTrackList.rs b/crates/web-sys/src/features/gen_ImageTrackList.rs index 9ddf49af0b0..d62c76e53f7 100644 --- a/crates/web-sys/src/features/gen_ImageTrackList.rs +++ b/crates/web-sys/src/features/gen_ImageTrackList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -63,7 +64,7 @@ extern "C" { #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ImageTrack")] #[wasm_bindgen(method, structural, js_class = "ImageTrackList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_InputDeviceInfo.rs b/crates/web-sys/src/features/gen_InputDeviceInfo.rs new file mode 100644 index 00000000000..65048ff536d --- /dev/null +++ b/crates/web-sys/src/features/gen_InputDeviceInfo.rs @@ -0,0 +1,31 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = MediaDeviceInfo , extends = :: js_sys :: Object , js_name = InputDeviceInfo , typescript_type = "InputDeviceInfo")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `InputDeviceInfo` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputDeviceInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type InputDeviceInfo; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaTrackCapabilities")] + # [wasm_bindgen (method , structural , js_class = "InputDeviceInfo" , js_name = getCapabilities)] + #[doc = "The `getCapabilities()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceInfo/getCapabilities)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputDeviceInfo`, `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_capabilities(this: &InputDeviceInfo) -> MediaTrackCapabilities; +} diff --git a/crates/web-sys/src/features/gen_InputEvent.rs b/crates/web-sys/src/features/gen_InputEvent.rs index cdf501b4db9..82056476aca 100644 --- a/crates/web-sys/src/features/gen_InputEvent.rs +++ b/crates/web-sys/src/features/gen_InputEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,14 +25,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEvent`*"] - pub fn input_type(this: &InputEvent) -> String; + pub fn input_type(this: &InputEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "InputEvent" , 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/InputEvent/data)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEvent`*"] - pub fn data(this: &InputEvent) -> Option; + pub fn data(this: &InputEvent) -> Option<::alloc::string::String>; #[cfg(feature = "DataTransfer")] # [wasm_bindgen (structural , method , getter , js_class = "InputEvent" , js_name = dataTransfer)] #[doc = "Getter for the `dataTransfer` field of this object."] diff --git a/crates/web-sys/src/features/gen_InputEventInit.rs b/crates/web-sys/src/features/gen_InputEventInit.rs index 1ddd034d14b..7ff44de646c 100644 --- a/crates/web-sys/src/features/gen_InputEventInit.rs +++ b/crates/web-sys/src/features/gen_InputEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,110 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] pub type InputEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &InputEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &InputEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &InputEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &InputEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &InputEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &InputEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &InputEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &InputEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &InputEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &InputEventInit, val: Option<&Window>); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &InputEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &InputEventInit, val: Option<&str>); + #[cfg(feature = "DataTransfer")] + #[doc = "Get the `dataTransfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `InputEventInit`*"] + #[wasm_bindgen(method, getter = "dataTransfer")] + pub fn get_data_transfer(this: &InputEventInit) -> Option; + #[cfg(feature = "DataTransfer")] + #[doc = "Change the `dataTransfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `InputEventInit`*"] + #[wasm_bindgen(method, setter = "dataTransfer")] + pub fn set_data_transfer(this: &InputEventInit, val: Option<&DataTransfer>); + #[doc = "Get the `inputType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, getter = "inputType")] + pub fn get_input_type(this: &InputEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `inputType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, setter = "inputType")] + pub fn set_input_type(this: &InputEventInit, val: &str); + #[doc = "Get the `isComposing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, getter = "isComposing")] + pub fn get_is_composing(this: &InputEventInit) -> Option; + #[doc = "Change the `isComposing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, setter = "isComposing")] + pub fn set_is_composing(this: &InputEventInit, val: bool); + #[doc = "Get the `targetRanges` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, getter = "targetRanges")] + pub fn get_target_ranges(this: &InputEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `targetRanges` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[wasm_bindgen(method, setter = "targetRanges")] + pub fn set_target_ranges(this: &InputEventInit, val: &::wasm_bindgen::JsValue); } impl InputEventInit { #[doc = "Construct a new `InputEventInit`."] @@ -19,165 +124,56 @@ impl InputEventInit { 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: `InputEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InputEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `data` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[deprecated = "Use `set_data()` instead."] pub fn data(&mut self, val: Option<&str>) -> &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.set_data(val); self } #[cfg(feature = "DataTransfer")] - #[doc = "Change the `dataTransfer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `InputEventInit`*"] + #[deprecated = "Use `set_data_transfer()` instead."] pub fn data_transfer(&mut self, val: Option<&DataTransfer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dataTransfer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_data_transfer(val); self } - #[doc = "Change the `inputType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[deprecated = "Use `set_input_type()` instead."] pub fn input_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inputType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_input_type(val); self } - #[doc = "Change the `isComposing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[deprecated = "Use `set_is_composing()` instead."] pub fn is_composing(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isComposing"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_composing(val); self } - #[doc = "Change the `targetRanges` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InputEventInit`*"] + #[deprecated = "Use `set_target_ranges()` instead."] pub fn target_ranges(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targetRanges"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_target_ranges(val); self } } diff --git a/crates/web-sys/src/features/gen_InstallTriggerData.rs b/crates/web-sys/src/features/gen_InstallTriggerData.rs deleted file mode 100644 index bb84c53068a..00000000000 --- a/crates/web-sys/src/features/gen_InstallTriggerData.rs +++ /dev/null @@ -1,70 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = InstallTriggerData)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `InstallTriggerData` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub type InstallTriggerData; -} -impl InstallTriggerData { - #[doc = "Construct a new `InstallTriggerData`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `Hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub fn hash(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("Hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `IconURL` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub fn icon_url(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("IconURL"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `URL` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `InstallTriggerData`*"] - pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("URL"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for InstallTriggerData { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_IntersectionObserver.rs b/crates/web-sys/src/features/gen_IntersectionObserver.rs index bf4a27b726c..371e3d76b3b 100644 --- a/crates/web-sys/src/features/gen_IntersectionObserver.rs +++ b/crates/web-sys/src/features/gen_IntersectionObserver.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IntersectionObserver`*"] - pub fn root_margin(this: &IntersectionObserver) -> String; + pub fn root_margin(this: &IntersectionObserver) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "IntersectionObserver" , js_name = thresholds)] #[doc = "Getter for the `thresholds` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_IntersectionObserverEntry.rs b/crates/web-sys/src/features/gen_IntersectionObserverEntry.rs index 6caedd2f874..e79c6a1dfac 100644 --- a/crates/web-sys/src/features/gen_IntersectionObserverEntry.rs +++ b/crates/web-sys/src/features/gen_IntersectionObserverEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_IntersectionObserverEntryInit.rs b/crates/web-sys/src/features/gen_IntersectionObserverEntryInit.rs index cbdd61fa1b4..040bc7c312d 100644 --- a/crates/web-sys/src/features/gen_IntersectionObserverEntryInit.rs +++ b/crates/web-sys/src/features/gen_IntersectionObserverEntryInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,64 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"] pub type IntersectionObserverEntryInit; + #[cfg(feature = "DomRectInit")] + #[doc = "Get the `boundingClientRect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, getter = "boundingClientRect")] + pub fn get_bounding_client_rect(this: &IntersectionObserverEntryInit) -> DomRectInit; + #[cfg(feature = "DomRectInit")] + #[doc = "Change the `boundingClientRect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, setter = "boundingClientRect")] + pub fn set_bounding_client_rect(this: &IntersectionObserverEntryInit, val: &DomRectInit); + #[cfg(feature = "DomRectInit")] + #[doc = "Get the `intersectionRect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, getter = "intersectionRect")] + pub fn get_intersection_rect(this: &IntersectionObserverEntryInit) -> DomRectInit; + #[cfg(feature = "DomRectInit")] + #[doc = "Change the `intersectionRect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, setter = "intersectionRect")] + pub fn set_intersection_rect(this: &IntersectionObserverEntryInit, val: &DomRectInit); + #[cfg(feature = "DomRectInit")] + #[doc = "Get the `rootBounds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, getter = "rootBounds")] + pub fn get_root_bounds(this: &IntersectionObserverEntryInit) -> DomRectInit; + #[cfg(feature = "DomRectInit")] + #[doc = "Change the `rootBounds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, setter = "rootBounds")] + pub fn set_root_bounds(this: &IntersectionObserverEntryInit, val: &DomRectInit); + #[cfg(feature = "Element")] + #[doc = "Get the `target` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, getter = "target")] + pub fn get_target(this: &IntersectionObserverEntryInit) -> Element; + #[cfg(feature = "Element")] + #[doc = "Change the `target` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, setter = "target")] + pub fn set_target(this: &IntersectionObserverEntryInit, val: &Element); + #[doc = "Get the `time` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, getter = "time")] + pub fn get_time(this: &IntersectionObserverEntryInit) -> f64; + #[doc = "Change the `time` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"] + #[wasm_bindgen(method, setter = "time")] + pub fn set_time(this: &IntersectionObserverEntryInit, val: f64); } impl IntersectionObserverEntryInit { #[cfg(all(feature = "DomRectInit", feature = "Element",))] @@ -24,93 +83,40 @@ impl IntersectionObserverEntryInit { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.bounding_client_rect(bounding_client_rect); - ret.intersection_rect(intersection_rect); - ret.root_bounds(root_bounds); - ret.target(target); - ret.time(time); + ret.set_bounding_client_rect(bounding_client_rect); + ret.set_intersection_rect(intersection_rect); + ret.set_root_bounds(root_bounds); + ret.set_target(target); + ret.set_time(time); ret } #[cfg(feature = "DomRectInit")] - #[doc = "Change the `boundingClientRect` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[deprecated = "Use `set_bounding_client_rect()` instead."] pub fn bounding_client_rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("boundingClientRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bounding_client_rect(val); self } #[cfg(feature = "DomRectInit")] - #[doc = "Change the `intersectionRect` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[deprecated = "Use `set_intersection_rect()` instead."] pub fn intersection_rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("intersectionRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_intersection_rect(val); self } #[cfg(feature = "DomRectInit")] - #[doc = "Change the `rootBounds` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `IntersectionObserverEntryInit`*"] + #[deprecated = "Use `set_root_bounds()` instead."] pub fn root_bounds(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rootBounds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_root_bounds(val); self } #[cfg(feature = "Element")] - #[doc = "Change the `target` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverEntryInit`*"] + #[deprecated = "Use `set_target()` instead."] pub fn target(&mut self, val: &Element) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("target"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_target(val); self } - #[doc = "Change the `time` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverEntryInit`*"] + #[deprecated = "Use `set_time()` instead."] pub fn time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("time"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_time(val); self } } diff --git a/crates/web-sys/src/features/gen_IntersectionObserverInit.rs b/crates/web-sys/src/features/gen_IntersectionObserverInit.rs index 33115b50ef1..d959f7e4e72 100644 --- a/crates/web-sys/src/features/gen_IntersectionObserverInit.rs +++ b/crates/web-sys/src/features/gen_IntersectionObserverInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] pub type IntersectionObserverInit; + #[cfg(feature = "Element")] + #[doc = "Get the `root` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverInit`*"] + #[wasm_bindgen(method, getter = "root")] + pub fn get_root(this: &IntersectionObserverInit) -> Option; + #[cfg(feature = "Element")] + #[doc = "Change the `root` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverInit`*"] + #[wasm_bindgen(method, setter = "root")] + pub fn set_root(this: &IntersectionObserverInit, val: Option<&Element>); + #[doc = "Get the `rootMargin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] + #[wasm_bindgen(method, getter = "rootMargin")] + pub fn get_root_margin(this: &IntersectionObserverInit) -> Option<::alloc::string::String>; + #[doc = "Change the `rootMargin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] + #[wasm_bindgen(method, setter = "rootMargin")] + pub fn set_root_margin(this: &IntersectionObserverInit, val: &str); + #[doc = "Get the `threshold` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] + #[wasm_bindgen(method, getter = "threshold")] + pub fn get_threshold(this: &IntersectionObserverInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `threshold` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] + #[wasm_bindgen(method, setter = "threshold")] + pub fn set_threshold(this: &IntersectionObserverInit, val: &::wasm_bindgen::JsValue); } impl IntersectionObserverInit { #[doc = "Construct a new `IntersectionObserverInit`."] @@ -20,51 +53,19 @@ impl IntersectionObserverInit { ret } #[cfg(feature = "Element")] - #[doc = "Change the `root` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Element`, `IntersectionObserverInit`*"] + #[deprecated = "Use `set_root()` instead."] pub fn root(&mut self, val: Option<&Element>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("root"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_root(val); self } - #[doc = "Change the `rootMargin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] + #[deprecated = "Use `set_root_margin()` instead."] pub fn root_margin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rootMargin"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_root_margin(val); self } - #[doc = "Change the `threshold` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IntersectionObserverInit`*"] + #[deprecated = "Use `set_threshold()` instead."] pub fn threshold(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("threshold"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_threshold(val); self } } diff --git a/crates/web-sys/src/features/gen_IntlUtils.rs b/crates/web-sys/src/features/gen_IntlUtils.rs index 751ce53e9a6..3d128e71d6c 100644 --- a/crates/web-sys/src/features/gen_IntlUtils.rs +++ b/crates/web-sys/src/features/gen_IntlUtils.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_IsInputPendingOptions.rs b/crates/web-sys/src/features/gen_IsInputPendingOptions.rs new file mode 100644 index 00000000000..b627894cb70 --- /dev/null +++ b/crates/web-sys/src/features/gen_IsInputPendingOptions.rs @@ -0,0 +1,61 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = IsInputPendingOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `IsInputPendingOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IsInputPendingOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type IsInputPendingOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `includeContinuous` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IsInputPendingOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "includeContinuous")] + pub fn get_include_continuous(this: &IsInputPendingOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `includeContinuous` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IsInputPendingOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "includeContinuous")] + pub fn set_include_continuous(this: &IsInputPendingOptions, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl IsInputPendingOptions { + #[doc = "Construct a new `IsInputPendingOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IsInputPendingOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_include_continuous()` instead."] + pub fn include_continuous(&mut self, val: bool) -> &mut Self { + self.set_include_continuous(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for IsInputPendingOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_IterableKeyAndValueResult.rs b/crates/web-sys/src/features/gen_IterableKeyAndValueResult.rs index c88d7cc1d41..d6c2c0b81fc 100644 --- a/crates/web-sys/src/features/gen_IterableKeyAndValueResult.rs +++ b/crates/web-sys/src/features/gen_IterableKeyAndValueResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] pub type IterableKeyAndValueResult; + #[doc = "Get the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] + #[wasm_bindgen(method, getter = "done")] + pub fn get_done(this: &IterableKeyAndValueResult) -> Option; + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] + #[wasm_bindgen(method, setter = "done")] + pub fn set_done(this: &IterableKeyAndValueResult, val: bool); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &IterableKeyAndValueResult) -> Option<::js_sys::Array>; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &IterableKeyAndValueResult, val: &::wasm_bindgen::JsValue); } impl IterableKeyAndValueResult { #[doc = "Construct a new `IterableKeyAndValueResult`."] @@ -19,30 +40,14 @@ impl IterableKeyAndValueResult { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] + #[deprecated = "Use `set_done()` instead."] pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_done(val); self } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IterableKeyAndValueResult`*"] + #[deprecated = "Use `set_value()` instead."] pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_IterableKeyOrValueResult.rs b/crates/web-sys/src/features/gen_IterableKeyOrValueResult.rs index 7dd96ba8c71..366d7aaae76 100644 --- a/crates/web-sys/src/features/gen_IterableKeyOrValueResult.rs +++ b/crates/web-sys/src/features/gen_IterableKeyOrValueResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] pub type IterableKeyOrValueResult; + #[doc = "Get the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] + #[wasm_bindgen(method, getter = "done")] + pub fn get_done(this: &IterableKeyOrValueResult) -> Option; + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] + #[wasm_bindgen(method, setter = "done")] + pub fn set_done(this: &IterableKeyOrValueResult, val: bool); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &IterableKeyOrValueResult) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &IterableKeyOrValueResult, val: &::wasm_bindgen::JsValue); } impl IterableKeyOrValueResult { #[doc = "Construct a new `IterableKeyOrValueResult`."] @@ -19,30 +40,14 @@ impl IterableKeyOrValueResult { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] + #[deprecated = "Use `set_done()` instead."] pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_done(val); self } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IterableKeyOrValueResult`*"] + #[deprecated = "Use `set_value()` instead."] pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_IterationCompositeOperation.rs b/crates/web-sys/src/features/gen_IterationCompositeOperation.rs index b4aa9f6cce0..d87ccf88585 100644 --- a/crates/web-sys/src/features/gen_IterationCompositeOperation.rs +++ b/crates/web-sys/src/features/gen_IterationCompositeOperation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `IterationCompositeOperation` enum."] diff --git a/crates/web-sys/src/features/gen_JsonWebKey.rs b/crates/web-sys/src/features/gen_JsonWebKey.rs index b377c19c8f4..c45d21fcd6a 100644 --- a/crates/web-sys/src/features/gen_JsonWebKey.rs +++ b/crates/web-sys/src/features/gen_JsonWebKey.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,186 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] pub type JsonWebKey; + #[doc = "Get the `alg` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "alg")] + pub fn get_alg(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `alg` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "alg")] + pub fn set_alg(this: &JsonWebKey, val: &str); + #[doc = "Get the `crv` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "crv")] + pub fn get_crv(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `crv` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "crv")] + pub fn set_crv(this: &JsonWebKey, val: &str); + #[doc = "Get the `d` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "d")] + pub fn get_d(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `d` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "d")] + pub fn set_d(this: &JsonWebKey, val: &str); + #[doc = "Get the `dp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "dp")] + pub fn get_dp(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `dp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "dp")] + pub fn set_dp(this: &JsonWebKey, val: &str); + #[doc = "Get the `dq` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "dq")] + pub fn get_dq(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `dq` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "dq")] + pub fn set_dq(this: &JsonWebKey, val: &str); + #[doc = "Get the `e` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "e")] + pub fn get_e(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `e` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "e")] + pub fn set_e(this: &JsonWebKey, val: &str); + #[doc = "Get the `ext` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "ext")] + pub fn get_ext(this: &JsonWebKey) -> Option; + #[doc = "Change the `ext` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "ext")] + pub fn set_ext(this: &JsonWebKey, val: bool); + #[doc = "Get the `k` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "k")] + pub fn get_k(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `k` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "k")] + pub fn set_k(this: &JsonWebKey, val: &str); + #[doc = "Get the `key_ops` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "key_ops")] + pub fn get_key_ops(this: &JsonWebKey) -> Option<::js_sys::Array>; + #[doc = "Change the `key_ops` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "key_ops")] + pub fn set_key_ops(this: &JsonWebKey, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `kty` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "kty")] + pub fn get_kty(this: &JsonWebKey) -> ::alloc::string::String; + #[doc = "Change the `kty` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "kty")] + pub fn set_kty(this: &JsonWebKey, val: &str); + #[doc = "Get the `n` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "n")] + pub fn get_n(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `n` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "n")] + pub fn set_n(this: &JsonWebKey, val: &str); + #[doc = "Get the `oth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "oth")] + pub fn get_oth(this: &JsonWebKey) -> Option<::js_sys::Array>; + #[doc = "Change the `oth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "oth")] + pub fn set_oth(this: &JsonWebKey, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `p` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "p")] + pub fn get_p(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `p` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "p")] + pub fn set_p(this: &JsonWebKey, val: &str); + #[doc = "Get the `q` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "q")] + pub fn get_q(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `q` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "q")] + pub fn set_q(this: &JsonWebKey, val: &str); + #[doc = "Get the `qi` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "qi")] + pub fn get_qi(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `qi` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "qi")] + pub fn set_qi(this: &JsonWebKey, val: &str); + #[doc = "Get the `use` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "use")] + pub fn get_use(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `use` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "use")] + pub fn set_use(this: &JsonWebKey, val: &str); + #[doc = "Get the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &JsonWebKey, val: &str); + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &JsonWebKey) -> Option<::alloc::string::String>; + #[doc = "Change the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &JsonWebKey, val: &str); } impl JsonWebKey { #[doc = "Construct a new `JsonWebKey`."] @@ -17,245 +198,97 @@ impl JsonWebKey { pub fn new(kty: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.kty(kty); + ret.set_kty(kty); ret } - #[doc = "Change the `alg` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_alg()` instead."] pub fn alg(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alg"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alg(val); self } - #[doc = "Change the `crv` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_crv()` instead."] pub fn crv(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("crv"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_crv(val); self } - #[doc = "Change the `d` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_d()` instead."] pub fn d(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("d"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_d(val); self } - #[doc = "Change the `dp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_dp()` instead."] pub fn dp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dp(val); self } - #[doc = "Change the `dq` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_dq()` instead."] pub fn dq(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dq"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dq(val); self } - #[doc = "Change the `e` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_e()` instead."] pub fn e(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("e"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_e(val); self } - #[doc = "Change the `ext` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_ext()` instead."] pub fn ext(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ext"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ext(val); self } - #[doc = "Change the `k` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_k()` instead."] pub fn k(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("k"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_k(val); self } - #[doc = "Change the `key_ops` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_key_ops()` instead."] pub fn key_ops(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("key_ops"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key_ops(val); self } - #[doc = "Change the `kty` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_kty()` instead."] pub fn kty(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("kty"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_kty(val); self } - #[doc = "Change the `n` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_n()` instead."] pub fn n(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("n"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_n(val); self } - #[doc = "Change the `oth` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_oth()` instead."] pub fn oth(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("oth"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_oth(val); self } - #[doc = "Change the `p` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_p()` instead."] pub fn p(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p(val); self } - #[doc = "Change the `q` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_q()` instead."] pub fn q(&mut self, val: &str) -> &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.set_q(val); self } - #[doc = "Change the `qi` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_qi()` instead."] pub fn qi(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("qi"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_qi(val); self } - #[doc = "Change the `use` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_use()` instead."] pub fn use_(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("use"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_use(val); self } - #[doc = "Change the `x` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_x()` instead."] pub fn x(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x(val); self } - #[doc = "Change the `y` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"] + #[deprecated = "Use `set_y()` instead."] pub fn y(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_y(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyAlgorithm.rs b/crates/web-sys/src/features/gen_KeyAlgorithm.rs index 556fdb0112d..80be162fa90 100644 --- a/crates/web-sys/src/features/gen_KeyAlgorithm.rs +++ b/crates/web-sys/src/features/gen_KeyAlgorithm.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyAlgorithm`*"] pub type KeyAlgorithm; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyAlgorithm`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &KeyAlgorithm) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyAlgorithm`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &KeyAlgorithm, val: &str); } impl KeyAlgorithm { #[doc = "Construct a new `KeyAlgorithm`."] @@ -17,20 +28,12 @@ impl KeyAlgorithm { 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.set_name(name); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyAlgorithm`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyEvent.rs b/crates/web-sys/src/features/gen_KeyEvent.rs index 997fa81014d..6d834cb8553 100644 --- a/crates/web-sys/src/features/gen_KeyEvent.rs +++ b/crates/web-sys/src/features/gen_KeyEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_KeyFrameRequestEvent.rs b/crates/web-sys/src/features/gen_KeyFrameRequestEvent.rs new file mode 100644 index 00000000000..17595b6c55b --- /dev/null +++ b/crates/web-sys/src/features/gen_KeyFrameRequestEvent.rs @@ -0,0 +1,52 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = KeyFrameRequestEvent , typescript_type = "KeyFrameRequestEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `KeyFrameRequestEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyFrameRequestEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyFrameRequestEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type KeyFrameRequestEvent; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "KeyFrameRequestEvent" , js_name = rid)] + #[doc = "Getter for the `rid` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyFrameRequestEvent/rid)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyFrameRequestEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn rid(this: &KeyFrameRequestEvent) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "KeyFrameRequestEvent")] + #[doc = "The `new KeyFrameRequestEvent(..)` constructor, creating a new instance of `KeyFrameRequestEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyFrameRequestEvent/KeyFrameRequestEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyFrameRequestEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(type_: &str) -> Result; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "KeyFrameRequestEvent")] + #[doc = "The `new KeyFrameRequestEvent(..)` constructor, creating a new instance of `KeyFrameRequestEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyFrameRequestEvent/KeyFrameRequestEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyFrameRequestEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_rid(type_: &str, rid: &str) -> Result; +} diff --git a/crates/web-sys/src/features/gen_KeyIdsInitData.rs b/crates/web-sys/src/features/gen_KeyIdsInitData.rs index 02c02c1241e..c6f785a3d73 100644 --- a/crates/web-sys/src/features/gen_KeyIdsInitData.rs +++ b/crates/web-sys/src/features/gen_KeyIdsInitData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyIdsInitData`*"] pub type KeyIdsInitData; + #[doc = "Get the `kids` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyIdsInitData`*"] + #[wasm_bindgen(method, getter = "kids")] + pub fn get_kids(this: &KeyIdsInitData) -> ::js_sys::Array; + #[doc = "Change the `kids` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyIdsInitData`*"] + #[wasm_bindgen(method, setter = "kids")] + pub fn set_kids(this: &KeyIdsInitData, val: &::wasm_bindgen::JsValue); } impl KeyIdsInitData { #[doc = "Construct a new `KeyIdsInitData`."] @@ -17,20 +28,12 @@ impl KeyIdsInitData { pub fn new(kids: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.kids(kids); + ret.set_kids(kids); ret } - #[doc = "Change the `kids` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyIdsInitData`*"] + #[deprecated = "Use `set_kids()` instead."] pub fn kids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("kids"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_kids(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyboardEvent.rs b/crates/web-sys/src/features/gen_KeyboardEvent.rs index 4bb5b0f2a1e..fafaffc0c9b 100644 --- a/crates/web-sys/src/features/gen_KeyboardEvent.rs +++ b/crates/web-sys/src/features/gen_KeyboardEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -80,14 +81,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEvent`*"] - pub fn key(this: &KeyboardEvent) -> String; + pub fn key(this: &KeyboardEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "KeyboardEvent" , js_name = code)] #[doc = "Getter for the `code` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEvent`*"] - pub fn code(this: &KeyboardEvent) -> String; + pub fn code(this: &KeyboardEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "KeyboardEvent")] #[doc = "The `new KeyboardEvent(..)` constructor, creating a new instance of `KeyboardEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_KeyboardEventInit.rs b/crates/web-sys/src/features/gen_KeyboardEventInit.rs index a1ec1ae2e13..6321debf9ab 100644 --- a/crates/web-sys/src/features/gen_KeyboardEventInit.rs +++ b/crates/web-sys/src/features/gen_KeyboardEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,268 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] pub type KeyboardEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &KeyboardEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &KeyboardEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &KeyboardEventInit, val: Option<&Window>); + #[doc = "Get the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "altKey")] + pub fn get_alt_key(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "altKey")] + pub fn set_alt_key(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "ctrlKey")] + pub fn get_ctrl_key(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "ctrlKey")] + pub fn set_ctrl_key(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "metaKey")] + pub fn get_meta_key(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "metaKey")] + pub fn set_meta_key(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierAltGraph")] + pub fn get_modifier_alt_graph(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierAltGraph")] + pub fn set_modifier_alt_graph(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierCapsLock")] + pub fn get_modifier_caps_lock(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierCapsLock")] + pub fn set_modifier_caps_lock(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFn")] + pub fn get_modifier_fn(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFn")] + pub fn set_modifier_fn(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFnLock")] + pub fn get_modifier_fn_lock(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFnLock")] + pub fn set_modifier_fn_lock(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierNumLock")] + pub fn get_modifier_num_lock(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierNumLock")] + pub fn set_modifier_num_lock(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierOS")] + pub fn get_modifier_os(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierOS")] + pub fn set_modifier_os(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierScrollLock")] + pub fn get_modifier_scroll_lock(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierScrollLock")] + pub fn set_modifier_scroll_lock(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbol")] + pub fn get_modifier_symbol(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbol")] + pub fn set_modifier_symbol(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbolLock")] + pub fn get_modifier_symbol_lock(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + pub fn set_modifier_symbol_lock(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "shiftKey")] + pub fn get_shift_key(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "shiftKey")] + pub fn set_shift_key(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `charCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "charCode")] + pub fn get_char_code(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `charCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "charCode")] + pub fn set_char_code(this: &KeyboardEventInit, val: u32); + #[doc = "Get the `code` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "code")] + pub fn get_code(this: &KeyboardEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `code` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "code")] + pub fn set_code(this: &KeyboardEventInit, val: &str); + #[doc = "Get the `isComposing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "isComposing")] + pub fn get_is_composing(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `isComposing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "isComposing")] + pub fn set_is_composing(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `key` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "key")] + pub fn get_key(this: &KeyboardEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `key` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "key")] + pub fn set_key(this: &KeyboardEventInit, val: &str); + #[doc = "Get the `keyCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "keyCode")] + pub fn get_key_code(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `keyCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "keyCode")] + pub fn set_key_code(this: &KeyboardEventInit, val: u32); + #[doc = "Get the `location` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "location")] + pub fn get_location(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `location` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "location")] + pub fn set_location(this: &KeyboardEventInit, val: u32); + #[doc = "Get the `repeat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "repeat")] + pub fn get_repeat(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `repeat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "repeat")] + pub fn set_repeat(this: &KeyboardEventInit, val: bool); + #[doc = "Get the `which` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, getter = "which")] + pub fn get_which(this: &KeyboardEventInit) -> Option; + #[doc = "Change the `which` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[wasm_bindgen(method, setter = "which")] + pub fn set_which(this: &KeyboardEventInit, val: u32); } impl KeyboardEventInit { #[doc = "Construct a new `KeyboardEventInit`."] @@ -19,422 +282,135 @@ impl KeyboardEventInit { 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: `KeyboardEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `altKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_alt_key()` instead."] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alt_key(val); self } - #[doc = "Change the `ctrlKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_ctrl_key()` instead."] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ctrl_key(val); self } - #[doc = "Change the `metaKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_meta_key()` instead."] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_meta_key(val); self } - #[doc = "Change the `modifierAltGraph` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_alt_graph()` instead."] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_alt_graph(val); self } - #[doc = "Change the `modifierCapsLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_caps_lock()` instead."] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_caps_lock(val); self } - #[doc = "Change the `modifierFn` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_fn()` instead."] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn(val); self } - #[doc = "Change the `modifierFnLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_fn_lock()` instead."] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn_lock(val); self } - #[doc = "Change the `modifierNumLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_num_lock()` instead."] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_num_lock(val); self } - #[doc = "Change the `modifierOS` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_os()` instead."] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_os(val); self } - #[doc = "Change the `modifierScrollLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_scroll_lock()` instead."] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_scroll_lock(val); self } - #[doc = "Change the `modifierSymbol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_symbol()` instead."] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol(val); self } - #[doc = "Change the `modifierSymbolLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_modifier_symbol_lock()` instead."] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol_lock(val); self } - #[doc = "Change the `shiftKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_shift_key()` instead."] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shift_key(val); self } - #[doc = "Change the `charCode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_char_code()` instead."] pub fn char_code(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_char_code(val); self } - #[doc = "Change the `code` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_code()` instead."] pub fn code(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_code(val); self } - #[doc = "Change the `isComposing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_is_composing()` instead."] pub fn is_composing(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isComposing"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_composing(val); self } - #[doc = "Change the `key` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_key()` instead."] pub fn key(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("key"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key(val); self } - #[doc = "Change the `keyCode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_key_code()` instead."] pub fn key_code(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key_code(val); self } - #[doc = "Change the `location` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_location()` instead."] pub fn location(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("location"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_location(val); self } - #[doc = "Change the `repeat` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_repeat()` instead."] pub fn repeat(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("repeat"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_repeat(val); self } - #[doc = "Change the `which` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"] + #[deprecated = "Use `set_which()` instead."] pub fn which(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("which"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_which(val); self } } diff --git a/crates/web-sys/src/features/gen_KeyframeAnimationOptions.rs b/crates/web-sys/src/features/gen_KeyframeAnimationOptions.rs new file mode 100644 index 00000000000..17a15a0c694 --- /dev/null +++ b/crates/web-sys/src/features/gen_KeyframeAnimationOptions.rs @@ -0,0 +1,345 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = KeyframeAnimationOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `KeyframeAnimationOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type KeyframeAnimationOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "delay")] + pub fn get_delay(this: &KeyframeAnimationOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "delay")] + pub fn set_delay(this: &KeyframeAnimationOptions, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PlaybackDirection")] + #[doc = "Get the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`, `PlaybackDirection`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "direction")] + pub fn get_direction(this: &KeyframeAnimationOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PlaybackDirection")] + #[doc = "Change the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`, `PlaybackDirection`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "direction")] + pub fn set_direction(this: &KeyframeAnimationOptions, val: PlaybackDirection); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &KeyframeAnimationOptions) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &KeyframeAnimationOptions, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &KeyframeAnimationOptions) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &KeyframeAnimationOptions, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "endDelay")] + pub fn get_end_delay(this: &KeyframeAnimationOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "endDelay")] + pub fn set_end_delay(this: &KeyframeAnimationOptions, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FillMode")] + #[doc = "Get the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FillMode`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "fill")] + pub fn get_fill(this: &KeyframeAnimationOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FillMode")] + #[doc = "Change the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FillMode`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "fill")] + pub fn set_fill(this: &KeyframeAnimationOptions, val: FillMode); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "iterationStart")] + pub fn get_iteration_start(this: &KeyframeAnimationOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "iterationStart")] + pub fn set_iteration_start(this: &KeyframeAnimationOptions, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "iterations")] + pub fn get_iterations(this: &KeyframeAnimationOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "iterations")] + pub fn set_iterations(this: &KeyframeAnimationOptions, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CompositeOperation")] + #[doc = "Get the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositeOperation`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composite")] + pub fn get_composite(this: &KeyframeAnimationOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CompositeOperation")] + #[doc = "Change the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositeOperation`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "composite")] + pub fn set_composite(this: &KeyframeAnimationOptions, val: CompositeOperation); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "IterationCompositeOperation")] + #[doc = "Get the `iterationComposite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterationCompositeOperation`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "iterationComposite")] + pub fn get_iteration_composite( + this: &KeyframeAnimationOptions, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "IterationCompositeOperation")] + #[doc = "Change the `iterationComposite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterationCompositeOperation`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "iterationComposite")] + pub fn set_iteration_composite( + this: &KeyframeAnimationOptions, + val: IterationCompositeOperation, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &KeyframeAnimationOptions) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &KeyframeAnimationOptions, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AnimationTimeline")] + #[doc = "Get the `timeline` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationTimeline`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timeline")] + pub fn get_timeline(this: &KeyframeAnimationOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AnimationTimeline")] + #[doc = "Change the `timeline` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AnimationTimeline`, `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timeline")] + pub fn set_timeline(this: &KeyframeAnimationOptions, val: Option<&AnimationTimeline>); +} +#[cfg(web_sys_unstable_apis)] +impl KeyframeAnimationOptions { + #[doc = "Construct a new `KeyframeAnimationOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeAnimationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_delay()` instead."] + pub fn delay(&mut self, val: f64) -> &mut Self { + self.set_delay(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PlaybackDirection")] + #[deprecated = "Use `set_direction()` instead."] + pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { + self.set_direction(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_duration()` instead."] + pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_duration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_easing()` instead."] + pub fn easing(&mut self, val: &str) -> &mut Self { + self.set_easing(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_end_delay()` instead."] + pub fn end_delay(&mut self, val: f64) -> &mut Self { + self.set_end_delay(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FillMode")] + #[deprecated = "Use `set_fill()` instead."] + pub fn fill(&mut self, val: FillMode) -> &mut Self { + self.set_fill(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_iteration_start()` instead."] + pub fn iteration_start(&mut self, val: f64) -> &mut Self { + self.set_iteration_start(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_iterations()` instead."] + pub fn iterations(&mut self, val: f64) -> &mut Self { + self.set_iterations(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CompositeOperation")] + #[deprecated = "Use `set_composite()` instead."] + pub fn composite(&mut self, val: CompositeOperation) -> &mut Self { + self.set_composite(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "IterationCompositeOperation")] + #[deprecated = "Use `set_iteration_composite()` instead."] + pub fn iteration_composite(&mut self, val: IterationCompositeOperation) -> &mut Self { + self.set_iteration_composite(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AnimationTimeline")] + #[deprecated = "Use `set_timeline()` instead."] + pub fn timeline(&mut self, val: Option<&AnimationTimeline>) -> &mut Self { + self.set_timeline(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for KeyframeAnimationOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_KeyframeEffect.rs b/crates/web-sys/src/features/gen_KeyframeEffect.rs index 08bdbd73254..d69ca13c44f 100644 --- a/crates/web-sys/src/features/gen_KeyframeEffect.rs +++ b/crates/web-sys/src/features/gen_KeyframeEffect.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,27 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/target)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffect`*"] + #[deprecated] pub fn set_target(this: &KeyframeEffect, value: Option<&::js_sys::Object>); + #[cfg(feature = "Element")] + # [wasm_bindgen (structural , method , setter , js_class = "KeyframeEffect" , js_name = target)] + #[doc = "Setter for the `target` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/target)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Element`, `KeyframeEffect`*"] + pub fn set_target_opt_element(this: &KeyframeEffect, value: Option<&Element>); + #[cfg(feature = "CssPseudoElement")] + # [wasm_bindgen (structural , method , setter , js_class = "KeyframeEffect" , js_name = target)] + #[doc = "Setter for the `target` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/KeyframeEffect/target)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssPseudoElement`, `KeyframeEffect`*"] + pub fn set_target_opt_css_pseudo_element( + this: &KeyframeEffect, + value: Option<&CssPseudoElement>, + ); #[cfg(feature = "IterationCompositeOperation")] # [wasm_bindgen (structural , method , getter , js_class = "KeyframeEffect" , js_name = iterationComposite)] #[doc = "Getter for the `iterationComposite` field of this object."] diff --git a/crates/web-sys/src/features/gen_KeyframeEffectOptions.rs b/crates/web-sys/src/features/gen_KeyframeEffectOptions.rs index 0aad56b7ec3..2d16182a56d 100644 --- a/crates/web-sys/src/features/gen_KeyframeEffectOptions.rs +++ b/crates/web-sys/src/features/gen_KeyframeEffectOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,116 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] pub type KeyframeEffectOptions; + #[doc = "Get the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "delay")] + pub fn get_delay(this: &KeyframeEffectOptions) -> Option; + #[doc = "Change the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "delay")] + pub fn set_delay(this: &KeyframeEffectOptions, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[doc = "Get the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`, `PlaybackDirection`*"] + #[wasm_bindgen(method, getter = "direction")] + pub fn get_direction(this: &KeyframeEffectOptions) -> Option; + #[cfg(feature = "PlaybackDirection")] + #[doc = "Change the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`, `PlaybackDirection`*"] + #[wasm_bindgen(method, setter = "direction")] + pub fn set_direction(this: &KeyframeEffectOptions, val: PlaybackDirection); + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &KeyframeEffectOptions) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &KeyframeEffectOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &KeyframeEffectOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &KeyframeEffectOptions, val: &str); + #[doc = "Get the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "endDelay")] + pub fn get_end_delay(this: &KeyframeEffectOptions) -> Option; + #[doc = "Change the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "endDelay")] + pub fn set_end_delay(this: &KeyframeEffectOptions, val: f64); + #[cfg(feature = "FillMode")] + #[doc = "Get the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FillMode`, `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "fill")] + pub fn get_fill(this: &KeyframeEffectOptions) -> Option; + #[cfg(feature = "FillMode")] + #[doc = "Change the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FillMode`, `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "fill")] + pub fn set_fill(this: &KeyframeEffectOptions, val: FillMode); + #[doc = "Get the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "iterationStart")] + pub fn get_iteration_start(this: &KeyframeEffectOptions) -> Option; + #[doc = "Change the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "iterationStart")] + pub fn set_iteration_start(this: &KeyframeEffectOptions, val: f64); + #[doc = "Get the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "iterations")] + pub fn get_iterations(this: &KeyframeEffectOptions) -> Option; + #[doc = "Change the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "iterations")] + pub fn set_iterations(this: &KeyframeEffectOptions, val: f64); + #[cfg(feature = "CompositeOperation")] + #[doc = "Get the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositeOperation`, `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "composite")] + pub fn get_composite(this: &KeyframeEffectOptions) -> Option; + #[cfg(feature = "CompositeOperation")] + #[doc = "Change the `composite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CompositeOperation`, `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "composite")] + pub fn set_composite(this: &KeyframeEffectOptions, val: CompositeOperation); + #[cfg(feature = "IterationCompositeOperation")] + #[doc = "Get the `iterationComposite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterationCompositeOperation`, `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, getter = "iterationComposite")] + pub fn get_iteration_composite( + this: &KeyframeEffectOptions, + ) -> Option; + #[cfg(feature = "IterationCompositeOperation")] + #[doc = "Change the `iterationComposite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IterationCompositeOperation`, `KeyframeEffectOptions`*"] + #[wasm_bindgen(method, setter = "iterationComposite")] + pub fn set_iteration_composite(this: &KeyframeEffectOptions, val: IterationCompositeOperation); } impl KeyframeEffectOptions { #[doc = "Construct a new `KeyframeEffectOptions`."] @@ -19,167 +130,58 @@ impl KeyframeEffectOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `delay` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_delay()` instead."] pub fn delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delay(val); self } #[cfg(feature = "PlaybackDirection")] - #[doc = "Change the `direction` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`, `PlaybackDirection`*"] + #[deprecated = "Use `set_direction()` instead."] pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_direction(val); self } - #[doc = "Change the `duration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_duration()` instead."] pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_duration(val); self } - #[doc = "Change the `easing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_easing()` instead."] 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.set_easing(val); self } - #[doc = "Change the `endDelay` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_end_delay()` instead."] pub fn end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_end_delay(val); self } #[cfg(feature = "FillMode")] - #[doc = "Change the `fill` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FillMode`, `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_fill()` instead."] pub fn fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fill(val); self } - #[doc = "Change the `iterationStart` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_iteration_start()` instead."] pub fn iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iteration_start(val); self } - #[doc = "Change the `iterations` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_iterations()` instead."] pub fn iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iterations(val); self } #[cfg(feature = "CompositeOperation")] - #[doc = "Change the `composite` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CompositeOperation`, `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_composite()` instead."] 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.set_composite(val); self } #[cfg(feature = "IterationCompositeOperation")] - #[doc = "Change the `iterationComposite` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IterationCompositeOperation`, `KeyframeEffectOptions`*"] + #[deprecated = "Use `set_iteration_composite()` instead."] pub fn iteration_composite(&mut self, val: IterationCompositeOperation) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationComposite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iteration_composite(val); self } } diff --git a/crates/web-sys/src/features/gen_L10nElement.rs b/crates/web-sys/src/features/gen_L10nElement.rs index 7bdb10b95e2..0ee26b8266c 100644 --- a/crates/web-sys/src/features/gen_L10nElement.rs +++ b/crates/web-sys/src/features/gen_L10nElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] pub type L10nElement; + #[doc = "Get the `l10nArgs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, getter = "l10nArgs")] + pub fn get_l10n_args(this: &L10nElement) -> Option<::js_sys::Object>; + #[doc = "Change the `l10nArgs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, setter = "l10nArgs")] + pub fn set_l10n_args(this: &L10nElement, val: Option<&::js_sys::Object>); + #[doc = "Get the `l10nAttrs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, getter = "l10nAttrs")] + pub fn get_l10n_attrs(this: &L10nElement) -> Option<::alloc::string::String>; + #[doc = "Change the `l10nAttrs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, setter = "l10nAttrs")] + pub fn set_l10n_attrs(this: &L10nElement, val: Option<&str>); + #[doc = "Get the `l10nId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, getter = "l10nId")] + pub fn get_l10n_id(this: &L10nElement) -> ::alloc::string::String; + #[doc = "Change the `l10nId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, setter = "l10nId")] + pub fn set_l10n_id(this: &L10nElement, val: &str); + #[doc = "Get the `localName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, getter = "localName")] + pub fn get_local_name(this: &L10nElement) -> ::alloc::string::String; + #[doc = "Change the `localName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, setter = "localName")] + pub fn set_local_name(this: &L10nElement, val: &str); + #[doc = "Get the `namespaceURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, getter = "namespaceURI")] + pub fn get_namespace_uri(this: &L10nElement) -> ::alloc::string::String; + #[doc = "Change the `namespaceURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, setter = "namespaceURI")] + pub fn set_namespace_uri(this: &L10nElement, val: &str); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &L10nElement) -> Option<::alloc::string::String>; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &L10nElement, val: Option<&str>); } impl L10nElement { #[doc = "Construct a new `L10nElement`."] @@ -17,104 +78,39 @@ impl L10nElement { pub fn new(l10n_id: &str, local_name: &str, namespace_uri: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.l10n_id(l10n_id); - ret.local_name(local_name); - ret.namespace_uri(namespace_uri); + ret.set_l10n_id(l10n_id); + ret.set_local_name(local_name); + ret.set_namespace_uri(namespace_uri); ret } - #[doc = "Change the `l10nArgs` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[deprecated = "Use `set_l10n_args()` instead."] pub fn l10n_args(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("l10nArgs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_l10n_args(val); self } - #[doc = "Change the `l10nAttrs` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[deprecated = "Use `set_l10n_attrs()` instead."] pub fn l10n_attrs(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("l10nAttrs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_l10n_attrs(val); self } - #[doc = "Change the `l10nId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[deprecated = "Use `set_l10n_id()` instead."] pub fn l10n_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("l10nId"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_l10n_id(val); self } - #[doc = "Change the `localName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[deprecated = "Use `set_local_name()` instead."] pub fn local_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_local_name(val); self } - #[doc = "Change the `namespaceURI` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[deprecated = "Use `set_namespace_uri()` instead."] pub fn namespace_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("namespaceURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_namespace_uri(val); self } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: Option<&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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_L10nValue.rs b/crates/web-sys/src/features/gen_L10nValue.rs index 964afcccd45..11658dacb23 100644 --- a/crates/web-sys/src/features/gen_L10nValue.rs +++ b/crates/web-sys/src/features/gen_L10nValue.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] pub type L10nValue; + #[doc = "Get the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] + #[wasm_bindgen(method, getter = "attributes")] + pub fn get_attributes(this: &L10nValue) -> Option<::js_sys::Array>; + #[doc = "Change the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] + #[wasm_bindgen(method, setter = "attributes")] + pub fn set_attributes(this: &L10nValue, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &L10nValue) -> Option<::alloc::string::String>; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &L10nValue, val: Option<&str>); } impl L10nValue { #[doc = "Construct a new `L10nValue`."] @@ -19,34 +40,14 @@ impl L10nValue { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `attributes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] + #[deprecated = "Use `set_attributes()` instead."] pub fn attributes(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attributes(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `L10nValue`*"] + #[deprecated = "Use `set_value()` instead."] pub fn value(&mut self, val: Option<&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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_LargeBlobSupport.rs b/crates/web-sys/src/features/gen_LargeBlobSupport.rs new file mode 100644 index 00000000000..508b901fe8f --- /dev/null +++ b/crates/web-sys/src/features/gen_LargeBlobSupport.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `LargeBlobSupport` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `LargeBlobSupport`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum LargeBlobSupport { + Required = "required", + Preferred = "preferred", +} diff --git a/crates/web-sys/src/features/gen_LatencyMode.rs b/crates/web-sys/src/features/gen_LatencyMode.rs index 6179b28493e..aa53e603fba 100644 --- a/crates/web-sys/src/features/gen_LatencyMode.rs +++ b/crates/web-sys/src/features/gen_LatencyMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_LifecycleCallbacks.rs b/crates/web-sys/src/features/gen_LifecycleCallbacks.rs index bb95ad3c06e..2628c289394 100644 --- a/crates/web-sys/src/features/gen_LifecycleCallbacks.rs +++ b/crates/web-sys/src/features/gen_LifecycleCallbacks.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] pub type LifecycleCallbacks; + #[doc = "Get the `adoptedCallback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[wasm_bindgen(method, getter = "adoptedCallback")] + pub fn get_adopted_callback(this: &LifecycleCallbacks) -> Option<::js_sys::Function>; + #[doc = "Change the `adoptedCallback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[wasm_bindgen(method, setter = "adoptedCallback")] + pub fn set_adopted_callback(this: &LifecycleCallbacks, val: &::js_sys::Function); + #[doc = "Get the `attributeChangedCallback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[wasm_bindgen(method, getter = "attributeChangedCallback")] + pub fn get_attribute_changed_callback(this: &LifecycleCallbacks) -> Option<::js_sys::Function>; + #[doc = "Change the `attributeChangedCallback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[wasm_bindgen(method, setter = "attributeChangedCallback")] + pub fn set_attribute_changed_callback(this: &LifecycleCallbacks, val: &::js_sys::Function); + #[doc = "Get the `connectedCallback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[wasm_bindgen(method, getter = "connectedCallback")] + pub fn get_connected_callback(this: &LifecycleCallbacks) -> Option<::js_sys::Function>; + #[doc = "Change the `connectedCallback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[wasm_bindgen(method, setter = "connectedCallback")] + pub fn set_connected_callback(this: &LifecycleCallbacks, val: &::js_sys::Function); + #[doc = "Get the `disconnectedCallback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[wasm_bindgen(method, getter = "disconnectedCallback")] + pub fn get_disconnected_callback(this: &LifecycleCallbacks) -> Option<::js_sys::Function>; + #[doc = "Change the `disconnectedCallback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[wasm_bindgen(method, setter = "disconnectedCallback")] + pub fn set_disconnected_callback(this: &LifecycleCallbacks, val: &::js_sys::Function); } impl LifecycleCallbacks { #[doc = "Construct a new `LifecycleCallbacks`."] @@ -19,72 +60,24 @@ impl LifecycleCallbacks { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `adoptedCallback` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[deprecated = "Use `set_adopted_callback()` instead."] pub fn adopted_callback(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("adoptedCallback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_adopted_callback(val); self } - #[doc = "Change the `attributeChangedCallback` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[deprecated = "Use `set_attribute_changed_callback()` instead."] pub fn attribute_changed_callback(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeChangedCallback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attribute_changed_callback(val); self } - #[doc = "Change the `connectedCallback` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[deprecated = "Use `set_connected_callback()` instead."] pub fn connected_callback(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("connectedCallback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_connected_callback(val); self } - #[doc = "Change the `disconnectedCallback` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"] + #[deprecated = "Use `set_disconnected_callback()` instead."] pub fn disconnected_callback(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disconnectedCallback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_disconnected_callback(val); self } } diff --git a/crates/web-sys/src/features/gen_LineAlignSetting.rs b/crates/web-sys/src/features/gen_LineAlignSetting.rs index a8c4e011014..eb1cf3d6057 100644 --- a/crates/web-sys/src/features/gen_LineAlignSetting.rs +++ b/crates/web-sys/src/features/gen_LineAlignSetting.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `LineAlignSetting` enum."] diff --git a/crates/web-sys/src/features/gen_ListBoxObject.rs b/crates/web-sys/src/features/gen_ListBoxObject.rs index 09bc45de50a..2a13c9f1fb5 100644 --- a/crates/web-sys/src/features/gen_ListBoxObject.rs +++ b/crates/web-sys/src/features/gen_ListBoxObject.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_LocalMediaStream.rs b/crates/web-sys/src/features/gen_LocalMediaStream.rs index f6eb1543773..5529e8dbd73 100644 --- a/crates/web-sys/src/features/gen_LocalMediaStream.rs +++ b/crates/web-sys/src/features/gen_LocalMediaStream.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_LocaleInfo.rs b/crates/web-sys/src/features/gen_LocaleInfo.rs index 75842e8400c..f48406db4fa 100644 --- a/crates/web-sys/src/features/gen_LocaleInfo.rs +++ b/crates/web-sys/src/features/gen_LocaleInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] pub type LocaleInfo; + #[doc = "Get the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] + #[wasm_bindgen(method, getter = "direction")] + pub fn get_direction(this: &LocaleInfo) -> Option<::alloc::string::String>; + #[doc = "Change the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] + #[wasm_bindgen(method, setter = "direction")] + pub fn set_direction(this: &LocaleInfo, val: &str); + #[doc = "Get the `locale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] + #[wasm_bindgen(method, getter = "locale")] + pub fn get_locale(this: &LocaleInfo) -> Option<::alloc::string::String>; + #[doc = "Change the `locale` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] + #[wasm_bindgen(method, setter = "locale")] + pub fn set_locale(this: &LocaleInfo, val: &str); } impl LocaleInfo { #[doc = "Construct a new `LocaleInfo`."] @@ -19,35 +40,14 @@ impl LocaleInfo { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `direction` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] + #[deprecated = "Use `set_direction()` instead."] pub fn direction(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_direction(val); self } - #[doc = "Change the `locale` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `LocaleInfo`*"] + #[deprecated = "Use `set_locale()` instead."] pub fn locale(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("locale"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_locale(val); self } } diff --git a/crates/web-sys/src/features/gen_Location.rs b/crates/web-sys/src/features/gen_Location.rs index f75f2bd4832..3b485fcba0e 100644 --- a/crates/web-sys/src/features/gen_Location.rs +++ b/crates/web-sys/src/features/gen_Location.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn href(this: &Location) -> Result; + pub fn href(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Location" , js_name = href)] #[doc = "Setter for the `href` field of this object."] #[doc = ""] @@ -31,14 +32,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn origin(this: &Location) -> Result; + pub fn origin(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "Location" , js_name = protocol)] #[doc = "Getter for the `protocol` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/protocol)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn protocol(this: &Location) -> Result; + pub fn protocol(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Location" , js_name = protocol)] #[doc = "Setter for the `protocol` field of this object."] #[doc = ""] @@ -52,7 +53,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/host)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn host(this: &Location) -> Result; + pub fn host(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Location" , js_name = host)] #[doc = "Setter for the `host` field of this object."] #[doc = ""] @@ -66,7 +67,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/hostname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn hostname(this: &Location) -> Result; + pub fn hostname(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Location" , js_name = hostname)] #[doc = "Setter for the `hostname` field of this object."] #[doc = ""] @@ -80,7 +81,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/port)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn port(this: &Location) -> Result; + pub fn port(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Location" , js_name = port)] #[doc = "Setter for the `port` field of this object."] #[doc = ""] @@ -94,7 +95,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/pathname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn pathname(this: &Location) -> Result; + pub fn pathname(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Location" , js_name = pathname)] #[doc = "Setter for the `pathname` field of this object."] #[doc = ""] @@ -108,7 +109,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/search)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn search(this: &Location) -> Result; + pub fn search(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Location" , js_name = search)] #[doc = "Setter for the `search` field of this object."] #[doc = ""] @@ -122,7 +123,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Location/hash)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Location`*"] - pub fn hash(this: &Location) -> Result; + pub fn hash(this: &Location) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Location" , js_name = hash)] #[doc = "Setter for the `hash` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_GpuMapMode.rs b/crates/web-sys/src/features/gen_Lock.rs similarity index 58% rename from crates/web-sys/src/features/gen_GpuMapMode.rs rename to crates/web-sys/src/features/gen_Lock.rs index 7da1a45475b..785dc9d1801 100644 --- a/crates/web-sys/src/features/gen_GpuMapMode.rs +++ b/crates/web-sys/src/features/gen_Lock.rs @@ -1,37 +1,42 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUMapMode , typescript_type = "GPUMapMode")] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Lock , typescript_type = "Lock")] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuMapMode` class."] + #[doc = "The `Lock` class."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUMapMode)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Lock)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuMapMode`*"] + #[doc = "*This API requires the following crate features to be activated: `Lock`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuMapMode; -} -#[cfg(web_sys_unstable_apis)] -impl GpuMapMode { + pub type Lock; #[cfg(web_sys_unstable_apis)] - #[doc = "The `GPUMapMode.READ` const."] + # [wasm_bindgen (structural , method , getter , js_class = "Lock" , js_name = name)] + #[doc = "Getter for the `name` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuMapMode`*"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Lock/name)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Lock`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub const READ: u32 = 1u64 as u32; + pub fn name(this: &Lock) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] - #[doc = "The `GPUMapMode.WRITE` const."] + #[cfg(feature = "LockMode")] + # [wasm_bindgen (structural , method , getter , js_class = "Lock" , js_name = mode)] + #[doc = "Getter for the `mode` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Lock/mode)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuMapMode`*"] + #[doc = "*This API requires the following crate features to be activated: `Lock`, `LockMode`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub const WRITE: u32 = 2u64 as u32; + pub fn mode(this: &Lock) -> LockMode; } diff --git a/crates/web-sys/src/features/gen_LockInfo.rs b/crates/web-sys/src/features/gen_LockInfo.rs new file mode 100644 index 00000000000..961a4dfe383 --- /dev/null +++ b/crates/web-sys/src/features/gen_LockInfo.rs @@ -0,0 +1,112 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = LockInfo)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `LockInfo` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type LockInfo; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `clientId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "clientId")] + pub fn get_client_id(this: &LockInfo) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `clientId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "clientId")] + pub fn set_client_id(this: &LockInfo, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockInfo`, `LockMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &LockInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockInfo`, `LockMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &LockInfo, val: LockMode); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &LockInfo) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &LockInfo, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl LockInfo { + #[doc = "Construct a new `LockInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_client_id()` instead."] + pub fn client_id(&mut self, val: &str) -> &mut Self { + self.set_client_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockMode")] + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: LockMode) -> &mut Self { + self.set_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: &str) -> &mut Self { + self.set_name(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for LockInfo { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_LockManager.rs b/crates/web-sys/src/features/gen_LockManager.rs new file mode 100644 index 00000000000..d1d52894863 --- /dev/null +++ b/crates/web-sys/src/features/gen_LockManager.rs @@ -0,0 +1,62 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = LockManager , typescript_type = "LockManager")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `LockManager` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/LockManager)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManager`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type LockManager; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "LockManager" , js_name = query)] + #[doc = "The `query()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/LockManager/query)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManager`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn query(this: &LockManager) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "LockManager" , js_name = request)] + #[doc = "The `request()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManager`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_with_callback( + this: &LockManager, + name: &str, + callback: &::js_sys::Function, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockOptions")] + # [wasm_bindgen (method , structural , js_class = "LockManager" , js_name = request)] + #[doc = "The `request()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManager`, `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_with_options_and_callback( + this: &LockManager, + name: &str, + options: &LockOptions, + callback: &::js_sys::Function, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_LockManagerSnapshot.rs b/crates/web-sys/src/features/gen_LockManagerSnapshot.rs new file mode 100644 index 00000000000..eaf27c0dbbe --- /dev/null +++ b/crates/web-sys/src/features/gen_LockManagerSnapshot.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = LockManagerSnapshot)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `LockManagerSnapshot` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManagerSnapshot`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type LockManagerSnapshot; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `held` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManagerSnapshot`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "held")] + pub fn get_held(this: &LockManagerSnapshot) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `held` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManagerSnapshot`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "held")] + pub fn set_held(this: &LockManagerSnapshot, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `pending` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManagerSnapshot`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "pending")] + pub fn get_pending(this: &LockManagerSnapshot) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `pending` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManagerSnapshot`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "pending")] + pub fn set_pending(this: &LockManagerSnapshot, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl LockManagerSnapshot { + #[doc = "Construct a new `LockManagerSnapshot`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManagerSnapshot`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_held()` instead."] + pub fn held(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_held(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_pending()` instead."] + pub fn pending(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_pending(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for LockManagerSnapshot { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_LockMode.rs b/crates/web-sys/src/features/gen_LockMode.rs new file mode 100644 index 00000000000..18459e67ec1 --- /dev/null +++ b/crates/web-sys/src/features/gen_LockMode.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `LockMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `LockMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum LockMode { + Shared = "shared", + Exclusive = "exclusive", +} diff --git a/crates/web-sys/src/features/gen_LockOptions.rs b/crates/web-sys/src/features/gen_LockOptions.rs new file mode 100644 index 00000000000..3f023869c94 --- /dev/null +++ b/crates/web-sys/src/features/gen_LockOptions.rs @@ -0,0 +1,139 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = LockOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `LockOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type LockOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `ifAvailable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "ifAvailable")] + pub fn get_if_available(this: &LockOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `ifAvailable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "ifAvailable")] + pub fn set_if_available(this: &LockOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockMode`, `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &LockOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockMode`, `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &LockOptions, val: LockMode); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[doc = "Get the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "signal")] + pub fn get_signal(this: &LockOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "signal")] + pub fn set_signal(this: &LockOptions, val: &AbortSignal); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `steal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "steal")] + pub fn get_steal(this: &LockOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `steal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "steal")] + pub fn set_steal(this: &LockOptions, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl LockOptions { + #[doc = "Construct a new `LockOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_if_available()` instead."] + pub fn if_available(&mut self, val: bool) -> &mut Self { + self.set_if_available(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockMode")] + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: LockMode) -> &mut Self { + self.set_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[deprecated = "Use `set_signal()` instead."] + pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { + self.set_signal(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_steal()` instead."] + pub fn steal(&mut self, val: bool) -> &mut Self { + self.set_steal(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for LockOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_MathMlElement.rs b/crates/web-sys/src/features/gen_MathMlElement.rs new file mode 100644 index 00000000000..78824e3e751 --- /dev/null +++ b/crates/web-sys/src/features/gen_MathMlElement.rs @@ -0,0 +1,1327 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Element , extends = Node , extends = EventTarget , extends = :: js_sys :: Object , js_name = MathMLElement , typescript_type = "MathMLElement")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MathMlElement` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub type MathMlElement; + #[cfg(feature = "CssStyleDeclaration")] + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = style)] + #[doc = "Getter for the `style` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/style)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`, `MathMlElement`*"] + pub fn style(this: &MathMlElement) -> CssStyleDeclaration; + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , 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/MathMLElement/onabort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onabort(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , 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/MathMLElement/onabort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onabort(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onblur)] + #[doc = "Getter for the `onblur` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onblur)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onblur(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onblur)] + #[doc = "Setter for the `onblur` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onblur)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onblur(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onfocus)] + #[doc = "Getter for the `onfocus` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onfocus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onfocus(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onfocus)] + #[doc = "Setter for the `onfocus` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onfocus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onfocus(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onauxclick)] + #[doc = "Getter for the `onauxclick` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onauxclick)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onauxclick(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onauxclick)] + #[doc = "Setter for the `onauxclick` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onauxclick)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onauxclick(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onbeforetoggle)] + #[doc = "Getter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onbeforetoggle(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onbeforetoggle)] + #[doc = "Setter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onbeforetoggle(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = oncanplay)] + #[doc = "Getter for the `oncanplay` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oncanplay)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn oncanplay(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = oncanplay)] + #[doc = "Setter for the `oncanplay` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oncanplay)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_oncanplay(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = oncanplaythrough)] + #[doc = "Getter for the `oncanplaythrough` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oncanplaythrough)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn oncanplaythrough(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = oncanplaythrough)] + #[doc = "Setter for the `oncanplaythrough` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oncanplaythrough)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_oncanplaythrough(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , 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/MathMLElement/onchange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onchange(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , 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/MathMLElement/onchange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onchange(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onclick)] + #[doc = "Getter for the `onclick` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onclick)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onclick(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onclick)] + #[doc = "Setter for the `onclick` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onclick)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onclick(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onclose)] + #[doc = "Getter for the `onclose` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onclose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onclose(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onclose)] + #[doc = "Setter for the `onclose` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onclose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onclose(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = oncontextmenu)] + #[doc = "Getter for the `oncontextmenu` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oncontextmenu)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn oncontextmenu(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = oncontextmenu)] + #[doc = "Setter for the `oncontextmenu` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oncontextmenu)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_oncontextmenu(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondblclick)] + #[doc = "Getter for the `ondblclick` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondblclick)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondblclick(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondblclick)] + #[doc = "Setter for the `ondblclick` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondblclick)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondblclick(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondrag)] + #[doc = "Getter for the `ondrag` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondrag)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondrag(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondrag)] + #[doc = "Setter for the `ondrag` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondrag)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondrag(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondragend)] + #[doc = "Getter for the `ondragend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondragend(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondragend)] + #[doc = "Setter for the `ondragend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondragend(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondragenter)] + #[doc = "Getter for the `ondragenter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragenter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondragenter(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondragenter)] + #[doc = "Setter for the `ondragenter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragenter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondragenter(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondragexit)] + #[doc = "Getter for the `ondragexit` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragexit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondragexit(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondragexit)] + #[doc = "Setter for the `ondragexit` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragexit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondragexit(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondragleave)] + #[doc = "Getter for the `ondragleave` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragleave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondragleave(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondragleave)] + #[doc = "Setter for the `ondragleave` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragleave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondragleave(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondragover)] + #[doc = "Getter for the `ondragover` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondragover(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondragover)] + #[doc = "Setter for the `ondragover` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondragover(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondragstart)] + #[doc = "Getter for the `ondragstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondragstart(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondragstart)] + #[doc = "Setter for the `ondragstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondragstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondragstart(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondrop)] + #[doc = "Getter for the `ondrop` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondrop)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondrop(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondrop)] + #[doc = "Setter for the `ondrop` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondrop)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondrop(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ondurationchange)] + #[doc = "Getter for the `ondurationchange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondurationchange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ondurationchange(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ondurationchange)] + #[doc = "Setter for the `ondurationchange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ondurationchange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ondurationchange(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onemptied)] + #[doc = "Getter for the `onemptied` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onemptied)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onemptied(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onemptied)] + #[doc = "Setter for the `onemptied` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onemptied)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onemptied(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , 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/MathMLElement/onended)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onended(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , 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/MathMLElement/onended)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onended(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = oninput)] + #[doc = "Getter for the `oninput` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oninput)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn oninput(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = oninput)] + #[doc = "Setter for the `oninput` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oninput)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_oninput(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = oninvalid)] + #[doc = "Getter for the `oninvalid` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oninvalid)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn oninvalid(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = oninvalid)] + #[doc = "Setter for the `oninvalid` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/oninvalid)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_oninvalid(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onkeydown)] + #[doc = "Getter for the `onkeydown` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onkeydown)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onkeydown(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onkeydown)] + #[doc = "Setter for the `onkeydown` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onkeydown)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onkeydown(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onkeypress)] + #[doc = "Getter for the `onkeypress` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onkeypress)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onkeypress(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onkeypress)] + #[doc = "Setter for the `onkeypress` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onkeypress)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onkeypress(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onkeyup)] + #[doc = "Getter for the `onkeyup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onkeyup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onkeyup(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onkeyup)] + #[doc = "Setter for the `onkeyup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onkeyup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onkeyup(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onload)] + #[doc = "Getter for the `onload` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onload)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onload(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onload)] + #[doc = "Setter for the `onload` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onload)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onload(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onloadeddata)] + #[doc = "Getter for the `onloadeddata` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onloadeddata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onloadeddata(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onloadeddata)] + #[doc = "Setter for the `onloadeddata` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onloadeddata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onloadeddata(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onloadedmetadata)] + #[doc = "Getter for the `onloadedmetadata` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onloadedmetadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onloadedmetadata(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onloadedmetadata)] + #[doc = "Setter for the `onloadedmetadata` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onloadedmetadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onloadedmetadata(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onloadend)] + #[doc = "Getter for the `onloadend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onloadend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onloadend(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onloadend)] + #[doc = "Setter for the `onloadend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onloadend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onloadend(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onloadstart)] + #[doc = "Getter for the `onloadstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onloadstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onloadstart(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onloadstart)] + #[doc = "Setter for the `onloadstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onloadstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onloadstart(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onmousedown)] + #[doc = "Getter for the `onmousedown` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmousedown)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onmousedown(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onmousedown)] + #[doc = "Setter for the `onmousedown` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmousedown)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onmousedown(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onmouseenter)] + #[doc = "Getter for the `onmouseenter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseenter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onmouseenter(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onmouseenter)] + #[doc = "Setter for the `onmouseenter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseenter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onmouseenter(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onmouseleave)] + #[doc = "Getter for the `onmouseleave` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseleave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onmouseleave(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onmouseleave)] + #[doc = "Setter for the `onmouseleave` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseleave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onmouseleave(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onmousemove)] + #[doc = "Getter for the `onmousemove` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmousemove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onmousemove(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onmousemove)] + #[doc = "Setter for the `onmousemove` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmousemove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onmousemove(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onmouseout)] + #[doc = "Getter for the `onmouseout` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onmouseout(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onmouseout)] + #[doc = "Setter for the `onmouseout` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onmouseout(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onmouseover)] + #[doc = "Getter for the `onmouseover` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onmouseover(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onmouseover)] + #[doc = "Setter for the `onmouseover` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onmouseover(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onmouseup)] + #[doc = "Getter for the `onmouseup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onmouseup(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onmouseup)] + #[doc = "Setter for the `onmouseup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onmouseup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onmouseup(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onwheel)] + #[doc = "Getter for the `onwheel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwheel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onwheel(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onwheel)] + #[doc = "Setter for the `onwheel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwheel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onwheel(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpause)] + #[doc = "Getter for the `onpause` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpause)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpause(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpause)] + #[doc = "Setter for the `onpause` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpause)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpause(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onplay)] + #[doc = "Getter for the `onplay` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onplay)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onplay(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onplay)] + #[doc = "Setter for the `onplay` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onplay)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onplay(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onplaying)] + #[doc = "Getter for the `onplaying` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onplaying)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onplaying(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onplaying)] + #[doc = "Setter for the `onplaying` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onplaying)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onplaying(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onprogress)] + #[doc = "Getter for the `onprogress` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onprogress)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onprogress(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onprogress)] + #[doc = "Setter for the `onprogress` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onprogress)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onprogress(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onratechange)] + #[doc = "Getter for the `onratechange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onratechange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onratechange(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onratechange)] + #[doc = "Setter for the `onratechange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onratechange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onratechange(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onreset)] + #[doc = "Getter for the `onreset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onreset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onreset(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onreset)] + #[doc = "Setter for the `onreset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onreset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onreset(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onresize)] + #[doc = "Getter for the `onresize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onresize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onresize(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onresize)] + #[doc = "Setter for the `onresize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onresize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onresize(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onscroll)] + #[doc = "Getter for the `onscroll` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onscroll)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onscroll(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onscroll)] + #[doc = "Setter for the `onscroll` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onscroll)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onscroll(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onseeked)] + #[doc = "Getter for the `onseeked` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onseeked)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onseeked(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onseeked)] + #[doc = "Setter for the `onseeked` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onseeked)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onseeked(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onseeking)] + #[doc = "Getter for the `onseeking` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onseeking)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onseeking(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onseeking)] + #[doc = "Setter for the `onseeking` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onseeking)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onseeking(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onselect)] + #[doc = "Getter for the `onselect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onselect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onselect(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onselect)] + #[doc = "Setter for the `onselect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onselect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onselect(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onshow)] + #[doc = "Getter for the `onshow` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onshow)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onshow(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onshow)] + #[doc = "Setter for the `onshow` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onshow)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onshow(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onstalled)] + #[doc = "Getter for the `onstalled` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onstalled)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onstalled(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onstalled)] + #[doc = "Setter for the `onstalled` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onstalled)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onstalled(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onsubmit)] + #[doc = "Getter for the `onsubmit` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onsubmit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onsubmit(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onsubmit)] + #[doc = "Setter for the `onsubmit` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onsubmit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onsubmit(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onsuspend)] + #[doc = "Getter for the `onsuspend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onsuspend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onsuspend(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onsuspend)] + #[doc = "Setter for the `onsuspend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onsuspend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onsuspend(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontimeupdate)] + #[doc = "Getter for the `ontimeupdate` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontimeupdate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontimeupdate(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontimeupdate)] + #[doc = "Setter for the `ontimeupdate` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontimeupdate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontimeupdate(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onvolumechange)] + #[doc = "Getter for the `onvolumechange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onvolumechange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onvolumechange(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onvolumechange)] + #[doc = "Setter for the `onvolumechange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onvolumechange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onvolumechange(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onwaiting)] + #[doc = "Getter for the `onwaiting` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwaiting)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onwaiting(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onwaiting)] + #[doc = "Setter for the `onwaiting` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwaiting)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onwaiting(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onselectstart)] + #[doc = "Getter for the `onselectstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onselectstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onselectstart(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onselectstart)] + #[doc = "Setter for the `onselectstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onselectstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onselectstart(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontoggle)] + #[doc = "Getter for the `ontoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontoggle(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontoggle)] + #[doc = "Setter for the `ontoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontoggle(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpointercancel)] + #[doc = "Getter for the `onpointercancel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointercancel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpointercancel(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpointercancel)] + #[doc = "Setter for the `onpointercancel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointercancel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpointercancel(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpointerdown)] + #[doc = "Getter for the `onpointerdown` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerdown)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpointerdown(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpointerdown)] + #[doc = "Setter for the `onpointerdown` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerdown)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpointerdown(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpointerup)] + #[doc = "Getter for the `onpointerup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpointerup(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpointerup)] + #[doc = "Setter for the `onpointerup` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerup)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpointerup(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpointermove)] + #[doc = "Getter for the `onpointermove` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointermove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpointermove(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpointermove)] + #[doc = "Setter for the `onpointermove` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointermove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpointermove(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpointerout)] + #[doc = "Getter for the `onpointerout` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpointerout(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpointerout)] + #[doc = "Setter for the `onpointerout` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerout)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpointerout(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpointerover)] + #[doc = "Getter for the `onpointerover` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpointerover(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpointerover)] + #[doc = "Setter for the `onpointerover` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerover)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpointerover(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpointerenter)] + #[doc = "Getter for the `onpointerenter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerenter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpointerenter(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpointerenter)] + #[doc = "Setter for the `onpointerenter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerenter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpointerenter(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onpointerleave)] + #[doc = "Getter for the `onpointerleave` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerleave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onpointerleave(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onpointerleave)] + #[doc = "Setter for the `onpointerleave` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onpointerleave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onpointerleave(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ongotpointercapture)] + #[doc = "Getter for the `ongotpointercapture` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ongotpointercapture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ongotpointercapture(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ongotpointercapture)] + #[doc = "Setter for the `ongotpointercapture` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ongotpointercapture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ongotpointercapture(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onlostpointercapture)] + #[doc = "Getter for the `onlostpointercapture` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onlostpointercapture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onlostpointercapture(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onlostpointercapture)] + #[doc = "Setter for the `onlostpointercapture` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onlostpointercapture)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onlostpointercapture(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onanimationcancel)] + #[doc = "Getter for the `onanimationcancel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onanimationcancel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onanimationcancel(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onanimationcancel)] + #[doc = "Setter for the `onanimationcancel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onanimationcancel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onanimationcancel(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onanimationend)] + #[doc = "Getter for the `onanimationend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onanimationend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onanimationend(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onanimationend)] + #[doc = "Setter for the `onanimationend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onanimationend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onanimationend(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onanimationiteration)] + #[doc = "Getter for the `onanimationiteration` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onanimationiteration)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onanimationiteration(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onanimationiteration)] + #[doc = "Setter for the `onanimationiteration` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onanimationiteration)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onanimationiteration(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onanimationstart)] + #[doc = "Getter for the `onanimationstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onanimationstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onanimationstart(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onanimationstart)] + #[doc = "Setter for the `onanimationstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onanimationstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onanimationstart(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontransitioncancel)] + #[doc = "Getter for the `ontransitioncancel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontransitioncancel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontransitioncancel(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontransitioncancel)] + #[doc = "Setter for the `ontransitioncancel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontransitioncancel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontransitioncancel(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontransitionend)] + #[doc = "Getter for the `ontransitionend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontransitionend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontransitionend(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontransitionend)] + #[doc = "Setter for the `ontransitionend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontransitionend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontransitionend(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontransitionrun)] + #[doc = "Getter for the `ontransitionrun` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontransitionrun)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontransitionrun(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontransitionrun)] + #[doc = "Setter for the `ontransitionrun` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontransitionrun)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontransitionrun(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontransitionstart)] + #[doc = "Getter for the `ontransitionstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontransitionstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontransitionstart(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontransitionstart)] + #[doc = "Setter for the `ontransitionstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontransitionstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontransitionstart(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onwebkitanimationend)] + #[doc = "Getter for the `onwebkitanimationend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwebkitanimationend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onwebkitanimationend(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onwebkitanimationend)] + #[doc = "Setter for the `onwebkitanimationend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwebkitanimationend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onwebkitanimationend(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onwebkitanimationiteration)] + #[doc = "Getter for the `onwebkitanimationiteration` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwebkitanimationiteration)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onwebkitanimationiteration(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onwebkitanimationiteration)] + #[doc = "Setter for the `onwebkitanimationiteration` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwebkitanimationiteration)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onwebkitanimationiteration(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onwebkitanimationstart)] + #[doc = "Getter for the `onwebkitanimationstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwebkitanimationstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onwebkitanimationstart(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onwebkitanimationstart)] + #[doc = "Setter for the `onwebkitanimationstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwebkitanimationstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onwebkitanimationstart(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onwebkittransitionend)] + #[doc = "Getter for the `onwebkittransitionend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwebkittransitionend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onwebkittransitionend(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onwebkittransitionend)] + #[doc = "Setter for the `onwebkittransitionend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onwebkittransitionend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onwebkittransitionend(this: &MathMlElement, value: Option<&::js_sys::Function>); + #[cfg(feature = "DomStringMap")] + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = dataset)] + #[doc = "Getter for the `dataset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/dataset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomStringMap`, `MathMlElement`*"] + pub fn dataset(this: &MathMlElement) -> DomStringMap; + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = nonce)] + #[doc = "Getter for the `nonce` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/nonce)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn nonce(this: &MathMlElement) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = nonce)] + #[doc = "Setter for the `nonce` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/nonce)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_nonce(this: &MathMlElement, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = autofocus)] + #[doc = "Getter for the `autofocus` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/autofocus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn autofocus(this: &MathMlElement) -> bool; + # [wasm_bindgen (structural , catch , method , setter , js_class = "MathMLElement" , js_name = autofocus)] + #[doc = "Setter for the `autofocus` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/autofocus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_autofocus(this: &MathMlElement, value: bool) -> Result<(), JsValue>; + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = tabIndex)] + #[doc = "Getter for the `tabIndex` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/tabIndex)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn tab_index(this: &MathMlElement) -> i32; + # [wasm_bindgen (structural , catch , method , setter , js_class = "MathMLElement" , js_name = tabIndex)] + #[doc = "Setter for the `tabIndex` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/tabIndex)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_tab_index(this: &MathMlElement, value: i32) -> Result<(), JsValue>; + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = onerror)] + #[doc = "Getter for the `onerror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onerror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn onerror(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = onerror)] + #[doc = "Setter for the `onerror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/onerror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_onerror(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontouchstart)] + #[doc = "Getter for the `ontouchstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontouchstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontouchstart(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontouchstart)] + #[doc = "Setter for the `ontouchstart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontouchstart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontouchstart(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontouchend)] + #[doc = "Getter for the `ontouchend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontouchend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontouchend(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontouchend)] + #[doc = "Setter for the `ontouchend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontouchend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontouchend(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontouchmove)] + #[doc = "Getter for the `ontouchmove` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontouchmove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontouchmove(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontouchmove)] + #[doc = "Setter for the `ontouchmove` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontouchmove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontouchmove(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "MathMLElement" , js_name = ontouchcancel)] + #[doc = "Getter for the `ontouchcancel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontouchcancel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn ontouchcancel(this: &MathMlElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "MathMLElement" , js_name = ontouchcancel)] + #[doc = "Setter for the `ontouchcancel` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/ontouchcancel)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn set_ontouchcancel(this: &MathMlElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (catch , method , structural , js_class = "MathMLElement" , js_name = blur)] + #[doc = "The `blur()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/blur)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn blur(this: &MathMlElement) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "MathMLElement" , js_name = focus)] + #[doc = "The `focus()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/focus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MathMlElement`*"] + pub fn focus(this: &MathMlElement) -> Result<(), JsValue>; + #[cfg(feature = "FocusOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "MathMLElement" , js_name = focus)] + #[doc = "The `focus()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MathMLElement/focus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`, `MathMlElement`*"] + pub fn focus_with_options(this: &MathMlElement, options: &FocusOptions) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_MediaCapabilities.rs b/crates/web-sys/src/features/gen_MediaCapabilities.rs index 1169339b6a8..e2fb0ad531a 100644 --- a/crates/web-sys/src/features/gen_MediaCapabilities.rs +++ b/crates/web-sys/src/features/gen_MediaCapabilities.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaCapabilitiesInfo.rs b/crates/web-sys/src/features/gen_MediaCapabilitiesInfo.rs index 2f36d5d1c25..b35b38eed83 100644 --- a/crates/web-sys/src/features/gen_MediaCapabilitiesInfo.rs +++ b/crates/web-sys/src/features/gen_MediaCapabilitiesInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaConfiguration.rs b/crates/web-sys/src/features/gen_MediaConfiguration.rs index d56d3704465..57c9d39f59f 100644 --- a/crates/web-sys/src/features/gen_MediaConfiguration.rs +++ b/crates/web-sys/src/features/gen_MediaConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,30 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaConfiguration`*"] pub type MediaConfiguration; + #[cfg(feature = "AudioConfiguration")] + #[doc = "Get the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaConfiguration`*"] + #[wasm_bindgen(method, getter = "audio")] + pub fn get_audio(this: &MediaConfiguration) -> Option; + #[cfg(feature = "AudioConfiguration")] + #[doc = "Change the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaConfiguration`*"] + #[wasm_bindgen(method, setter = "audio")] + pub fn set_audio(this: &MediaConfiguration, val: &AudioConfiguration); + #[cfg(feature = "VideoConfiguration")] + #[doc = "Get the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaConfiguration`, `VideoConfiguration`*"] + #[wasm_bindgen(method, getter = "video")] + pub fn get_video(this: &MediaConfiguration) -> Option; + #[cfg(feature = "VideoConfiguration")] + #[doc = "Change the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaConfiguration`, `VideoConfiguration`*"] + #[wasm_bindgen(method, setter = "video")] + pub fn set_video(this: &MediaConfiguration, val: &VideoConfiguration); } impl MediaConfiguration { #[doc = "Construct a new `MediaConfiguration`."] @@ -20,31 +45,15 @@ impl MediaConfiguration { ret } #[cfg(feature = "AudioConfiguration")] - #[doc = "Change the `audio` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaConfiguration`*"] + #[deprecated = "Use `set_audio()` instead."] pub fn audio(&mut self, val: &AudioConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio(val); self } #[cfg(feature = "VideoConfiguration")] - #[doc = "Change the `video` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaConfiguration`, `VideoConfiguration`*"] + #[deprecated = "Use `set_video()` instead."] pub fn video(&mut self, val: &VideoConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_video(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaDecodingConfiguration.rs b/crates/web-sys/src/features/gen_MediaDecodingConfiguration.rs index ef23b597fc8..8fac4291e8f 100644 --- a/crates/web-sys/src/features/gen_MediaDecodingConfiguration.rs +++ b/crates/web-sys/src/features/gen_MediaDecodingConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,42 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`*"] pub type MediaDecodingConfiguration; + #[cfg(feature = "AudioConfiguration")] + #[doc = "Get the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaDecodingConfiguration`*"] + #[wasm_bindgen(method, getter = "audio")] + pub fn get_audio(this: &MediaDecodingConfiguration) -> Option; + #[cfg(feature = "AudioConfiguration")] + #[doc = "Change the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaDecodingConfiguration`*"] + #[wasm_bindgen(method, setter = "audio")] + pub fn set_audio(this: &MediaDecodingConfiguration, val: &AudioConfiguration); + #[cfg(feature = "VideoConfiguration")] + #[doc = "Get the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `VideoConfiguration`*"] + #[wasm_bindgen(method, getter = "video")] + pub fn get_video(this: &MediaDecodingConfiguration) -> Option; + #[cfg(feature = "VideoConfiguration")] + #[doc = "Change the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `VideoConfiguration`*"] + #[wasm_bindgen(method, setter = "video")] + pub fn set_video(this: &MediaDecodingConfiguration, val: &VideoConfiguration); + #[cfg(feature = "MediaDecodingType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &MediaDecodingConfiguration) -> MediaDecodingType; + #[cfg(feature = "MediaDecodingType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &MediaDecodingConfiguration, val: MediaDecodingType); } impl MediaDecodingConfiguration { #[cfg(feature = "MediaDecodingType")] @@ -18,49 +55,25 @@ impl MediaDecodingConfiguration { pub fn new(type_: MediaDecodingType) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.type_(type_); + ret.set_type(type_); ret } #[cfg(feature = "AudioConfiguration")] - #[doc = "Change the `audio` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaDecodingConfiguration`*"] + #[deprecated = "Use `set_audio()` instead."] pub fn audio(&mut self, val: &AudioConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio(val); self } #[cfg(feature = "VideoConfiguration")] - #[doc = "Change the `video` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `VideoConfiguration`*"] + #[deprecated = "Use `set_video()` instead."] pub fn video(&mut self, val: &VideoConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_video(val); self } #[cfg(feature = "MediaDecodingType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaDecodingConfiguration`, `MediaDecodingType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: MediaDecodingType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaDecodingType.rs b/crates/web-sys/src/features/gen_MediaDecodingType.rs index 79ae5f89203..865462b8a51 100644 --- a/crates/web-sys/src/features/gen_MediaDecodingType.rs +++ b/crates/web-sys/src/features/gen_MediaDecodingType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaDecodingType` enum."] diff --git a/crates/web-sys/src/features/gen_MediaDeviceInfo.rs b/crates/web-sys/src/features/gen_MediaDeviceInfo.rs index c3f9af20ef0..9de3988588e 100644 --- a/crates/web-sys/src/features/gen_MediaDeviceInfo.rs +++ b/crates/web-sys/src/features/gen_MediaDeviceInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/deviceId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaDeviceInfo`*"] - pub fn device_id(this: &MediaDeviceInfo) -> String; + pub fn device_id(this: &MediaDeviceInfo) -> ::alloc::string::String; #[cfg(feature = "MediaDeviceKind")] # [wasm_bindgen (structural , method , getter , js_class = "MediaDeviceInfo" , js_name = kind)] #[doc = "Getter for the `kind` field of this object."] @@ -32,14 +33,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaDeviceInfo`*"] - pub fn label(this: &MediaDeviceInfo) -> String; + pub fn label(this: &MediaDeviceInfo) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaDeviceInfo" , js_name = groupId)] #[doc = "Getter for the `groupId` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/groupId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaDeviceInfo`*"] - pub fn group_id(this: &MediaDeviceInfo) -> String; + pub fn group_id(this: &MediaDeviceInfo) -> ::alloc::string::String; # [wasm_bindgen (method , structural , js_class = "MediaDeviceInfo" , js_name = toJSON)] #[doc = "The `toJSON()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MediaDeviceKind.rs b/crates/web-sys/src/features/gen_MediaDeviceKind.rs index ff9873c265a..69c6ed8ce9b 100644 --- a/crates/web-sys/src/features/gen_MediaDeviceKind.rs +++ b/crates/web-sys/src/features/gen_MediaDeviceKind.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaDeviceKind` enum."] diff --git a/crates/web-sys/src/features/gen_MediaDevices.rs b/crates/web-sys/src/features/gen_MediaDevices.rs index d8a76c67fe4..d491e87d8d3 100644 --- a/crates/web-sys/src/features/gen_MediaDevices.rs +++ b/crates/web-sys/src/features/gen_MediaDevices.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaElementAudioSourceNode.rs b/crates/web-sys/src/features/gen_MediaElementAudioSourceNode.rs index 4b5507167da..94023c0462a 100644 --- a/crates/web-sys/src/features/gen_MediaElementAudioSourceNode.rs +++ b/crates/web-sys/src/features/gen_MediaElementAudioSourceNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaElementAudioSourceOptions.rs b/crates/web-sys/src/features/gen_MediaElementAudioSourceOptions.rs index 6db428e5894..2c9735b71c5 100644 --- a/crates/web-sys/src/features/gen_MediaElementAudioSourceOptions.rs +++ b/crates/web-sys/src/features/gen_MediaElementAudioSourceOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaElementAudioSourceOptions`*"] pub type MediaElementAudioSourceOptions; + #[cfg(feature = "HtmlMediaElement")] + #[doc = "Get the `mediaElement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`, `MediaElementAudioSourceOptions`*"] + #[wasm_bindgen(method, getter = "mediaElement")] + pub fn get_media_element(this: &MediaElementAudioSourceOptions) -> HtmlMediaElement; + #[cfg(feature = "HtmlMediaElement")] + #[doc = "Change the `mediaElement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`, `MediaElementAudioSourceOptions`*"] + #[wasm_bindgen(method, setter = "mediaElement")] + pub fn set_media_element(this: &MediaElementAudioSourceOptions, val: &HtmlMediaElement); } impl MediaElementAudioSourceOptions { #[cfg(feature = "HtmlMediaElement")] @@ -18,25 +31,13 @@ impl MediaElementAudioSourceOptions { pub fn new(media_element: &HtmlMediaElement) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.media_element(media_element); + ret.set_media_element(media_element); ret } #[cfg(feature = "HtmlMediaElement")] - #[doc = "Change the `mediaElement` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HtmlMediaElement`, `MediaElementAudioSourceOptions`*"] + #[deprecated = "Use `set_media_element()` instead."] pub fn media_element(&mut self, val: &HtmlMediaElement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaElement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_element(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaEncodingConfiguration.rs b/crates/web-sys/src/features/gen_MediaEncodingConfiguration.rs index a52fe6a7667..2b7c56af555 100644 --- a/crates/web-sys/src/features/gen_MediaEncodingConfiguration.rs +++ b/crates/web-sys/src/features/gen_MediaEncodingConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,42 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`*"] pub type MediaEncodingConfiguration; + #[cfg(feature = "AudioConfiguration")] + #[doc = "Get the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaEncodingConfiguration`*"] + #[wasm_bindgen(method, getter = "audio")] + pub fn get_audio(this: &MediaEncodingConfiguration) -> Option; + #[cfg(feature = "AudioConfiguration")] + #[doc = "Change the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaEncodingConfiguration`*"] + #[wasm_bindgen(method, setter = "audio")] + pub fn set_audio(this: &MediaEncodingConfiguration, val: &AudioConfiguration); + #[cfg(feature = "VideoConfiguration")] + #[doc = "Get the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`, `VideoConfiguration`*"] + #[wasm_bindgen(method, getter = "video")] + pub fn get_video(this: &MediaEncodingConfiguration) -> Option; + #[cfg(feature = "VideoConfiguration")] + #[doc = "Change the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`, `VideoConfiguration`*"] + #[wasm_bindgen(method, setter = "video")] + pub fn set_video(this: &MediaEncodingConfiguration, val: &VideoConfiguration); + #[cfg(feature = "MediaEncodingType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`, `MediaEncodingType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &MediaEncodingConfiguration) -> MediaEncodingType; + #[cfg(feature = "MediaEncodingType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`, `MediaEncodingType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &MediaEncodingConfiguration, val: MediaEncodingType); } impl MediaEncodingConfiguration { #[cfg(feature = "MediaEncodingType")] @@ -18,49 +55,25 @@ impl MediaEncodingConfiguration { pub fn new(type_: MediaEncodingType) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.type_(type_); + ret.set_type(type_); ret } #[cfg(feature = "AudioConfiguration")] - #[doc = "Change the `audio` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`, `MediaEncodingConfiguration`*"] + #[deprecated = "Use `set_audio()` instead."] pub fn audio(&mut self, val: &AudioConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio(val); self } #[cfg(feature = "VideoConfiguration")] - #[doc = "Change the `video` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`, `VideoConfiguration`*"] + #[deprecated = "Use `set_video()` instead."] pub fn video(&mut self, val: &VideoConfiguration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_video(val); self } #[cfg(feature = "MediaEncodingType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaEncodingConfiguration`, `MediaEncodingType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: MediaEncodingType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaEncodingType.rs b/crates/web-sys/src/features/gen_MediaEncodingType.rs index e478627cb7d..84d8bba8c8f 100644 --- a/crates/web-sys/src/features/gen_MediaEncodingType.rs +++ b/crates/web-sys/src/features/gen_MediaEncodingType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaEncodingType` enum."] diff --git a/crates/web-sys/src/features/gen_MediaEncryptedEvent.rs b/crates/web-sys/src/features/gen_MediaEncryptedEvent.rs index 07eab6308ea..f353c147a00 100644 --- a/crates/web-sys/src/features/gen_MediaEncryptedEvent.rs +++ b/crates/web-sys/src/features/gen_MediaEncryptedEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaEncryptedEvent/initDataType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaEncryptedEvent`*"] - pub fn init_data_type(this: &MediaEncryptedEvent) -> String; + pub fn init_data_type(this: &MediaEncryptedEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , catch , method , getter , js_class = "MediaEncryptedEvent" , js_name = initData)] #[doc = "Getter for the `initData` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MediaError.rs b/crates/web-sys/src/features/gen_MediaError.rs index 538ed20da3b..20bf3982829 100644 --- a/crates/web-sys/src/features/gen_MediaError.rs +++ b/crates/web-sys/src/features/gen_MediaError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaError/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaError`*"] - pub fn message(this: &MediaError) -> String; + pub fn message(this: &MediaError) -> ::alloc::string::String; } impl MediaError { #[doc = "The `MediaError.MEDIA_ERR_ABORTED` const."] diff --git a/crates/web-sys/src/features/gen_MediaImage.rs b/crates/web-sys/src/features/gen_MediaImage.rs new file mode 100644 index 00000000000..524dd2ceb52 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaImage.rs @@ -0,0 +1,104 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaImage)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaImage` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaImage; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sizes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sizes")] + pub fn get_sizes(this: &MediaImage) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `sizes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sizes")] + pub fn set_sizes(this: &MediaImage, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `src` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "src")] + pub fn get_src(this: &MediaImage) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `src` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "src")] + pub fn set_src(this: &MediaImage, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &MediaImage) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &MediaImage, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl MediaImage { + #[doc = "Construct a new `MediaImage`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaImage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(src: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_src(src); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sizes()` instead."] + pub fn sizes(&mut self, val: &str) -> &mut Self { + self.set_sizes(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_src()` instead."] + pub fn src(&mut self, val: &str) -> &mut Self { + self.set_src(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: &str) -> &mut Self { + self.set_type(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_MediaKeyError.rs b/crates/web-sys/src/features/gen_MediaKeyError.rs index 3d9306c9f86..5ceee0e5f77 100644 --- a/crates/web-sys/src/features/gen_MediaKeyError.rs +++ b/crates/web-sys/src/features/gen_MediaKeyError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaKeyMessageEvent.rs b/crates/web-sys/src/features/gen_MediaKeyMessageEvent.rs index bfc16e9cd8f..ee33562001d 100644 --- a/crates/web-sys/src/features/gen_MediaKeyMessageEvent.rs +++ b/crates/web-sys/src/features/gen_MediaKeyMessageEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaKeyMessageEventInit.rs b/crates/web-sys/src/features/gen_MediaKeyMessageEventInit.rs index a741832a288..793bfe30038 100644 --- a/crates/web-sys/src/features/gen_MediaKeyMessageEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaKeyMessageEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] pub type MediaKeyMessageEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MediaKeyMessageEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MediaKeyMessageEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MediaKeyMessageEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MediaKeyMessageEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MediaKeyMessageEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MediaKeyMessageEventInit, val: bool); + #[doc = "Get the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[wasm_bindgen(method, getter = "message")] + pub fn get_message(this: &MediaKeyMessageEventInit) -> ::js_sys::ArrayBuffer; + #[doc = "Change the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[wasm_bindgen(method, setter = "message")] + pub fn set_message(this: &MediaKeyMessageEventInit, val: &::js_sys::ArrayBuffer); + #[cfg(feature = "MediaKeyMessageType")] + #[doc = "Get the `messageType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`, `MediaKeyMessageType`*"] + #[wasm_bindgen(method, getter = "messageType")] + pub fn get_message_type(this: &MediaKeyMessageEventInit) -> MediaKeyMessageType; + #[cfg(feature = "MediaKeyMessageType")] + #[doc = "Change the `messageType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`, `MediaKeyMessageType`*"] + #[wasm_bindgen(method, setter = "messageType")] + pub fn set_message_type(this: &MediaKeyMessageEventInit, val: MediaKeyMessageType); } impl MediaKeyMessageEventInit { #[cfg(feature = "MediaKeyMessageType")] @@ -18,94 +71,34 @@ impl MediaKeyMessageEventInit { pub fn new(message: &::js_sys::ArrayBuffer, message_type: MediaKeyMessageType) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.message(message); - ret.message_type(message_type); + ret.set_message(message); + ret.set_message_type(message_type); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `message` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`*"] + #[deprecated = "Use `set_message()` instead."] pub fn message(&mut self, val: &::js_sys::ArrayBuffer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_message(val); self } #[cfg(feature = "MediaKeyMessageType")] - #[doc = "Change the `messageType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyMessageEventInit`, `MediaKeyMessageType`*"] + #[deprecated = "Use `set_message_type()` instead."] pub fn message_type(&mut self, val: MediaKeyMessageType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("messageType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_message_type(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeyMessageType.rs b/crates/web-sys/src/features/gen_MediaKeyMessageType.rs index b101fb7ec2b..c4251b25a7a 100644 --- a/crates/web-sys/src/features/gen_MediaKeyMessageType.rs +++ b/crates/web-sys/src/features/gen_MediaKeyMessageType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaKeyMessageType` enum."] diff --git a/crates/web-sys/src/features/gen_MediaKeyNeededEventInit.rs b/crates/web-sys/src/features/gen_MediaKeyNeededEventInit.rs index 5dc1067f38e..cb666ee08ea 100644 --- a/crates/web-sys/src/features/gen_MediaKeyNeededEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaKeyNeededEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] pub type MediaKeyNeededEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MediaKeyNeededEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MediaKeyNeededEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MediaKeyNeededEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MediaKeyNeededEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MediaKeyNeededEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MediaKeyNeededEventInit, val: bool); + #[doc = "Get the `initData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, getter = "initData")] + pub fn get_init_data(this: &MediaKeyNeededEventInit) -> Option<::js_sys::ArrayBuffer>; + #[doc = "Change the `initData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, setter = "initData")] + pub fn set_init_data(this: &MediaKeyNeededEventInit, val: Option<&::js_sys::ArrayBuffer>); + #[doc = "Get the `initDataType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, getter = "initDataType")] + pub fn get_init_data_type(this: &MediaKeyNeededEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `initDataType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[wasm_bindgen(method, setter = "initDataType")] + pub fn set_init_data_type(this: &MediaKeyNeededEventInit, val: &str); } impl MediaKeyNeededEventInit { #[doc = "Construct a new `MediaKeyNeededEventInit`."] @@ -19,89 +70,29 @@ impl MediaKeyNeededEventInit { 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: `MediaKeyNeededEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `initData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[deprecated = "Use `set_init_data()` instead."] pub fn init_data(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_init_data(val); self } - #[doc = "Change the `initDataType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeyNeededEventInit`*"] + #[deprecated = "Use `set_init_data_type()` instead."] pub fn init_data_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initDataType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_init_data_type(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeySession.rs b/crates/web-sys/src/features/gen_MediaKeySession.rs index df29983ca6a..310943dc192 100644 --- a/crates/web-sys/src/features/gen_MediaKeySession.rs +++ b/crates/web-sys/src/features/gen_MediaKeySession.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/sessionId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"] - pub fn session_id(this: &MediaKeySession) -> String; + pub fn session_id(this: &MediaKeySession) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaKeySession" , js_name = expiration)] #[doc = "Getter for the `expiration` field of this object."] #[doc = ""] @@ -105,6 +106,17 @@ extern "C" { init_data_type: &str, init_data: &mut [u8], ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "MediaKeySession" , js_name = generateRequest)] + #[doc = "The `generateRequest()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/generateRequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"] + pub fn generate_request_with_js_u8_array( + this: &MediaKeySession, + init_data_type: &str, + init_data: &::js_sys::Uint8Array, + ) -> ::js_sys::Promise; # [wasm_bindgen (method , structural , js_class = "MediaKeySession" , js_name = load)] #[doc = "The `load()` method."] #[doc = ""] @@ -136,4 +148,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"] pub fn update_with_u8_array(this: &MediaKeySession, response: &mut [u8]) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "MediaKeySession" , js_name = update)] + #[doc = "The `update()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/update)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"] + pub fn update_with_js_u8_array( + this: &MediaKeySession, + response: &::js_sys::Uint8Array, + ) -> ::js_sys::Promise; } diff --git a/crates/web-sys/src/features/gen_MediaKeySessionType.rs b/crates/web-sys/src/features/gen_MediaKeySessionType.rs index c50b308c039..0f131bcccb9 100644 --- a/crates/web-sys/src/features/gen_MediaKeySessionType.rs +++ b/crates/web-sys/src/features/gen_MediaKeySessionType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaKeySessionType` enum."] diff --git a/crates/web-sys/src/features/gen_MediaKeyStatus.rs b/crates/web-sys/src/features/gen_MediaKeyStatus.rs index 7e24d37aba7..8016cdeb2ff 100644 --- a/crates/web-sys/src/features/gen_MediaKeyStatus.rs +++ b/crates/web-sys/src/features/gen_MediaKeyStatus.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaKeyStatus` enum."] diff --git a/crates/web-sys/src/features/gen_MediaKeyStatusMap.rs b/crates/web-sys/src/features/gen_MediaKeyStatusMap.rs index ee2b22c9d3b..630b356b373 100644 --- a/crates/web-sys/src/features/gen_MediaKeyStatusMap.rs +++ b/crates/web-sys/src/features/gen_MediaKeyStatusMap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -18,6 +19,21 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyStatusMap`*"] pub fn size(this: &MediaKeyStatusMap) -> u32; + # [wasm_bindgen (method , structural , js_class = "MediaKeyStatusMap" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeyStatusMap/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyStatusMap`*"] + pub fn entries(this: &MediaKeyStatusMap) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "MediaKeyStatusMap" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeyStatusMap/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyStatusMap`*"] + pub fn for_each(this: &MediaKeyStatusMap, callback: &::js_sys::Function) + -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "MediaKeyStatusMap" , js_name = get)] #[doc = "The `get()` method."] #[doc = ""] @@ -38,6 +54,16 @@ extern "C" { this: &MediaKeyStatusMap, key_id: &mut [u8], ) -> Result<::wasm_bindgen::JsValue, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "MediaKeyStatusMap" , js_name = get)] + #[doc = "The `get()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeyStatusMap/get)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyStatusMap`*"] + pub fn get_with_js_u8_array( + this: &MediaKeyStatusMap, + key_id: &::js_sys::Uint8Array, + ) -> Result<::wasm_bindgen::JsValue, JsValue>; # [wasm_bindgen (method , structural , js_class = "MediaKeyStatusMap" , js_name = has)] #[doc = "The `has()` method."] #[doc = ""] @@ -52,4 +78,25 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeyStatusMap`*"] pub fn has_with_u8_array(this: &MediaKeyStatusMap, key_id: &mut [u8]) -> bool; + # [wasm_bindgen (method , structural , js_class = "MediaKeyStatusMap" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeyStatusMap/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyStatusMap`*"] + pub fn has_with_js_u8_array(this: &MediaKeyStatusMap, key_id: &::js_sys::Uint8Array) -> bool; + # [wasm_bindgen (method , structural , js_class = "MediaKeyStatusMap" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeyStatusMap/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyStatusMap`*"] + pub fn keys(this: &MediaKeyStatusMap) -> ::js_sys::Iterator; + # [wasm_bindgen (method , structural , js_class = "MediaKeyStatusMap" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeyStatusMap/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeyStatusMap`*"] + pub fn values(this: &MediaKeyStatusMap) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_MediaKeySystemAccess.rs b/crates/web-sys/src/features/gen_MediaKeySystemAccess.rs index 544a59a8701..d5f7d0b1017 100644 --- a/crates/web-sys/src/features/gen_MediaKeySystemAccess.rs +++ b/crates/web-sys/src/features/gen_MediaKeySystemAccess.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySystemAccess/keySystem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemAccess`*"] - pub fn key_system(this: &MediaKeySystemAccess) -> String; + pub fn key_system(this: &MediaKeySystemAccess) -> ::alloc::string::String; # [wasm_bindgen (method , structural , js_class = "MediaKeySystemAccess" , js_name = createMediaKeys)] #[doc = "The `createMediaKeys()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MediaKeySystemConfiguration.rs b/crates/web-sys/src/features/gen_MediaKeySystemConfiguration.rs index c565cf98ffb..ef8f2e3c915 100644 --- a/crates/web-sys/src/features/gen_MediaKeySystemConfiguration.rs +++ b/crates/web-sys/src/features/gen_MediaKeySystemConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,92 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] pub type MediaKeySystemConfiguration; + #[doc = "Get the `audioCapabilities` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, getter = "audioCapabilities")] + pub fn get_audio_capabilities(this: &MediaKeySystemConfiguration) -> Option<::js_sys::Array>; + #[doc = "Change the `audioCapabilities` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, setter = "audioCapabilities")] + pub fn set_audio_capabilities( + this: &MediaKeySystemConfiguration, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "MediaKeysRequirement")] + #[doc = "Get the `distinctiveIdentifier` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"] + #[wasm_bindgen(method, getter = "distinctiveIdentifier")] + pub fn get_distinctive_identifier( + this: &MediaKeySystemConfiguration, + ) -> Option; + #[cfg(feature = "MediaKeysRequirement")] + #[doc = "Change the `distinctiveIdentifier` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"] + #[wasm_bindgen(method, setter = "distinctiveIdentifier")] + pub fn set_distinctive_identifier( + this: &MediaKeySystemConfiguration, + val: MediaKeysRequirement, + ); + #[doc = "Get the `initDataTypes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, getter = "initDataTypes")] + pub fn get_init_data_types(this: &MediaKeySystemConfiguration) -> Option<::js_sys::Array>; + #[doc = "Change the `initDataTypes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, setter = "initDataTypes")] + pub fn set_init_data_types(this: &MediaKeySystemConfiguration, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &MediaKeySystemConfiguration) -> Option<::alloc::string::String>; + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &MediaKeySystemConfiguration, val: &str); + #[cfg(feature = "MediaKeysRequirement")] + #[doc = "Get the `persistentState` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"] + #[wasm_bindgen(method, getter = "persistentState")] + pub fn get_persistent_state(this: &MediaKeySystemConfiguration) + -> Option; + #[cfg(feature = "MediaKeysRequirement")] + #[doc = "Change the `persistentState` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"] + #[wasm_bindgen(method, setter = "persistentState")] + pub fn set_persistent_state(this: &MediaKeySystemConfiguration, val: MediaKeysRequirement); + #[doc = "Get the `sessionTypes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, getter = "sessionTypes")] + pub fn get_session_types(this: &MediaKeySystemConfiguration) -> Option<::js_sys::Array>; + #[doc = "Change the `sessionTypes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, setter = "sessionTypes")] + pub fn set_session_types(this: &MediaKeySystemConfiguration, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `videoCapabilities` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, getter = "videoCapabilities")] + pub fn get_video_capabilities(this: &MediaKeySystemConfiguration) -> Option<::js_sys::Array>; + #[doc = "Change the `videoCapabilities` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[wasm_bindgen(method, setter = "videoCapabilities")] + pub fn set_video_capabilities( + this: &MediaKeySystemConfiguration, + val: &::wasm_bindgen::JsValue, + ); } impl MediaKeySystemConfiguration { #[doc = "Construct a new `MediaKeySystemConfiguration`."] @@ -19,121 +106,41 @@ impl MediaKeySystemConfiguration { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `audioCapabilities` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[deprecated = "Use `set_audio_capabilities()` instead."] pub fn audio_capabilities(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioCapabilities"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio_capabilities(val); self } #[cfg(feature = "MediaKeysRequirement")] - #[doc = "Change the `distinctiveIdentifier` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"] + #[deprecated = "Use `set_distinctive_identifier()` instead."] pub fn distinctive_identifier(&mut self, val: MediaKeysRequirement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("distinctiveIdentifier"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_distinctive_identifier(val); self } - #[doc = "Change the `initDataTypes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[deprecated = "Use `set_init_data_types()` instead."] pub fn init_data_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initDataTypes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_init_data_types(val); self } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } #[cfg(feature = "MediaKeysRequirement")] - #[doc = "Change the `persistentState` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`, `MediaKeysRequirement`*"] + #[deprecated = "Use `set_persistent_state()` instead."] pub fn persistent_state(&mut self, val: MediaKeysRequirement) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("persistentState"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_persistent_state(val); self } - #[doc = "Change the `sessionTypes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[deprecated = "Use `set_session_types()` instead."] pub fn session_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sessionTypes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_session_types(val); self } - #[doc = "Change the `videoCapabilities` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemConfiguration`*"] + #[deprecated = "Use `set_video_capabilities()` instead."] pub fn video_capabilities(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("videoCapabilities"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_video_capabilities(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeySystemMediaCapability.rs b/crates/web-sys/src/features/gen_MediaKeySystemMediaCapability.rs index b3def21e2cb..ebdb9451d47 100644 --- a/crates/web-sys/src/features/gen_MediaKeySystemMediaCapability.rs +++ b/crates/web-sys/src/features/gen_MediaKeySystemMediaCapability.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] pub type MediaKeySystemMediaCapability; + #[doc = "Get the `contentType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] + #[wasm_bindgen(method, getter = "contentType")] + pub fn get_content_type( + this: &MediaKeySystemMediaCapability, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `contentType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] + #[wasm_bindgen(method, setter = "contentType")] + pub fn set_content_type(this: &MediaKeySystemMediaCapability, val: &str); + #[doc = "Get the `robustness` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] + #[wasm_bindgen(method, getter = "robustness")] + pub fn get_robustness(this: &MediaKeySystemMediaCapability) -> Option<::alloc::string::String>; + #[doc = "Change the `robustness` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] + #[wasm_bindgen(method, setter = "robustness")] + pub fn set_robustness(this: &MediaKeySystemMediaCapability, val: &str); } impl MediaKeySystemMediaCapability { #[doc = "Construct a new `MediaKeySystemMediaCapability`."] @@ -19,38 +42,14 @@ impl MediaKeySystemMediaCapability { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `contentType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] + #[deprecated = "Use `set_content_type()` instead."] 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.set_content_type(val); self } - #[doc = "Change the `robustness` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemMediaCapability`*"] + #[deprecated = "Use `set_robustness()` instead."] pub fn robustness(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("robustness"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_robustness(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeySystemStatus.rs b/crates/web-sys/src/features/gen_MediaKeySystemStatus.rs index eaf627da510..fee902ec516 100644 --- a/crates/web-sys/src/features/gen_MediaKeySystemStatus.rs +++ b/crates/web-sys/src/features/gen_MediaKeySystemStatus.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaKeySystemStatus` enum."] diff --git a/crates/web-sys/src/features/gen_MediaKeys.rs b/crates/web-sys/src/features/gen_MediaKeys.rs index ecf90c11eb2..c9df498a7d5 100644 --- a/crates/web-sys/src/features/gen_MediaKeys.rs +++ b/crates/web-sys/src/features/gen_MediaKeys.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/keySystem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeys`*"] - pub fn key_system(this: &MediaKeys) -> String; + pub fn key_system(this: &MediaKeys) -> ::alloc::string::String; #[cfg(feature = "MediaKeySession")] # [wasm_bindgen (catch , method , structural , js_class = "MediaKeys" , js_name = createSession)] #[doc = "The `createSession()` method."] @@ -75,4 +76,14 @@ extern "C" { this: &MediaKeys, server_certificate: &mut [u8], ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "MediaKeys" , js_name = setServerCertificate)] + #[doc = "The `setServerCertificate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/setServerCertificate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeys`*"] + pub fn set_server_certificate_with_js_u8_array( + this: &MediaKeys, + server_certificate: &::js_sys::Uint8Array, + ) -> ::js_sys::Promise; } diff --git a/crates/web-sys/src/features/gen_MediaKeysPolicy.rs b/crates/web-sys/src/features/gen_MediaKeysPolicy.rs index df5fefbe954..99c26cb234b 100644 --- a/crates/web-sys/src/features/gen_MediaKeysPolicy.rs +++ b/crates/web-sys/src/features/gen_MediaKeysPolicy.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaKeysPolicy`*"] pub type MediaKeysPolicy; + #[doc = "Get the `minHdcpVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeysPolicy`*"] + #[wasm_bindgen(method, getter = "minHdcpVersion")] + pub fn get_min_hdcp_version(this: &MediaKeysPolicy) -> Option<::alloc::string::String>; + #[doc = "Change the `minHdcpVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeysPolicy`*"] + #[wasm_bindgen(method, setter = "minHdcpVersion")] + pub fn set_min_hdcp_version(this: &MediaKeysPolicy, val: &str); } impl MediaKeysPolicy { #[doc = "Construct a new `MediaKeysPolicy`."] @@ -19,21 +30,9 @@ impl MediaKeysPolicy { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `minHdcpVersion` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeysPolicy`*"] + #[deprecated = "Use `set_min_hdcp_version()` instead."] pub fn min_hdcp_version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("minHdcpVersion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_min_hdcp_version(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaKeysRequirement.rs b/crates/web-sys/src/features/gen_MediaKeysRequirement.rs index 8703cbe660c..e1f3bb08cec 100644 --- a/crates/web-sys/src/features/gen_MediaKeysRequirement.rs +++ b/crates/web-sys/src/features/gen_MediaKeysRequirement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaKeysRequirement` enum."] diff --git a/crates/web-sys/src/features/gen_MediaList.rs b/crates/web-sys/src/features/gen_MediaList.rs index 89b8f383fed..4416d737d62 100644 --- a/crates/web-sys/src/features/gen_MediaList.rs +++ b/crates/web-sys/src/features/gen_MediaList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaList/mediaText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaList`*"] - pub fn media_text(this: &MediaList) -> String; + pub fn media_text(this: &MediaList) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "MediaList" , js_name = mediaText)] #[doc = "Setter for the `mediaText` field of this object."] #[doc = ""] @@ -52,12 +53,12 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaList/item)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaList`*"] - pub fn item(this: &MediaList, index: u32) -> Option; + pub fn item(this: &MediaList, index: u32) -> Option<::alloc::string::String>; #[wasm_bindgen(method, structural, js_class = "MediaList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaList`*"] - pub fn get(this: &MediaList, index: u32) -> Option; + pub fn get(this: &MediaList, index: u32) -> Option<::alloc::string::String>; } diff --git a/crates/web-sys/src/features/gen_MediaMetadata.rs b/crates/web-sys/src/features/gen_MediaMetadata.rs new file mode 100644 index 00000000000..3825e029d87 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaMetadata.rs @@ -0,0 +1,130 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaMetadata , typescript_type = "MediaMetadata")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaMetadata` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaMetadata; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "MediaMetadata" , js_name = title)] + #[doc = "Getter for the `title` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/title)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn title(this: &MediaMetadata) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "MediaMetadata" , js_name = title)] + #[doc = "Setter for the `title` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/title)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_title(this: &MediaMetadata, value: &str); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "MediaMetadata" , js_name = artist)] + #[doc = "Getter for the `artist` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/artist)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn artist(this: &MediaMetadata) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "MediaMetadata" , js_name = artist)] + #[doc = "Setter for the `artist` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/artist)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_artist(this: &MediaMetadata, value: &str); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "MediaMetadata" , js_name = album)] + #[doc = "Getter for the `album` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/album)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn album(this: &MediaMetadata) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "MediaMetadata" , js_name = album)] + #[doc = "Setter for the `album` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/album)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_album(this: &MediaMetadata, value: &str); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "MediaMetadata" , js_name = artwork)] + #[doc = "Getter for the `artwork` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/artwork)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn artwork(this: &MediaMetadata) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "MediaMetadata" , js_name = artwork)] + #[doc = "Setter for the `artwork` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/artwork)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_artwork(this: &MediaMetadata, value: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "MediaMetadata")] + #[doc = "The `new MediaMetadata(..)` constructor, creating a new instance of `MediaMetadata`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/MediaMetadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaMetadataInit")] + #[wasm_bindgen(catch, constructor, js_class = "MediaMetadata")] + #[doc = "The `new MediaMetadata(..)` constructor, creating a new instance of `MediaMetadata`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata/MediaMetadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`, `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_init(init: &MediaMetadataInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_MediaMetadataInit.rs b/crates/web-sys/src/features/gen_MediaMetadataInit.rs new file mode 100644 index 00000000000..45f5cf4fcb9 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaMetadataInit.rs @@ -0,0 +1,133 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaMetadataInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaMetadataInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaMetadataInit; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `album` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "album")] + pub fn get_album(this: &MediaMetadataInit) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `album` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "album")] + pub fn set_album(this: &MediaMetadataInit, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `artist` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "artist")] + pub fn get_artist(this: &MediaMetadataInit) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `artist` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "artist")] + pub fn set_artist(this: &MediaMetadataInit, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `artwork` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "artwork")] + pub fn get_artwork(this: &MediaMetadataInit) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `artwork` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "artwork")] + pub fn set_artwork(this: &MediaMetadataInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `title` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "title")] + pub fn get_title(this: &MediaMetadataInit) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `title` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "title")] + pub fn set_title(this: &MediaMetadataInit, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl MediaMetadataInit { + #[doc = "Construct a new `MediaMetadataInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadataInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_album()` instead."] + pub fn album(&mut self, val: &str) -> &mut Self { + self.set_album(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_artist()` instead."] + pub fn artist(&mut self, val: &str) -> &mut Self { + self.set_artist(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_artwork()` instead."] + pub fn artwork(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_artwork(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_title()` instead."] + pub fn title(&mut self, val: &str) -> &mut Self { + self.set_title(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for MediaMetadataInit { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_MediaPositionState.rs b/crates/web-sys/src/features/gen_MediaPositionState.rs new file mode 100644 index 00000000000..b381f380ad4 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaPositionState.rs @@ -0,0 +1,109 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaPositionState)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaPositionState` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaPositionState; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &MediaPositionState) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &MediaPositionState, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `playbackRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "playbackRate")] + pub fn get_playback_rate(this: &MediaPositionState) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `playbackRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "playbackRate")] + pub fn set_playback_rate(this: &MediaPositionState, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `position` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "position")] + pub fn get_position(this: &MediaPositionState) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `position` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "position")] + pub fn set_position(this: &MediaPositionState, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl MediaPositionState { + #[doc = "Construct a new `MediaPositionState`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_duration()` instead."] + pub fn duration(&mut self, val: f64) -> &mut Self { + self.set_duration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_playback_rate()` instead."] + pub fn playback_rate(&mut self, val: f64) -> &mut Self { + self.set_playback_rate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_position()` instead."] + pub fn position(&mut self, val: f64) -> &mut Self { + self.set_position(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for MediaPositionState { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_MediaQueryList.rs b/crates/web-sys/src/features/gen_MediaQueryList.rs index 24faf3a316d..938c30aba8f 100644 --- a/crates/web-sys/src/features/gen_MediaQueryList.rs +++ b/crates/web-sys/src/features/gen_MediaQueryList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/media)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryList`*"] - pub fn media(this: &MediaQueryList) -> String; + pub fn media(this: &MediaQueryList) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaQueryList" , js_name = matches)] #[doc = "Getter for the `matches` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MediaQueryListEvent.rs b/crates/web-sys/src/features/gen_MediaQueryListEvent.rs index ceca733f1fc..80f51a83391 100644 --- a/crates/web-sys/src/features/gen_MediaQueryListEvent.rs +++ b/crates/web-sys/src/features/gen_MediaQueryListEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListEvent/media)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEvent`*"] - pub fn media(this: &MediaQueryListEvent) -> String; + pub fn media(this: &MediaQueryListEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaQueryListEvent" , js_name = matches)] #[doc = "Getter for the `matches` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MediaQueryListEventInit.rs b/crates/web-sys/src/features/gen_MediaQueryListEventInit.rs index 5546b6ed5a7..bd8d9554b3c 100644 --- a/crates/web-sys/src/features/gen_MediaQueryListEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaQueryListEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] pub type MediaQueryListEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MediaQueryListEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MediaQueryListEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MediaQueryListEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MediaQueryListEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MediaQueryListEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MediaQueryListEventInit, val: bool); + #[doc = "Get the `matches` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, getter = "matches")] + pub fn get_matches(this: &MediaQueryListEventInit) -> Option; + #[doc = "Change the `matches` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, setter = "matches")] + pub fn set_matches(this: &MediaQueryListEventInit, val: bool); + #[doc = "Get the `media` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, getter = "media")] + pub fn get_media(this: &MediaQueryListEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `media` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[wasm_bindgen(method, setter = "media")] + pub fn set_media(this: &MediaQueryListEventInit, val: &str); } impl MediaQueryListEventInit { #[doc = "Construct a new `MediaQueryListEventInit`."] @@ -19,85 +70,29 @@ impl MediaQueryListEventInit { 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: `MediaQueryListEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `matches` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[deprecated = "Use `set_matches()` instead."] pub fn matches(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("matches"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_matches(val); self } - #[doc = "Change the `media` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaQueryListEventInit`*"] + #[deprecated = "Use `set_media()` instead."] pub fn media(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("media"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaRecorder.rs b/crates/web-sys/src/features/gen_MediaRecorder.rs index 1153152da4b..7cb779d4c65 100644 --- a/crates/web-sys/src/features/gen_MediaRecorder.rs +++ b/crates/web-sys/src/features/gen_MediaRecorder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -33,7 +34,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/mimeType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] - pub fn mime_type(this: &MediaRecorder) -> String; + pub fn mime_type(this: &MediaRecorder) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaRecorder" , js_name = ondataavailable)] #[doc = "Getter for the `ondataavailable` field of this object."] #[doc = ""] @@ -157,7 +158,7 @@ extern "C" { # [wasm_bindgen (static_method_of = MediaRecorder , js_class = "MediaRecorder" , js_name = isTypeSupported)] #[doc = "The `isTypeSupported()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorder`*"] pub fn is_type_supported(type_: &str) -> bool; diff --git a/crates/web-sys/src/features/gen_MediaRecorderErrorEvent.rs b/crates/web-sys/src/features/gen_MediaRecorderErrorEvent.rs index 5a00bb630d2..c4bd916edda 100644 --- a/crates/web-sys/src/features/gen_MediaRecorderErrorEvent.rs +++ b/crates/web-sys/src/features/gen_MediaRecorderErrorEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaRecorderErrorEventInit.rs b/crates/web-sys/src/features/gen_MediaRecorderErrorEventInit.rs index 834785822cd..1e73b9846a7 100644 --- a/crates/web-sys/src/features/gen_MediaRecorderErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaRecorderErrorEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] pub type MediaRecorderErrorEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MediaRecorderErrorEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MediaRecorderErrorEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MediaRecorderErrorEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MediaRecorderErrorEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MediaRecorderErrorEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MediaRecorderErrorEventInit, val: bool); + #[cfg(feature = "DomException")] + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomException`, `MediaRecorderErrorEventInit`*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &MediaRecorderErrorEventInit) -> DomException; + #[cfg(feature = "DomException")] + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomException`, `MediaRecorderErrorEventInit`*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &MediaRecorderErrorEventInit, val: &DomException); } impl MediaRecorderErrorEventInit { #[cfg(feature = "DomException")] @@ -18,72 +61,28 @@ impl MediaRecorderErrorEventInit { pub fn new(error: &DomException) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.error(error); + ret.set_error(error); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaRecorderErrorEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "DomException")] - #[doc = "Change the `error` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomException`, `MediaRecorderErrorEventInit`*"] + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: &DomException) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaRecorderOptions.rs b/crates/web-sys/src/features/gen_MediaRecorderOptions.rs index 756be77b751..7346fa75627 100644 --- a/crates/web-sys/src/features/gen_MediaRecorderOptions.rs +++ b/crates/web-sys/src/features/gen_MediaRecorderOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] pub type MediaRecorderOptions; + #[doc = "Get the `audioBitsPerSecond` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, getter = "audioBitsPerSecond")] + pub fn get_audio_bits_per_second(this: &MediaRecorderOptions) -> Option; + #[doc = "Change the `audioBitsPerSecond` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, setter = "audioBitsPerSecond")] + pub fn set_audio_bits_per_second(this: &MediaRecorderOptions, val: u32); + #[doc = "Get the `bitsPerSecond` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, getter = "bitsPerSecond")] + pub fn get_bits_per_second(this: &MediaRecorderOptions) -> Option; + #[doc = "Change the `bitsPerSecond` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, setter = "bitsPerSecond")] + pub fn set_bits_per_second(this: &MediaRecorderOptions, val: u32); + #[doc = "Get the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, getter = "mimeType")] + pub fn get_mime_type(this: &MediaRecorderOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, setter = "mimeType")] + pub fn set_mime_type(this: &MediaRecorderOptions, val: &str); + #[doc = "Get the `videoBitsPerSecond` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, getter = "videoBitsPerSecond")] + pub fn get_video_bits_per_second(this: &MediaRecorderOptions) -> Option; + #[doc = "Change the `videoBitsPerSecond` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[wasm_bindgen(method, setter = "videoBitsPerSecond")] + pub fn set_video_bits_per_second(this: &MediaRecorderOptions, val: u32); } impl MediaRecorderOptions { #[doc = "Construct a new `MediaRecorderOptions`."] @@ -19,72 +60,24 @@ impl MediaRecorderOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `audioBitsPerSecond` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[deprecated = "Use `set_audio_bits_per_second()` instead."] pub fn audio_bits_per_second(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioBitsPerSecond"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio_bits_per_second(val); self } - #[doc = "Change the `bitsPerSecond` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[deprecated = "Use `set_bits_per_second()` instead."] pub fn bits_per_second(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitsPerSecond"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bits_per_second(val); self } - #[doc = "Change the `mimeType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[deprecated = "Use `set_mime_type()` instead."] pub fn mime_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mimeType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mime_type(val); self } - #[doc = "Change the `videoBitsPerSecond` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"] + #[deprecated = "Use `set_video_bits_per_second()` instead."] pub fn video_bits_per_second(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("videoBitsPerSecond"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_video_bits_per_second(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaSession.rs b/crates/web-sys/src/features/gen_MediaSession.rs new file mode 100644 index 00000000000..54f0f3ff1c6 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaSession.rs @@ -0,0 +1,128 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaSession , typescript_type = "MediaSession")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaSession` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaSession; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaMetadata")] + # [wasm_bindgen (structural , method , getter , js_class = "MediaSession" , js_name = metadata)] + #[doc = "Getter for the `metadata` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/metadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`, `MediaSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn metadata(this: &MediaSession) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaMetadata")] + # [wasm_bindgen (structural , method , setter , js_class = "MediaSession" , js_name = metadata)] + #[doc = "Setter for the `metadata` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/metadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaMetadata`, `MediaSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_metadata(this: &MediaSession, value: Option<&MediaMetadata>); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaSessionPlaybackState")] + # [wasm_bindgen (structural , method , getter , js_class = "MediaSession" , js_name = playbackState)] + #[doc = "Getter for the `playbackState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSession`, `MediaSessionPlaybackState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn playback_state(this: &MediaSession) -> MediaSessionPlaybackState; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaSessionPlaybackState")] + # [wasm_bindgen (structural , method , setter , js_class = "MediaSession" , js_name = playbackState)] + #[doc = "Setter for the `playbackState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSession`, `MediaSessionPlaybackState`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_playback_state(this: &MediaSession, value: MediaSessionPlaybackState); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaSessionAction")] + # [wasm_bindgen (method , structural , js_class = "MediaSession" , js_name = setActionHandler)] + #[doc = "The `setActionHandler()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setActionHandler)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSession`, `MediaSessionAction`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_action_handler( + this: &MediaSession, + action: MediaSessionAction, + handler: Option<&::js_sys::Function>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "MediaSession" , js_name = setCameraActive)] + #[doc = "The `setCameraActive()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setCameraActive)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_camera_active(this: &MediaSession, active: bool); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "MediaSession" , js_name = setMicrophoneActive)] + #[doc = "The `setMicrophoneActive()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setMicrophoneActive)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_microphone_active(this: &MediaSession, active: bool); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "MediaSession" , js_name = setPositionState)] + #[doc = "The `setPositionState()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setPositionState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_position_state(this: &MediaSession); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaPositionState")] + # [wasm_bindgen (method , structural , js_class = "MediaSession" , js_name = setPositionState)] + #[doc = "The `setPositionState()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/setPositionState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaPositionState`, `MediaSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_position_state_with_state(this: &MediaSession, state: &MediaPositionState); +} diff --git a/crates/web-sys/src/features/gen_MediaSessionAction.rs b/crates/web-sys/src/features/gen_MediaSessionAction.rs new file mode 100644 index 00000000000..20f74a59aa7 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaSessionAction.rs @@ -0,0 +1,26 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `MediaSessionAction` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `MediaSessionAction`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum MediaSessionAction { + Play = "play", + Pause = "pause", + Seekbackward = "seekbackward", + Seekforward = "seekforward", + Previoustrack = "previoustrack", + Nexttrack = "nexttrack", + Skipad = "skipad", + Stop = "stop", + Seekto = "seekto", + Togglemicrophone = "togglemicrophone", + Togglecamera = "togglecamera", + Hangup = "hangup", +} diff --git a/crates/web-sys/src/features/gen_MediaSessionActionDetails.rs b/crates/web-sys/src/features/gen_MediaSessionActionDetails.rs new file mode 100644 index 00000000000..679e574a7e2 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaSessionActionDetails.rs @@ -0,0 +1,132 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaSessionActionDetails)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaSessionActionDetails` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaSessionActionDetails; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaSessionAction")] + #[doc = "Get the `action` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionAction`, `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "action")] + pub fn get_action(this: &MediaSessionActionDetails) -> MediaSessionAction; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaSessionAction")] + #[doc = "Change the `action` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionAction`, `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "action")] + pub fn set_action(this: &MediaSessionActionDetails, val: MediaSessionAction); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `fastSeek` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "fastSeek")] + pub fn get_fast_seek(this: &MediaSessionActionDetails) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `fastSeek` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "fastSeek")] + pub fn set_fast_seek(this: &MediaSessionActionDetails, val: Option); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `seekOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "seekOffset")] + pub fn get_seek_offset(this: &MediaSessionActionDetails) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `seekOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "seekOffset")] + pub fn set_seek_offset(this: &MediaSessionActionDetails, val: Option); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `seekTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "seekTime")] + pub fn get_seek_time(this: &MediaSessionActionDetails) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `seekTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "seekTime")] + pub fn set_seek_time(this: &MediaSessionActionDetails, val: Option); +} +#[cfg(web_sys_unstable_apis)] +impl MediaSessionActionDetails { + #[cfg(feature = "MediaSessionAction")] + #[doc = "Construct a new `MediaSessionActionDetails`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaSessionAction`, `MediaSessionActionDetails`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(action: MediaSessionAction) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_action(action); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaSessionAction")] + #[deprecated = "Use `set_action()` instead."] + pub fn action(&mut self, val: MediaSessionAction) -> &mut Self { + self.set_action(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_fast_seek()` instead."] + pub fn fast_seek(&mut self, val: Option) -> &mut Self { + self.set_fast_seek(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_seek_offset()` instead."] + pub fn seek_offset(&mut self, val: Option) -> &mut Self { + self.set_seek_offset(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_seek_time()` instead."] + pub fn seek_time(&mut self, val: Option) -> &mut Self { + self.set_seek_time(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_MediaSessionPlaybackState.rs b/crates/web-sys/src/features/gen_MediaSessionPlaybackState.rs new file mode 100644 index 00000000000..a1e12dc79a3 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaSessionPlaybackState.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `MediaSessionPlaybackState` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `MediaSessionPlaybackState`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum MediaSessionPlaybackState { + None = "none", + Paused = "paused", + Playing = "playing", +} diff --git a/crates/web-sys/src/features/gen_MediaSource.rs b/crates/web-sys/src/features/gen_MediaSource.rs index 1edd2c3c580..a243a7fb2f8 100644 --- a/crates/web-sys/src/features/gen_MediaSource.rs +++ b/crates/web-sys/src/features/gen_MediaSource.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -134,7 +135,7 @@ extern "C" { # [wasm_bindgen (static_method_of = MediaSource , js_class = "MediaSource" , js_name = isTypeSupported)] #[doc = "The `isTypeSupported()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/isTypeSupported)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/isTypeSupported_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"] pub fn is_type_supported(type_: &str) -> bool; diff --git a/crates/web-sys/src/features/gen_MediaSourceEndOfStreamError.rs b/crates/web-sys/src/features/gen_MediaSourceEndOfStreamError.rs index 76edf0e6d45..ca6827210fe 100644 --- a/crates/web-sys/src/features/gen_MediaSourceEndOfStreamError.rs +++ b/crates/web-sys/src/features/gen_MediaSourceEndOfStreamError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaSourceEndOfStreamError` enum."] diff --git a/crates/web-sys/src/features/gen_MediaSourceEnum.rs b/crates/web-sys/src/features/gen_MediaSourceEnum.rs index a3d8326ee38..b10fe7e1b4a 100644 --- a/crates/web-sys/src/features/gen_MediaSourceEnum.rs +++ b/crates/web-sys/src/features/gen_MediaSourceEnum.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaSourceEnum` enum."] diff --git a/crates/web-sys/src/features/gen_MediaSourceReadyState.rs b/crates/web-sys/src/features/gen_MediaSourceReadyState.rs index b0033cbc58e..1b8e06a0965 100644 --- a/crates/web-sys/src/features/gen_MediaSourceReadyState.rs +++ b/crates/web-sys/src/features/gen_MediaSourceReadyState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaSourceReadyState` enum."] diff --git a/crates/web-sys/src/features/gen_MediaStream.rs b/crates/web-sys/src/features/gen_MediaStream.rs index 75d5f21a926..788c2bf7f4e 100644 --- a/crates/web-sys/src/features/gen_MediaStream.rs +++ b/crates/web-sys/src/features/gen_MediaStream.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"] - pub fn id(this: &MediaStream) -> String; + pub fn id(this: &MediaStream) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaStream" , js_name = active)] #[doc = "Getter for the `active` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MediaStreamAudioDestinationNode.rs b/crates/web-sys/src/features/gen_MediaStreamAudioDestinationNode.rs index 84464845985..5c32916b0bd 100644 --- a/crates/web-sys/src/features/gen_MediaStreamAudioDestinationNode.rs +++ b/crates/web-sys/src/features/gen_MediaStreamAudioDestinationNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaStreamAudioSourceNode.rs b/crates/web-sys/src/features/gen_MediaStreamAudioSourceNode.rs index 0c206a44cfc..b7f56c617c4 100644 --- a/crates/web-sys/src/features/gen_MediaStreamAudioSourceNode.rs +++ b/crates/web-sys/src/features/gen_MediaStreamAudioSourceNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaStreamAudioSourceOptions.rs b/crates/web-sys/src/features/gen_MediaStreamAudioSourceOptions.rs index 8f72c319a85..f7d58375fa3 100644 --- a/crates/web-sys/src/features/gen_MediaStreamAudioSourceOptions.rs +++ b/crates/web-sys/src/features/gen_MediaStreamAudioSourceOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamAudioSourceOptions`*"] pub type MediaStreamAudioSourceOptions; + #[cfg(feature = "MediaStream")] + #[doc = "Get the `mediaStream` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamAudioSourceOptions`*"] + #[wasm_bindgen(method, getter = "mediaStream")] + pub fn get_media_stream(this: &MediaStreamAudioSourceOptions) -> MediaStream; + #[cfg(feature = "MediaStream")] + #[doc = "Change the `mediaStream` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamAudioSourceOptions`*"] + #[wasm_bindgen(method, setter = "mediaStream")] + pub fn set_media_stream(this: &MediaStreamAudioSourceOptions, val: &MediaStream); } impl MediaStreamAudioSourceOptions { #[cfg(feature = "MediaStream")] @@ -18,25 +31,13 @@ impl MediaStreamAudioSourceOptions { pub fn new(media_stream: &MediaStream) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.media_stream(media_stream); + ret.set_media_stream(media_stream); ret } #[cfg(feature = "MediaStream")] - #[doc = "Change the `mediaStream` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamAudioSourceOptions`*"] + #[deprecated = "Use `set_media_stream()` instead."] pub fn media_stream(&mut self, val: &MediaStream) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaStream"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_stream(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamConstraints.rs b/crates/web-sys/src/features/gen_MediaStreamConstraints.rs index 9950c1844f1..509442d58cb 100644 --- a/crates/web-sys/src/features/gen_MediaStreamConstraints.rs +++ b/crates/web-sys/src/features/gen_MediaStreamConstraints.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] pub type MediaStreamConstraints; + #[doc = "Get the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, getter = "audio")] + pub fn get_audio(this: &MediaStreamConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `audio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, setter = "audio")] + pub fn set_audio(this: &MediaStreamConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `fake` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, getter = "fake")] + pub fn get_fake(this: &MediaStreamConstraints) -> Option; + #[doc = "Change the `fake` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, setter = "fake")] + pub fn set_fake(this: &MediaStreamConstraints, val: bool); + #[doc = "Get the `peerIdentity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, getter = "peerIdentity")] + pub fn get_peer_identity(this: &MediaStreamConstraints) -> Option<::alloc::string::String>; + #[doc = "Change the `peerIdentity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, setter = "peerIdentity")] + pub fn set_peer_identity(this: &MediaStreamConstraints, val: Option<&str>); + #[doc = "Get the `picture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, getter = "picture")] + pub fn get_picture(this: &MediaStreamConstraints) -> Option; + #[doc = "Change the `picture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, setter = "picture")] + pub fn set_picture(this: &MediaStreamConstraints, val: bool); + #[doc = "Get the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, getter = "video")] + pub fn get_video(this: &MediaStreamConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `video` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[wasm_bindgen(method, setter = "video")] + pub fn set_video(this: &MediaStreamConstraints, val: &::wasm_bindgen::JsValue); } impl MediaStreamConstraints { #[doc = "Construct a new `MediaStreamConstraints`."] @@ -19,77 +70,29 @@ impl MediaStreamConstraints { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `audio` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[deprecated = "Use `set_audio()` instead."] pub fn audio(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("audio"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio(val); self } - #[doc = "Change the `fake` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[deprecated = "Use `set_fake()` instead."] pub fn fake(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fake"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fake(val); self } - #[doc = "Change the `peerIdentity` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[deprecated = "Use `set_peer_identity()` instead."] pub fn peer_identity(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("peerIdentity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_peer_identity(val); self } - #[doc = "Change the `picture` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[deprecated = "Use `set_picture()` instead."] pub fn picture(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("picture"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_picture(val); self } - #[doc = "Change the `video` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamConstraints`*"] + #[deprecated = "Use `set_video()` instead."] pub fn video(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("video"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_video(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamError.rs b/crates/web-sys/src/features/gen_MediaStreamError.rs index b18996d425b..971f801b6b0 100644 --- a/crates/web-sys/src/features/gen_MediaStreamError.rs +++ b/crates/web-sys/src/features/gen_MediaStreamError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,19 +18,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamError/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamError`*"] - pub fn name(this: &MediaStreamError) -> String; + pub fn name(this: &MediaStreamError) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaStreamError" , js_name = message)] #[doc = "Getter for the `message` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamError/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamError`*"] - pub fn message(this: &MediaStreamError) -> Option; + pub fn message(this: &MediaStreamError) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "MediaStreamError" , js_name = constraint)] #[doc = "Getter for the `constraint` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamError/constraint)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamError`*"] - pub fn constraint(this: &MediaStreamError) -> Option; + pub fn constraint(this: &MediaStreamError) -> Option<::alloc::string::String>; } diff --git a/crates/web-sys/src/features/gen_MediaStreamEvent.rs b/crates/web-sys/src/features/gen_MediaStreamEvent.rs index d562649b4a1..60996204cd8 100644 --- a/crates/web-sys/src/features/gen_MediaStreamEvent.rs +++ b/crates/web-sys/src/features/gen_MediaStreamEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaStreamEventInit.rs b/crates/web-sys/src/features/gen_MediaStreamEventInit.rs index eb3d2956474..0bc44a3cd3d 100644 --- a/crates/web-sys/src/features/gen_MediaStreamEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaStreamEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] pub type MediaStreamEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MediaStreamEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MediaStreamEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MediaStreamEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MediaStreamEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MediaStreamEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MediaStreamEventInit, val: bool); + #[cfg(feature = "MediaStream")] + #[doc = "Get the `stream` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamEventInit`*"] + #[wasm_bindgen(method, getter = "stream")] + pub fn get_stream(this: &MediaStreamEventInit) -> Option; + #[cfg(feature = "MediaStream")] + #[doc = "Change the `stream` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamEventInit`*"] + #[wasm_bindgen(method, setter = "stream")] + pub fn set_stream(this: &MediaStreamEventInit, val: Option<&MediaStream>); } impl MediaStreamEventInit { #[doc = "Construct a new `MediaStreamEventInit`."] @@ -19,70 +62,25 @@ impl MediaStreamEventInit { 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: `MediaStreamEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "MediaStream")] - #[doc = "Change the `stream` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamEventInit`*"] + #[deprecated = "Use `set_stream()` instead."] pub fn stream(&mut self, val: Option<&MediaStream>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stream"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stream(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamTrack.rs b/crates/web-sys/src/features/gen_MediaStreamTrack.rs index 113d02887fb..369b58a7d8c 100644 --- a/crates/web-sys/src/features/gen_MediaStreamTrack.rs +++ b/crates/web-sys/src/features/gen_MediaStreamTrack.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,21 +18,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/kind)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"] - pub fn kind(this: &MediaStreamTrack) -> String; + pub fn kind(this: &MediaStreamTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaStreamTrack" , 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/MediaStreamTrack/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"] - pub fn id(this: &MediaStreamTrack) -> String; + pub fn id(this: &MediaStreamTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaStreamTrack" , 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/MediaStreamTrack/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"] - pub fn label(this: &MediaStreamTrack) -> String; + pub fn label(this: &MediaStreamTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MediaStreamTrack" , js_name = enabled)] #[doc = "Getter for the `enabled` field of this object."] #[doc = ""] @@ -128,6 +129,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"] pub fn clone(this: &MediaStreamTrack) -> MediaStreamTrack; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaTrackCapabilities")] + # [wasm_bindgen (method , structural , js_class = "MediaStreamTrack" , js_name = getCapabilities)] + #[doc = "The `getCapabilities()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getCapabilities)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_capabilities(this: &MediaStreamTrack) -> MediaTrackCapabilities; #[cfg(feature = "MediaTrackConstraints")] # [wasm_bindgen (method , structural , js_class = "MediaStreamTrack" , js_name = getConstraints)] #[doc = "The `getConstraints()` method."] diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackEvent.rs b/crates/web-sys/src/features/gen_MediaStreamTrackEvent.rs index 30884b9ec4a..b819e87fd4c 100644 --- a/crates/web-sys/src/features/gen_MediaStreamTrackEvent.rs +++ b/crates/web-sys/src/features/gen_MediaStreamTrackEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackEventInit.rs b/crates/web-sys/src/features/gen_MediaStreamTrackEventInit.rs index 4657ef56bf7..6b8a54383e6 100644 --- a/crates/web-sys/src/features/gen_MediaStreamTrackEventInit.rs +++ b/crates/web-sys/src/features/gen_MediaStreamTrackEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] pub type MediaStreamTrackEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MediaStreamTrackEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MediaStreamTrackEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MediaStreamTrackEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MediaStreamTrackEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MediaStreamTrackEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MediaStreamTrackEventInit, val: bool); + #[cfg(feature = "MediaStreamTrack")] + #[doc = "Get the `track` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackEventInit`*"] + #[wasm_bindgen(method, getter = "track")] + pub fn get_track(this: &MediaStreamTrackEventInit) -> MediaStreamTrack; + #[cfg(feature = "MediaStreamTrack")] + #[doc = "Change the `track` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackEventInit`*"] + #[wasm_bindgen(method, setter = "track")] + pub fn set_track(this: &MediaStreamTrackEventInit, val: &MediaStreamTrack); } impl MediaStreamTrackEventInit { #[cfg(feature = "MediaStreamTrack")] @@ -18,72 +61,28 @@ impl MediaStreamTrackEventInit { pub fn new(track: &MediaStreamTrack) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.track(track); + ret.set_track(track); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "MediaStreamTrack")] - #[doc = "Change the `track` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackEventInit`*"] + #[deprecated = "Use `set_track()` instead."] pub fn track(&mut self, val: &MediaStreamTrack) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("track"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_track(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackGenerator.rs b/crates/web-sys/src/features/gen_MediaStreamTrackGenerator.rs new file mode 100644 index 00000000000..7a83f7e1d89 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaStreamTrackGenerator.rs @@ -0,0 +1,55 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = MediaStreamTrack , extends = EventTarget , extends = :: js_sys :: Object , js_name = MediaStreamTrackGenerator , typescript_type = "MediaStreamTrackGenerator")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaStreamTrackGenerator` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackGenerator)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackGenerator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaStreamTrackGenerator; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "MediaStreamTrackGenerator" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackGenerator/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackGenerator`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &MediaStreamTrackGenerator) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , setter , js_class = "MediaStreamTrackGenerator" , js_name = writable)] + #[doc = "Setter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackGenerator/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackGenerator`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_writable(this: &MediaStreamTrackGenerator, value: &WritableStream); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaStreamTrackGeneratorInit")] + #[wasm_bindgen(catch, constructor, js_class = "MediaStreamTrackGenerator")] + #[doc = "The `new MediaStreamTrackGenerator(..)` constructor, creating a new instance of `MediaStreamTrackGenerator`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackGenerator/MediaStreamTrackGenerator)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackGenerator`, `MediaStreamTrackGeneratorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(init: &MediaStreamTrackGeneratorInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackGeneratorInit.rs b/crates/web-sys/src/features/gen_MediaStreamTrackGeneratorInit.rs new file mode 100644 index 00000000000..eabbd1f487b --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaStreamTrackGeneratorInit.rs @@ -0,0 +1,56 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaStreamTrackGeneratorInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaStreamTrackGeneratorInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackGeneratorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaStreamTrackGeneratorInit; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `kind` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackGeneratorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "kind")] + pub fn get_kind(this: &MediaStreamTrackGeneratorInit) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `kind` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackGeneratorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "kind")] + pub fn set_kind(this: &MediaStreamTrackGeneratorInit, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl MediaStreamTrackGeneratorInit { + #[doc = "Construct a new `MediaStreamTrackGeneratorInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackGeneratorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(kind: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_kind(kind); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_kind()` instead."] + pub fn kind(&mut self, val: &str) -> &mut Self { + self.set_kind(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackProcessor.rs b/crates/web-sys/src/features/gen_MediaStreamTrackProcessor.rs new file mode 100644 index 00000000000..599afdc9093 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaStreamTrackProcessor.rs @@ -0,0 +1,55 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaStreamTrackProcessor , typescript_type = "MediaStreamTrackProcessor")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaStreamTrackProcessor` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackProcessor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaStreamTrackProcessor; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "MediaStreamTrackProcessor" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackProcessor/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessor`, `ReadableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &MediaStreamTrackProcessor) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , setter , js_class = "MediaStreamTrackProcessor" , js_name = readable)] + #[doc = "Setter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackProcessor/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessor`, `ReadableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_readable(this: &MediaStreamTrackProcessor, value: &ReadableStream); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaStreamTrackProcessorInit")] + #[wasm_bindgen(catch, constructor, js_class = "MediaStreamTrackProcessor")] + #[doc = "The `new MediaStreamTrackProcessor(..)` constructor, creating a new instance of `MediaStreamTrackProcessor`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackProcessor/MediaStreamTrackProcessor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessor`, `MediaStreamTrackProcessorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(init: &MediaStreamTrackProcessorInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackProcessorInit.rs b/crates/web-sys/src/features/gen_MediaStreamTrackProcessorInit.rs new file mode 100644 index 00000000000..fc9946330d5 --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaStreamTrackProcessorInit.rs @@ -0,0 +1,84 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaStreamTrackProcessorInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaStreamTrackProcessorInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaStreamTrackProcessorInit; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `maxBufferSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "maxBufferSize")] + pub fn get_max_buffer_size(this: &MediaStreamTrackProcessorInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `maxBufferSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "maxBufferSize")] + pub fn set_max_buffer_size(this: &MediaStreamTrackProcessorInit, val: u16); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaStreamTrack")] + #[doc = "Get the `track` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackProcessorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "track")] + pub fn get_track(this: &MediaStreamTrackProcessorInit) -> MediaStreamTrack; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaStreamTrack")] + #[doc = "Change the `track` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackProcessorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "track")] + pub fn set_track(this: &MediaStreamTrackProcessorInit, val: &MediaStreamTrack); +} +#[cfg(web_sys_unstable_apis)] +impl MediaStreamTrackProcessorInit { + #[cfg(feature = "MediaStreamTrack")] + #[doc = "Construct a new `MediaStreamTrackProcessorInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackProcessorInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(track: &MediaStreamTrack) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_track(track); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_max_buffer_size()` instead."] + pub fn max_buffer_size(&mut self, val: u16) -> &mut Self { + self.set_max_buffer_size(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MediaStreamTrack")] + #[deprecated = "Use `set_track()` instead."] + pub fn track(&mut self, val: &MediaStreamTrack) -> &mut Self { + self.set_track(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_MediaStreamTrackState.rs b/crates/web-sys/src/features/gen_MediaStreamTrackState.rs index 66d23902aca..854efb46141 100644 --- a/crates/web-sys/src/features/gen_MediaStreamTrackState.rs +++ b/crates/web-sys/src/features/gen_MediaStreamTrackState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MediaStreamTrackState` enum."] diff --git a/crates/web-sys/src/features/gen_MediaTrackCapabilities.rs b/crates/web-sys/src/features/gen_MediaTrackCapabilities.rs new file mode 100644 index 00000000000..08378bdcecf --- /dev/null +++ b/crates/web-sys/src/features/gen_MediaTrackCapabilities.rs @@ -0,0 +1,445 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MediaTrackCapabilities)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MediaTrackCapabilities` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MediaTrackCapabilities; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[doc = "Get the `aspectRatio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "aspectRatio")] + pub fn get_aspect_ratio(this: &MediaTrackCapabilities) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[doc = "Change the `aspectRatio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "aspectRatio")] + pub fn set_aspect_ratio(this: &MediaTrackCapabilities, val: &DoubleRange); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "autoGainControl")] + pub fn get_auto_gain_control(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "autoGainControl")] + pub fn set_auto_gain_control(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `backgroundBlur` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "backgroundBlur")] + pub fn get_background_blur(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `backgroundBlur` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "backgroundBlur")] + pub fn set_background_blur(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &MediaTrackCapabilities) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &MediaTrackCapabilities, val: &ULongRange); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "deviceId")] + pub fn get_device_id(this: &MediaTrackCapabilities) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "deviceId")] + pub fn set_device_id(this: &MediaTrackCapabilities, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "echoCancellation")] + pub fn get_echo_cancellation(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "echoCancellation")] + pub fn set_echo_cancellation(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "facingMode")] + pub fn get_facing_mode(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "facingMode")] + pub fn set_facing_mode(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[doc = "Get the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "frameRate")] + pub fn get_frame_rate(this: &MediaTrackCapabilities) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[doc = "Change the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "frameRate")] + pub fn set_frame_rate(this: &MediaTrackCapabilities, val: &DoubleRange); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `groupId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "groupId")] + pub fn get_group_id(this: &MediaTrackCapabilities) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `groupId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "groupId")] + pub fn set_group_id(this: &MediaTrackCapabilities, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &MediaTrackCapabilities) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &MediaTrackCapabilities, val: &ULongRange); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[doc = "Get the `latency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "latency")] + pub fn get_latency(this: &MediaTrackCapabilities) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[doc = "Change the `latency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DoubleRange`, `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "latency")] + pub fn set_latency(this: &MediaTrackCapabilities, val: &DoubleRange); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "noiseSuppression")] + pub fn get_noise_suppression(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "noiseSuppression")] + pub fn set_noise_suppression(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `resizeMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "resizeMode")] + pub fn get_resize_mode(this: &MediaTrackCapabilities) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `resizeMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "resizeMode")] + pub fn set_resize_mode(this: &MediaTrackCapabilities, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Get the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleRate")] + pub fn get_sample_rate(this: &MediaTrackCapabilities) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Change the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sampleRate")] + pub fn set_sample_rate(this: &MediaTrackCapabilities, val: &ULongRange); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Get the `sampleSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sampleSize")] + pub fn get_sample_size(this: &MediaTrackCapabilities) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Change the `sampleSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sampleSize")] + pub fn set_sample_size(this: &MediaTrackCapabilities, val: &ULongRange); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &MediaTrackCapabilities) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`, `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &MediaTrackCapabilities, val: &ULongRange); +} +#[cfg(web_sys_unstable_apis)] +impl MediaTrackCapabilities { + #[doc = "Construct a new `MediaTrackCapabilities`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackCapabilities`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[deprecated = "Use `set_aspect_ratio()` instead."] + pub fn aspect_ratio(&mut self, val: &DoubleRange) -> &mut Self { + self.set_aspect_ratio(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_auto_gain_control()` instead."] + pub fn auto_gain_control(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_auto_gain_control(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_background_blur()` instead."] + pub fn background_blur(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_background_blur(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[deprecated = "Use `set_channel_count()` instead."] + pub fn channel_count(&mut self, val: &ULongRange) -> &mut Self { + self.set_channel_count(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_device_id()` instead."] + pub fn device_id(&mut self, val: &str) -> &mut Self { + self.set_device_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_echo_cancellation()` instead."] + pub fn echo_cancellation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_echo_cancellation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_facing_mode()` instead."] + pub fn facing_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_facing_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[deprecated = "Use `set_frame_rate()` instead."] + pub fn frame_rate(&mut self, val: &DoubleRange) -> &mut Self { + self.set_frame_rate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_group_id()` instead."] + pub fn group_id(&mut self, val: &str) -> &mut Self { + self.set_group_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[deprecated = "Use `set_height()` instead."] + pub fn height(&mut self, val: &ULongRange) -> &mut Self { + self.set_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DoubleRange")] + #[deprecated = "Use `set_latency()` instead."] + pub fn latency(&mut self, val: &DoubleRange) -> &mut Self { + self.set_latency(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_noise_suppression()` instead."] + pub fn noise_suppression(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_noise_suppression(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_resize_mode()` instead."] + pub fn resize_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_resize_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[deprecated = "Use `set_sample_rate()` instead."] + pub fn sample_rate(&mut self, val: &ULongRange) -> &mut Self { + self.set_sample_rate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[deprecated = "Use `set_sample_size()` instead."] + pub fn sample_size(&mut self, val: &ULongRange) -> &mut Self { + self.set_sample_size(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ULongRange")] + #[deprecated = "Use `set_width()` instead."] + pub fn width(&mut self, val: &ULongRange) -> &mut Self { + self.set_width(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for MediaTrackCapabilities { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_MediaTrackConstraintSet.rs b/crates/web-sys/src/features/gen_MediaTrackConstraintSet.rs index f89ab83c1c7..3654baba0bf 100644 --- a/crates/web-sys/src/features/gen_MediaTrackConstraintSet.rs +++ b/crates/web-sys/src/features/gen_MediaTrackConstraintSet.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,166 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] pub type MediaTrackConstraintSet; + #[doc = "Get the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "autoGainControl")] + pub fn get_auto_gain_control(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "autoGainControl")] + pub fn set_auto_gain_control(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `browserWindow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "browserWindow")] + pub fn get_browser_window(this: &MediaTrackConstraintSet) -> Option; + #[doc = "Change the `browserWindow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "browserWindow")] + pub fn set_browser_window(this: &MediaTrackConstraintSet, val: f64); + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "deviceId")] + pub fn get_device_id(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "deviceId")] + pub fn set_device_id(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "echoCancellation")] + pub fn get_echo_cancellation(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "echoCancellation")] + pub fn set_echo_cancellation(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "facingMode")] + pub fn get_facing_mode(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "facingMode")] + pub fn set_facing_mode(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "frameRate")] + pub fn get_frame_rate(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "frameRate")] + pub fn set_frame_rate(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `mediaSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "mediaSource")] + pub fn get_media_source(this: &MediaTrackConstraintSet) -> Option<::alloc::string::String>; + #[doc = "Change the `mediaSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "mediaSource")] + pub fn set_media_source(this: &MediaTrackConstraintSet, val: &str); + #[doc = "Get the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "noiseSuppression")] + pub fn get_noise_suppression(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "noiseSuppression")] + pub fn set_noise_suppression(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `scrollWithPage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "scrollWithPage")] + pub fn get_scroll_with_page(this: &MediaTrackConstraintSet) -> Option; + #[doc = "Change the `scrollWithPage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "scrollWithPage")] + pub fn set_scroll_with_page(this: &MediaTrackConstraintSet, val: bool); + #[doc = "Get the `viewportHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "viewportHeight")] + pub fn get_viewport_height(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `viewportHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "viewportHeight")] + pub fn set_viewport_height(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `viewportOffsetX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "viewportOffsetX")] + pub fn get_viewport_offset_x(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `viewportOffsetX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "viewportOffsetX")] + pub fn set_viewport_offset_x(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `viewportOffsetY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "viewportOffsetY")] + pub fn get_viewport_offset_y(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `viewportOffsetY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "viewportOffsetY")] + pub fn set_viewport_offset_y(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `viewportWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "viewportWidth")] + pub fn get_viewport_width(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `viewportWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "viewportWidth")] + pub fn set_viewport_width(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &MediaTrackConstraintSet) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &MediaTrackConstraintSet, val: &::wasm_bindgen::JsValue); } impl MediaTrackConstraintSet { #[doc = "Construct a new `MediaTrackConstraintSet`."] @@ -19,269 +180,84 @@ impl MediaTrackConstraintSet { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `autoGainControl` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_auto_gain_control()` instead."] pub fn auto_gain_control(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoGainControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_auto_gain_control(val); self } - #[doc = "Change the `browserWindow` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_browser_window()` instead."] pub fn browser_window(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("browserWindow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_browser_window(val); self } - #[doc = "Change the `channelCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_channel_count()` instead."] pub fn 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("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_channel_count(val); self } - #[doc = "Change the `deviceId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_device_id()` instead."] pub fn device_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_device_id(val); self } - #[doc = "Change the `echoCancellation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_echo_cancellation()` instead."] pub fn echo_cancellation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoCancellation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_echo_cancellation(val); self } - #[doc = "Change the `facingMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_facing_mode()` instead."] pub fn facing_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("facingMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_facing_mode(val); self } - #[doc = "Change the `frameRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_frame_rate()` instead."] pub fn frame_rate(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frame_rate(val); self } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `mediaSource` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_media_source()` instead."] pub fn media_source(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaSource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_source(val); self } - #[doc = "Change the `noiseSuppression` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_noise_suppression()` instead."] pub fn noise_suppression(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noiseSuppression"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_noise_suppression(val); self } - #[doc = "Change the `scrollWithPage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_scroll_with_page()` instead."] pub fn scroll_with_page(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scrollWithPage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_scroll_with_page(val); self } - #[doc = "Change the `viewportHeight` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_viewport_height()` instead."] pub fn viewport_height(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_viewport_height(val); self } - #[doc = "Change the `viewportOffsetX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_viewport_offset_x()` instead."] pub fn viewport_offset_x(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportOffsetX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_viewport_offset_x(val); self } - #[doc = "Change the `viewportOffsetY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_viewport_offset_y()` instead."] pub fn viewport_offset_y(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportOffsetY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_viewport_offset_y(val); self } - #[doc = "Change the `viewportWidth` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_viewport_width()` instead."] pub fn viewport_width(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_viewport_width(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraintSet`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaTrackConstraints.rs b/crates/web-sys/src/features/gen_MediaTrackConstraints.rs index 8f76b79644a..f73bee2e8b0 100644 --- a/crates/web-sys/src/features/gen_MediaTrackConstraints.rs +++ b/crates/web-sys/src/features/gen_MediaTrackConstraints.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,176 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] pub type MediaTrackConstraints; + #[doc = "Get the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "autoGainControl")] + pub fn get_auto_gain_control(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "autoGainControl")] + pub fn set_auto_gain_control(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `browserWindow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "browserWindow")] + pub fn get_browser_window(this: &MediaTrackConstraints) -> Option; + #[doc = "Change the `browserWindow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "browserWindow")] + pub fn set_browser_window(this: &MediaTrackConstraints, val: f64); + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "deviceId")] + pub fn get_device_id(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "deviceId")] + pub fn set_device_id(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "echoCancellation")] + pub fn get_echo_cancellation(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "echoCancellation")] + pub fn set_echo_cancellation(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "facingMode")] + pub fn get_facing_mode(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "facingMode")] + pub fn set_facing_mode(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "frameRate")] + pub fn get_frame_rate(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "frameRate")] + pub fn set_frame_rate(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `mediaSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "mediaSource")] + pub fn get_media_source(this: &MediaTrackConstraints) -> Option<::alloc::string::String>; + #[doc = "Change the `mediaSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "mediaSource")] + pub fn set_media_source(this: &MediaTrackConstraints, val: &str); + #[doc = "Get the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "noiseSuppression")] + pub fn get_noise_suppression(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "noiseSuppression")] + pub fn set_noise_suppression(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `scrollWithPage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "scrollWithPage")] + pub fn get_scroll_with_page(this: &MediaTrackConstraints) -> Option; + #[doc = "Change the `scrollWithPage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "scrollWithPage")] + pub fn set_scroll_with_page(this: &MediaTrackConstraints, val: bool); + #[doc = "Get the `viewportHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "viewportHeight")] + pub fn get_viewport_height(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `viewportHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "viewportHeight")] + pub fn set_viewport_height(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `viewportOffsetX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "viewportOffsetX")] + pub fn get_viewport_offset_x(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `viewportOffsetX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "viewportOffsetX")] + pub fn set_viewport_offset_x(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `viewportOffsetY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "viewportOffsetY")] + pub fn get_viewport_offset_y(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `viewportOffsetY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "viewportOffsetY")] + pub fn set_viewport_offset_y(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `viewportWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "viewportWidth")] + pub fn get_viewport_width(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `viewportWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "viewportWidth")] + pub fn set_viewport_width(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &MediaTrackConstraints) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `advanced` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, getter = "advanced")] + pub fn get_advanced(this: &MediaTrackConstraints) -> Option<::js_sys::Array>; + #[doc = "Change the `advanced` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[wasm_bindgen(method, setter = "advanced")] + pub fn set_advanced(this: &MediaTrackConstraints, val: &::wasm_bindgen::JsValue); } impl MediaTrackConstraints { #[doc = "Construct a new `MediaTrackConstraints`."] @@ -19,286 +190,89 @@ impl MediaTrackConstraints { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `autoGainControl` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_auto_gain_control()` instead."] pub fn auto_gain_control(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoGainControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_auto_gain_control(val); self } - #[doc = "Change the `browserWindow` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_browser_window()` instead."] pub fn browser_window(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("browserWindow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_browser_window(val); self } - #[doc = "Change the `channelCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_channel_count()` instead."] pub fn 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("channelCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_channel_count(val); self } - #[doc = "Change the `deviceId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_device_id()` instead."] pub fn device_id(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_device_id(val); self } - #[doc = "Change the `echoCancellation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_echo_cancellation()` instead."] pub fn echo_cancellation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoCancellation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_echo_cancellation(val); self } - #[doc = "Change the `facingMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_facing_mode()` instead."] pub fn facing_mode(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("facingMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_facing_mode(val); self } - #[doc = "Change the `frameRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_frame_rate()` instead."] pub fn frame_rate(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frame_rate(val); self } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `mediaSource` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_media_source()` instead."] pub fn media_source(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaSource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_source(val); self } - #[doc = "Change the `noiseSuppression` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_noise_suppression()` instead."] pub fn noise_suppression(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noiseSuppression"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_noise_suppression(val); self } - #[doc = "Change the `scrollWithPage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_scroll_with_page()` instead."] pub fn scroll_with_page(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scrollWithPage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_scroll_with_page(val); self } - #[doc = "Change the `viewportHeight` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_viewport_height()` instead."] pub fn viewport_height(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_viewport_height(val); self } - #[doc = "Change the `viewportOffsetX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_viewport_offset_x()` instead."] pub fn viewport_offset_x(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportOffsetX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_viewport_offset_x(val); self } - #[doc = "Change the `viewportOffsetY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_viewport_offset_y()` instead."] pub fn viewport_offset_y(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportOffsetY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_viewport_offset_y(val); self } - #[doc = "Change the `viewportWidth` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_viewport_width()` instead."] pub fn viewport_width(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("viewportWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_viewport_width(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } - #[doc = "Change the `advanced` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackConstraints`*"] + #[deprecated = "Use `set_advanced()` instead."] pub fn advanced(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("advanced"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_advanced(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaTrackSettings.rs b/crates/web-sys/src/features/gen_MediaTrackSettings.rs index e279a5595e1..d7b63e11026 100644 --- a/crates/web-sys/src/features/gen_MediaTrackSettings.rs +++ b/crates/web-sys/src/features/gen_MediaTrackSettings.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,96 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] pub type MediaTrackSettings; + #[doc = "Get the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "autoGainControl")] + pub fn get_auto_gain_control(this: &MediaTrackSettings) -> Option; + #[doc = "Change the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "autoGainControl")] + pub fn set_auto_gain_control(this: &MediaTrackSettings, val: bool); + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &MediaTrackSettings) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &MediaTrackSettings, val: i32); + #[doc = "Get the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "deviceId")] + pub fn get_device_id(this: &MediaTrackSettings) -> Option<::alloc::string::String>; + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "deviceId")] + pub fn set_device_id(this: &MediaTrackSettings, val: &str); + #[doc = "Get the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "echoCancellation")] + pub fn get_echo_cancellation(this: &MediaTrackSettings) -> Option; + #[doc = "Change the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "echoCancellation")] + pub fn set_echo_cancellation(this: &MediaTrackSettings, val: bool); + #[doc = "Get the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "facingMode")] + pub fn get_facing_mode(this: &MediaTrackSettings) -> Option<::alloc::string::String>; + #[doc = "Change the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "facingMode")] + pub fn set_facing_mode(this: &MediaTrackSettings, val: &str); + #[doc = "Get the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "frameRate")] + pub fn get_frame_rate(this: &MediaTrackSettings) -> Option; + #[doc = "Change the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "frameRate")] + pub fn set_frame_rate(this: &MediaTrackSettings, val: f64); + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &MediaTrackSettings) -> Option; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &MediaTrackSettings, val: i32); + #[doc = "Get the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "noiseSuppression")] + pub fn get_noise_suppression(this: &MediaTrackSettings) -> Option; + #[doc = "Change the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "noiseSuppression")] + pub fn set_noise_suppression(this: &MediaTrackSettings, val: bool); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &MediaTrackSettings) -> Option; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &MediaTrackSettings, val: i32); } impl MediaTrackSettings { #[doc = "Construct a new `MediaTrackSettings`."] @@ -19,150 +110,49 @@ impl MediaTrackSettings { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `autoGainControl` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_auto_gain_control()` instead."] pub fn auto_gain_control(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoGainControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_auto_gain_control(val); self } - #[doc = "Change the `channelCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_channel_count()` instead."] pub fn channel_count(&mut self, val: i32) -> &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.set_channel_count(val); self } - #[doc = "Change the `deviceId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_device_id()` instead."] pub fn device_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_device_id(val); self } - #[doc = "Change the `echoCancellation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_echo_cancellation()` instead."] pub fn echo_cancellation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoCancellation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_echo_cancellation(val); self } - #[doc = "Change the `facingMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_facing_mode()` instead."] pub fn facing_mode(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("facingMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_facing_mode(val); self } - #[doc = "Change the `frameRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_frame_rate()` instead."] pub fn frame_rate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frame_rate(val); self } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `noiseSuppression` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_noise_suppression()` instead."] pub fn noise_suppression(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noiseSuppression"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_noise_suppression(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSettings`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/crates/web-sys/src/features/gen_MediaTrackSupportedConstraints.rs b/crates/web-sys/src/features/gen_MediaTrackSupportedConstraints.rs index 068ae203e23..6e5cc4cc683 100644 --- a/crates/web-sys/src/features/gen_MediaTrackSupportedConstraints.rs +++ b/crates/web-sys/src/features/gen_MediaTrackSupportedConstraints.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,156 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] pub type MediaTrackSupportedConstraints; + #[doc = "Get the `aspectRatio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "aspectRatio")] + pub fn get_aspect_ratio(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `aspectRatio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "aspectRatio")] + pub fn set_aspect_ratio(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "autoGainControl")] + pub fn get_auto_gain_control(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `autoGainControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "autoGainControl")] + pub fn set_auto_gain_control(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "deviceId")] + pub fn get_device_id(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `deviceId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "deviceId")] + pub fn set_device_id(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "echoCancellation")] + pub fn get_echo_cancellation(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `echoCancellation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "echoCancellation")] + pub fn set_echo_cancellation(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "facingMode")] + pub fn get_facing_mode(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `facingMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "facingMode")] + pub fn set_facing_mode(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "frameRate")] + pub fn get_frame_rate(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `frameRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "frameRate")] + pub fn set_frame_rate(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `groupId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "groupId")] + pub fn get_group_id(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `groupId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "groupId")] + pub fn set_group_id(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `latency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "latency")] + pub fn get_latency(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `latency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "latency")] + pub fn set_latency(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "noiseSuppression")] + pub fn get_noise_suppression(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `noiseSuppression` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "noiseSuppression")] + pub fn set_noise_suppression(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "sampleRate")] + pub fn get_sample_rate(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "sampleRate")] + pub fn set_sample_rate(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `sampleSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "sampleSize")] + pub fn get_sample_size(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `sampleSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "sampleSize")] + pub fn set_sample_size(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `volume` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "volume")] + pub fn get_volume(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `volume` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "volume")] + pub fn set_volume(this: &MediaTrackSupportedConstraints, val: bool); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &MediaTrackSupportedConstraints) -> Option; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &MediaTrackSupportedConstraints, val: bool); } impl MediaTrackSupportedConstraints { #[doc = "Construct a new `MediaTrackSupportedConstraints`."] @@ -19,249 +170,79 @@ impl MediaTrackSupportedConstraints { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `aspectRatio` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_aspect_ratio()` instead."] pub fn aspect_ratio(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("aspectRatio"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_aspect_ratio(val); self } - #[doc = "Change the `autoGainControl` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_auto_gain_control()` instead."] pub fn auto_gain_control(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoGainControl"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_auto_gain_control(val); self } - #[doc = "Change the `channelCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_channel_count()` instead."] pub fn channel_count(&mut self, val: bool) -> &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.set_channel_count(val); self } - #[doc = "Change the `deviceId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_device_id()` instead."] pub fn device_id(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deviceId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_device_id(val); self } - #[doc = "Change the `echoCancellation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_echo_cancellation()` instead."] pub fn echo_cancellation(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoCancellation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_echo_cancellation(val); self } - #[doc = "Change the `facingMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_facing_mode()` instead."] pub fn facing_mode(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("facingMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_facing_mode(val); self } - #[doc = "Change the `frameRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_frame_rate()` instead."] pub fn frame_rate(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frame_rate(val); self } - #[doc = "Change the `groupId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_group_id()` instead."] pub fn group_id(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("groupId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_group_id(val); self } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `latency` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_latency()` instead."] pub fn latency(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("latency"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_latency(val); self } - #[doc = "Change the `noiseSuppression` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_noise_suppression()` instead."] pub fn noise_suppression(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noiseSuppression"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_noise_suppression(val); self } - #[doc = "Change the `sampleRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_sample_rate()` instead."] pub fn sample_rate(&mut self, val: bool) -> &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.set_sample_rate(val); self } - #[doc = "Change the `sampleSize` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_sample_size()` instead."] pub fn sample_size(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sampleSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sample_size(val); self } - #[doc = "Change the `volume` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_volume()` instead."] pub fn volume(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("volume"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_volume(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaTrackSupportedConstraints`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/crates/web-sys/src/features/gen_MemoryAttribution.rs b/crates/web-sys/src/features/gen_MemoryAttribution.rs new file mode 100644 index 00000000000..1bee0c80767 --- /dev/null +++ b/crates/web-sys/src/features/gen_MemoryAttribution.rs @@ -0,0 +1,112 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MemoryAttribution)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MemoryAttribution` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MemoryAttribution; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MemoryAttributionContainer")] + #[doc = "Get the `container` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`, `MemoryAttributionContainer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "container")] + pub fn get_container(this: &MemoryAttribution) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MemoryAttributionContainer")] + #[doc = "Change the `container` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`, `MemoryAttributionContainer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "container")] + pub fn set_container(this: &MemoryAttribution, val: &MemoryAttributionContainer); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `scope` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "scope")] + pub fn get_scope(this: &MemoryAttribution) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `scope` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "scope")] + pub fn set_scope(this: &MemoryAttribution, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "url")] + pub fn get_url(this: &MemoryAttribution) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "url")] + pub fn set_url(this: &MemoryAttribution, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl MemoryAttribution { + #[doc = "Construct a new `MemoryAttribution`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "MemoryAttributionContainer")] + #[deprecated = "Use `set_container()` instead."] + pub fn container(&mut self, val: &MemoryAttributionContainer) -> &mut Self { + self.set_container(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_scope()` instead."] + pub fn scope(&mut self, val: &str) -> &mut Self { + self.set_scope(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_url()` instead."] + pub fn url(&mut self, val: &str) -> &mut Self { + self.set_url(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for MemoryAttribution { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_MemoryAttributionContainer.rs b/crates/web-sys/src/features/gen_MemoryAttributionContainer.rs new file mode 100644 index 00000000000..07dcd7828b3 --- /dev/null +++ b/crates/web-sys/src/features/gen_MemoryAttributionContainer.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MemoryAttributionContainer)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MemoryAttributionContainer` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttributionContainer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MemoryAttributionContainer; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttributionContainer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &MemoryAttributionContainer) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttributionContainer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &MemoryAttributionContainer, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `src` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttributionContainer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "src")] + pub fn get_src(this: &MemoryAttributionContainer) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `src` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttributionContainer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "src")] + pub fn set_src(this: &MemoryAttributionContainer, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl MemoryAttributionContainer { + #[doc = "Construct a new `MemoryAttributionContainer`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryAttributionContainer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_src()` instead."] + pub fn src(&mut self, val: &str) -> &mut Self { + self.set_src(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for MemoryAttributionContainer { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_MemoryBreakdownEntry.rs b/crates/web-sys/src/features/gen_MemoryBreakdownEntry.rs new file mode 100644 index 00000000000..97ad8cecf9d --- /dev/null +++ b/crates/web-sys/src/features/gen_MemoryBreakdownEntry.rs @@ -0,0 +1,109 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MemoryBreakdownEntry)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MemoryBreakdownEntry` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MemoryBreakdownEntry; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attribution` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attribution")] + pub fn get_attribution(this: &MemoryBreakdownEntry) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attribution` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attribution")] + pub fn set_attribution(this: &MemoryBreakdownEntry, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytes")] + pub fn get_bytes(this: &MemoryBreakdownEntry) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytes")] + pub fn set_bytes(this: &MemoryBreakdownEntry, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `types` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "types")] + pub fn get_types(this: &MemoryBreakdownEntry) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `types` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "types")] + pub fn set_types(this: &MemoryBreakdownEntry, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl MemoryBreakdownEntry { + #[doc = "Construct a new `MemoryBreakdownEntry`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attribution()` instead."] + pub fn attribution(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_attribution(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes()` instead."] + pub fn bytes(&mut self, val: f64) -> &mut Self { + self.set_bytes(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_types()` instead."] + pub fn types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_types(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for MemoryBreakdownEntry { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_MemoryMeasurement.rs b/crates/web-sys/src/features/gen_MemoryMeasurement.rs new file mode 100644 index 00000000000..041a0e64493 --- /dev/null +++ b/crates/web-sys/src/features/gen_MemoryMeasurement.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MemoryMeasurement)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `MemoryMeasurement` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type MemoryMeasurement; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `breakdown` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "breakdown")] + pub fn get_breakdown(this: &MemoryMeasurement) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `breakdown` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "breakdown")] + pub fn set_breakdown(this: &MemoryMeasurement, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytes")] + pub fn get_bytes(this: &MemoryMeasurement) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytes")] + pub fn set_bytes(this: &MemoryMeasurement, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl MemoryMeasurement { + #[doc = "Construct a new `MemoryMeasurement`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_breakdown()` instead."] + pub fn breakdown(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_breakdown(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes()` instead."] + pub fn bytes(&mut self, val: f64) -> &mut Self { + self.set_bytes(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for MemoryMeasurement { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_MessageChannel.rs b/crates/web-sys/src/features/gen_MessageChannel.rs index 4422c14af5d..10c61420bb8 100644 --- a/crates/web-sys/src/features/gen_MessageChannel.rs +++ b/crates/web-sys/src/features/gen_MessageChannel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MessageEvent.rs b/crates/web-sys/src/features/gen_MessageEvent.rs index 89df3994280..1afdf3413f1 100644 --- a/crates/web-sys/src/features/gen_MessageEvent.rs +++ b/crates/web-sys/src/features/gen_MessageEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,14 +25,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEvent`*"] - pub fn origin(this: &MessageEvent) -> String; + pub fn origin(this: &MessageEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MessageEvent" , js_name = lastEventId)] #[doc = "Getter for the `lastEventId` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/lastEventId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEvent`*"] - pub fn last_event_id(this: &MessageEvent) -> String; + pub fn last_event_id(this: &MessageEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MessageEvent" , js_name = source)] #[doc = "Getter for the `source` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MessageEventInit.rs b/crates/web-sys/src/features/gen_MessageEventInit.rs index 86092746eba..4f96b0cc6c3 100644 --- a/crates/web-sys/src/features/gen_MessageEventInit.rs +++ b/crates/web-sys/src/features/gen_MessageEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,86 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] pub type MessageEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MessageEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MessageEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MessageEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MessageEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MessageEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MessageEventInit, val: bool); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &MessageEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &MessageEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `lastEventId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, getter = "lastEventId")] + pub fn get_last_event_id(this: &MessageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `lastEventId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, setter = "lastEventId")] + pub fn set_last_event_id(this: &MessageEventInit, val: &str); + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &MessageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &MessageEventInit, val: &str); + #[doc = "Get the `ports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, getter = "ports")] + pub fn get_ports(this: &MessageEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `ports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, setter = "ports")] + pub fn set_ports(this: &MessageEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &MessageEventInit) -> Option<::js_sys::Object>; + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &MessageEventInit, val: Option<&::js_sys::Object>); } impl MessageEventInit { #[doc = "Construct a new `MessageEventInit`."] @@ -19,126 +100,44 @@ impl MessageEventInit { 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: `MessageEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `data` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[deprecated = "Use `set_data()` instead."] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_data(val); self } - #[doc = "Change the `lastEventId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[deprecated = "Use `set_last_event_id()` instead."] pub fn last_event_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastEventId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_last_event_id(val); self } - #[doc = "Change the `origin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[deprecated = "Use `set_origin()` instead."] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_origin(val); self } - #[doc = "Change the `ports` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[deprecated = "Use `set_ports()` instead."] pub fn ports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ports"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ports(val); self } - #[doc = "Change the `source` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MessageEventInit`*"] + #[deprecated = "Use `set_source()` instead."] pub fn source(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source(val); self } } diff --git a/crates/web-sys/src/features/gen_MessagePort.rs b/crates/web-sys/src/features/gen_MessagePort.rs index 2eaf463d003..3e77303b1cf 100644 --- a/crates/web-sys/src/features/gen_MessagePort.rs +++ b/crates/web-sys/src/features/gen_MessagePort.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MidiAccess.rs b/crates/web-sys/src/features/gen_MidiAccess.rs index 4c0db7544e8..e6a9c4e4f26 100644 --- a/crates/web-sys/src/features/gen_MidiAccess.rs +++ b/crates/web-sys/src/features/gen_MidiAccess.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MidiConnectionEvent.rs b/crates/web-sys/src/features/gen_MidiConnectionEvent.rs index 03adeb7d649..71503ee7452 100644 --- a/crates/web-sys/src/features/gen_MidiConnectionEvent.rs +++ b/crates/web-sys/src/features/gen_MidiConnectionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MidiConnectionEventInit.rs b/crates/web-sys/src/features/gen_MidiConnectionEventInit.rs index 3b863c8cbc9..97410953386 100644 --- a/crates/web-sys/src/features/gen_MidiConnectionEventInit.rs +++ b/crates/web-sys/src/features/gen_MidiConnectionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] pub type MidiConnectionEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MidiConnectionEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MidiConnectionEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MidiConnectionEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MidiConnectionEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MidiConnectionEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MidiConnectionEventInit, val: bool); + #[cfg(feature = "MidiPort")] + #[doc = "Get the `port` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`, `MidiPort`*"] + #[wasm_bindgen(method, getter = "port")] + pub fn get_port(this: &MidiConnectionEventInit) -> Option; + #[cfg(feature = "MidiPort")] + #[doc = "Change the `port` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`, `MidiPort`*"] + #[wasm_bindgen(method, setter = "port")] + pub fn set_port(this: &MidiConnectionEventInit, val: Option<&MidiPort>); } impl MidiConnectionEventInit { #[doc = "Construct a new `MidiConnectionEventInit`."] @@ -19,69 +62,25 @@ impl MidiConnectionEventInit { 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: `MidiConnectionEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "MidiPort")] - #[doc = "Change the `port` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MidiConnectionEventInit`, `MidiPort`*"] + #[deprecated = "Use `set_port()` instead."] pub fn port(&mut self, val: Option<&MidiPort>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("port"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_port(val); self } } diff --git a/crates/web-sys/src/features/gen_MidiInput.rs b/crates/web-sys/src/features/gen_MidiInput.rs index d481aa2e9a5..7d57ce959d0 100644 --- a/crates/web-sys/src/features/gen_MidiInput.rs +++ b/crates/web-sys/src/features/gen_MidiInput.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MidiInputMap.rs b/crates/web-sys/src/features/gen_MidiInputMap.rs index 7a682bdad00..f477f0cd4be 100644 --- a/crates/web-sys/src/features/gen_MidiInputMap.rs +++ b/crates/web-sys/src/features/gen_MidiInputMap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -11,4 +12,54 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiInputMap`*"] pub type MidiInputMap; + # [wasm_bindgen (structural , method , getter , js_class = "MIDIInputMap" , 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/MIDIInputMap/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiInputMap`*"] + pub fn size(this: &MidiInputMap) -> u32; + # [wasm_bindgen (method , structural , js_class = "MIDIInputMap" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIInputMap/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiInputMap`*"] + pub fn entries(this: &MidiInputMap) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "MIDIInputMap" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIInputMap/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiInputMap`*"] + pub fn for_each(this: &MidiInputMap, callback: &::js_sys::Function) -> Result<(), JsValue>; + #[cfg(feature = "MidiInput")] + # [wasm_bindgen (method , structural , js_class = "MIDIInputMap" , js_name = get)] + #[doc = "The `get()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIInputMap/get)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiInput`, `MidiInputMap`*"] + pub fn get(this: &MidiInputMap, key: &str) -> Option; + # [wasm_bindgen (method , structural , js_class = "MIDIInputMap" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIInputMap/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiInputMap`*"] + pub fn has(this: &MidiInputMap, key: &str) -> bool; + # [wasm_bindgen (method , structural , js_class = "MIDIInputMap" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIInputMap/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiInputMap`*"] + pub fn keys(this: &MidiInputMap) -> ::js_sys::Iterator; + # [wasm_bindgen (method , structural , js_class = "MIDIInputMap" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIInputMap/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiInputMap`*"] + pub fn values(this: &MidiInputMap) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_MidiMessageEvent.rs b/crates/web-sys/src/features/gen_MidiMessageEvent.rs index f4462faf743..0bfeb396953 100644 --- a/crates/web-sys/src/features/gen_MidiMessageEvent.rs +++ b/crates/web-sys/src/features/gen_MidiMessageEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIMessageEvent/data)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiMessageEvent`*"] - pub fn data(this: &MidiMessageEvent) -> Result, JsValue>; + pub fn data(this: &MidiMessageEvent) -> Result<::alloc::vec::Vec, JsValue>; #[wasm_bindgen(catch, constructor, js_class = "MIDIMessageEvent")] #[doc = "The `new MidiMessageEvent(..)` constructor, creating a new instance of `MidiMessageEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MidiMessageEventInit.rs b/crates/web-sys/src/features/gen_MidiMessageEventInit.rs index b1c6e943e9f..cc97c207493 100644 --- a/crates/web-sys/src/features/gen_MidiMessageEventInit.rs +++ b/crates/web-sys/src/features/gen_MidiMessageEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] pub type MidiMessageEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MidiMessageEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MidiMessageEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MidiMessageEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MidiMessageEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MidiMessageEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MidiMessageEventInit, val: bool); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &MidiMessageEventInit) -> Option<::alloc::vec::Vec>; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &MidiMessageEventInit, val: &::js_sys::Uint8Array); } impl MidiMessageEventInit { #[doc = "Construct a new `MidiMessageEventInit`."] @@ -19,55 +60,24 @@ impl MidiMessageEventInit { 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: `MidiMessageEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); + self + } + #[deprecated = "Use `set_data()` instead."] + pub fn data(&mut self, val: &::js_sys::Uint8Array) -> &mut Self { + self.set_data(val); self } } diff --git a/crates/web-sys/src/features/gen_MidiOptions.rs b/crates/web-sys/src/features/gen_MidiOptions.rs index d1e320d7829..3404891355a 100644 --- a/crates/web-sys/src/features/gen_MidiOptions.rs +++ b/crates/web-sys/src/features/gen_MidiOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] pub type MidiOptions; + #[doc = "Get the `software` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] + #[wasm_bindgen(method, getter = "software")] + pub fn get_software(this: &MidiOptions) -> Option; + #[doc = "Change the `software` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] + #[wasm_bindgen(method, setter = "software")] + pub fn set_software(this: &MidiOptions, val: bool); + #[doc = "Get the `sysex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] + #[wasm_bindgen(method, getter = "sysex")] + pub fn get_sysex(this: &MidiOptions) -> Option; + #[doc = "Change the `sysex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] + #[wasm_bindgen(method, setter = "sysex")] + pub fn set_sysex(this: &MidiOptions, val: bool); } impl MidiOptions { #[doc = "Construct a new `MidiOptions`."] @@ -19,34 +40,14 @@ impl MidiOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `software` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] + #[deprecated = "Use `set_software()` instead."] pub fn software(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("software"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_software(val); self } - #[doc = "Change the `sysex` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MidiOptions`*"] + #[deprecated = "Use `set_sysex()` instead."] pub fn sysex(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sysex"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sysex(val); self } } diff --git a/crates/web-sys/src/features/gen_MidiOutput.rs b/crates/web-sys/src/features/gen_MidiOutput.rs index 8dc8a7aaeeb..7f1e806daac 100644 --- a/crates/web-sys/src/features/gen_MidiOutput.rs +++ b/crates/web-sys/src/features/gen_MidiOutput.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MidiOutputMap.rs b/crates/web-sys/src/features/gen_MidiOutputMap.rs index d20f434544b..872306acd19 100644 --- a/crates/web-sys/src/features/gen_MidiOutputMap.rs +++ b/crates/web-sys/src/features/gen_MidiOutputMap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -11,4 +12,54 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiOutputMap`*"] pub type MidiOutputMap; + # [wasm_bindgen (structural , method , getter , js_class = "MIDIOutputMap" , 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/MIDIOutputMap/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOutputMap`*"] + pub fn size(this: &MidiOutputMap) -> u32; + # [wasm_bindgen (method , structural , js_class = "MIDIOutputMap" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOutputMap`*"] + pub fn entries(this: &MidiOutputMap) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "MIDIOutputMap" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOutputMap`*"] + pub fn for_each(this: &MidiOutputMap, callback: &::js_sys::Function) -> Result<(), JsValue>; + #[cfg(feature = "MidiOutput")] + # [wasm_bindgen (method , structural , js_class = "MIDIOutputMap" , js_name = get)] + #[doc = "The `get()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap/get)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOutput`, `MidiOutputMap`*"] + pub fn get(this: &MidiOutputMap, key: &str) -> Option; + # [wasm_bindgen (method , structural , js_class = "MIDIOutputMap" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOutputMap`*"] + pub fn has(this: &MidiOutputMap, key: &str) -> bool; + # [wasm_bindgen (method , structural , js_class = "MIDIOutputMap" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOutputMap`*"] + pub fn keys(this: &MidiOutputMap) -> ::js_sys::Iterator; + # [wasm_bindgen (method , structural , js_class = "MIDIOutputMap" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MidiOutputMap`*"] + pub fn values(this: &MidiOutputMap) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_MidiPort.rs b/crates/web-sys/src/features/gen_MidiPort.rs index c69a4ee0afe..9a8393546ca 100644 --- a/crates/web-sys/src/features/gen_MidiPort.rs +++ b/crates/web-sys/src/features/gen_MidiPort.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,28 +18,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIPort/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiPort`*"] - pub fn id(this: &MidiPort) -> String; + pub fn id(this: &MidiPort) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MIDIPort" , js_name = manufacturer)] #[doc = "Getter for the `manufacturer` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIPort/manufacturer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiPort`*"] - pub fn manufacturer(this: &MidiPort) -> Option; + pub fn manufacturer(this: &MidiPort) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "MIDIPort" , 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/MIDIPort/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiPort`*"] - pub fn name(this: &MidiPort) -> Option; + pub fn name(this: &MidiPort) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "MIDIPort" , js_name = version)] #[doc = "Getter for the `version` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIPort/version)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MidiPort`*"] - pub fn version(this: &MidiPort) -> Option; + pub fn version(this: &MidiPort) -> Option<::alloc::string::String>; #[cfg(feature = "MidiPortType")] # [wasm_bindgen (structural , method , getter , js_class = "MIDIPort" , js_name = type)] #[doc = "Getter for the `type` field of this object."] diff --git a/crates/web-sys/src/features/gen_MidiPortConnectionState.rs b/crates/web-sys/src/features/gen_MidiPortConnectionState.rs index ae25b7e4572..e0389280ebc 100644 --- a/crates/web-sys/src/features/gen_MidiPortConnectionState.rs +++ b/crates/web-sys/src/features/gen_MidiPortConnectionState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MidiPortConnectionState` enum."] diff --git a/crates/web-sys/src/features/gen_MidiPortDeviceState.rs b/crates/web-sys/src/features/gen_MidiPortDeviceState.rs index c443c64edf5..f1bd843f5f1 100644 --- a/crates/web-sys/src/features/gen_MidiPortDeviceState.rs +++ b/crates/web-sys/src/features/gen_MidiPortDeviceState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MidiPortDeviceState` enum."] diff --git a/crates/web-sys/src/features/gen_MidiPortType.rs b/crates/web-sys/src/features/gen_MidiPortType.rs index d987ea7b42f..507c37d92ff 100644 --- a/crates/web-sys/src/features/gen_MidiPortType.rs +++ b/crates/web-sys/src/features/gen_MidiPortType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `MidiPortType` enum."] diff --git a/crates/web-sys/src/features/gen_MimeType.rs b/crates/web-sys/src/features/gen_MimeType.rs index 1588cb14a8a..93f6664bfac 100644 --- a/crates/web-sys/src/features/gen_MimeType.rs +++ b/crates/web-sys/src/features/gen_MimeType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MimeType/description)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MimeType`*"] - pub fn description(this: &MimeType) -> String; + pub fn description(this: &MimeType) -> ::alloc::string::String; #[cfg(feature = "Plugin")] # [wasm_bindgen (structural , method , getter , js_class = "MimeType" , js_name = enabledPlugin)] #[doc = "Getter for the `enabledPlugin` field of this object."] @@ -32,12 +33,12 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MimeType/suffixes)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MimeType`*"] - pub fn suffixes(this: &MimeType) -> String; + pub fn suffixes(this: &MimeType) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MimeType" , 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/MimeType/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MimeType`*"] - pub fn type_(this: &MimeType) -> String; + pub fn type_(this: &MimeType) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_MimeTypeArray.rs b/crates/web-sys/src/features/gen_MimeTypeArray.rs index 79fe54a74a1..cef986fb26b 100644 --- a/crates/web-sys/src/features/gen_MimeTypeArray.rs +++ b/crates/web-sys/src/features/gen_MimeTypeArray.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -36,7 +37,7 @@ extern "C" { pub fn named_item(this: &MimeTypeArray, name: &str) -> Option; #[cfg(feature = "MimeType")] #[wasm_bindgen(method, structural, js_class = "MimeTypeArray", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] @@ -44,7 +45,7 @@ extern "C" { pub fn get_with_index(this: &MimeTypeArray, index: u32) -> Option; #[cfg(feature = "MimeType")] #[wasm_bindgen(method, structural, js_class = "MimeTypeArray", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MouseEvent.rs b/crates/web-sys/src/features/gen_MouseEvent.rs index 3a44e137e7a..96f448f165b 100644 --- a/crates/web-sys/src/features/gen_MouseEvent.rs +++ b/crates/web-sys/src/features/gen_MouseEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -123,7 +124,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/region)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEvent`*"] - pub fn region(this: &MouseEvent) -> Option; + pub fn region(this: &MouseEvent) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "MouseEvent" , js_name = movementX)] #[doc = "Getter for the `movementX` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MouseEventInit.rs b/crates/web-sys/src/features/gen_MouseEventInit.rs index def45c9f43b..61220cd7536 100644 --- a/crates/web-sys/src/features/gen_MouseEventInit.rs +++ b/crates/web-sys/src/features/gen_MouseEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,280 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] pub type MouseEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &MouseEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &MouseEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &MouseEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &MouseEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &MouseEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &MouseEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &MouseEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &MouseEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &MouseEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &MouseEventInit, val: Option<&Window>); + #[doc = "Get the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "altKey")] + pub fn get_alt_key(this: &MouseEventInit) -> Option; + #[doc = "Change the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "altKey")] + pub fn set_alt_key(this: &MouseEventInit, val: bool); + #[doc = "Get the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "ctrlKey")] + pub fn get_ctrl_key(this: &MouseEventInit) -> Option; + #[doc = "Change the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "ctrlKey")] + pub fn set_ctrl_key(this: &MouseEventInit, val: bool); + #[doc = "Get the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "metaKey")] + pub fn get_meta_key(this: &MouseEventInit) -> Option; + #[doc = "Change the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "metaKey")] + pub fn set_meta_key(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierAltGraph")] + pub fn get_modifier_alt_graph(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierAltGraph")] + pub fn set_modifier_alt_graph(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierCapsLock")] + pub fn get_modifier_caps_lock(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierCapsLock")] + pub fn set_modifier_caps_lock(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFn")] + pub fn get_modifier_fn(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFn")] + pub fn set_modifier_fn(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFnLock")] + pub fn get_modifier_fn_lock(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFnLock")] + pub fn set_modifier_fn_lock(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierNumLock")] + pub fn get_modifier_num_lock(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierNumLock")] + pub fn set_modifier_num_lock(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierOS")] + pub fn get_modifier_os(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierOS")] + pub fn set_modifier_os(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierScrollLock")] + pub fn get_modifier_scroll_lock(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierScrollLock")] + pub fn set_modifier_scroll_lock(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbol")] + pub fn get_modifier_symbol(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbol")] + pub fn set_modifier_symbol(this: &MouseEventInit, val: bool); + #[doc = "Get the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbolLock")] + pub fn get_modifier_symbol_lock(this: &MouseEventInit) -> Option; + #[doc = "Change the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + pub fn set_modifier_symbol_lock(this: &MouseEventInit, val: bool); + #[doc = "Get the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "shiftKey")] + pub fn get_shift_key(this: &MouseEventInit) -> Option; + #[doc = "Change the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "shiftKey")] + pub fn set_shift_key(this: &MouseEventInit, val: bool); + #[doc = "Get the `button` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "button")] + pub fn get_button(this: &MouseEventInit) -> Option; + #[doc = "Change the `button` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "button")] + pub fn set_button(this: &MouseEventInit, val: i16); + #[doc = "Get the `buttons` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "buttons")] + pub fn get_buttons(this: &MouseEventInit) -> Option; + #[doc = "Change the `buttons` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "buttons")] + pub fn set_buttons(this: &MouseEventInit, val: u16); + #[doc = "Get the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "clientX")] + pub fn get_client_x(this: &MouseEventInit) -> Option; + #[doc = "Change the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "clientX")] + pub fn set_client_x(this: &MouseEventInit, val: i32); + #[doc = "Get the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "clientY")] + pub fn get_client_y(this: &MouseEventInit) -> Option; + #[doc = "Change the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "clientY")] + pub fn set_client_y(this: &MouseEventInit, val: i32); + #[doc = "Get the `movementX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "movementX")] + pub fn get_movement_x(this: &MouseEventInit) -> Option; + #[doc = "Change the `movementX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "movementX")] + pub fn set_movement_x(this: &MouseEventInit, val: i32); + #[doc = "Get the `movementY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "movementY")] + pub fn get_movement_y(this: &MouseEventInit) -> Option; + #[doc = "Change the `movementY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "movementY")] + pub fn set_movement_y(this: &MouseEventInit, val: i32); + #[cfg(feature = "EventTarget")] + #[doc = "Get the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "relatedTarget")] + pub fn get_related_target(this: &MouseEventInit) -> Option; + #[cfg(feature = "EventTarget")] + #[doc = "Change the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "relatedTarget")] + pub fn set_related_target(this: &MouseEventInit, val: Option<&EventTarget>); + #[doc = "Get the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "screenX")] + pub fn get_screen_x(this: &MouseEventInit) -> Option; + #[doc = "Change the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "screenX")] + pub fn set_screen_x(this: &MouseEventInit, val: i32); + #[doc = "Get the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, getter = "screenY")] + pub fn get_screen_y(this: &MouseEventInit) -> Option; + #[doc = "Change the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[wasm_bindgen(method, setter = "screenY")] + pub fn set_screen_y(this: &MouseEventInit, val: i32); } impl MouseEventInit { #[doc = "Construct a new `MouseEventInit`."] @@ -19,452 +294,141 @@ impl MouseEventInit { 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: `MouseEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `altKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_alt_key()` instead."] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alt_key(val); self } - #[doc = "Change the `ctrlKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_ctrl_key()` instead."] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ctrl_key(val); self } - #[doc = "Change the `metaKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_meta_key()` instead."] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_meta_key(val); self } - #[doc = "Change the `modifierAltGraph` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_alt_graph()` instead."] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_alt_graph(val); self } - #[doc = "Change the `modifierCapsLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_caps_lock()` instead."] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_caps_lock(val); self } - #[doc = "Change the `modifierFn` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_fn()` instead."] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn(val); self } - #[doc = "Change the `modifierFnLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_fn_lock()` instead."] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn_lock(val); self } - #[doc = "Change the `modifierNumLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_num_lock()` instead."] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_num_lock(val); self } - #[doc = "Change the `modifierOS` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_os()` instead."] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_os(val); self } - #[doc = "Change the `modifierScrollLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_scroll_lock()` instead."] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_scroll_lock(val); self } - #[doc = "Change the `modifierSymbol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_symbol()` instead."] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol(val); self } - #[doc = "Change the `modifierSymbolLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_modifier_symbol_lock()` instead."] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol_lock(val); self } - #[doc = "Change the `shiftKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_shift_key()` instead."] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shift_key(val); self } - #[doc = "Change the `button` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_button()` instead."] pub fn button(&mut self, val: i16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_button(val); self } - #[doc = "Change the `buttons` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_buttons()` instead."] pub fn buttons(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buttons"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_buttons(val); self } - #[doc = "Change the `clientX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_client_x()` instead."] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_x(val); self } - #[doc = "Change the `clientY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_client_y()` instead."] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_y(val); self } - #[doc = "Change the `movementX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_movement_x()` instead."] pub fn movement_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_movement_x(val); self } - #[doc = "Change the `movementY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_movement_y()` instead."] pub fn movement_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_movement_y(val); self } #[cfg(feature = "EventTarget")] - #[doc = "Change the `relatedTarget` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `MouseEventInit`*"] + #[deprecated = "Use `set_related_target()` instead."] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_related_target(val); self } - #[doc = "Change the `screenX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_screen_x()` instead."] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_x(val); self } - #[doc = "Change the `screenY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MouseEventInit`*"] + #[deprecated = "Use `set_screen_y()` instead."] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_y(val); self } } diff --git a/crates/web-sys/src/features/gen_MouseScrollEvent.rs b/crates/web-sys/src/features/gen_MouseScrollEvent.rs index 01d2970113b..9bed2d61768 100644 --- a/crates/web-sys/src/features/gen_MouseScrollEvent.rs +++ b/crates/web-sys/src/features/gen_MouseScrollEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MozDebug.rs b/crates/web-sys/src/features/gen_MozDebug.rs index 6d83c97f3a2..7fd1c91d31d 100644 --- a/crates/web-sys/src/features/gen_MozDebug.rs +++ b/crates/web-sys/src/features/gen_MozDebug.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MutationEvent.rs b/crates/web-sys/src/features/gen_MutationEvent.rs index 72f7bc9ad18..cd3b3d34aed 100644 --- a/crates/web-sys/src/features/gen_MutationEvent.rs +++ b/crates/web-sys/src/features/gen_MutationEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,21 +26,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/prevValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"] - pub fn prev_value(this: &MutationEvent) -> String; + pub fn prev_value(this: &MutationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MutationEvent" , js_name = newValue)] #[doc = "Getter for the `newValue` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/newValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"] - pub fn new_value(this: &MutationEvent) -> String; + pub fn new_value(this: &MutationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MutationEvent" , js_name = attrName)] #[doc = "Getter for the `attrName` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/attrName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"] - pub fn attr_name(this: &MutationEvent) -> String; + pub fn attr_name(this: &MutationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "MutationEvent" , js_name = attrChange)] #[doc = "Getter for the `attrChange` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_MutationObserver.rs b/crates/web-sys/src/features/gen_MutationObserver.rs index c9ce64ea260..58ba233c170 100644 --- a/crates/web-sys/src/features/gen_MutationObserver.rs +++ b/crates/web-sys/src/features/gen_MutationObserver.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_MutationObserverInit.rs b/crates/web-sys/src/features/gen_MutationObserverInit.rs index fb3aac8010e..69ac7cf001d 100644 --- a/crates/web-sys/src/features/gen_MutationObserverInit.rs +++ b/crates/web-sys/src/features/gen_MutationObserverInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,96 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] pub type MutationObserverInit; + #[doc = "Get the `animations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "animations")] + pub fn get_animations(this: &MutationObserverInit) -> Option; + #[doc = "Change the `animations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "animations")] + pub fn set_animations(this: &MutationObserverInit, val: bool); + #[doc = "Get the `attributeFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "attributeFilter")] + pub fn get_attribute_filter(this: &MutationObserverInit) -> Option<::js_sys::Array>; + #[doc = "Change the `attributeFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "attributeFilter")] + pub fn set_attribute_filter(this: &MutationObserverInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `attributeOldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "attributeOldValue")] + pub fn get_attribute_old_value(this: &MutationObserverInit) -> Option; + #[doc = "Change the `attributeOldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "attributeOldValue")] + pub fn set_attribute_old_value(this: &MutationObserverInit, val: bool); + #[doc = "Get the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "attributes")] + pub fn get_attributes(this: &MutationObserverInit) -> Option; + #[doc = "Change the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "attributes")] + pub fn set_attributes(this: &MutationObserverInit, val: bool); + #[doc = "Get the `characterData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "characterData")] + pub fn get_character_data(this: &MutationObserverInit) -> Option; + #[doc = "Change the `characterData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "characterData")] + pub fn set_character_data(this: &MutationObserverInit, val: bool); + #[doc = "Get the `characterDataOldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "characterDataOldValue")] + pub fn get_character_data_old_value(this: &MutationObserverInit) -> Option; + #[doc = "Change the `characterDataOldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "characterDataOldValue")] + pub fn set_character_data_old_value(this: &MutationObserverInit, val: bool); + #[doc = "Get the `childList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "childList")] + pub fn get_child_list(this: &MutationObserverInit) -> Option; + #[doc = "Change the `childList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "childList")] + pub fn set_child_list(this: &MutationObserverInit, val: bool); + #[doc = "Get the `nativeAnonymousChildList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "nativeAnonymousChildList")] + pub fn get_native_anonymous_child_list(this: &MutationObserverInit) -> Option; + #[doc = "Change the `nativeAnonymousChildList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "nativeAnonymousChildList")] + pub fn set_native_anonymous_child_list(this: &MutationObserverInit, val: bool); + #[doc = "Get the `subtree` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, getter = "subtree")] + pub fn get_subtree(this: &MutationObserverInit) -> Option; + #[doc = "Change the `subtree` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[wasm_bindgen(method, setter = "subtree")] + pub fn set_subtree(this: &MutationObserverInit, val: bool); } impl MutationObserverInit { #[doc = "Construct a new `MutationObserverInit`."] @@ -19,157 +110,49 @@ impl MutationObserverInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `animations` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_animations()` instead."] pub fn animations(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("animations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_animations(val); self } - #[doc = "Change the `attributeFilter` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_attribute_filter()` instead."] pub fn attribute_filter(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attribute_filter(val); self } - #[doc = "Change the `attributeOldValue` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_attribute_old_value()` instead."] pub fn attribute_old_value(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeOldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attribute_old_value(val); self } - #[doc = "Change the `attributes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_attributes()` instead."] pub fn attributes(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attributes(val); self } - #[doc = "Change the `characterData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_character_data()` instead."] pub fn character_data(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("characterData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_character_data(val); self } - #[doc = "Change the `characterDataOldValue` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_character_data_old_value()` instead."] pub fn character_data_old_value(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("characterDataOldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_character_data_old_value(val); self } - #[doc = "Change the `childList` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_child_list()` instead."] pub fn child_list(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("childList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_child_list(val); self } - #[doc = "Change the `nativeAnonymousChildList` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_native_anonymous_child_list()` instead."] pub fn native_anonymous_child_list(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nativeAnonymousChildList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_native_anonymous_child_list(val); self } - #[doc = "Change the `subtree` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObserverInit`*"] + #[deprecated = "Use `set_subtree()` instead."] pub fn subtree(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("subtree"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_subtree(val); self } } diff --git a/crates/web-sys/src/features/gen_MutationObservingInfo.rs b/crates/web-sys/src/features/gen_MutationObservingInfo.rs index 96178ea3ade..6d6aceb0514 100644 --- a/crates/web-sys/src/features/gen_MutationObservingInfo.rs +++ b/crates/web-sys/src/features/gen_MutationObservingInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,108 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] pub type MutationObservingInfo; + #[doc = "Get the `animations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "animations")] + pub fn get_animations(this: &MutationObservingInfo) -> Option; + #[doc = "Change the `animations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "animations")] + pub fn set_animations(this: &MutationObservingInfo, val: bool); + #[doc = "Get the `attributeFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "attributeFilter")] + pub fn get_attribute_filter(this: &MutationObservingInfo) -> Option<::js_sys::Array>; + #[doc = "Change the `attributeFilter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "attributeFilter")] + pub fn set_attribute_filter(this: &MutationObservingInfo, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `attributeOldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "attributeOldValue")] + pub fn get_attribute_old_value(this: &MutationObservingInfo) -> Option; + #[doc = "Change the `attributeOldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "attributeOldValue")] + pub fn set_attribute_old_value(this: &MutationObservingInfo, val: bool); + #[doc = "Get the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "attributes")] + pub fn get_attributes(this: &MutationObservingInfo) -> Option; + #[doc = "Change the `attributes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "attributes")] + pub fn set_attributes(this: &MutationObservingInfo, val: bool); + #[doc = "Get the `characterData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "characterData")] + pub fn get_character_data(this: &MutationObservingInfo) -> Option; + #[doc = "Change the `characterData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "characterData")] + pub fn set_character_data(this: &MutationObservingInfo, val: bool); + #[doc = "Get the `characterDataOldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "characterDataOldValue")] + pub fn get_character_data_old_value(this: &MutationObservingInfo) -> Option; + #[doc = "Change the `characterDataOldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "characterDataOldValue")] + pub fn set_character_data_old_value(this: &MutationObservingInfo, val: bool); + #[doc = "Get the `childList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "childList")] + pub fn get_child_list(this: &MutationObservingInfo) -> Option; + #[doc = "Change the `childList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "childList")] + pub fn set_child_list(this: &MutationObservingInfo, val: bool); + #[doc = "Get the `nativeAnonymousChildList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "nativeAnonymousChildList")] + pub fn get_native_anonymous_child_list(this: &MutationObservingInfo) -> Option; + #[doc = "Change the `nativeAnonymousChildList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "nativeAnonymousChildList")] + pub fn set_native_anonymous_child_list(this: &MutationObservingInfo, val: bool); + #[doc = "Get the `subtree` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, getter = "subtree")] + pub fn get_subtree(this: &MutationObservingInfo) -> Option; + #[doc = "Change the `subtree` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[wasm_bindgen(method, setter = "subtree")] + pub fn set_subtree(this: &MutationObservingInfo, val: bool); + #[cfg(feature = "Node")] + #[doc = "Get the `observedNode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`, `Node`*"] + #[wasm_bindgen(method, getter = "observedNode")] + pub fn get_observed_node(this: &MutationObservingInfo) -> Option; + #[cfg(feature = "Node")] + #[doc = "Change the `observedNode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`, `Node`*"] + #[wasm_bindgen(method, setter = "observedNode")] + pub fn set_observed_node(this: &MutationObservingInfo, val: Option<&Node>); } impl MutationObservingInfo { #[doc = "Construct a new `MutationObservingInfo`."] @@ -19,175 +122,55 @@ impl MutationObservingInfo { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `animations` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_animations()` instead."] pub fn animations(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("animations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_animations(val); self } - #[doc = "Change the `attributeFilter` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_attribute_filter()` instead."] pub fn attribute_filter(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeFilter"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attribute_filter(val); self } - #[doc = "Change the `attributeOldValue` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_attribute_old_value()` instead."] pub fn attribute_old_value(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributeOldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attribute_old_value(val); self } - #[doc = "Change the `attributes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_attributes()` instead."] pub fn attributes(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attributes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attributes(val); self } - #[doc = "Change the `characterData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_character_data()` instead."] pub fn character_data(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("characterData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_character_data(val); self } - #[doc = "Change the `characterDataOldValue` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_character_data_old_value()` instead."] pub fn character_data_old_value(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("characterDataOldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_character_data_old_value(val); self } - #[doc = "Change the `childList` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_child_list()` instead."] pub fn child_list(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("childList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_child_list(val); self } - #[doc = "Change the `nativeAnonymousChildList` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_native_anonymous_child_list()` instead."] pub fn native_anonymous_child_list(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nativeAnonymousChildList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_native_anonymous_child_list(val); self } - #[doc = "Change the `subtree` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`*"] + #[deprecated = "Use `set_subtree()` instead."] pub fn subtree(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("subtree"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_subtree(val); self } #[cfg(feature = "Node")] - #[doc = "Change the `observedNode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MutationObservingInfo`, `Node`*"] + #[deprecated = "Use `set_observed_node()` instead."] pub fn observed_node(&mut self, val: Option<&Node>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("observedNode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_observed_node(val); self } } diff --git a/crates/web-sys/src/features/gen_MutationRecord.rs b/crates/web-sys/src/features/gen_MutationRecord.rs index 2a9e4c36511..f898c07d02c 100644 --- a/crates/web-sys/src/features/gen_MutationRecord.rs +++ b/crates/web-sys/src/features/gen_MutationRecord.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationRecord`*"] - pub fn type_(this: &MutationRecord) -> String; + pub fn type_(this: &MutationRecord) -> ::alloc::string::String; #[cfg(feature = "Node")] # [wasm_bindgen (structural , method , getter , js_class = "MutationRecord" , js_name = target)] #[doc = "Getter for the `target` field of this object."] @@ -64,19 +65,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/attributeName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationRecord`*"] - pub fn attribute_name(this: &MutationRecord) -> Option; + pub fn attribute_name(this: &MutationRecord) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "MutationRecord" , js_name = attributeNamespace)] #[doc = "Getter for the `attributeNamespace` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/attributeNamespace)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationRecord`*"] - pub fn attribute_namespace(this: &MutationRecord) -> Option; + pub fn attribute_namespace(this: &MutationRecord) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "MutationRecord" , js_name = oldValue)] #[doc = "Getter for the `oldValue` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord/oldValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MutationRecord`*"] - pub fn old_value(this: &MutationRecord) -> Option; + pub fn old_value(this: &MutationRecord) -> Option<::alloc::string::String>; } diff --git a/crates/web-sys/src/features/gen_NamedNodeMap.rs b/crates/web-sys/src/features/gen_NamedNodeMap.rs index ee2d2e0435c..82af2f737cb 100644 --- a/crates/web-sys/src/features/gen_NamedNodeMap.rs +++ b/crates/web-sys/src/features/gen_NamedNodeMap.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -84,7 +85,7 @@ extern "C" { pub fn set_named_item_ns(this: &NamedNodeMap, arg: &Attr) -> Result, JsValue>; #[cfg(feature = "Attr")] #[wasm_bindgen(method, structural, js_class = "NamedNodeMap", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] @@ -92,7 +93,7 @@ extern "C" { pub fn get_with_name(this: &NamedNodeMap, name: &str) -> Option; #[cfg(feature = "Attr")] #[wasm_bindgen(method, structural, js_class = "NamedNodeMap", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_NativeOsFileReadOptions.rs b/crates/web-sys/src/features/gen_NativeOsFileReadOptions.rs index 1c1354d2200..733fed4acbd 100644 --- a/crates/web-sys/src/features/gen_NativeOsFileReadOptions.rs +++ b/crates/web-sys/src/features/gen_NativeOsFileReadOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] pub type NativeOsFileReadOptions; + #[doc = "Get the `bytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] + #[wasm_bindgen(method, getter = "bytes")] + pub fn get_bytes(this: &NativeOsFileReadOptions) -> Option; + #[doc = "Change the `bytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] + #[wasm_bindgen(method, setter = "bytes")] + pub fn set_bytes(this: &NativeOsFileReadOptions, val: Option); + #[doc = "Get the `encoding` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] + #[wasm_bindgen(method, getter = "encoding")] + pub fn get_encoding(this: &NativeOsFileReadOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `encoding` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] + #[wasm_bindgen(method, setter = "encoding")] + pub fn set_encoding(this: &NativeOsFileReadOptions, val: Option<&str>); } impl NativeOsFileReadOptions { #[doc = "Construct a new `NativeOsFileReadOptions`."] @@ -19,34 +40,14 @@ impl NativeOsFileReadOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `bytes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] + #[deprecated = "Use `set_bytes()` instead."] pub fn bytes(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("bytes"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes(val); self } - #[doc = "Change the `encoding` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NativeOsFileReadOptions`*"] + #[deprecated = "Use `set_encoding()` instead."] pub fn encoding(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("encoding"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_encoding(val); self } } diff --git a/crates/web-sys/src/features/gen_NativeOsFileWriteAtomicOptions.rs b/crates/web-sys/src/features/gen_NativeOsFileWriteAtomicOptions.rs index a06f19128cb..44e685503ed 100644 --- a/crates/web-sys/src/features/gen_NativeOsFileWriteAtomicOptions.rs +++ b/crates/web-sys/src/features/gen_NativeOsFileWriteAtomicOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] pub type NativeOsFileWriteAtomicOptions; + #[doc = "Get the `backupTo` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, getter = "backupTo")] + pub fn get_backup_to(this: &NativeOsFileWriteAtomicOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `backupTo` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, setter = "backupTo")] + pub fn set_backup_to(this: &NativeOsFileWriteAtomicOptions, val: Option<&str>); + #[doc = "Get the `bytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, getter = "bytes")] + pub fn get_bytes(this: &NativeOsFileWriteAtomicOptions) -> Option; + #[doc = "Change the `bytes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, setter = "bytes")] + pub fn set_bytes(this: &NativeOsFileWriteAtomicOptions, val: Option); + #[doc = "Get the `flush` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, getter = "flush")] + pub fn get_flush(this: &NativeOsFileWriteAtomicOptions) -> Option; + #[doc = "Change the `flush` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, setter = "flush")] + pub fn set_flush(this: &NativeOsFileWriteAtomicOptions, val: bool); + #[doc = "Get the `noOverwrite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, getter = "noOverwrite")] + pub fn get_no_overwrite(this: &NativeOsFileWriteAtomicOptions) -> Option; + #[doc = "Change the `noOverwrite` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, setter = "noOverwrite")] + pub fn set_no_overwrite(this: &NativeOsFileWriteAtomicOptions, val: bool); + #[doc = "Get the `tmpPath` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, getter = "tmpPath")] + pub fn get_tmp_path(this: &NativeOsFileWriteAtomicOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `tmpPath` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[wasm_bindgen(method, setter = "tmpPath")] + pub fn set_tmp_path(this: &NativeOsFileWriteAtomicOptions, val: Option<&str>); } impl NativeOsFileWriteAtomicOptions { #[doc = "Construct a new `NativeOsFileWriteAtomicOptions`."] @@ -19,81 +70,29 @@ impl NativeOsFileWriteAtomicOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `backupTo` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[deprecated = "Use `set_backup_to()` instead."] pub fn backup_to(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("backupTo"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_backup_to(val); self } - #[doc = "Change the `bytes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[deprecated = "Use `set_bytes()` instead."] pub fn bytes(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("bytes"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes(val); self } - #[doc = "Change the `flush` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[deprecated = "Use `set_flush()` instead."] pub fn flush(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flush"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_flush(val); self } - #[doc = "Change the `noOverwrite` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[deprecated = "Use `set_no_overwrite()` instead."] pub fn no_overwrite(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noOverwrite"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_no_overwrite(val); self } - #[doc = "Change the `tmpPath` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NativeOsFileWriteAtomicOptions`*"] + #[deprecated = "Use `set_tmp_path()` instead."] pub fn tmp_path(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("tmpPath"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_tmp_path(val); self } } diff --git a/crates/web-sys/src/features/gen_NavigationType.rs b/crates/web-sys/src/features/gen_NavigationType.rs index 0ec80186f8f..8f82bdd2866 100644 --- a/crates/web-sys/src/features/gen_NavigationType.rs +++ b/crates/web-sys/src/features/gen_NavigationType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `NavigationType` enum."] diff --git a/crates/web-sys/src/features/gen_Navigator.rs b/crates/web-sys/src/features/gen_Navigator.rs index 19e76045e3c..fa2913ade18 100644 --- a/crates/web-sys/src/features/gen_Navigator.rs +++ b/crates/web-sys/src/features/gen_Navigator.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -11,6 +12,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] pub type Navigator; + #[cfg(feature = "Clipboard")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = clipboard)] + #[doc = "Getter for the `clipboard` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Clipboard`, `Navigator`*"] + pub fn clipboard(this: &Navigator) -> Clipboard; #[cfg(feature = "Permissions")] # [wasm_bindgen (structural , catch , method , getter , js_class = "Navigator" , js_name = permissions)] #[doc = "Getter for the `permissions` field of this object."] @@ -41,7 +50,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn do_not_track(this: &Navigator) -> String; + pub fn do_not_track(this: &Navigator) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = maxTouchPoints)] #[doc = "Getter for the `maxTouchPoints` field of this object."] #[doc = ""] @@ -104,6 +113,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CredentialsContainer`, `Navigator`*"] pub fn credentials(this: &Navigator) -> CredentialsContainer; + #[cfg(feature = "UserActivation")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = userActivation)] + #[doc = "Getter for the `userActivation` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userActivation)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Navigator`, `UserActivation`*"] + pub fn user_activation(this: &Navigator) -> UserActivation; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Bluetooth")] # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = bluetooth)] @@ -117,17 +134,17 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn bluetooth(this: &Navigator) -> Option; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "Clipboard")] - # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = clipboard)] - #[doc = "Getter for the `clipboard` field of this object."] + #[cfg(feature = "MediaSession")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = mediaSession)] + #[doc = "Getter for the `mediaSession` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaSession)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Clipboard`, `Navigator`*"] + #[doc = "*This API requires the following crate features to be activated: `MediaSession`, `Navigator`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn clipboard(this: &Navigator) -> Option; + pub fn media_session(this: &Navigator) -> MediaSession; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WakeLock")] # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = wakeLock)] @@ -153,6 +170,18 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn hid(this: &Navigator) -> Hid; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Serial")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = serial)] + #[doc = "Getter for the `serial` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/serial)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Navigator`, `Serial`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn serial(this: &Navigator) -> Serial; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Usb")] # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = usb)] #[doc = "Getter for the `usb` field of this object."] @@ -176,6 +205,18 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn xr(this: &Navigator) -> XrSystem; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Scheduling")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = scheduling)] + #[doc = "Getter for the `scheduling` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/scheduling)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Navigator`, `Scheduling`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn scheduling(this: &Navigator) -> Scheduling; # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = hardwareConcurrency)] #[doc = "Getter for the `hardwareConcurrency` field of this object."] #[doc = ""] @@ -184,6 +225,17 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] pub fn hardware_concurrency(this: &Navigator) -> f64; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = deviceMemory)] + #[doc = "Getter for the `deviceMemory` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/deviceMemory)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device_memory(this: &Navigator) -> f64; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Gpu")] # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = gpu)] #[doc = "Getter for the `gpu` field of this object."] @@ -209,49 +261,49 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/appCodeName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn app_code_name(this: &Navigator) -> Result; + pub fn app_code_name(this: &Navigator) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = appName)] #[doc = "Getter for the `appName` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/appName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn app_name(this: &Navigator) -> String; + pub fn app_name(this: &Navigator) -> ::alloc::string::String; # [wasm_bindgen (structural , catch , method , getter , js_class = "Navigator" , js_name = appVersion)] #[doc = "Getter for the `appVersion` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/appVersion)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn app_version(this: &Navigator) -> Result; + pub fn app_version(this: &Navigator) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "Navigator" , js_name = platform)] #[doc = "Getter for the `platform` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn platform(this: &Navigator) -> Result; + pub fn platform(this: &Navigator) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "Navigator" , js_name = userAgent)] #[doc = "Getter for the `userAgent` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn user_agent(this: &Navigator) -> Result; + pub fn user_agent(this: &Navigator) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = product)] #[doc = "Getter for the `product` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/product)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn product(this: &Navigator) -> String; + pub fn product(this: &Navigator) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , 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/Navigator/language)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn language(this: &Navigator) -> Option; + pub fn language(this: &Navigator) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = languages)] #[doc = "Getter for the `languages` field of this object."] #[doc = ""] @@ -259,6 +311,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] pub fn languages(this: &Navigator) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockManager")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = locks)] + #[doc = "Getter for the `locks` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/locks)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManager`, `Navigator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn locks(this: &Navigator) -> LockManager; # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = onLine)] #[doc = "Getter for the `onLine` field of this object."] #[doc = ""] @@ -275,17 +339,24 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `Navigator`, `StorageManager`*"] pub fn storage(this: &Navigator) -> StorageManager; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "NavigatorUaData")] + # [wasm_bindgen (structural , method , getter , js_class = "Navigator" , js_name = userAgentData)] + #[doc = "Getter for the `userAgentData` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Navigator`, `NavigatorUaData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn user_agent_data(this: &Navigator) -> NavigatorUaData; # [wasm_bindgen (method , structural , js_class = "Navigator" , js_name = canShare)] #[doc = "The `canShare()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/canShare)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn can_share(this: &Navigator) -> bool; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ShareData")] # [wasm_bindgen (method , structural , js_class = "Navigator" , js_name = canShare)] #[doc = "The `canShare()` method."] @@ -293,9 +364,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/canShare)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`, `ShareData`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn can_share_with_data(this: &Navigator, data: &ShareData) -> bool; # [wasm_bindgen (catch , method , structural , js_class = "Navigator" , js_name = getGamepads)] #[doc = "The `getGamepads()` method."] @@ -311,14 +379,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] pub fn get_vr_displays(this: &Navigator) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "GamepadServiceTest")] - # [wasm_bindgen (method , structural , js_class = "Navigator" , js_name = requestGamepadServiceTest)] - #[doc = "The `requestGamepadServiceTest()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/requestGamepadServiceTest)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GamepadServiceTest`, `Navigator`*"] - pub fn request_gamepad_service_test(this: &Navigator) -> GamepadServiceTest; # [wasm_bindgen (catch , method , structural , js_class = "Navigator" , js_name = requestMIDIAccess)] #[doc = "The `requestMIDIAccess()` method."] #[doc = ""] @@ -397,6 +457,17 @@ extern "C" { url: &str, data: Option<&mut [u8]>, ) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "Navigator" , js_name = sendBeacon)] + #[doc = "The `sendBeacon()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] + pub fn send_beacon_with_opt_js_u8_array( + this: &Navigator, + url: &str, + data: Option<&::js_sys::Uint8Array>, + ) -> Result; #[cfg(feature = "FormData")] # [wasm_bindgen (catch , method , structural , js_class = "Navigator" , js_name = sendBeacon)] #[doc = "The `sendBeacon()` method."] @@ -444,18 +515,13 @@ extern "C" { url: &str, data: Option<&ReadableStream>, ) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "Navigator" , js_name = share)] #[doc = "The `share()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn share(this: &Navigator) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ShareData")] # [wasm_bindgen (method , structural , js_class = "Navigator" , js_name = share)] #[doc = "The `share()` method."] @@ -463,9 +529,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`, `ShareData`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn share_with_data(this: &Navigator, data: &ShareData) -> ::js_sys::Promise; # [wasm_bindgen (method , structural , js_class = "Navigator" , js_name = vibrate)] #[doc = "The `vibrate()` method."] @@ -473,7 +536,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Navigator`*"] - pub fn vibrate_with_duration(this: &Navigator, duration: u32) -> bool; + pub fn vibrate_with_duration(this: &Navigator, pattern: u32) -> bool; # [wasm_bindgen (method , structural , js_class = "Navigator" , js_name = vibrate)] #[doc = "The `vibrate()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_NavigatorAutomationInformation.rs b/crates/web-sys/src/features/gen_NavigatorAutomationInformation.rs index c1fbff681af..730e71295ec 100644 --- a/crates/web-sys/src/features/gen_NavigatorAutomationInformation.rs +++ b/crates/web-sys/src/features/gen_NavigatorAutomationInformation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_NavigatorUaBrandVersion.rs b/crates/web-sys/src/features/gen_NavigatorUaBrandVersion.rs new file mode 100644 index 00000000000..b78201b704a --- /dev/null +++ b/crates/web-sys/src/features/gen_NavigatorUaBrandVersion.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = NavigatorUABrandVersion)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `NavigatorUaBrandVersion` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaBrandVersion`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type NavigatorUaBrandVersion; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `brand` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaBrandVersion`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "brand")] + pub fn get_brand(this: &NavigatorUaBrandVersion) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `brand` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaBrandVersion`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "brand")] + pub fn set_brand(this: &NavigatorUaBrandVersion, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaBrandVersion`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "version")] + pub fn get_version(this: &NavigatorUaBrandVersion) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaBrandVersion`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "version")] + pub fn set_version(this: &NavigatorUaBrandVersion, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl NavigatorUaBrandVersion { + #[doc = "Construct a new `NavigatorUaBrandVersion`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaBrandVersion`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_brand()` instead."] + pub fn brand(&mut self, val: &str) -> &mut Self { + self.set_brand(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_version()` instead."] + pub fn version(&mut self, val: &str) -> &mut Self { + self.set_version(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for NavigatorUaBrandVersion { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_NavigatorUaData.rs b/crates/web-sys/src/features/gen_NavigatorUaData.rs new file mode 100644 index 00000000000..c1a93668363 --- /dev/null +++ b/crates/web-sys/src/features/gen_NavigatorUaData.rs @@ -0,0 +1,78 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = NavigatorUAData , typescript_type = "NavigatorUAData")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `NavigatorUaData` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type NavigatorUaData; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "NavigatorUAData" , js_name = brands)] + #[doc = "Getter for the `brands` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/brands)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn brands(this: &NavigatorUaData) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "NavigatorUAData" , js_name = mobile)] + #[doc = "Getter for the `mobile` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/mobile)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn mobile(this: &NavigatorUaData) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "NavigatorUAData" , js_name = platform)] + #[doc = "Getter for the `platform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn platform(this: &NavigatorUaData) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "NavigatorUAData" , js_name = getHighEntropyValues)] + #[doc = "The `getHighEntropyValues()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaData`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_high_entropy_values( + this: &NavigatorUaData, + hints: &::wasm_bindgen::JsValue, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "UaLowEntropyJson")] + # [wasm_bindgen (method , structural , js_class = "NavigatorUAData" , js_name = toJSON)] + #[doc = "The `toJSON()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/toJSON)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaData`, `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn to_json(this: &NavigatorUaData) -> UaLowEntropyJson; +} diff --git a/crates/web-sys/src/features/gen_NetworkCommandOptions.rs b/crates/web-sys/src/features/gen_NetworkCommandOptions.rs index dbf06652e5d..1cb911575c8 100644 --- a/crates/web-sys/src/features/gen_NetworkCommandOptions.rs +++ b/crates/web-sys/src/features/gen_NetworkCommandOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,442 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] pub type NetworkCommandOptions; + #[doc = "Get the `cmd` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "cmd")] + pub fn get_cmd(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `cmd` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "cmd")] + pub fn set_cmd(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `curExternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "curExternalIfname")] + pub fn get_cur_external_ifname(this: &NetworkCommandOptions) + -> Option<::alloc::string::String>; + #[doc = "Change the `curExternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "curExternalIfname")] + pub fn set_cur_external_ifname(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `curInternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "curInternalIfname")] + pub fn get_cur_internal_ifname(this: &NetworkCommandOptions) + -> Option<::alloc::string::String>; + #[doc = "Change the `curInternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "curInternalIfname")] + pub fn set_cur_internal_ifname(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `dns1` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "dns1")] + pub fn get_dns1(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `dns1` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "dns1")] + pub fn set_dns1(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `dns1_long` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "dns1_long")] + pub fn get_dns1_long(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `dns1_long` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "dns1_long")] + pub fn set_dns1_long(this: &NetworkCommandOptions, val: i32); + #[doc = "Get the `dns2` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "dns2")] + pub fn get_dns2(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `dns2` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "dns2")] + pub fn set_dns2(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `dns2_long` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "dns2_long")] + pub fn get_dns2_long(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `dns2_long` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "dns2_long")] + pub fn set_dns2_long(this: &NetworkCommandOptions, val: i32); + #[doc = "Get the `dnses` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "dnses")] + pub fn get_dnses(this: &NetworkCommandOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `dnses` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "dnses")] + pub fn set_dnses(this: &NetworkCommandOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `domain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "domain")] + pub fn get_domain(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `domain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "domain")] + pub fn set_domain(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `enable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "enable")] + pub fn get_enable(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `enable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "enable")] + pub fn set_enable(this: &NetworkCommandOptions, val: bool); + #[doc = "Get the `enabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "enabled")] + pub fn get_enabled(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `enabled` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "enabled")] + pub fn set_enabled(this: &NetworkCommandOptions, val: bool); + #[doc = "Get the `endIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "endIp")] + pub fn get_end_ip(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `endIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "endIp")] + pub fn set_end_ip(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `externalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "externalIfname")] + pub fn get_external_ifname(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `externalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "externalIfname")] + pub fn set_external_ifname(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `gateway` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "gateway")] + pub fn get_gateway(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `gateway` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "gateway")] + pub fn set_gateway(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `gateway_long` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "gateway_long")] + pub fn get_gateway_long(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `gateway_long` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "gateway_long")] + pub fn set_gateway_long(this: &NetworkCommandOptions, val: i32); + #[doc = "Get the `gateways` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "gateways")] + pub fn get_gateways(this: &NetworkCommandOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `gateways` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "gateways")] + pub fn set_gateways(this: &NetworkCommandOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &NetworkCommandOptions, val: i32); + #[doc = "Get the `ifname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "ifname")] + pub fn get_ifname(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `ifname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "ifname")] + pub fn set_ifname(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `interfaceList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "interfaceList")] + pub fn get_interface_list(this: &NetworkCommandOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `interfaceList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "interfaceList")] + pub fn set_interface_list(this: &NetworkCommandOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `internalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "internalIfname")] + pub fn get_internal_ifname(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `internalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "internalIfname")] + pub fn set_internal_ifname(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `ip` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "ip")] + pub fn get_ip(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `ip` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "ip")] + pub fn set_ip(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `ipaddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "ipaddr")] + pub fn get_ipaddr(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `ipaddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "ipaddr")] + pub fn set_ipaddr(this: &NetworkCommandOptions, val: i32); + #[doc = "Get the `key` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "key")] + pub fn get_key(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `key` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "key")] + pub fn set_key(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `link` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "link")] + pub fn get_link(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `link` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "link")] + pub fn set_link(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "mask")] + pub fn get_mask(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "mask")] + pub fn set_mask(this: &NetworkCommandOptions, val: i32); + #[doc = "Get the `maskLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "maskLength")] + pub fn get_mask_length(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `maskLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "maskLength")] + pub fn set_mask_length(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `mtu` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "mtu")] + pub fn get_mtu(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `mtu` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "mtu")] + pub fn set_mtu(this: &NetworkCommandOptions, val: i32); + #[doc = "Get the `preExternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "preExternalIfname")] + pub fn get_pre_external_ifname(this: &NetworkCommandOptions) + -> Option<::alloc::string::String>; + #[doc = "Change the `preExternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "preExternalIfname")] + pub fn set_pre_external_ifname(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `preInternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "preInternalIfname")] + pub fn get_pre_internal_ifname(this: &NetworkCommandOptions) + -> Option<::alloc::string::String>; + #[doc = "Change the `preInternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "preInternalIfname")] + pub fn set_pre_internal_ifname(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `prefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "prefix")] + pub fn get_prefix(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `prefix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "prefix")] + pub fn set_prefix(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `prefixLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "prefixLength")] + pub fn get_prefix_length(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `prefixLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "prefixLength")] + pub fn set_prefix_length(this: &NetworkCommandOptions, val: u32); + #[doc = "Get the `report` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "report")] + pub fn get_report(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `report` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "report")] + pub fn set_report(this: &NetworkCommandOptions, val: bool); + #[doc = "Get the `security` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "security")] + pub fn get_security(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `security` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "security")] + pub fn set_security(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `serverIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "serverIp")] + pub fn get_server_ip(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `serverIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "serverIp")] + pub fn set_server_ip(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `ssid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "ssid")] + pub fn get_ssid(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `ssid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "ssid")] + pub fn set_ssid(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `startIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "startIp")] + pub fn get_start_ip(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `startIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "startIp")] + pub fn set_start_ip(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `threshold` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "threshold")] + pub fn get_threshold(this: &NetworkCommandOptions) -> Option; + #[doc = "Change the `threshold` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "threshold")] + pub fn set_threshold(this: &NetworkCommandOptions, val: f64); + #[doc = "Get the `usbEndIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "usbEndIp")] + pub fn get_usb_end_ip(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `usbEndIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "usbEndIp")] + pub fn set_usb_end_ip(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `usbStartIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "usbStartIp")] + pub fn get_usb_start_ip(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `usbStartIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "usbStartIp")] + pub fn set_usb_start_ip(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `wifiEndIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "wifiEndIp")] + pub fn get_wifi_end_ip(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `wifiEndIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "wifiEndIp")] + pub fn set_wifi_end_ip(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `wifiStartIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "wifiStartIp")] + pub fn get_wifi_start_ip(this: &NetworkCommandOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `wifiStartIp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "wifiStartIp")] + pub fn set_wifi_start_ip(this: &NetworkCommandOptions, val: &str); + #[doc = "Get the `wifictrlinterfacename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, getter = "wifictrlinterfacename")] + pub fn get_wifictrlinterfacename( + this: &NetworkCommandOptions, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `wifictrlinterfacename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[wasm_bindgen(method, setter = "wifictrlinterfacename")] + pub fn set_wifictrlinterfacename(this: &NetworkCommandOptions, val: &str); } impl NetworkCommandOptions { #[doc = "Construct a new `NetworkCommandOptions`."] @@ -19,665 +456,219 @@ impl NetworkCommandOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `cmd` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_cmd()` instead."] pub fn cmd(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cmd"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cmd(val); self } - #[doc = "Change the `curExternalIfname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_cur_external_ifname()` instead."] pub fn cur_external_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("curExternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cur_external_ifname(val); self } - #[doc = "Change the `curInternalIfname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_cur_internal_ifname()` instead."] pub fn cur_internal_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("curInternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cur_internal_ifname(val); self } - #[doc = "Change the `dns1` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_dns1()` instead."] pub fn dns1(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dns1"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dns1(val); self } - #[doc = "Change the `dns1_long` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_dns1_long()` instead."] pub fn dns1_long(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dns1_long"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dns1_long(val); self } - #[doc = "Change the `dns2` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_dns2()` instead."] pub fn dns2(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dns2"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dns2(val); self } - #[doc = "Change the `dns2_long` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_dns2_long()` instead."] pub fn dns2_long(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dns2_long"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dns2_long(val); self } - #[doc = "Change the `dnses` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_dnses()` instead."] pub fn dnses(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dnses"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dnses(val); self } - #[doc = "Change the `domain` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_domain()` instead."] pub fn domain(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("domain"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_domain(val); self } - #[doc = "Change the `enable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_enable()` instead."] pub fn enable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("enable"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_enable(val); self } - #[doc = "Change the `enabled` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_enabled()` instead."] pub fn enabled(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("enabled"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_enabled(val); self } - #[doc = "Change the `endIp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_end_ip()` instead."] pub fn end_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("endIp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_end_ip(val); self } - #[doc = "Change the `externalIfname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_external_ifname()` instead."] pub fn external_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("externalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_external_ifname(val); self } - #[doc = "Change the `gateway` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_gateway()` instead."] pub fn gateway(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateway"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gateway(val); self } - #[doc = "Change the `gateway_long` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_gateway_long()` instead."] pub fn gateway_long(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateway_long"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gateway_long(val); self } - #[doc = "Change the `gateways` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_gateways()` instead."] pub fn gateways(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateways"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gateways(val); self } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `ifname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_ifname()` instead."] pub fn ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ifname"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ifname(val); self } - #[doc = "Change the `interfaceList` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_interface_list()` instead."] pub fn interface_list(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("interfaceList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_interface_list(val); self } - #[doc = "Change the `internalIfname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_internal_ifname()` instead."] pub fn internal_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("internalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_internal_ifname(val); self } - #[doc = "Change the `ip` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_ip()` instead."] pub fn ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ip"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ip(val); self } - #[doc = "Change the `ipaddr` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_ipaddr()` instead."] pub fn ipaddr(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ipaddr"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ipaddr(val); self } - #[doc = "Change the `key` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_key()` instead."] pub fn key(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("key"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key(val); self } - #[doc = "Change the `link` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_link()` instead."] pub fn link(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("link"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_link(val); self } - #[doc = "Change the `mask` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_mask()` instead."] pub fn mask(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mask(val); self } - #[doc = "Change the `maskLength` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_mask_length()` instead."] pub fn mask_length(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maskLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mask_length(val); self } - #[doc = "Change the `mode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_mode()` instead."] pub fn mode(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mode(val); self } - #[doc = "Change the `mtu` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_mtu()` instead."] pub fn mtu(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mtu"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mtu(val); self } - #[doc = "Change the `preExternalIfname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_pre_external_ifname()` instead."] pub fn pre_external_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preExternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pre_external_ifname(val); self } - #[doc = "Change the `preInternalIfname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_pre_internal_ifname()` instead."] pub fn pre_internal_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preInternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pre_internal_ifname(val); self } - #[doc = "Change the `prefix` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_prefix()` instead."] pub fn prefix(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("prefix"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prefix(val); self } - #[doc = "Change the `prefixLength` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_prefix_length()` instead."] pub fn prefix_length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("prefixLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prefix_length(val); self } - #[doc = "Change the `report` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_report()` instead."] pub fn report(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("report"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_report(val); self } - #[doc = "Change the `security` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_security()` instead."] pub fn security(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("security"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_security(val); self } - #[doc = "Change the `serverIp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_server_ip()` instead."] pub fn server_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serverIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_server_ip(val); self } - #[doc = "Change the `ssid` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_ssid()` instead."] pub fn ssid(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssid(val); self } - #[doc = "Change the `startIp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_start_ip()` instead."] pub fn start_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("startIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_start_ip(val); self } - #[doc = "Change the `threshold` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_threshold()` instead."] pub fn threshold(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("threshold"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_threshold(val); self } - #[doc = "Change the `usbEndIp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_usb_end_ip()` instead."] pub fn usb_end_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usbEndIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_usb_end_ip(val); self } - #[doc = "Change the `usbStartIp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_usb_start_ip()` instead."] pub fn usb_start_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usbStartIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_usb_start_ip(val); self } - #[doc = "Change the `wifiEndIp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_wifi_end_ip()` instead."] pub fn wifi_end_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("wifiEndIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_wifi_end_ip(val); self } - #[doc = "Change the `wifiStartIp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_wifi_start_ip()` instead."] pub fn wifi_start_ip(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("wifiStartIp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_wifi_start_ip(val); self } - #[doc = "Change the `wifictrlinterfacename` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkCommandOptions`*"] + #[deprecated = "Use `set_wifictrlinterfacename()` instead."] pub fn wifictrlinterfacename(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("wifictrlinterfacename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_wifictrlinterfacename(val); self } } diff --git a/crates/web-sys/src/features/gen_NetworkInformation.rs b/crates/web-sys/src/features/gen_NetworkInformation.rs index 3669e4c774b..f46232b2c15 100644 --- a/crates/web-sys/src/features/gen_NetworkInformation.rs +++ b/crates/web-sys/src/features/gen_NetworkInformation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_NetworkResultOptions.rs b/crates/web-sys/src/features/gen_NetworkResultOptions.rs index 8e21219814d..4d508d47c06 100644 --- a/crates/web-sys/src/features/gen_NetworkResultOptions.rs +++ b/crates/web-sys/src/features/gen_NetworkResultOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,356 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] pub type NetworkResultOptions; + #[doc = "Get the `broadcast` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "broadcast")] + pub fn get_broadcast(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `broadcast` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "broadcast")] + pub fn set_broadcast(this: &NetworkResultOptions, val: bool); + #[doc = "Get the `curExternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "curExternalIfname")] + pub fn get_cur_external_ifname(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `curExternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "curExternalIfname")] + pub fn set_cur_external_ifname(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `curInternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "curInternalIfname")] + pub fn get_cur_internal_ifname(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `curInternalIfname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "curInternalIfname")] + pub fn set_cur_internal_ifname(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `dns1` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "dns1")] + pub fn get_dns1(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `dns1` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "dns1")] + pub fn set_dns1(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `dns1_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "dns1_str")] + pub fn get_dns1_str(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `dns1_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "dns1_str")] + pub fn set_dns1_str(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `dns2` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "dns2")] + pub fn get_dns2(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `dns2` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "dns2")] + pub fn set_dns2(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `dns2_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "dns2_str")] + pub fn get_dns2_str(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `dns2_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "dns2_str")] + pub fn set_dns2_str(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `enable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "enable")] + pub fn get_enable(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `enable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "enable")] + pub fn set_enable(this: &NetworkResultOptions, val: bool); + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &NetworkResultOptions, val: bool); + #[doc = "Get the `flag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "flag")] + pub fn get_flag(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `flag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "flag")] + pub fn set_flag(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `gateway` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "gateway")] + pub fn get_gateway(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `gateway` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "gateway")] + pub fn set_gateway(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `gateway_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "gateway_str")] + pub fn get_gateway_str(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `gateway_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "gateway_str")] + pub fn set_gateway_str(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `interfaceList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "interfaceList")] + pub fn get_interface_list(this: &NetworkResultOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `interfaceList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "interfaceList")] + pub fn set_interface_list(this: &NetworkResultOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `ipAddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "ipAddr")] + pub fn get_ip_addr(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `ipAddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "ipAddr")] + pub fn set_ip_addr(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `ipaddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "ipaddr")] + pub fn get_ipaddr(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `ipaddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "ipaddr")] + pub fn set_ipaddr(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `ipaddr_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "ipaddr_str")] + pub fn get_ipaddr_str(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `ipaddr_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "ipaddr_str")] + pub fn set_ipaddr_str(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `lease` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "lease")] + pub fn get_lease(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `lease` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "lease")] + pub fn set_lease(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `macAddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "macAddr")] + pub fn get_mac_addr(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `macAddr` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "macAddr")] + pub fn set_mac_addr(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "mask")] + pub fn get_mask(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `mask` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "mask")] + pub fn set_mask(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `mask_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "mask_str")] + pub fn get_mask_str(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `mask_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "mask_str")] + pub fn set_mask_str(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `netId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "netId")] + pub fn get_net_id(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `netId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "netId")] + pub fn set_net_id(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `prefixLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "prefixLength")] + pub fn get_prefix_length(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `prefixLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "prefixLength")] + pub fn set_prefix_length(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "reason")] + pub fn get_reason(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "reason")] + pub fn set_reason(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `reply` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "reply")] + pub fn get_reply(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `reply` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "reply")] + pub fn set_reply(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `result` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "result")] + pub fn get_result(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `result` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "result")] + pub fn set_result(this: &NetworkResultOptions, val: bool); + #[doc = "Get the `resultCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "resultCode")] + pub fn get_result_code(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `resultCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "resultCode")] + pub fn set_result_code(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `resultReason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "resultReason")] + pub fn get_result_reason(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `resultReason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "resultReason")] + pub fn set_result_reason(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `ret` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "ret")] + pub fn get_ret(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `ret` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "ret")] + pub fn set_ret(this: &NetworkResultOptions, val: bool); + #[doc = "Get the `route` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "route")] + pub fn get_route(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `route` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "route")] + pub fn set_route(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `server` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "server")] + pub fn get_server(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `server` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "server")] + pub fn set_server(this: &NetworkResultOptions, val: i32); + #[doc = "Get the `server_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "server_str")] + pub fn get_server_str(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `server_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "server_str")] + pub fn set_server_str(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `success` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "success")] + pub fn get_success(this: &NetworkResultOptions) -> Option; + #[doc = "Change the `success` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "success")] + pub fn set_success(this: &NetworkResultOptions, val: bool); + #[doc = "Get the `topic` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "topic")] + pub fn get_topic(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `topic` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "topic")] + pub fn set_topic(this: &NetworkResultOptions, val: &str); + #[doc = "Get the `vendor_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, getter = "vendor_str")] + pub fn get_vendor_str(this: &NetworkResultOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `vendor_str` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[wasm_bindgen(method, setter = "vendor_str")] + pub fn set_vendor_str(this: &NetworkResultOptions, val: &str); } impl NetworkResultOptions { #[doc = "Construct a new `NetworkResultOptions`."] @@ -19,533 +370,179 @@ impl NetworkResultOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `broadcast` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_broadcast()` instead."] pub fn broadcast(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("broadcast"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_broadcast(val); self } - #[doc = "Change the `curExternalIfname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_cur_external_ifname()` instead."] pub fn cur_external_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("curExternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cur_external_ifname(val); self } - #[doc = "Change the `curInternalIfname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_cur_internal_ifname()` instead."] pub fn cur_internal_ifname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("curInternalIfname"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cur_internal_ifname(val); self } - #[doc = "Change the `dns1` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_dns1()` instead."] pub fn dns1(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dns1"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dns1(val); self } - #[doc = "Change the `dns1_str` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_dns1_str()` instead."] pub fn dns1_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dns1_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dns1_str(val); self } - #[doc = "Change the `dns2` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_dns2()` instead."] pub fn dns2(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dns2"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dns2(val); self } - #[doc = "Change the `dns2_str` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_dns2_str()` instead."] pub fn dns2_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("dns2_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dns2_str(val); self } - #[doc = "Change the `enable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_enable()` instead."] pub fn enable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("enable"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_enable(val); self } - #[doc = "Change the `error` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } - #[doc = "Change the `flag` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_flag()` instead."] pub fn flag(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flag"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_flag(val); self } - #[doc = "Change the `gateway` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_gateway()` instead."] pub fn gateway(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateway"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gateway(val); self } - #[doc = "Change the `gateway_str` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_gateway_str()` instead."] pub fn gateway_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gateway_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gateway_str(val); self } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `interfaceList` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_interface_list()` instead."] pub fn interface_list(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("interfaceList"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_interface_list(val); self } - #[doc = "Change the `ipAddr` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_ip_addr()` instead."] pub fn ip_addr(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ipAddr"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ip_addr(val); self } - #[doc = "Change the `ipaddr` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_ipaddr()` instead."] pub fn ipaddr(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ipaddr"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ipaddr(val); self } - #[doc = "Change the `ipaddr_str` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_ipaddr_str()` instead."] pub fn ipaddr_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ipaddr_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ipaddr_str(val); self } - #[doc = "Change the `lease` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_lease()` instead."] pub fn lease(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("lease"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_lease(val); self } - #[doc = "Change the `macAddr` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_mac_addr()` instead."] pub fn mac_addr(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("macAddr"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mac_addr(val); self } - #[doc = "Change the `mask` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_mask()` instead."] pub fn mask(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mask"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mask(val); self } - #[doc = "Change the `mask_str` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_mask_str()` instead."] pub fn mask_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mask_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mask_str(val); self } - #[doc = "Change the `netId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_net_id()` instead."] pub fn net_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("netId"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_net_id(val); self } - #[doc = "Change the `prefixLength` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_prefix_length()` instead."] pub fn prefix_length(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("prefixLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prefix_length(val); self } - #[doc = "Change the `reason` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_reason()` instead."] pub fn reason(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_reason(val); self } - #[doc = "Change the `reply` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_reply()` instead."] pub fn reply(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reply"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_reply(val); self } - #[doc = "Change the `result` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_result()` instead."] pub fn result(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("result"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_result(val); self } - #[doc = "Change the `resultCode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_result_code()` instead."] pub fn result_code(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resultCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_result_code(val); self } - #[doc = "Change the `resultReason` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_result_reason()` instead."] pub fn result_reason(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resultReason"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_result_reason(val); self } - #[doc = "Change the `ret` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_ret()` instead."] pub fn ret(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ret"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ret(val); self } - #[doc = "Change the `route` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_route()` instead."] pub fn route(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("route"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_route(val); self } - #[doc = "Change the `server` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_server()` instead."] pub fn server(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("server"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_server(val); self } - #[doc = "Change the `server_str` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_server_str()` instead."] pub fn server_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("server_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_server_str(val); self } - #[doc = "Change the `success` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_success()` instead."] pub fn success(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("success"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_success(val); self } - #[doc = "Change the `topic` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_topic()` instead."] pub fn topic(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("topic"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_topic(val); self } - #[doc = "Change the `vendor_str` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NetworkResultOptions`*"] + #[deprecated = "Use `set_vendor_str()` instead."] pub fn vendor_str(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vendor_str"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_vendor_str(val); self } } diff --git a/crates/web-sys/src/features/gen_Node.rs b/crates/web-sys/src/features/gen_Node.rs index f9acb1f9f8a..a2a0ad51b64 100644 --- a/crates/web-sys/src/features/gen_Node.rs +++ b/crates/web-sys/src/features/gen_Node.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,14 +25,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`*"] - pub fn node_name(this: &Node) -> String; + pub fn node_name(this: &Node) -> ::alloc::string::String; # [wasm_bindgen (structural , catch , method , getter , js_class = "Node" , js_name = baseURI)] #[doc = "Getter for the `baseURI` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`*"] - pub fn base_uri(this: &Node) -> Result, JsValue>; + pub fn base_uri(this: &Node) -> Result, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = isConnected)] #[doc = "Getter for the `isConnected` field of this object."] #[doc = ""] @@ -104,7 +105,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`*"] - pub fn node_value(this: &Node) -> Option; + pub fn node_value(this: &Node) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "Node" , js_name = nodeValue)] #[doc = "Setter for the `nodeValue` field of this object."] #[doc = ""] @@ -118,7 +119,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`*"] - pub fn text_content(this: &Node) -> Option; + pub fn text_content(this: &Node) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "Node" , js_name = textContent)] #[doc = "Setter for the `textContent` field of this object."] #[doc = ""] @@ -217,14 +218,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/lookupNamespaceURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`*"] - pub fn lookup_namespace_uri(this: &Node, prefix: Option<&str>) -> Option; + pub fn lookup_namespace_uri( + this: &Node, + prefix: Option<&str>, + ) -> Option<::alloc::string::String>; # [wasm_bindgen (method , structural , js_class = "Node" , js_name = lookupPrefix)] #[doc = "The `lookupPrefix()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/lookupPrefix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`*"] - pub fn lookup_prefix(this: &Node, namespace: Option<&str>) -> Option; + pub fn lookup_prefix(this: &Node, namespace: Option<&str>) -> Option<::alloc::string::String>; # [wasm_bindgen (method , structural , js_class = "Node" , js_name = normalize)] #[doc = "The `normalize()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_NodeFilter.rs b/crates/web-sys/src/features/gen_NodeFilter.rs index 7a1d400c12e..dfc7bbf68f0 100644 --- a/crates/web-sys/src/features/gen_NodeFilter.rs +++ b/crates/web-sys/src/features/gen_NodeFilter.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NodeFilter`*"] pub type NodeFilter; + #[doc = "Get the `acceptNode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NodeFilter`*"] + #[wasm_bindgen(method, getter = "acceptNode")] + pub fn get_accept_node(this: &NodeFilter) -> Option<::js_sys::Function>; + #[doc = "Change the `acceptNode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NodeFilter`*"] + #[wasm_bindgen(method, setter = "acceptNode")] + pub fn set_accept_node(this: &NodeFilter, val: &::js_sys::Function); } impl NodeFilter { #[doc = "Construct a new `NodeFilter`."] @@ -19,21 +30,9 @@ impl NodeFilter { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `acceptNode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NodeFilter`*"] + #[deprecated = "Use `set_accept_node()` instead."] pub fn accept_node(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("acceptNode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_accept_node(val); self } } diff --git a/crates/web-sys/src/features/gen_NodeIterator.rs b/crates/web-sys/src/features/gen_NodeIterator.rs index 1e32cc05f1b..d6f90a5c29f 100644 --- a/crates/web-sys/src/features/gen_NodeIterator.rs +++ b/crates/web-sys/src/features/gen_NodeIterator.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_NodeList.rs b/crates/web-sys/src/features/gen_NodeList.rs index b3bf91ef515..21edd471cbc 100644 --- a/crates/web-sys/src/features/gen_NodeList.rs +++ b/crates/web-sys/src/features/gen_NodeList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -18,6 +19,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NodeList`*"] pub fn length(this: &NodeList) -> u32; + # [wasm_bindgen (method , structural , js_class = "NodeList" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NodeList/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NodeList`*"] + pub fn entries(this: &NodeList) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "NodeList" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NodeList`*"] + pub fn for_each(this: &NodeList, callback: &::js_sys::Function) -> Result<(), JsValue>; #[cfg(feature = "Node")] # [wasm_bindgen (method , structural , js_class = "NodeList" , js_name = item)] #[doc = "The `item()` method."] @@ -26,9 +41,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`, `NodeList`*"] pub fn item(this: &NodeList, index: u32) -> Option; + # [wasm_bindgen (method , structural , js_class = "NodeList" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NodeList/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NodeList`*"] + pub fn keys(this: &NodeList) -> ::js_sys::Iterator; + # [wasm_bindgen (method , structural , js_class = "NodeList" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NodeList/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NodeList`*"] + pub fn values(this: &NodeList) -> ::js_sys::Iterator; #[cfg(feature = "Node")] #[wasm_bindgen(method, structural, js_class = "NodeList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_Notification.rs b/crates/web-sys/src/features/gen_Notification.rs index 2d3c7717d66..b2d9394677f 100644 --- a/crates/web-sys/src/features/gen_Notification.rs +++ b/crates/web-sys/src/features/gen_Notification.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -19,6 +20,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationPermission`*"] pub fn permission() -> NotificationPermission; + # [wasm_bindgen (structural , static_method_of = Notification , getter , js_class = "Notification" , js_name = maxActions)] + #[doc = "Getter for the `maxActions` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/maxActions)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`*"] + pub fn max_actions() -> u32; # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onclick)] #[doc = "Getter for the `onclick` field of this object."] #[doc = ""] @@ -81,7 +89,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/title)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] - pub fn title(this: &Notification) -> String; + pub fn title(this: &Notification) -> ::alloc::string::String; #[cfg(feature = "NotificationDirection")] # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = dir)] #[doc = "Getter for the `dir` field of this object."] @@ -96,28 +104,70 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/lang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] - pub fn lang(this: &Notification) -> Option; + pub fn lang(this: &Notification) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = body)] #[doc = "Getter for the `body` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/body)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] - pub fn body(this: &Notification) -> Option; + pub fn body(this: &Notification) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = tag)] #[doc = "Getter for the `tag` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/tag)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] - pub fn tag(this: &Notification) -> Option; + pub fn tag(this: &Notification) -> Option<::alloc::string::String>; + # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = image)] + #[doc = "Getter for the `image` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/image)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`*"] + pub fn image(this: &Notification) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = icon)] #[doc = "Getter for the `icon` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/icon)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] - pub fn icon(this: &Notification) -> Option; + pub fn icon(this: &Notification) -> Option<::alloc::string::String>; + # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = badge)] + #[doc = "Getter for the `badge` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/badge)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`*"] + pub fn badge(this: &Notification) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = vibrate)] + #[doc = "Getter for the `vibrate` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/vibrate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`*"] + pub fn vibrate(this: &Notification) -> ::js_sys::Array; + # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = timestamp)] + #[doc = "Getter for the `timestamp` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/timestamp)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`*"] + pub fn timestamp(this: &Notification) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = renotify)] + #[doc = "Getter for the `renotify` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/renotify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`*"] + pub fn renotify(this: &Notification) -> bool; + # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = silent)] + #[doc = "Getter for the `silent` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/silent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`*"] + pub fn silent(this: &Notification) -> Option; # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = requireInteraction)] #[doc = "Getter for the `requireInteraction` field of this object."] #[doc = ""] @@ -132,6 +182,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] pub fn data(this: &Notification) -> ::wasm_bindgen::JsValue; + # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = actions)] + #[doc = "Getter for the `actions` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/actions)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`*"] + pub fn actions(this: &Notification) -> ::js_sys::Array; #[wasm_bindgen(catch, constructor, js_class = "Notification")] #[doc = "The `new Notification(..)` constructor, creating a new instance of `Notification`."] #[doc = ""] @@ -157,32 +214,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] pub fn close(this: &Notification); - # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = get)] - #[doc = "The `get()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/get)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Notification`*"] - pub fn get() -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "GetNotificationOptions")] - # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = get)] - #[doc = "The `get()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/get)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GetNotificationOptions`, `Notification`*"] - pub fn get_with_filter(filter: &GetNotificationOptions) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = requestPermission)] #[doc = "The `requestPermission()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] pub fn request_permission() -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = requestPermission)] #[doc = "The `requestPermission()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Notification`*"] pub fn request_permission_with_permission_callback( diff --git a/crates/web-sys/src/features/gen_NotificationAction.rs b/crates/web-sys/src/features/gen_NotificationAction.rs new file mode 100644 index 00000000000..61f4f408041 --- /dev/null +++ b/crates/web-sys/src/features/gen_NotificationAction.rs @@ -0,0 +1,70 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = NotificationAction)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `NotificationAction` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] + pub type NotificationAction; + #[doc = "Get the `action` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] + #[wasm_bindgen(method, getter = "action")] + pub fn get_action(this: &NotificationAction) -> ::alloc::string::String; + #[doc = "Change the `action` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] + #[wasm_bindgen(method, setter = "action")] + pub fn set_action(this: &NotificationAction, val: &str); + #[doc = "Get the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] + #[wasm_bindgen(method, getter = "icon")] + pub fn get_icon(this: &NotificationAction) -> Option<::alloc::string::String>; + #[doc = "Change the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] + #[wasm_bindgen(method, setter = "icon")] + pub fn set_icon(this: &NotificationAction, val: &str); + #[doc = "Get the `title` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] + #[wasm_bindgen(method, getter = "title")] + pub fn get_title(this: &NotificationAction) -> ::alloc::string::String; + #[doc = "Change the `title` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] + #[wasm_bindgen(method, setter = "title")] + pub fn set_title(this: &NotificationAction, val: &str); +} +impl NotificationAction { + #[doc = "Construct a new `NotificationAction`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"] + pub fn new(action: &str, title: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_action(action); + ret.set_title(title); + ret + } + #[deprecated = "Use `set_action()` instead."] + pub fn action(&mut self, val: &str) -> &mut Self { + self.set_action(val); + self + } + #[deprecated = "Use `set_icon()` instead."] + pub fn icon(&mut self, val: &str) -> &mut Self { + self.set_icon(val); + self + } + #[deprecated = "Use `set_title()` instead."] + pub fn title(&mut self, val: &str) -> &mut Self { + self.set_title(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_NotificationBehavior.rs b/crates/web-sys/src/features/gen_NotificationBehavior.rs deleted file mode 100644 index bfd54b22e8b..00000000000 --- a/crates/web-sys/src/features/gen_NotificationBehavior.rs +++ /dev/null @@ -1,112 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = NotificationBehavior)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `NotificationBehavior` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationBehavior`*"] - pub type NotificationBehavior; -} -impl NotificationBehavior { - #[doc = "Construct a new `NotificationBehavior`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationBehavior`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `noclear` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationBehavior`*"] - pub fn noclear(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noclear"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `noscreen` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationBehavior`*"] - pub fn noscreen(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("noscreen"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `showOnlyOnce` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationBehavior`*"] - pub fn show_only_once(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("showOnlyOnce"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `soundFile` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationBehavior`*"] - pub fn sound_file(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("soundFile"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `vibrationPattern` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationBehavior`*"] - pub fn vibration_pattern(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vibrationPattern"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for NotificationBehavior { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_NotificationDirection.rs b/crates/web-sys/src/features/gen_NotificationDirection.rs index 6af832627b7..861eadfe8fe 100644 --- a/crates/web-sys/src/features/gen_NotificationDirection.rs +++ b/crates/web-sys/src/features/gen_NotificationDirection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `NotificationDirection` enum."] diff --git a/crates/web-sys/src/features/gen_NotificationEvent.rs b/crates/web-sys/src/features/gen_NotificationEvent.rs index d3c962d87e4..99d8ea14554 100644 --- a/crates/web-sys/src/features/gen_NotificationEvent.rs +++ b/crates/web-sys/src/features/gen_NotificationEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_NotificationEventInit.rs b/crates/web-sys/src/features/gen_NotificationEventInit.rs index 270f9fd52bf..0cc86bacbfe 100644 --- a/crates/web-sys/src/features/gen_NotificationEventInit.rs +++ b/crates/web-sys/src/features/gen_NotificationEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] pub type NotificationEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &NotificationEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &NotificationEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &NotificationEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &NotificationEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &NotificationEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &NotificationEventInit, val: bool); + #[cfg(feature = "Notification")] + #[doc = "Get the `notification` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationEventInit`*"] + #[wasm_bindgen(method, getter = "notification")] + pub fn get_notification(this: &NotificationEventInit) -> Notification; + #[cfg(feature = "Notification")] + #[doc = "Change the `notification` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationEventInit`*"] + #[wasm_bindgen(method, setter = "notification")] + pub fn set_notification(this: &NotificationEventInit, val: &Notification); } impl NotificationEventInit { #[cfg(feature = "Notification")] @@ -18,76 +61,28 @@ impl NotificationEventInit { pub fn new(notification: &Notification) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.notification(notification); + ret.set_notification(notification); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "Notification")] - #[doc = "Change the `notification` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationEventInit`*"] + #[deprecated = "Use `set_notification()` instead."] pub fn notification(&mut self, val: &Notification) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("notification"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_notification(val); self } } diff --git a/crates/web-sys/src/features/gen_NotificationOptions.rs b/crates/web-sys/src/features/gen_NotificationOptions.rs index 97d49a30296..96a3472919d 100644 --- a/crates/web-sys/src/features/gen_NotificationOptions.rs +++ b/crates/web-sys/src/features/gen_NotificationOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,148 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] pub type NotificationOptions; + #[doc = "Get the `actions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "actions")] + pub fn get_actions(this: &NotificationOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `actions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "actions")] + pub fn set_actions(this: &NotificationOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `badge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "badge")] + pub fn get_badge(this: &NotificationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `badge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "badge")] + pub fn set_badge(this: &NotificationOptions, val: &str); + #[doc = "Get the `body` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "body")] + pub fn get_body(this: &NotificationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `body` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "body")] + pub fn set_body(this: &NotificationOptions, val: &str); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &NotificationOptions) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &NotificationOptions, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "NotificationDirection")] + #[doc = "Get the `dir` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationDirection`, `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "dir")] + pub fn get_dir(this: &NotificationOptions) -> Option; + #[cfg(feature = "NotificationDirection")] + #[doc = "Change the `dir` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationDirection`, `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "dir")] + pub fn set_dir(this: &NotificationOptions, val: NotificationDirection); + #[doc = "Get the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "icon")] + pub fn get_icon(this: &NotificationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "icon")] + pub fn set_icon(this: &NotificationOptions, val: &str); + #[doc = "Get the `image` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "image")] + pub fn get_image(this: &NotificationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `image` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "image")] + pub fn set_image(this: &NotificationOptions, val: &str); + #[doc = "Get the `lang` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "lang")] + pub fn get_lang(this: &NotificationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `lang` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "lang")] + pub fn set_lang(this: &NotificationOptions, val: &str); + #[doc = "Get the `renotify` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "renotify")] + pub fn get_renotify(this: &NotificationOptions) -> Option; + #[doc = "Change the `renotify` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "renotify")] + pub fn set_renotify(this: &NotificationOptions, val: bool); + #[doc = "Get the `requireInteraction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "requireInteraction")] + pub fn get_require_interaction(this: &NotificationOptions) -> Option; + #[doc = "Change the `requireInteraction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "requireInteraction")] + pub fn set_require_interaction(this: &NotificationOptions, val: bool); + #[doc = "Get the `silent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "silent")] + pub fn get_silent(this: &NotificationOptions) -> Option; + #[doc = "Change the `silent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "silent")] + pub fn set_silent(this: &NotificationOptions, val: Option); + #[doc = "Get the `tag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "tag")] + pub fn get_tag(this: &NotificationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `tag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "tag")] + pub fn set_tag(this: &NotificationOptions, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &NotificationOptions) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &NotificationOptions, val: f64); + #[doc = "Get the `vibrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, getter = "vibrate")] + pub fn get_vibrate(this: &NotificationOptions) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `vibrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[wasm_bindgen(method, setter = "vibrate")] + pub fn set_vibrate(this: &NotificationOptions, val: &::wasm_bindgen::JsValue); } impl NotificationOptions { #[doc = "Construct a new `NotificationOptions`."] @@ -19,100 +162,75 @@ impl NotificationOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `body` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[deprecated = "Use `set_actions()` instead."] + pub fn actions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_actions(val); + self + } + #[deprecated = "Use `set_badge()` instead."] + pub fn badge(&mut self, val: &str) -> &mut Self { + self.set_badge(val); + self + } + #[deprecated = "Use `set_body()` instead."] pub fn body(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("body"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_body(val); self } - #[doc = "Change the `data` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[deprecated = "Use `set_data()` instead."] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_data(val); self } #[cfg(feature = "NotificationDirection")] - #[doc = "Change the `dir` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationDirection`, `NotificationOptions`*"] + #[deprecated = "Use `set_dir()` instead."] pub fn dir(&mut self, val: NotificationDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dir"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dir(val); self } - #[doc = "Change the `icon` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[deprecated = "Use `set_icon()` instead."] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_icon(val); self } - #[doc = "Change the `lang` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[deprecated = "Use `set_image()` instead."] + pub fn image(&mut self, val: &str) -> &mut Self { + self.set_image(val); + self + } + #[deprecated = "Use `set_lang()` instead."] pub fn lang(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("lang"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_lang(val); self } - #[doc = "Change the `requireInteraction` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[deprecated = "Use `set_renotify()` instead."] + pub fn renotify(&mut self, val: bool) -> &mut Self { + self.set_renotify(val); + self + } + #[deprecated = "Use `set_require_interaction()` instead."] pub fn require_interaction(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requireInteraction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_require_interaction(val); self } - #[doc = "Change the `tag` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"] + #[deprecated = "Use `set_silent()` instead."] + pub fn silent(&mut self, val: Option) -> &mut Self { + self.set_silent(val); + self + } + #[deprecated = "Use `set_tag()` instead."] pub fn tag(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tag"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_tag(val); + self + } + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } + #[deprecated = "Use `set_vibrate()` instead."] + pub fn vibrate(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_vibrate(val); self } } diff --git a/crates/web-sys/src/features/gen_NotificationPermission.rs b/crates/web-sys/src/features/gen_NotificationPermission.rs index 33530560e1e..35a4b8a59c5 100644 --- a/crates/web-sys/src/features/gen_NotificationPermission.rs +++ b/crates/web-sys/src/features/gen_NotificationPermission.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `NotificationPermission` enum."] diff --git a/crates/web-sys/src/features/gen_ObserverCallback.rs b/crates/web-sys/src/features/gen_ObserverCallback.rs index cdcc82dd9de..8fa10f9d7da 100644 --- a/crates/web-sys/src/features/gen_ObserverCallback.rs +++ b/crates/web-sys/src/features/gen_ObserverCallback.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`*"] pub type ObserverCallback; + #[doc = "Get the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`*"] + #[wasm_bindgen(method, getter = "handleEvent")] + pub fn get_handle_event(this: &ObserverCallback) -> Option<::js_sys::Function>; + #[doc = "Change the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`*"] + #[wasm_bindgen(method, setter = "handleEvent")] + pub fn set_handle_event(this: &ObserverCallback, val: &::js_sys::Function); } impl ObserverCallback { #[doc = "Construct a new `ObserverCallback`."] @@ -19,21 +30,9 @@ impl ObserverCallback { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `handleEvent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`*"] + #[deprecated = "Use `set_handle_event()` instead."] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_handle_event(val); self } } diff --git a/crates/web-sys/src/features/gen_OesElementIndexUint.rs b/crates/web-sys/src/features/gen_OesElementIndexUint.rs index aebb731715a..c7af2019b4f 100644 --- a/crates/web-sys/src/features/gen_OesElementIndexUint.rs +++ b/crates/web-sys/src/features/gen_OesElementIndexUint.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OesStandardDerivatives.rs b/crates/web-sys/src/features/gen_OesStandardDerivatives.rs index 8b1324e149e..51beb6438f2 100644 --- a/crates/web-sys/src/features/gen_OesStandardDerivatives.rs +++ b/crates/web-sys/src/features/gen_OesStandardDerivatives.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OesTextureFloat.rs b/crates/web-sys/src/features/gen_OesTextureFloat.rs index d30aa42d4b2..767a3e32f1b 100644 --- a/crates/web-sys/src/features/gen_OesTextureFloat.rs +++ b/crates/web-sys/src/features/gen_OesTextureFloat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OesTextureFloatLinear.rs b/crates/web-sys/src/features/gen_OesTextureFloatLinear.rs index 61763001ecc..ab2fc0668dc 100644 --- a/crates/web-sys/src/features/gen_OesTextureFloatLinear.rs +++ b/crates/web-sys/src/features/gen_OesTextureFloatLinear.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OesTextureHalfFloat.rs b/crates/web-sys/src/features/gen_OesTextureHalfFloat.rs index ae24073a45c..13b33fc94eb 100644 --- a/crates/web-sys/src/features/gen_OesTextureHalfFloat.rs +++ b/crates/web-sys/src/features/gen_OesTextureHalfFloat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OesTextureHalfFloatLinear.rs b/crates/web-sys/src/features/gen_OesTextureHalfFloatLinear.rs index b96e67ef260..00b9fb70a64 100644 --- a/crates/web-sys/src/features/gen_OesTextureHalfFloatLinear.rs +++ b/crates/web-sys/src/features/gen_OesTextureHalfFloatLinear.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OesVertexArrayObject.rs b/crates/web-sys/src/features/gen_OesVertexArrayObject.rs index 0aec22fef97..57130833e19 100644 --- a/crates/web-sys/src/features/gen_OesVertexArrayObject.rs +++ b/crates/web-sys/src/features/gen_OesVertexArrayObject.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OfflineAudioCompletionEvent.rs b/crates/web-sys/src/features/gen_OfflineAudioCompletionEvent.rs index b4a36f31280..0da6735f58e 100644 --- a/crates/web-sys/src/features/gen_OfflineAudioCompletionEvent.rs +++ b/crates/web-sys/src/features/gen_OfflineAudioCompletionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OfflineAudioCompletionEventInit.rs b/crates/web-sys/src/features/gen_OfflineAudioCompletionEventInit.rs index e3d202129bb..1d123058e01 100644 --- a/crates/web-sys/src/features/gen_OfflineAudioCompletionEventInit.rs +++ b/crates/web-sys/src/features/gen_OfflineAudioCompletionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] pub type OfflineAudioCompletionEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &OfflineAudioCompletionEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &OfflineAudioCompletionEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &OfflineAudioCompletionEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &OfflineAudioCompletionEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &OfflineAudioCompletionEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &OfflineAudioCompletionEventInit, val: bool); + #[cfg(feature = "AudioBuffer")] + #[doc = "Get the `renderedBuffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `OfflineAudioCompletionEventInit`*"] + #[wasm_bindgen(method, getter = "renderedBuffer")] + pub fn get_rendered_buffer(this: &OfflineAudioCompletionEventInit) -> AudioBuffer; + #[cfg(feature = "AudioBuffer")] + #[doc = "Change the `renderedBuffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `OfflineAudioCompletionEventInit`*"] + #[wasm_bindgen(method, setter = "renderedBuffer")] + pub fn set_rendered_buffer(this: &OfflineAudioCompletionEventInit, val: &AudioBuffer); } impl OfflineAudioCompletionEventInit { #[cfg(feature = "AudioBuffer")] @@ -18,76 +61,28 @@ impl OfflineAudioCompletionEventInit { pub fn new(rendered_buffer: &AudioBuffer) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.rendered_buffer(rendered_buffer); + ret.set_rendered_buffer(rendered_buffer); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OfflineAudioCompletionEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "AudioBuffer")] - #[doc = "Change the `renderedBuffer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `OfflineAudioCompletionEventInit`*"] + #[deprecated = "Use `set_rendered_buffer()` instead."] pub fn rendered_buffer(&mut self, val: &AudioBuffer) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("renderedBuffer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rendered_buffer(val); self } } diff --git a/crates/web-sys/src/features/gen_OfflineAudioContext.rs b/crates/web-sys/src/features/gen_OfflineAudioContext.rs index ecaba2102c3..6d535cea967 100644 --- a/crates/web-sys/src/features/gen_OfflineAudioContext.rs +++ b/crates/web-sys/src/features/gen_OfflineAudioContext.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -294,6 +295,42 @@ extern "C" { real: &mut [f32], imag: &mut [f32], ) -> Result; + #[cfg(feature = "PeriodicWave")] + # [wasm_bindgen (catch , method , structural , js_class = "OfflineAudioContext" , js_name = createPeriodicWave)] + #[doc = "The `createPeriodicWave()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext/createPeriodicWave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContext`, `PeriodicWave`*"] + pub fn create_periodic_wave_with_f32_array_and_f32_slice( + this: &OfflineAudioContext, + real: &::js_sys::Float32Array, + imag: &mut [f32], + ) -> Result; + #[cfg(feature = "PeriodicWave")] + # [wasm_bindgen (catch , method , structural , js_class = "OfflineAudioContext" , js_name = createPeriodicWave)] + #[doc = "The `createPeriodicWave()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext/createPeriodicWave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContext`, `PeriodicWave`*"] + pub fn create_periodic_wave_with_f32_slice_and_f32_array( + this: &OfflineAudioContext, + real: &mut [f32], + imag: &::js_sys::Float32Array, + ) -> Result; + #[cfg(feature = "PeriodicWave")] + # [wasm_bindgen (catch , method , structural , js_class = "OfflineAudioContext" , js_name = createPeriodicWave)] + #[doc = "The `createPeriodicWave()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext/createPeriodicWave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContext`, `PeriodicWave`*"] + pub fn create_periodic_wave_with_f32_array_and_f32_array( + this: &OfflineAudioContext, + real: &::js_sys::Float32Array, + imag: &::js_sys::Float32Array, + ) -> Result; #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))] # [wasm_bindgen (catch , method , structural , js_class = "OfflineAudioContext" , js_name = createPeriodicWave)] #[doc = "The `createPeriodicWave()` method."] @@ -307,6 +344,45 @@ extern "C" { imag: &mut [f32], constraints: &PeriodicWaveConstraints, ) -> Result; + #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))] + # [wasm_bindgen (catch , method , structural , js_class = "OfflineAudioContext" , js_name = createPeriodicWave)] + #[doc = "The `createPeriodicWave()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext/createPeriodicWave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"] + pub fn create_periodic_wave_with_f32_array_and_f32_slice_and_constraints( + this: &OfflineAudioContext, + real: &::js_sys::Float32Array, + imag: &mut [f32], + constraints: &PeriodicWaveConstraints, + ) -> Result; + #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))] + # [wasm_bindgen (catch , method , structural , js_class = "OfflineAudioContext" , js_name = createPeriodicWave)] + #[doc = "The `createPeriodicWave()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext/createPeriodicWave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"] + pub fn create_periodic_wave_with_f32_slice_and_f32_array_and_constraints( + this: &OfflineAudioContext, + real: &mut [f32], + imag: &::js_sys::Float32Array, + constraints: &PeriodicWaveConstraints, + ) -> Result; + #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))] + # [wasm_bindgen (catch , method , structural , js_class = "OfflineAudioContext" , js_name = createPeriodicWave)] + #[doc = "The `createPeriodicWave()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext/createPeriodicWave)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"] + pub fn create_periodic_wave_with_f32_array_and_f32_array_and_constraints( + this: &OfflineAudioContext, + real: &::js_sys::Float32Array, + imag: &::js_sys::Float32Array, + constraints: &PeriodicWaveConstraints, + ) -> Result; #[cfg(feature = "ScriptProcessorNode")] # [wasm_bindgen (catch , method , structural , js_class = "OfflineAudioContext" , js_name = createScriptProcessor)] #[doc = "The `createScriptProcessor()` method."] diff --git a/crates/web-sys/src/features/gen_OfflineAudioContextOptions.rs b/crates/web-sys/src/features/gen_OfflineAudioContextOptions.rs index ab1cf57dfbf..db91b726dcb 100644 --- a/crates/web-sys/src/features/gen_OfflineAudioContextOptions.rs +++ b/crates/web-sys/src/features/gen_OfflineAudioContextOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] pub type OfflineAudioContextOptions; + #[doc = "Get the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] + #[wasm_bindgen(method, getter = "length")] + pub fn get_length(this: &OfflineAudioContextOptions) -> u32; + #[doc = "Change the `length` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] + #[wasm_bindgen(method, setter = "length")] + pub fn set_length(this: &OfflineAudioContextOptions, val: u32); + #[doc = "Get the `numberOfChannels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] + #[wasm_bindgen(method, getter = "numberOfChannels")] + pub fn get_number_of_channels(this: &OfflineAudioContextOptions) -> Option; + #[doc = "Change the `numberOfChannels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] + #[wasm_bindgen(method, setter = "numberOfChannels")] + pub fn set_number_of_channels(this: &OfflineAudioContextOptions, val: u32); + #[doc = "Get the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] + #[wasm_bindgen(method, getter = "sampleRate")] + pub fn get_sample_rate(this: &OfflineAudioContextOptions) -> f32; + #[doc = "Change the `sampleRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] + #[wasm_bindgen(method, setter = "sampleRate")] + pub fn set_sample_rate(this: &OfflineAudioContextOptions, val: f32); } impl OfflineAudioContextOptions { #[doc = "Construct a new `OfflineAudioContextOptions`."] @@ -17,56 +48,23 @@ impl OfflineAudioContextOptions { 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.set_length(length); + ret.set_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: `OfflineAudioContextOptions`*"] + #[deprecated = "Use `set_length()` instead."] 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.set_length(val); self } - #[doc = "Change the `numberOfChannels` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] + #[deprecated = "Use `set_number_of_channels()` instead."] 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.set_number_of_channels(val); self } - #[doc = "Change the `sampleRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"] + #[deprecated = "Use `set_sample_rate()` instead."] 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.set_sample_rate(val); self } } diff --git a/crates/web-sys/src/features/gen_OfflineResourceList.rs b/crates/web-sys/src/features/gen_OfflineResourceList.rs index e3ccd3732fe..adf60ce9c21 100644 --- a/crates/web-sys/src/features/gen_OfflineResourceList.rs +++ b/crates/web-sys/src/features/gen_OfflineResourceList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OffscreenCanvas.rs b/crates/web-sys/src/features/gen_OffscreenCanvas.rs index bcf85992191..e925b0e1294 100644 --- a/crates/web-sys/src/features/gen_OffscreenCanvas.rs +++ b/crates/web-sys/src/features/gen_OffscreenCanvas.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -46,6 +47,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"] pub fn new(width: u32, height: u32) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = convertToBlob)] + #[doc = "The `convertToBlob()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/convertToBlob)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"] + pub fn convert_to_blob(this: &OffscreenCanvas) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "ImageEncodeOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = convertToBlob)] + #[doc = "The `convertToBlob()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/convertToBlob)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageEncodeOptions`, `OffscreenCanvas`*"] + pub fn convert_to_blob_with_options( + this: &OffscreenCanvas, + options: &ImageEncodeOptions, + ) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = getContext)] #[doc = "The `getContext()` method."] #[doc = ""] @@ -67,34 +86,6 @@ extern "C" { context_id: &str, context_options: &::wasm_bindgen::JsValue, ) -> Result, JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = toBlob)] - #[doc = "The `toBlob()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/toBlob)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"] - pub fn to_blob(this: &OffscreenCanvas) -> Result<::js_sys::Promise, JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = toBlob)] - #[doc = "The `toBlob()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/toBlob)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"] - pub fn to_blob_with_type( - this: &OffscreenCanvas, - type_: &str, - ) -> Result<::js_sys::Promise, JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = toBlob)] - #[doc = "The `toBlob()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/toBlob)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`*"] - pub fn to_blob_with_type_and_encoder_options( - this: &OffscreenCanvas, - type_: &str, - encoder_options: &::wasm_bindgen::JsValue, - ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvas" , js_name = transferToImageBitmap)] #[doc = "The `transferToImageBitmap()` method."] diff --git a/crates/web-sys/src/features/gen_OffscreenCanvasRenderingContext2d.rs b/crates/web-sys/src/features/gen_OffscreenCanvasRenderingContext2d.rs new file mode 100644 index 00000000000..7b756a15e59 --- /dev/null +++ b/crates/web-sys/src/features/gen_OffscreenCanvasRenderingContext2d.rs @@ -0,0 +1,1457 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = OffscreenCanvasRenderingContext2D , typescript_type = "OffscreenCanvasRenderingContext2D")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `OffscreenCanvasRenderingContext2d` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub type OffscreenCanvasRenderingContext2d; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = canvas)] + #[doc = "Getter for the `canvas` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/canvas)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `OffscreenCanvasRenderingContext2d`*"] + pub fn canvas(this: &OffscreenCanvasRenderingContext2d) -> OffscreenCanvas; + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = globalAlpha)] + #[doc = "Getter for the `globalAlpha` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/globalAlpha)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn global_alpha(this: &OffscreenCanvasRenderingContext2d) -> f64; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = globalAlpha)] + #[doc = "Setter for the `globalAlpha` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/globalAlpha)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_global_alpha(this: &OffscreenCanvasRenderingContext2d, value: f64); + # [wasm_bindgen (structural , catch , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = globalCompositeOperation)] + #[doc = "Getter for the `globalCompositeOperation` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/globalCompositeOperation)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn global_composite_operation( + this: &OffscreenCanvasRenderingContext2d, + ) -> Result<::alloc::string::String, JsValue>; + # [wasm_bindgen (structural , catch , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = globalCompositeOperation)] + #[doc = "Setter for the `globalCompositeOperation` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/globalCompositeOperation)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_global_composite_operation( + this: &OffscreenCanvasRenderingContext2d, + value: &str, + ) -> Result<(), JsValue>; + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyle)] + #[doc = "Getter for the `strokeStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn stroke_style(this: &OffscreenCanvasRenderingContext2d) -> ::wasm_bindgen::JsValue; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyle)] + #[doc = "Setter for the `strokeStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + #[deprecated] + pub fn set_stroke_style( + this: &OffscreenCanvasRenderingContext2d, + value: &::wasm_bindgen::JsValue, + ); + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyle)] + #[doc = "Setter for the `strokeStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_stroke_style_str(this: &OffscreenCanvasRenderingContext2d, value: &str); + #[cfg(feature = "CanvasGradient")] + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyle)] + #[doc = "Setter for the `strokeStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `OffscreenCanvasRenderingContext2d`*"] + pub fn set_stroke_style_canvas_gradient( + this: &OffscreenCanvasRenderingContext2d, + value: &CanvasGradient, + ); + #[cfg(feature = "CanvasPattern")] + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeStyle)] + #[doc = "Setter for the `strokeStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `OffscreenCanvasRenderingContext2d`*"] + pub fn set_stroke_style_canvas_pattern( + this: &OffscreenCanvasRenderingContext2d, + value: &CanvasPattern, + ); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyle)] + #[doc = "Getter for the `fillStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn fill_style(this: &OffscreenCanvasRenderingContext2d) -> ::wasm_bindgen::JsValue; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyle)] + #[doc = "Setter for the `fillStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + #[deprecated] + pub fn set_fill_style( + this: &OffscreenCanvasRenderingContext2d, + value: &::wasm_bindgen::JsValue, + ); + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyle)] + #[doc = "Setter for the `fillStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_fill_style_str(this: &OffscreenCanvasRenderingContext2d, value: &str); + #[cfg(feature = "CanvasGradient")] + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyle)] + #[doc = "Setter for the `fillStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `OffscreenCanvasRenderingContext2d`*"] + pub fn set_fill_style_canvas_gradient( + this: &OffscreenCanvasRenderingContext2d, + value: &CanvasGradient, + ); + #[cfg(feature = "CanvasPattern")] + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillStyle)] + #[doc = "Setter for the `fillStyle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillStyle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `OffscreenCanvasRenderingContext2d`*"] + pub fn set_fill_style_canvas_pattern( + this: &OffscreenCanvasRenderingContext2d, + value: &CanvasPattern, + ); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = filter)] + #[doc = "Getter for the `filter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/filter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn filter(this: &OffscreenCanvasRenderingContext2d) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = filter)] + #[doc = "Setter for the `filter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/filter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_filter(this: &OffscreenCanvasRenderingContext2d, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = imageSmoothingEnabled)] + #[doc = "Getter for the `imageSmoothingEnabled` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/imageSmoothingEnabled)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn image_smoothing_enabled(this: &OffscreenCanvasRenderingContext2d) -> bool; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = imageSmoothingEnabled)] + #[doc = "Setter for the `imageSmoothingEnabled` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/imageSmoothingEnabled)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_image_smoothing_enabled(this: &OffscreenCanvasRenderingContext2d, value: bool); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineWidth)] + #[doc = "Getter for the `lineWidth` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineWidth)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn line_width(this: &OffscreenCanvasRenderingContext2d) -> f64; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineWidth)] + #[doc = "Setter for the `lineWidth` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineWidth)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_line_width(this: &OffscreenCanvasRenderingContext2d, value: f64); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineCap)] + #[doc = "Getter for the `lineCap` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineCap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn line_cap(this: &OffscreenCanvasRenderingContext2d) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineCap)] + #[doc = "Setter for the `lineCap` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineCap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_line_cap(this: &OffscreenCanvasRenderingContext2d, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineJoin)] + #[doc = "Getter for the `lineJoin` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineJoin)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn line_join(this: &OffscreenCanvasRenderingContext2d) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineJoin)] + #[doc = "Setter for the `lineJoin` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineJoin)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_line_join(this: &OffscreenCanvasRenderingContext2d, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = miterLimit)] + #[doc = "Getter for the `miterLimit` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/miterLimit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn miter_limit(this: &OffscreenCanvasRenderingContext2d) -> f64; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = miterLimit)] + #[doc = "Setter for the `miterLimit` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/miterLimit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_miter_limit(this: &OffscreenCanvasRenderingContext2d, value: f64); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineDashOffset)] + #[doc = "Getter for the `lineDashOffset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineDashOffset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn line_dash_offset(this: &OffscreenCanvasRenderingContext2d) -> f64; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineDashOffset)] + #[doc = "Setter for the `lineDashOffset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineDashOffset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_line_dash_offset(this: &OffscreenCanvasRenderingContext2d, value: f64); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = shadowOffsetX)] + #[doc = "Getter for the `shadowOffsetX` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/shadowOffsetX)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn shadow_offset_x(this: &OffscreenCanvasRenderingContext2d) -> f64; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = shadowOffsetX)] + #[doc = "Setter for the `shadowOffsetX` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/shadowOffsetX)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_shadow_offset_x(this: &OffscreenCanvasRenderingContext2d, value: f64); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = shadowOffsetY)] + #[doc = "Getter for the `shadowOffsetY` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/shadowOffsetY)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn shadow_offset_y(this: &OffscreenCanvasRenderingContext2d) -> f64; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = shadowOffsetY)] + #[doc = "Setter for the `shadowOffsetY` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/shadowOffsetY)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_shadow_offset_y(this: &OffscreenCanvasRenderingContext2d, value: f64); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = shadowBlur)] + #[doc = "Getter for the `shadowBlur` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/shadowBlur)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn shadow_blur(this: &OffscreenCanvasRenderingContext2d) -> f64; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = shadowBlur)] + #[doc = "Setter for the `shadowBlur` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/shadowBlur)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_shadow_blur(this: &OffscreenCanvasRenderingContext2d, value: f64); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = shadowColor)] + #[doc = "Getter for the `shadowColor` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/shadowColor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn shadow_color(this: &OffscreenCanvasRenderingContext2d) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = shadowColor)] + #[doc = "Setter for the `shadowColor` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/shadowColor)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_shadow_color(this: &OffscreenCanvasRenderingContext2d, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = font)] + #[doc = "Getter for the `font` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/font)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn font(this: &OffscreenCanvasRenderingContext2d) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = font)] + #[doc = "Setter for the `font` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/font)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_font(this: &OffscreenCanvasRenderingContext2d, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = textAlign)] + #[doc = "Getter for the `textAlign` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/textAlign)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn text_align(this: &OffscreenCanvasRenderingContext2d) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = textAlign)] + #[doc = "Setter for the `textAlign` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/textAlign)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_text_align(this: &OffscreenCanvasRenderingContext2d, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = textBaseline)] + #[doc = "Getter for the `textBaseline` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/textBaseline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn text_baseline(this: &OffscreenCanvasRenderingContext2d) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "OffscreenCanvasRenderingContext2D" , js_name = textBaseline)] + #[doc = "Setter for the `textBaseline` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/textBaseline)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_text_baseline(this: &OffscreenCanvasRenderingContext2d, value: &str); + #[cfg(feature = "HtmlImageElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_image_element( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlImageElement, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "SvgImageElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `SvgImageElement`*"] + pub fn draw_image_with_svg_image_element( + this: &OffscreenCanvasRenderingContext2d, + image: &SvgImageElement, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "HtmlCanvasElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_canvas_element( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlCanvasElement, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "HtmlVideoElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_video_element( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlVideoElement, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "ImageBitmap")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_image_bitmap( + this: &OffscreenCanvasRenderingContext2d, + image: &ImageBitmap, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_offscreen_canvas( + this: &OffscreenCanvasRenderingContext2d, + image: &OffscreenCanvas, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_image_with_video_frame( + this: &OffscreenCanvasRenderingContext2d, + image: &VideoFrame, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "HtmlImageElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_image_element_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlImageElement, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "SvgImageElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `SvgImageElement`*"] + pub fn draw_image_with_svg_image_element_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &SvgImageElement, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "HtmlCanvasElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_canvas_element_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlCanvasElement, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "HtmlVideoElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_video_element_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlVideoElement, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "ImageBitmap")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_image_bitmap_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &ImageBitmap, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_offscreen_canvas_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &OffscreenCanvas, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_image_with_video_frame_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &VideoFrame, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "HtmlImageElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_image_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlImageElement, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "SvgImageElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `SvgImageElement`*"] + pub fn draw_image_with_svg_image_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &SvgImageElement, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "HtmlCanvasElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_canvas_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlCanvasElement, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "HtmlVideoElement")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_html_video_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlVideoElement, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "ImageBitmap")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_image_bitmap_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &ImageBitmap, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `OffscreenCanvasRenderingContext2d`*"] + pub fn draw_image_with_offscreen_canvas_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &OffscreenCanvas, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = drawImage)] + #[doc = "The `drawImage()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/drawImage)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draw_image_with_video_frame_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( + this: &OffscreenCanvasRenderingContext2d, + image: &VideoFrame, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + dx: f64, + dy: f64, + dw: f64, + dh: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = beginPath)] + #[doc = "The `beginPath()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/beginPath)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn begin_path(this: &OffscreenCanvasRenderingContext2d); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = clip)] + #[doc = "The `clip()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/clip)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn clip(this: &OffscreenCanvasRenderingContext2d); + #[cfg(feature = "CanvasWindingRule")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = clip)] + #[doc = "The `clip()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/clip)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasWindingRule`, `OffscreenCanvasRenderingContext2d`*"] + pub fn clip_with_canvas_winding_rule( + this: &OffscreenCanvasRenderingContext2d, + winding: CanvasWindingRule, + ); + #[cfg(feature = "Path2d")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = clip)] + #[doc = "The `clip()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/clip)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `Path2d`*"] + pub fn clip_with_path_2d(this: &OffscreenCanvasRenderingContext2d, path: &Path2d); + #[cfg(all(feature = "CanvasWindingRule", feature = "Path2d",))] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = clip)] + #[doc = "The `clip()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/clip)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasWindingRule`, `OffscreenCanvasRenderingContext2d`, `Path2d`*"] + pub fn clip_with_path_2d_and_winding( + this: &OffscreenCanvasRenderingContext2d, + path: &Path2d, + winding: CanvasWindingRule, + ); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fill)] + #[doc = "The `fill()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fill)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn fill(this: &OffscreenCanvasRenderingContext2d); + #[cfg(feature = "CanvasWindingRule")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fill)] + #[doc = "The `fill()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fill)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasWindingRule`, `OffscreenCanvasRenderingContext2d`*"] + pub fn fill_with_canvas_winding_rule( + this: &OffscreenCanvasRenderingContext2d, + winding: CanvasWindingRule, + ); + #[cfg(feature = "Path2d")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fill)] + #[doc = "The `fill()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fill)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `Path2d`*"] + pub fn fill_with_path_2d(this: &OffscreenCanvasRenderingContext2d, path: &Path2d); + #[cfg(all(feature = "CanvasWindingRule", feature = "Path2d",))] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fill)] + #[doc = "The `fill()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fill)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasWindingRule`, `OffscreenCanvasRenderingContext2d`, `Path2d`*"] + pub fn fill_with_path_2d_and_winding( + this: &OffscreenCanvasRenderingContext2d, + path: &Path2d, + winding: CanvasWindingRule, + ); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = isPointInPath)] + #[doc = "The `isPointInPath()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/isPointInPath)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn is_point_in_path_with_f64( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + ) -> bool; + #[cfg(feature = "CanvasWindingRule")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = isPointInPath)] + #[doc = "The `isPointInPath()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/isPointInPath)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasWindingRule`, `OffscreenCanvasRenderingContext2d`*"] + pub fn is_point_in_path_with_f64_and_canvas_winding_rule( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + winding: CanvasWindingRule, + ) -> bool; + #[cfg(feature = "Path2d")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = isPointInPath)] + #[doc = "The `isPointInPath()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/isPointInPath)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `Path2d`*"] + pub fn is_point_in_path_with_path_2d_and_f64( + this: &OffscreenCanvasRenderingContext2d, + path: &Path2d, + x: f64, + y: f64, + ) -> bool; + #[cfg(all(feature = "CanvasWindingRule", feature = "Path2d",))] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = isPointInPath)] + #[doc = "The `isPointInPath()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/isPointInPath)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasWindingRule`, `OffscreenCanvasRenderingContext2d`, `Path2d`*"] + pub fn is_point_in_path_with_path_2d_and_f64_and_winding( + this: &OffscreenCanvasRenderingContext2d, + path: &Path2d, + x: f64, + y: f64, + winding: CanvasWindingRule, + ) -> bool; + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = isPointInStroke)] + #[doc = "The `isPointInStroke()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/isPointInStroke)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn is_point_in_stroke_with_x_and_y( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + ) -> bool; + #[cfg(feature = "Path2d")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = isPointInStroke)] + #[doc = "The `isPointInStroke()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/isPointInStroke)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `Path2d`*"] + pub fn is_point_in_stroke_with_path_and_x_and_y( + this: &OffscreenCanvasRenderingContext2d, + path: &Path2d, + x: f64, + y: f64, + ) -> bool; + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = stroke)] + #[doc = "The `stroke()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/stroke)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn stroke(this: &OffscreenCanvasRenderingContext2d); + #[cfg(feature = "Path2d")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = stroke)] + #[doc = "The `stroke()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/stroke)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `Path2d`*"] + pub fn stroke_with_path(this: &OffscreenCanvasRenderingContext2d, path: &Path2d); + #[cfg(feature = "CanvasGradient")] + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createLinearGradient)] + #[doc = "The `createLinearGradient()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createLinearGradient)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_linear_gradient( + this: &OffscreenCanvasRenderingContext2d, + x0: f64, + y0: f64, + x1: f64, + y1: f64, + ) -> CanvasGradient; + #[cfg(all(feature = "CanvasPattern", feature = "HtmlImageElement",))] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `HtmlImageElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_pattern_with_html_image_element( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlImageElement, + repetition: &str, + ) -> Result, JsValue>; + #[cfg(all(feature = "CanvasPattern", feature = "SvgImageElement",))] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `OffscreenCanvasRenderingContext2d`, `SvgImageElement`*"] + pub fn create_pattern_with_svg_image_element( + this: &OffscreenCanvasRenderingContext2d, + image: &SvgImageElement, + repetition: &str, + ) -> Result, JsValue>; + #[cfg(all(feature = "CanvasPattern", feature = "HtmlCanvasElement",))] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `HtmlCanvasElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_pattern_with_html_canvas_element( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlCanvasElement, + repetition: &str, + ) -> Result, JsValue>; + #[cfg(all(feature = "CanvasPattern", feature = "HtmlVideoElement",))] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `HtmlVideoElement`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_pattern_with_html_video_element( + this: &OffscreenCanvasRenderingContext2d, + image: &HtmlVideoElement, + repetition: &str, + ) -> Result, JsValue>; + #[cfg(all(feature = "CanvasPattern", feature = "ImageBitmap",))] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `ImageBitmap`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_pattern_with_image_bitmap( + this: &OffscreenCanvasRenderingContext2d, + image: &ImageBitmap, + repetition: &str, + ) -> Result, JsValue>; + #[cfg(all(feature = "CanvasPattern", feature = "OffscreenCanvas",))] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `OffscreenCanvas`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_pattern_with_offscreen_canvas( + this: &OffscreenCanvasRenderingContext2d, + image: &OffscreenCanvas, + repetition: &str, + ) -> Result, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "CanvasPattern", feature = "VideoFrame",))] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createPattern)] + #[doc = "The `createPattern()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createPattern)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `OffscreenCanvasRenderingContext2d`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_pattern_with_video_frame( + this: &OffscreenCanvasRenderingContext2d, + image: &VideoFrame, + repetition: &str, + ) -> Result, JsValue>; + #[cfg(feature = "CanvasGradient")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createRadialGradient)] + #[doc = "The `createRadialGradient()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createRadialGradient)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_radial_gradient( + this: &OffscreenCanvasRenderingContext2d, + x0: f64, + y0: f64, + r0: f64, + x1: f64, + y1: f64, + r1: f64, + ) -> Result; + #[cfg(feature = "ImageData")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createImageData)] + #[doc = "The `createImageData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createImageData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageData`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_image_data_with_sw_and_sh( + this: &OffscreenCanvasRenderingContext2d, + sw: f64, + sh: f64, + ) -> Result; + #[cfg(feature = "ImageData")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = createImageData)] + #[doc = "The `createImageData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/createImageData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageData`, `OffscreenCanvasRenderingContext2d`*"] + pub fn create_image_data_with_imagedata( + this: &OffscreenCanvasRenderingContext2d, + imagedata: &ImageData, + ) -> Result; + #[cfg(feature = "ImageData")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = getImageData)] + #[doc = "The `getImageData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/getImageData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageData`, `OffscreenCanvasRenderingContext2d`*"] + pub fn get_image_data( + this: &OffscreenCanvasRenderingContext2d, + sx: f64, + sy: f64, + sw: f64, + sh: f64, + ) -> Result; + #[cfg(feature = "ImageData")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = putImageData)] + #[doc = "The `putImageData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/putImageData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageData`, `OffscreenCanvasRenderingContext2d`*"] + pub fn put_image_data( + this: &OffscreenCanvasRenderingContext2d, + imagedata: &ImageData, + dx: f64, + dy: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "ImageData")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = putImageData)] + #[doc = "The `putImageData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/putImageData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageData`, `OffscreenCanvasRenderingContext2d`*"] + pub fn put_image_data_with_dirty_x_and_dirty_y_and_dirty_width_and_dirty_height( + this: &OffscreenCanvasRenderingContext2d, + imagedata: &ImageData, + dx: f64, + dy: f64, + dirty_x: f64, + dirty_y: f64, + dirty_width: f64, + dirty_height: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = arc)] + #[doc = "The `arc()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/arc)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn arc( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + radius: f64, + start_angle: f64, + end_angle: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = arc)] + #[doc = "The `arc()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/arc)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn arc_with_anticlockwise( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + radius: f64, + start_angle: f64, + end_angle: f64, + anticlockwise: bool, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = arcTo)] + #[doc = "The `arcTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/arcTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn arc_to( + this: &OffscreenCanvasRenderingContext2d, + x1: f64, + y1: f64, + x2: f64, + y2: f64, + radius: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = bezierCurveTo)] + #[doc = "The `bezierCurveTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/bezierCurveTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn bezier_curve_to( + this: &OffscreenCanvasRenderingContext2d, + cp1x: f64, + cp1y: f64, + cp2x: f64, + cp2y: f64, + x: f64, + y: f64, + ); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = closePath)] + #[doc = "The `closePath()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/closePath)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn close_path(this: &OffscreenCanvasRenderingContext2d); + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = ellipse)] + #[doc = "The `ellipse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/ellipse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn ellipse( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + radius_x: f64, + radius_y: f64, + rotation: f64, + start_angle: f64, + end_angle: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = ellipse)] + #[doc = "The `ellipse()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/ellipse)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn ellipse_with_anticlockwise( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + radius_x: f64, + radius_y: f64, + rotation: f64, + start_angle: f64, + end_angle: f64, + anticlockwise: bool, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = lineTo)] + #[doc = "The `lineTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/lineTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn line_to(this: &OffscreenCanvasRenderingContext2d, x: f64, y: f64); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = moveTo)] + #[doc = "The `moveTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/moveTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn move_to(this: &OffscreenCanvasRenderingContext2d, x: f64, y: f64); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = quadraticCurveTo)] + #[doc = "The `quadraticCurveTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/quadraticCurveTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn quadratic_curve_to( + this: &OffscreenCanvasRenderingContext2d, + cpx: f64, + cpy: f64, + x: f64, + y: f64, + ); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = rect)] + #[doc = "The `rect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/rect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn rect(this: &OffscreenCanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn round_rect( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn round_rect_with_f64( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "DomPointInit")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `OffscreenCanvasRenderingContext2d`*"] + pub fn round_rect_with_dom_point_init( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &DomPointInit, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn round_rect_with_f64_sequence( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn round_rect_with_dom_point_init_sequence( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = getLineDash)] + #[doc = "The `getLineDash()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/getLineDash)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn get_line_dash(this: &OffscreenCanvasRenderingContext2d) -> ::js_sys::Array; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = setLineDash)] + #[doc = "The `setLineDash()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/setLineDash)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_line_dash( + this: &OffscreenCanvasRenderingContext2d, + segments: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = clearRect)] + #[doc = "The `clearRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/clearRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn clear_rect(this: &OffscreenCanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillRect)] + #[doc = "The `fillRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn fill_rect(this: &OffscreenCanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeRect)] + #[doc = "The `strokeRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn stroke_rect(this: &OffscreenCanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = reset)] + #[doc = "The `reset()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/reset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn reset(this: &OffscreenCanvasRenderingContext2d); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = restore)] + #[doc = "The `restore()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/restore)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn restore(this: &OffscreenCanvasRenderingContext2d); + # [wasm_bindgen (method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = save)] + #[doc = "The `save()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/save)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn save(this: &OffscreenCanvasRenderingContext2d); + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillText)] + #[doc = "The `fillText()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn fill_text( + this: &OffscreenCanvasRenderingContext2d, + text: &str, + x: f64, + y: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = fillText)] + #[doc = "The `fillText()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/fillText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn fill_text_with_max_width( + this: &OffscreenCanvasRenderingContext2d, + text: &str, + x: f64, + y: f64, + max_width: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "TextMetrics")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = measureText)] + #[doc = "The `measureText()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/measureText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`, `TextMetrics`*"] + pub fn measure_text( + this: &OffscreenCanvasRenderingContext2d, + text: &str, + ) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeText)] + #[doc = "The `strokeText()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn stroke_text( + this: &OffscreenCanvasRenderingContext2d, + text: &str, + x: f64, + y: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = strokeText)] + #[doc = "The `strokeText()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/strokeText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn stroke_text_with_max_width( + this: &OffscreenCanvasRenderingContext2d, + text: &str, + x: f64, + y: f64, + max_width: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "DomMatrix")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = getTransform)] + #[doc = "The `getTransform()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/getTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix`, `OffscreenCanvasRenderingContext2d`*"] + pub fn get_transform(this: &OffscreenCanvasRenderingContext2d) -> Result; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = resetTransform)] + #[doc = "The `resetTransform()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/resetTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn reset_transform(this: &OffscreenCanvasRenderingContext2d) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = rotate)] + #[doc = "The `rotate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/rotate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn rotate(this: &OffscreenCanvasRenderingContext2d, angle: f64) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = scale)] + #[doc = "The `scale()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/scale)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn scale(this: &OffscreenCanvasRenderingContext2d, x: f64, y: f64) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = setTransform)] + #[doc = "The `setTransform()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/setTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_transform( + this: &OffscreenCanvasRenderingContext2d, + a: f64, + b: f64, + c: f64, + d: f64, + e: f64, + f: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = setTransform)] + #[doc = "The `setTransform()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/setTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn set_transform_with_default_dom_matrix_2d_init( + this: &OffscreenCanvasRenderingContext2d, + ) -> Result<(), JsValue>; + #[cfg(feature = "DomMatrix2dInit")] + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = setTransform)] + #[doc = "The `setTransform()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/setTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomMatrix2dInit`, `OffscreenCanvasRenderingContext2d`*"] + pub fn set_transform_with_dom_matrix_2d_init( + this: &OffscreenCanvasRenderingContext2d, + transform: &DomMatrix2dInit, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = transform)] + #[doc = "The `transform()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/transform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn transform( + this: &OffscreenCanvasRenderingContext2d, + a: f64, + b: f64, + c: f64, + d: f64, + e: f64, + f: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "OffscreenCanvasRenderingContext2D" , js_name = translate)] + #[doc = "The `translate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvasRenderingContext2D/translate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvasRenderingContext2d`*"] + pub fn translate( + this: &OffscreenCanvasRenderingContext2d, + x: f64, + y: f64, + ) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_OpenFilePickerOptions.rs b/crates/web-sys/src/features/gen_OpenFilePickerOptions.rs new file mode 100644 index 00000000000..8fc7269e414 --- /dev/null +++ b/crates/web-sys/src/features/gen_OpenFilePickerOptions.rs @@ -0,0 +1,157 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = OpenFilePickerOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `OpenFilePickerOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type OpenFilePickerOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `excludeAcceptAllOption` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "excludeAcceptAllOption")] + pub fn get_exclude_accept_all_option(this: &OpenFilePickerOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `excludeAcceptAllOption` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "excludeAcceptAllOption")] + pub fn set_exclude_accept_all_option(this: &OpenFilePickerOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &OpenFilePickerOptions) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &OpenFilePickerOptions, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `startIn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "startIn")] + pub fn get_start_in(this: &OpenFilePickerOptions) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `startIn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "startIn")] + pub fn set_start_in(this: &OpenFilePickerOptions, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `types` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "types")] + pub fn get_types(this: &OpenFilePickerOptions) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `types` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "types")] + pub fn set_types(this: &OpenFilePickerOptions, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `multiple` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "multiple")] + pub fn get_multiple(this: &OpenFilePickerOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `multiple` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "multiple")] + pub fn set_multiple(this: &OpenFilePickerOptions, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl OpenFilePickerOptions { + #[doc = "Construct a new `OpenFilePickerOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_exclude_accept_all_option()` instead."] + pub fn exclude_accept_all_option(&mut self, val: bool) -> &mut Self { + self.set_exclude_accept_all_option(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_start_in()` instead."] + pub fn start_in(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_start_in(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_types()` instead."] + pub fn types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_types(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_multiple()` instead."] + pub fn multiple(&mut self, val: bool) -> &mut Self { + self.set_multiple(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for OpenFilePickerOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_OpenWindowEventDetail.rs b/crates/web-sys/src/features/gen_OpenWindowEventDetail.rs index 278e2f8a317..2d21350c17b 100644 --- a/crates/web-sys/src/features/gen_OpenWindowEventDetail.rs +++ b/crates/web-sys/src/features/gen_OpenWindowEventDetail.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] pub type OpenWindowEventDetail; + #[doc = "Get the `features` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[wasm_bindgen(method, getter = "features")] + pub fn get_features(this: &OpenWindowEventDetail) -> Option<::alloc::string::String>; + #[doc = "Change the `features` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[wasm_bindgen(method, setter = "features")] + pub fn set_features(this: &OpenWindowEventDetail, val: &str); + #[cfg(feature = "Node")] + #[doc = "Get the `frameElement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Node`, `OpenWindowEventDetail`*"] + #[wasm_bindgen(method, getter = "frameElement")] + pub fn get_frame_element(this: &OpenWindowEventDetail) -> Option; + #[cfg(feature = "Node")] + #[doc = "Change the `frameElement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Node`, `OpenWindowEventDetail`*"] + #[wasm_bindgen(method, setter = "frameElement")] + pub fn set_frame_element(this: &OpenWindowEventDetail, val: Option<&Node>); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &OpenWindowEventDetail) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &OpenWindowEventDetail, val: &str); + #[doc = "Get the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[wasm_bindgen(method, getter = "url")] + pub fn get_url(this: &OpenWindowEventDetail) -> Option<::alloc::string::String>; + #[doc = "Change the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[wasm_bindgen(method, setter = "url")] + pub fn set_url(this: &OpenWindowEventDetail, val: &str); } impl OpenWindowEventDetail { #[doc = "Construct a new `OpenWindowEventDetail`."] @@ -19,65 +62,25 @@ impl OpenWindowEventDetail { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `features` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[deprecated = "Use `set_features()` instead."] pub fn features(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("features"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_features(val); self } #[cfg(feature = "Node")] - #[doc = "Change the `frameElement` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Node`, `OpenWindowEventDetail`*"] + #[deprecated = "Use `set_frame_element()` instead."] pub fn frame_element(&mut self, val: Option<&Node>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameElement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frame_element(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `url` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OpenWindowEventDetail`*"] + #[deprecated = "Use `set_url()` instead."] pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_url(val); self } } diff --git a/crates/web-sys/src/features/gen_OptionalEffectTiming.rs b/crates/web-sys/src/features/gen_OptionalEffectTiming.rs index 5838e3205de..c469d425415 100644 --- a/crates/web-sys/src/features/gen_OptionalEffectTiming.rs +++ b/crates/web-sys/src/features/gen_OptionalEffectTiming.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,90 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] pub type OptionalEffectTiming; + #[doc = "Get the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, getter = "delay")] + pub fn get_delay(this: &OptionalEffectTiming) -> Option; + #[doc = "Change the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, setter = "delay")] + pub fn set_delay(this: &OptionalEffectTiming, val: f64); + #[cfg(feature = "PlaybackDirection")] + #[doc = "Get the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`, `PlaybackDirection`*"] + #[wasm_bindgen(method, getter = "direction")] + pub fn get_direction(this: &OptionalEffectTiming) -> Option; + #[cfg(feature = "PlaybackDirection")] + #[doc = "Change the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`, `PlaybackDirection`*"] + #[wasm_bindgen(method, setter = "direction")] + pub fn set_direction(this: &OptionalEffectTiming, val: PlaybackDirection); + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &OptionalEffectTiming) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &OptionalEffectTiming, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, getter = "easing")] + pub fn get_easing(this: &OptionalEffectTiming) -> Option<::alloc::string::String>; + #[doc = "Change the `easing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, setter = "easing")] + pub fn set_easing(this: &OptionalEffectTiming, val: &str); + #[doc = "Get the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, getter = "endDelay")] + pub fn get_end_delay(this: &OptionalEffectTiming) -> Option; + #[doc = "Change the `endDelay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, setter = "endDelay")] + pub fn set_end_delay(this: &OptionalEffectTiming, val: f64); + #[cfg(feature = "FillMode")] + #[doc = "Get the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FillMode`, `OptionalEffectTiming`*"] + #[wasm_bindgen(method, getter = "fill")] + pub fn get_fill(this: &OptionalEffectTiming) -> Option; + #[cfg(feature = "FillMode")] + #[doc = "Change the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FillMode`, `OptionalEffectTiming`*"] + #[wasm_bindgen(method, setter = "fill")] + pub fn set_fill(this: &OptionalEffectTiming, val: FillMode); + #[doc = "Get the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, getter = "iterationStart")] + pub fn get_iteration_start(this: &OptionalEffectTiming) -> Option; + #[doc = "Change the `iterationStart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, setter = "iterationStart")] + pub fn set_iteration_start(this: &OptionalEffectTiming, val: f64); + #[doc = "Get the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, getter = "iterations")] + pub fn get_iterations(this: &OptionalEffectTiming) -> Option; + #[doc = "Change the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[wasm_bindgen(method, setter = "iterations")] + pub fn set_iterations(this: &OptionalEffectTiming, val: f64); } impl OptionalEffectTiming { #[doc = "Construct a new `OptionalEffectTiming`."] @@ -19,131 +104,46 @@ impl OptionalEffectTiming { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `delay` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[deprecated = "Use `set_delay()` instead."] pub fn delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("delay"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delay(val); self } #[cfg(feature = "PlaybackDirection")] - #[doc = "Change the `direction` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`, `PlaybackDirection`*"] + #[deprecated = "Use `set_direction()` instead."] pub fn direction(&mut self, val: PlaybackDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_direction(val); self } - #[doc = "Change the `duration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[deprecated = "Use `set_duration()` instead."] pub fn duration(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_duration(val); self } - #[doc = "Change the `easing` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[deprecated = "Use `set_easing()` instead."] 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.set_easing(val); self } - #[doc = "Change the `endDelay` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[deprecated = "Use `set_end_delay()` instead."] pub fn end_delay(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endDelay"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_end_delay(val); self } #[cfg(feature = "FillMode")] - #[doc = "Change the `fill` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `FillMode`, `OptionalEffectTiming`*"] + #[deprecated = "Use `set_fill()` instead."] pub fn fill(&mut self, val: FillMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fill(val); self } - #[doc = "Change the `iterationStart` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[deprecated = "Use `set_iteration_start()` instead."] pub fn iteration_start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterationStart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iteration_start(val); self } - #[doc = "Change the `iterations` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OptionalEffectTiming`*"] + #[deprecated = "Use `set_iterations()` instead."] pub fn iterations(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iterations(val); self } } diff --git a/crates/web-sys/src/features/gen_OrientationLockType.rs b/crates/web-sys/src/features/gen_OrientationLockType.rs index fd5c86e801b..a87f9e7aaf7 100644 --- a/crates/web-sys/src/features/gen_OrientationLockType.rs +++ b/crates/web-sys/src/features/gen_OrientationLockType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `OrientationLockType` enum."] diff --git a/crates/web-sys/src/features/gen_OrientationType.rs b/crates/web-sys/src/features/gen_OrientationType.rs index 15ecbc59aea..21b96131a8c 100644 --- a/crates/web-sys/src/features/gen_OrientationType.rs +++ b/crates/web-sys/src/features/gen_OrientationType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `OrientationType` enum."] diff --git a/crates/web-sys/src/features/gen_OscillatorNode.rs b/crates/web-sys/src/features/gen_OscillatorNode.rs index b72525ea4a1..2e87a03aaae 100644 --- a/crates/web-sys/src/features/gen_OscillatorNode.rs +++ b/crates/web-sys/src/features/gen_OscillatorNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_OscillatorOptions.rs b/crates/web-sys/src/features/gen_OscillatorOptions.rs index becbba03395..32f4507e5fd 100644 --- a/crates/web-sys/src/features/gen_OscillatorOptions.rs +++ b/crates/web-sys/src/features/gen_OscillatorOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,84 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] pub type OscillatorOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &OscillatorOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &OscillatorOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `OscillatorOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &OscillatorOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `OscillatorOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &OscillatorOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `OscillatorOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &OscillatorOptions) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `OscillatorOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &OscillatorOptions, val: ChannelInterpretation); + #[doc = "Get the `detune` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] + #[wasm_bindgen(method, getter = "detune")] + pub fn get_detune(this: &OscillatorOptions) -> Option; + #[doc = "Change the `detune` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] + #[wasm_bindgen(method, setter = "detune")] + pub fn set_detune(this: &OscillatorOptions, val: f32); + #[doc = "Get the `frequency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] + #[wasm_bindgen(method, getter = "frequency")] + pub fn get_frequency(this: &OscillatorOptions) -> Option; + #[doc = "Change the `frequency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] + #[wasm_bindgen(method, setter = "frequency")] + pub fn set_frequency(this: &OscillatorOptions, val: f32); + #[cfg(feature = "PeriodicWave")] + #[doc = "Get the `periodicWave` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `PeriodicWave`*"] + #[wasm_bindgen(method, getter = "periodicWave")] + pub fn get_periodic_wave(this: &OscillatorOptions) -> Option; + #[cfg(feature = "PeriodicWave")] + #[doc = "Change the `periodicWave` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `PeriodicWave`*"] + #[wasm_bindgen(method, setter = "periodicWave")] + pub fn set_periodic_wave(this: &OscillatorOptions, val: &PeriodicWave); + #[cfg(feature = "OscillatorType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `OscillatorType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &OscillatorOptions) -> Option; + #[cfg(feature = "OscillatorType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `OscillatorType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &OscillatorOptions, val: OscillatorType); } impl OscillatorOptions { #[doc = "Construct a new `OscillatorOptions`."] @@ -19,120 +98,43 @@ impl OscillatorOptions { 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: `OscillatorOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `OscillatorOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `OscillatorOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `detune` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] + #[deprecated = "Use `set_detune()` instead."] 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.set_detune(val); self } - #[doc = "Change the `frequency` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"] + #[deprecated = "Use `set_frequency()` instead."] 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.set_frequency(val); self } #[cfg(feature = "PeriodicWave")] - #[doc = "Change the `periodicWave` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `PeriodicWave`*"] + #[deprecated = "Use `set_periodic_wave()` instead."] pub fn periodic_wave(&mut self, val: &PeriodicWave) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("periodicWave"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_periodic_wave(val); self } #[cfg(feature = "OscillatorType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `OscillatorType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: OscillatorType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_OscillatorType.rs b/crates/web-sys/src/features/gen_OscillatorType.rs index 49272cf55b3..af4f43180fe 100644 --- a/crates/web-sys/src/features/gen_OscillatorType.rs +++ b/crates/web-sys/src/features/gen_OscillatorType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `OscillatorType` enum."] diff --git a/crates/web-sys/src/features/gen_OverSampleType.rs b/crates/web-sys/src/features/gen_OverSampleType.rs index bbedb3db6ed..3f36eea4ca8 100644 --- a/crates/web-sys/src/features/gen_OverSampleType.rs +++ b/crates/web-sys/src/features/gen_OverSampleType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `OverSampleType` enum."] diff --git a/crates/web-sys/src/features/gen_OvrMultiview2.rs b/crates/web-sys/src/features/gen_OvrMultiview2.rs new file mode 100644 index 00000000000..d5ecd0f60d0 --- /dev/null +++ b/crates/web-sys/src/features/gen_OvrMultiview2.rs @@ -0,0 +1,49 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = OVR_multiview2 , typescript_type = "OVR_multiview2")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `OvrMultiview2` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OVR_multiview2)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OvrMultiview2`*"] + pub type OvrMultiview2; + #[cfg(feature = "WebGlTexture")] + # [wasm_bindgen (method , structural , js_class = "OVR_multiview2" , js_name = framebufferTextureMultiviewOVR)] + #[doc = "The `framebufferTextureMultiviewOVR()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OVR_multiview2/framebufferTextureMultiviewOVR)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OvrMultiview2`, `WebGlTexture`*"] + pub fn framebuffer_texture_multiview_ovr( + this: &OvrMultiview2, + target: u32, + attachment: u32, + texture: Option<&WebGlTexture>, + level: i32, + base_view_index: i32, + num_views: i32, + ); +} +impl OvrMultiview2 { + #[doc = "The `OVR_multiview2.FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OvrMultiview2`*"] + pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: u32 = 38448u64 as u32; + #[doc = "The `OVR_multiview2.FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OvrMultiview2`*"] + pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: u32 = 38450u64 as u32; + #[doc = "The `OVR_multiview2.MAX_VIEWS_OVR` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OvrMultiview2`*"] + pub const MAX_VIEWS_OVR: u32 = 38449u64 as u32; + #[doc = "The `OVR_multiview2.FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OvrMultiview2`*"] + pub const FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: u32 = 38451u64 as u32; +} diff --git a/crates/web-sys/src/features/gen_PageTransitionEvent.rs b/crates/web-sys/src/features/gen_PageTransitionEvent.rs index 2fed4a4d02a..3939c322262 100644 --- a/crates/web-sys/src/features/gen_PageTransitionEvent.rs +++ b/crates/web-sys/src/features/gen_PageTransitionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PageTransitionEventInit.rs b/crates/web-sys/src/features/gen_PageTransitionEventInit.rs index 460c6fdcfce..28e3cbeba68 100644 --- a/crates/web-sys/src/features/gen_PageTransitionEventInit.rs +++ b/crates/web-sys/src/features/gen_PageTransitionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] pub type PageTransitionEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PageTransitionEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PageTransitionEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PageTransitionEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PageTransitionEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PageTransitionEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PageTransitionEventInit, val: bool); + #[doc = "Get the `inFrameSwap` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, getter = "inFrameSwap")] + pub fn get_in_frame_swap(this: &PageTransitionEventInit) -> Option; + #[doc = "Change the `inFrameSwap` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, setter = "inFrameSwap")] + pub fn set_in_frame_swap(this: &PageTransitionEventInit, val: bool); + #[doc = "Get the `persisted` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, getter = "persisted")] + pub fn get_persisted(this: &PageTransitionEventInit) -> Option; + #[doc = "Change the `persisted` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[wasm_bindgen(method, setter = "persisted")] + pub fn set_persisted(this: &PageTransitionEventInit, val: bool); } impl PageTransitionEventInit { #[doc = "Construct a new `PageTransitionEventInit`."] @@ -19,89 +70,29 @@ impl PageTransitionEventInit { 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: `PageTransitionEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `inFrameSwap` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[deprecated = "Use `set_in_frame_swap()` instead."] pub fn in_frame_swap(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inFrameSwap"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_in_frame_swap(val); self } - #[doc = "Change the `persisted` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PageTransitionEventInit`*"] + #[deprecated = "Use `set_persisted()` instead."] pub fn persisted(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("persisted"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_persisted(val); self } } diff --git a/crates/web-sys/src/features/gen_PaintRequest.rs b/crates/web-sys/src/features/gen_PaintRequest.rs index 393bfe116fa..73a849fd73e 100644 --- a/crates/web-sys/src/features/gen_PaintRequest.rs +++ b/crates/web-sys/src/features/gen_PaintRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,5 +26,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaintRequest/reason)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaintRequest`*"] - pub fn reason(this: &PaintRequest) -> String; + pub fn reason(this: &PaintRequest) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_PaintRequestList.rs b/crates/web-sys/src/features/gen_PaintRequestList.rs index 25bf3d56c11..8be17f217d2 100644 --- a/crates/web-sys/src/features/gen_PaintRequestList.rs +++ b/crates/web-sys/src/features/gen_PaintRequestList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -28,7 +29,7 @@ extern "C" { pub fn item(this: &PaintRequestList, index: u32) -> Option; #[cfg(feature = "PaintRequest")] #[wasm_bindgen(method, structural, js_class = "PaintRequestList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PaintWorkletGlobalScope.rs b/crates/web-sys/src/features/gen_PaintWorkletGlobalScope.rs index d022a7e2cb0..dccd6d22455 100644 --- a/crates/web-sys/src/features/gen_PaintWorkletGlobalScope.rs +++ b/crates/web-sys/src/features/gen_PaintWorkletGlobalScope.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PannerNode.rs b/crates/web-sys/src/features/gen_PannerNode.rs index 47787d29026..58d1fd2a23b 100644 --- a/crates/web-sys/src/features/gen_PannerNode.rs +++ b/crates/web-sys/src/features/gen_PannerNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PannerOptions.rs b/crates/web-sys/src/features/gen_PannerOptions.rs index 343ad89ca70..2447947c572 100644 --- a/crates/web-sys/src/features/gen_PannerOptions.rs +++ b/crates/web-sys/src/features/gen_PannerOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,184 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] pub type PannerOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &PannerOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &PannerOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `PannerOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &PannerOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `PannerOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &PannerOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `PannerOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &PannerOptions) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `PannerOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &PannerOptions, val: ChannelInterpretation); + #[doc = "Get the `coneInnerAngle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "coneInnerAngle")] + pub fn get_cone_inner_angle(this: &PannerOptions) -> Option; + #[doc = "Change the `coneInnerAngle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "coneInnerAngle")] + pub fn set_cone_inner_angle(this: &PannerOptions, val: f64); + #[doc = "Get the `coneOuterAngle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "coneOuterAngle")] + pub fn get_cone_outer_angle(this: &PannerOptions) -> Option; + #[doc = "Change the `coneOuterAngle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "coneOuterAngle")] + pub fn set_cone_outer_angle(this: &PannerOptions, val: f64); + #[doc = "Get the `coneOuterGain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "coneOuterGain")] + pub fn get_cone_outer_gain(this: &PannerOptions) -> Option; + #[doc = "Change the `coneOuterGain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "coneOuterGain")] + pub fn set_cone_outer_gain(this: &PannerOptions, val: f64); + #[cfg(feature = "DistanceModelType")] + #[doc = "Get the `distanceModel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DistanceModelType`, `PannerOptions`*"] + #[wasm_bindgen(method, getter = "distanceModel")] + pub fn get_distance_model(this: &PannerOptions) -> Option; + #[cfg(feature = "DistanceModelType")] + #[doc = "Change the `distanceModel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DistanceModelType`, `PannerOptions`*"] + #[wasm_bindgen(method, setter = "distanceModel")] + pub fn set_distance_model(this: &PannerOptions, val: DistanceModelType); + #[doc = "Get the `maxDistance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "maxDistance")] + pub fn get_max_distance(this: &PannerOptions) -> Option; + #[doc = "Change the `maxDistance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "maxDistance")] + pub fn set_max_distance(this: &PannerOptions, val: f64); + #[doc = "Get the `orientationX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "orientationX")] + pub fn get_orientation_x(this: &PannerOptions) -> Option; + #[doc = "Change the `orientationX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "orientationX")] + pub fn set_orientation_x(this: &PannerOptions, val: f32); + #[doc = "Get the `orientationY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "orientationY")] + pub fn get_orientation_y(this: &PannerOptions) -> Option; + #[doc = "Change the `orientationY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "orientationY")] + pub fn set_orientation_y(this: &PannerOptions, val: f32); + #[doc = "Get the `orientationZ` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "orientationZ")] + pub fn get_orientation_z(this: &PannerOptions) -> Option; + #[doc = "Change the `orientationZ` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "orientationZ")] + pub fn set_orientation_z(this: &PannerOptions, val: f32); + #[cfg(feature = "PanningModelType")] + #[doc = "Get the `panningModel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`, `PanningModelType`*"] + #[wasm_bindgen(method, getter = "panningModel")] + pub fn get_panning_model(this: &PannerOptions) -> Option; + #[cfg(feature = "PanningModelType")] + #[doc = "Change the `panningModel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`, `PanningModelType`*"] + #[wasm_bindgen(method, setter = "panningModel")] + pub fn set_panning_model(this: &PannerOptions, val: PanningModelType); + #[doc = "Get the `positionX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "positionX")] + pub fn get_position_x(this: &PannerOptions) -> Option; + #[doc = "Change the `positionX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "positionX")] + pub fn set_position_x(this: &PannerOptions, val: f32); + #[doc = "Get the `positionY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "positionY")] + pub fn get_position_y(this: &PannerOptions) -> Option; + #[doc = "Change the `positionY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "positionY")] + pub fn set_position_y(this: &PannerOptions, val: f32); + #[doc = "Get the `positionZ` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "positionZ")] + pub fn get_position_z(this: &PannerOptions) -> Option; + #[doc = "Change the `positionZ` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "positionZ")] + pub fn set_position_z(this: &PannerOptions, val: f32); + #[doc = "Get the `refDistance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "refDistance")] + pub fn get_ref_distance(this: &PannerOptions) -> Option; + #[doc = "Change the `refDistance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "refDistance")] + pub fn set_ref_distance(this: &PannerOptions, val: f64); + #[doc = "Get the `rolloffFactor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, getter = "rolloffFactor")] + pub fn get_rolloff_factor(this: &PannerOptions) -> Option; + #[doc = "Change the `rolloffFactor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[wasm_bindgen(method, setter = "rolloffFactor")] + pub fn set_rolloff_factor(this: &PannerOptions, val: f64); } impl PannerOptions { #[doc = "Construct a new `PannerOptions`."] @@ -19,297 +198,93 @@ impl PannerOptions { 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: `PannerOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `PannerOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `PannerOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `coneInnerAngle` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_cone_inner_angle()` instead."] pub fn cone_inner_angle(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("coneInnerAngle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cone_inner_angle(val); self } - #[doc = "Change the `coneOuterAngle` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_cone_outer_angle()` instead."] pub fn cone_outer_angle(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("coneOuterAngle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cone_outer_angle(val); self } - #[doc = "Change the `coneOuterGain` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_cone_outer_gain()` instead."] pub fn cone_outer_gain(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("coneOuterGain"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cone_outer_gain(val); self } #[cfg(feature = "DistanceModelType")] - #[doc = "Change the `distanceModel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DistanceModelType`, `PannerOptions`*"] + #[deprecated = "Use `set_distance_model()` instead."] pub fn distance_model(&mut self, val: DistanceModelType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("distanceModel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_distance_model(val); self } - #[doc = "Change the `maxDistance` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_max_distance()` instead."] pub fn max_distance(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxDistance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max_distance(val); self } - #[doc = "Change the `orientationX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_orientation_x()` instead."] pub fn orientation_x(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("orientationX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_orientation_x(val); self } - #[doc = "Change the `orientationY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_orientation_y()` instead."] pub fn orientation_y(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("orientationY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_orientation_y(val); self } - #[doc = "Change the `orientationZ` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_orientation_z()` instead."] pub fn orientation_z(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("orientationZ"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_orientation_z(val); self } #[cfg(feature = "PanningModelType")] - #[doc = "Change the `panningModel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`, `PanningModelType`*"] + #[deprecated = "Use `set_panning_model()` instead."] pub fn panning_model(&mut self, val: PanningModelType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("panningModel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_panning_model(val); self } - #[doc = "Change the `positionX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_position_x()` instead."] pub fn position_x(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("positionX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_position_x(val); self } - #[doc = "Change the `positionY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_position_y()` instead."] pub fn position_y(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("positionY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_position_y(val); self } - #[doc = "Change the `positionZ` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_position_z()` instead."] pub fn position_z(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("positionZ"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_position_z(val); self } - #[doc = "Change the `refDistance` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_ref_distance()` instead."] pub fn ref_distance(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("refDistance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ref_distance(val); self } - #[doc = "Change the `rolloffFactor` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"] + #[deprecated = "Use `set_rolloff_factor()` instead."] pub fn rolloff_factor(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rolloffFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rolloff_factor(val); self } } diff --git a/crates/web-sys/src/features/gen_PanningModelType.rs b/crates/web-sys/src/features/gen_PanningModelType.rs index bdee90bcea6..e6a7ca2c8c0 100644 --- a/crates/web-sys/src/features/gen_PanningModelType.rs +++ b/crates/web-sys/src/features/gen_PanningModelType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PanningModelType` enum."] diff --git a/crates/web-sys/src/features/gen_ParityType.rs b/crates/web-sys/src/features/gen_ParityType.rs new file mode 100644 index 00000000000..f1a4a28c367 --- /dev/null +++ b/crates/web-sys/src/features/gen_ParityType.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `ParityType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `ParityType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ParityType { + None = "none", + Even = "even", + Odd = "odd", +} diff --git a/crates/web-sys/src/features/gen_Path2d.rs b/crates/web-sys/src/features/gen_Path2d.rs index 7cdb3e8d95a..7cd55c12f46 100644 --- a/crates/web-sys/src/features/gen_Path2d.rs +++ b/crates/web-sys/src/features/gen_Path2d.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -173,4 +174,68 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Path2d`*"] pub fn rect(this: &Path2d, x: f64, y: f64, w: f64, h: f64); + # [wasm_bindgen (catch , method , structural , js_class = "Path2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Path2d`*"] + pub fn round_rect(this: &Path2d, x: f64, y: f64, w: f64, h: f64) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "Path2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Path2d`*"] + pub fn round_rect_with_f64( + this: &Path2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: f64, + ) -> Result<(), JsValue>; + #[cfg(feature = "DomPointInit")] + # [wasm_bindgen (catch , method , structural , js_class = "Path2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointInit`, `Path2d`*"] + pub fn round_rect_with_dom_point_init( + this: &Path2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &DomPointInit, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "Path2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Path2d`*"] + pub fn round_rect_with_f64_sequence( + this: &Path2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "Path2D" , js_name = roundRect)] + #[doc = "The `roundRect()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Path2D/roundRect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Path2d`*"] + pub fn round_rect_with_dom_point_init_sequence( + this: &Path2d, + x: f64, + y: f64, + w: f64, + h: f64, + radii: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_PaymentAddress.rs b/crates/web-sys/src/features/gen_PaymentAddress.rs index 7402ca5be9b..8e32be7f44c 100644 --- a/crates/web-sys/src/features/gen_PaymentAddress.rs +++ b/crates/web-sys/src/features/gen_PaymentAddress.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/country)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn country(this: &PaymentAddress) -> String; + pub fn country(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = addressLine)] #[doc = "Getter for the `addressLine` field of this object."] #[doc = ""] @@ -31,63 +32,63 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/region)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn region(this: &PaymentAddress) -> String; + pub fn region(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = city)] #[doc = "Getter for the `city` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/city)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn city(this: &PaymentAddress) -> String; + pub fn city(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = dependentLocality)] #[doc = "Getter for the `dependentLocality` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/dependentLocality)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn dependent_locality(this: &PaymentAddress) -> String; + pub fn dependent_locality(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = postalCode)] #[doc = "Getter for the `postalCode` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/postalCode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn postal_code(this: &PaymentAddress) -> String; + pub fn postal_code(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = sortingCode)] #[doc = "Getter for the `sortingCode` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/sortingCode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn sorting_code(this: &PaymentAddress) -> String; + pub fn sorting_code(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = languageCode)] #[doc = "Getter for the `languageCode` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/languageCode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn language_code(this: &PaymentAddress) -> String; + pub fn language_code(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = organization)] #[doc = "Getter for the `organization` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/organization)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn organization(this: &PaymentAddress) -> String; + pub fn organization(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = recipient)] #[doc = "Getter for the `recipient` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/recipient)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn recipient(this: &PaymentAddress) -> String; + pub fn recipient(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentAddress" , js_name = phone)] #[doc = "Getter for the `phone` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentAddress/phone)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentAddress`*"] - pub fn phone(this: &PaymentAddress) -> String; + pub fn phone(this: &PaymentAddress) -> ::alloc::string::String; # [wasm_bindgen (method , structural , js_class = "PaymentAddress" , js_name = toJSON)] #[doc = "The `toJSON()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PaymentComplete.rs b/crates/web-sys/src/features/gen_PaymentComplete.rs index 77812acffba..e090f091de2 100644 --- a/crates/web-sys/src/features/gen_PaymentComplete.rs +++ b/crates/web-sys/src/features/gen_PaymentComplete.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PaymentComplete` enum."] diff --git a/crates/web-sys/src/features/gen_PaymentMethodChangeEvent.rs b/crates/web-sys/src/features/gen_PaymentMethodChangeEvent.rs index 68d5868c894..540a249d493 100644 --- a/crates/web-sys/src/features/gen_PaymentMethodChangeEvent.rs +++ b/crates/web-sys/src/features/gen_PaymentMethodChangeEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentMethodChangeEvent/methodName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEvent`*"] - pub fn method_name(this: &PaymentMethodChangeEvent) -> String; + pub fn method_name(this: &PaymentMethodChangeEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentMethodChangeEvent" , js_name = methodDetails)] #[doc = "Getter for the `methodDetails` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PaymentMethodChangeEventInit.rs b/crates/web-sys/src/features/gen_PaymentMethodChangeEventInit.rs index 0aa07478f16..14249066fad 100644 --- a/crates/web-sys/src/features/gen_PaymentMethodChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_PaymentMethodChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] pub type PaymentMethodChangeEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PaymentMethodChangeEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PaymentMethodChangeEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PaymentMethodChangeEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PaymentMethodChangeEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PaymentMethodChangeEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PaymentMethodChangeEventInit, val: bool); + #[doc = "Get the `methodDetails` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, getter = "methodDetails")] + pub fn get_method_details(this: &PaymentMethodChangeEventInit) -> Option<::js_sys::Object>; + #[doc = "Change the `methodDetails` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, setter = "methodDetails")] + pub fn set_method_details(this: &PaymentMethodChangeEventInit, val: Option<&::js_sys::Object>); + #[doc = "Get the `methodName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, getter = "methodName")] + pub fn get_method_name(this: &PaymentMethodChangeEventInit) -> ::alloc::string::String; + #[doc = "Change the `methodName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[wasm_bindgen(method, setter = "methodName")] + pub fn set_method_name(this: &PaymentMethodChangeEventInit, val: &str); } impl PaymentMethodChangeEventInit { #[doc = "Construct a new `PaymentMethodChangeEventInit`."] @@ -17,92 +68,32 @@ impl PaymentMethodChangeEventInit { pub fn new(method_name: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.method_name(method_name); + ret.set_method_name(method_name); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `methodDetails` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[deprecated = "Use `set_method_details()` instead."] pub fn method_details(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("methodDetails"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_method_details(val); self } - #[doc = "Change the `methodName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"] + #[deprecated = "Use `set_method_name()` instead."] pub fn method_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("methodName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_method_name(val); self } } diff --git a/crates/web-sys/src/features/gen_PaymentRequestUpdateEvent.rs b/crates/web-sys/src/features/gen_PaymentRequestUpdateEvent.rs index fa60547c348..9f3e1283fe9 100644 --- a/crates/web-sys/src/features/gen_PaymentRequestUpdateEvent.rs +++ b/crates/web-sys/src/features/gen_PaymentRequestUpdateEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PaymentRequestUpdateEventInit.rs b/crates/web-sys/src/features/gen_PaymentRequestUpdateEventInit.rs index c3877bf6b19..1ee2b715532 100644 --- a/crates/web-sys/src/features/gen_PaymentRequestUpdateEventInit.rs +++ b/crates/web-sys/src/features/gen_PaymentRequestUpdateEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] pub type PaymentRequestUpdateEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PaymentRequestUpdateEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PaymentRequestUpdateEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PaymentRequestUpdateEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PaymentRequestUpdateEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PaymentRequestUpdateEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PaymentRequestUpdateEventInit, val: bool); } impl PaymentRequestUpdateEventInit { #[doc = "Construct a new `PaymentRequestUpdateEventInit`."] @@ -19,55 +50,19 @@ impl PaymentRequestUpdateEventInit { 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: `PaymentRequestUpdateEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PaymentRequestUpdateEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } } diff --git a/crates/web-sys/src/features/gen_PaymentResponse.rs b/crates/web-sys/src/features/gen_PaymentResponse.rs index b9007db1c07..bcf13501191 100644 --- a/crates/web-sys/src/features/gen_PaymentResponse.rs +++ b/crates/web-sys/src/features/gen_PaymentResponse.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentResponse/requestId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentResponse`*"] - pub fn request_id(this: &PaymentResponse) -> String; + pub fn request_id(this: &PaymentResponse) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentResponse" , js_name = methodName)] #[doc = "Getter for the `methodName` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentResponse/methodName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentResponse`*"] - pub fn method_name(this: &PaymentResponse) -> String; + pub fn method_name(this: &PaymentResponse) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PaymentResponse" , js_name = details)] #[doc = "Getter for the `details` field of this object."] #[doc = ""] @@ -46,28 +47,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentResponse/shippingOption)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentResponse`*"] - pub fn shipping_option(this: &PaymentResponse) -> Option; + pub fn shipping_option(this: &PaymentResponse) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "PaymentResponse" , js_name = payerName)] #[doc = "Getter for the `payerName` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentResponse/payerName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentResponse`*"] - pub fn payer_name(this: &PaymentResponse) -> Option; + pub fn payer_name(this: &PaymentResponse) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "PaymentResponse" , js_name = payerEmail)] #[doc = "Getter for the `payerEmail` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentResponse/payerEmail)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentResponse`*"] - pub fn payer_email(this: &PaymentResponse) -> Option; + pub fn payer_email(this: &PaymentResponse) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "PaymentResponse" , js_name = payerPhone)] #[doc = "Getter for the `payerPhone` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PaymentResponse/payerPhone)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PaymentResponse`*"] - pub fn payer_phone(this: &PaymentResponse) -> Option; + pub fn payer_phone(this: &PaymentResponse) -> Option<::alloc::string::String>; # [wasm_bindgen (method , structural , js_class = "PaymentResponse" , js_name = complete)] #[doc = "The `complete()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_Pbkdf2Params.rs b/crates/web-sys/src/features/gen_Pbkdf2Params.rs index 4bf39c68389..8a44fa1a697 100644 --- a/crates/web-sys/src/features/gen_Pbkdf2Params.rs +++ b/crates/web-sys/src/features/gen_Pbkdf2Params.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] pub type Pbkdf2Params; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &Pbkdf2Params) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &Pbkdf2Params, val: &str); + #[doc = "Get the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[wasm_bindgen(method, getter = "hash")] + pub fn get_hash(this: &Pbkdf2Params) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[wasm_bindgen(method, setter = "hash")] + pub fn set_hash(this: &Pbkdf2Params, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[wasm_bindgen(method, getter = "iterations")] + pub fn get_iterations(this: &Pbkdf2Params) -> u32; + #[doc = "Change the `iterations` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[wasm_bindgen(method, setter = "iterations")] + pub fn set_iterations(this: &Pbkdf2Params, val: u32); + #[doc = "Get the `salt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[wasm_bindgen(method, getter = "salt")] + pub fn get_salt(this: &Pbkdf2Params) -> ::js_sys::Object; + #[doc = "Change the `salt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[wasm_bindgen(method, setter = "salt")] + pub fn set_salt(this: &Pbkdf2Params, val: &::js_sys::Object); } impl Pbkdf2Params { #[doc = "Construct a new `Pbkdf2Params`."] @@ -22,66 +63,30 @@ impl Pbkdf2Params { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.hash(hash); - ret.iterations(iterations); - ret.salt(salt); + ret.set_name(name); + ret.set_hash(hash); + ret.set_iterations(iterations); + ret.set_salt(salt); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[deprecated = "Use `set_hash()` instead."] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash(val); self } - #[doc = "Change the `iterations` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[deprecated = "Use `set_iterations()` instead."] pub fn iterations(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iterations"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_iterations(val); self } - #[doc = "Change the `salt` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Pbkdf2Params`*"] + #[deprecated = "Use `set_salt()` instead."] pub fn salt(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("salt"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_salt(val); self } } diff --git a/crates/web-sys/src/features/gen_PcImplIceConnectionState.rs b/crates/web-sys/src/features/gen_PcImplIceConnectionState.rs index f79b4ea0e6e..a9b2b351165 100644 --- a/crates/web-sys/src/features/gen_PcImplIceConnectionState.rs +++ b/crates/web-sys/src/features/gen_PcImplIceConnectionState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PcImplIceConnectionState` enum."] diff --git a/crates/web-sys/src/features/gen_PcImplIceGatheringState.rs b/crates/web-sys/src/features/gen_PcImplIceGatheringState.rs index dd9fe873f63..d52a7eae0e9 100644 --- a/crates/web-sys/src/features/gen_PcImplIceGatheringState.rs +++ b/crates/web-sys/src/features/gen_PcImplIceGatheringState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PcImplIceGatheringState` enum."] diff --git a/crates/web-sys/src/features/gen_PcImplSignalingState.rs b/crates/web-sys/src/features/gen_PcImplSignalingState.rs index bc940be7208..06cb051820b 100644 --- a/crates/web-sys/src/features/gen_PcImplSignalingState.rs +++ b/crates/web-sys/src/features/gen_PcImplSignalingState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PcImplSignalingState` enum."] diff --git a/crates/web-sys/src/features/gen_PcObserverStateType.rs b/crates/web-sys/src/features/gen_PcObserverStateType.rs index 11a74b3da20..75f4b1be15a 100644 --- a/crates/web-sys/src/features/gen_PcObserverStateType.rs +++ b/crates/web-sys/src/features/gen_PcObserverStateType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PcObserverStateType` enum."] diff --git a/crates/web-sys/src/features/gen_Performance.rs b/crates/web-sys/src/features/gen_Performance.rs index 0e4212900f6..1ef04f761d9 100644 --- a/crates/web-sys/src/features/gen_Performance.rs +++ b/crates/web-sys/src/features/gen_Performance.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -152,6 +153,17 @@ extern "C" { start_mark: &str, end_mark: &str, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Performance" , js_name = measureUserAgentSpecificMemory)] + #[doc = "The `measureUserAgentSpecificMemory()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measureUserAgentSpecificMemory)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Performance`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn measure_user_agent_specific_memory(this: &Performance) -> ::js_sys::Promise; # [wasm_bindgen (method , structural , js_class = "Performance" , js_name = now)] #[doc = "The `now()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PerformanceEntry.rs b/crates/web-sys/src/features/gen_PerformanceEntry.rs index 41e22c04f5e..3b261b8bb4c 100644 --- a/crates/web-sys/src/features/gen_PerformanceEntry.rs +++ b/crates/web-sys/src/features/gen_PerformanceEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntry`*"] - pub fn name(this: &PerformanceEntry) -> String; + pub fn name(this: &PerformanceEntry) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PerformanceEntry" , js_name = entryType)] #[doc = "Getter for the `entryType` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntry`*"] - pub fn entry_type(this: &PerformanceEntry) -> String; + pub fn entry_type(this: &PerformanceEntry) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PerformanceEntry" , js_name = startTime)] #[doc = "Getter for the `startTime` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PerformanceEntryEventInit.rs b/crates/web-sys/src/features/gen_PerformanceEntryEventInit.rs index 8849719872c..54ac82a5611 100644 --- a/crates/web-sys/src/features/gen_PerformanceEntryEventInit.rs +++ b/crates/web-sys/src/features/gen_PerformanceEntryEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,96 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] pub type PerformanceEntryEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PerformanceEntryEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PerformanceEntryEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PerformanceEntryEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PerformanceEntryEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PerformanceEntryEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PerformanceEntryEventInit, val: bool); + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &PerformanceEntryEventInit) -> Option; + #[doc = "Change the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &PerformanceEntryEventInit, val: f64); + #[doc = "Get the `entryType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "entryType")] + pub fn get_entry_type(this: &PerformanceEntryEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `entryType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "entryType")] + pub fn set_entry_type(this: &PerformanceEntryEventInit, val: &str); + #[doc = "Get the `epoch` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "epoch")] + pub fn get_epoch(this: &PerformanceEntryEventInit) -> Option; + #[doc = "Change the `epoch` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "epoch")] + pub fn set_epoch(this: &PerformanceEntryEventInit, val: f64); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &PerformanceEntryEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &PerformanceEntryEventInit, val: &str); + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &PerformanceEntryEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &PerformanceEntryEventInit, val: &str); + #[doc = "Get the `startTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, getter = "startTime")] + pub fn get_start_time(this: &PerformanceEntryEventInit) -> Option; + #[doc = "Change the `startTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[wasm_bindgen(method, setter = "startTime")] + pub fn set_start_time(this: &PerformanceEntryEventInit, val: f64); } impl PerformanceEntryEventInit { #[doc = "Construct a new `PerformanceEntryEventInit`."] @@ -19,146 +110,49 @@ impl PerformanceEntryEventInit { 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: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `duration` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_duration()` instead."] pub fn duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_duration(val); self } - #[doc = "Change the `entryType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_entry_type()` instead."] pub fn entry_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_entry_type(val); self } - #[doc = "Change the `epoch` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_epoch()` instead."] pub fn epoch(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("epoch"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_epoch(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `origin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_origin()` instead."] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_origin(val); self } - #[doc = "Change the `startTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryEventInit`*"] + #[deprecated = "Use `set_start_time()` instead."] pub fn start_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("startTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_start_time(val); self } } diff --git a/crates/web-sys/src/features/gen_PerformanceEntryFilterOptions.rs b/crates/web-sys/src/features/gen_PerformanceEntryFilterOptions.rs index abc5c78de82..8a39f177022 100644 --- a/crates/web-sys/src/features/gen_PerformanceEntryFilterOptions.rs +++ b/crates/web-sys/src/features/gen_PerformanceEntryFilterOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] pub type PerformanceEntryFilterOptions; + #[doc = "Get the `entryType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[wasm_bindgen(method, getter = "entryType")] + pub fn get_entry_type(this: &PerformanceEntryFilterOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `entryType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[wasm_bindgen(method, setter = "entryType")] + pub fn set_entry_type(this: &PerformanceEntryFilterOptions, val: &str); + #[doc = "Get the `initiatorType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[wasm_bindgen(method, getter = "initiatorType")] + pub fn get_initiator_type( + this: &PerformanceEntryFilterOptions, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `initiatorType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[wasm_bindgen(method, setter = "initiatorType")] + pub fn set_initiator_type(this: &PerformanceEntryFilterOptions, val: &str); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &PerformanceEntryFilterOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &PerformanceEntryFilterOptions, val: &str); } impl PerformanceEntryFilterOptions { #[doc = "Construct a new `PerformanceEntryFilterOptions`."] @@ -19,51 +52,19 @@ impl PerformanceEntryFilterOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `entryType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[deprecated = "Use `set_entry_type()` instead."] pub fn entry_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_entry_type(val); self } - #[doc = "Change the `initiatorType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[deprecated = "Use `set_initiator_type()` instead."] pub fn initiator_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("initiatorType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_initiator_type(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceEntryFilterOptions`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_PerformanceMark.rs b/crates/web-sys/src/features/gen_PerformanceMark.rs index b74bed7fd3b..80029413f93 100644 --- a/crates/web-sys/src/features/gen_PerformanceMark.rs +++ b/crates/web-sys/src/features/gen_PerformanceMark.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PerformanceMeasure.rs b/crates/web-sys/src/features/gen_PerformanceMeasure.rs index e7981e72043..88c59b62670 100644 --- a/crates/web-sys/src/features/gen_PerformanceMeasure.rs +++ b/crates/web-sys/src/features/gen_PerformanceMeasure.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PerformanceNavigation.rs b/crates/web-sys/src/features/gen_PerformanceNavigation.rs index 339e622276a..33efbfc45a7 100644 --- a/crates/web-sys/src/features/gen_PerformanceNavigation.rs +++ b/crates/web-sys/src/features/gen_PerformanceNavigation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PerformanceNavigationTiming.rs b/crates/web-sys/src/features/gen_PerformanceNavigationTiming.rs index 2193b4c822e..322892b5d88 100644 --- a/crates/web-sys/src/features/gen_PerformanceNavigationTiming.rs +++ b/crates/web-sys/src/features/gen_PerformanceNavigationTiming.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PerformanceObserver.rs b/crates/web-sys/src/features/gen_PerformanceObserver.rs index 1146a121ac9..893cffbd1a6 100644 --- a/crates/web-sys/src/features/gen_PerformanceObserver.rs +++ b/crates/web-sys/src/features/gen_PerformanceObserver.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PerformanceObserverEntryList.rs b/crates/web-sys/src/features/gen_PerformanceObserverEntryList.rs index 29b5dd6da0f..441cab30c4e 100644 --- a/crates/web-sys/src/features/gen_PerformanceObserverEntryList.rs +++ b/crates/web-sys/src/features/gen_PerformanceObserverEntryList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PerformanceObserverInit.rs b/crates/web-sys/src/features/gen_PerformanceObserverInit.rs index cdfef4c53e3..87721fe39d8 100644 --- a/crates/web-sys/src/features/gen_PerformanceObserverInit.rs +++ b/crates/web-sys/src/features/gen_PerformanceObserverInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] pub type PerformanceObserverInit; + #[doc = "Get the `buffered` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] + #[wasm_bindgen(method, getter = "buffered")] + pub fn get_buffered(this: &PerformanceObserverInit) -> Option; + #[doc = "Change the `buffered` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] + #[wasm_bindgen(method, setter = "buffered")] + pub fn set_buffered(this: &PerformanceObserverInit, val: bool); + #[doc = "Get the `entryTypes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] + #[wasm_bindgen(method, getter = "entryTypes")] + pub fn get_entry_types(this: &PerformanceObserverInit) -> ::js_sys::Array; + #[doc = "Change the `entryTypes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] + #[wasm_bindgen(method, setter = "entryTypes")] + pub fn set_entry_types(this: &PerformanceObserverInit, val: &::wasm_bindgen::JsValue); } impl PerformanceObserverInit { #[doc = "Construct a new `PerformanceObserverInit`."] @@ -17,41 +38,17 @@ impl PerformanceObserverInit { pub fn new(entry_types: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.entry_types(entry_types); + ret.set_entry_types(entry_types); ret } - #[doc = "Change the `buffered` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] + #[deprecated = "Use `set_buffered()` instead."] pub fn buffered(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buffered"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_buffered(val); self } - #[doc = "Change the `entryTypes` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PerformanceObserverInit`*"] + #[deprecated = "Use `set_entry_types()` instead."] pub fn entry_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("entryTypes"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_entry_types(val); self } } diff --git a/crates/web-sys/src/features/gen_PerformanceResourceTiming.rs b/crates/web-sys/src/features/gen_PerformanceResourceTiming.rs index 4aa5d2e721d..1f46626b3b4 100644 --- a/crates/web-sys/src/features/gen_PerformanceResourceTiming.rs +++ b/crates/web-sys/src/features/gen_PerformanceResourceTiming.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/initiatorType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceResourceTiming`*"] - pub fn initiator_type(this: &PerformanceResourceTiming) -> String; + pub fn initiator_type(this: &PerformanceResourceTiming) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PerformanceResourceTiming" , js_name = nextHopProtocol)] #[doc = "Getter for the `nextHopProtocol` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/nextHopProtocol)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceResourceTiming`*"] - pub fn next_hop_protocol(this: &PerformanceResourceTiming) -> String; + pub fn next_hop_protocol(this: &PerformanceResourceTiming) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PerformanceResourceTiming" , js_name = workerStart)] #[doc = "Getter for the `workerStart` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PerformanceServerTiming.rs b/crates/web-sys/src/features/gen_PerformanceServerTiming.rs index 2b77307e4ed..46a4dbb76c9 100644 --- a/crates/web-sys/src/features/gen_PerformanceServerTiming.rs +++ b/crates/web-sys/src/features/gen_PerformanceServerTiming.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceServerTiming/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceServerTiming`*"] - pub fn name(this: &PerformanceServerTiming) -> String; + pub fn name(this: &PerformanceServerTiming) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PerformanceServerTiming" , js_name = duration)] #[doc = "Getter for the `duration` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceServerTiming/description)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PerformanceServerTiming`*"] - pub fn description(this: &PerformanceServerTiming) -> String; + pub fn description(this: &PerformanceServerTiming) -> ::alloc::string::String; # [wasm_bindgen (method , structural , js_class = "PerformanceServerTiming" , js_name = toJSON)] #[doc = "The `toJSON()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PerformanceTiming.rs b/crates/web-sys/src/features/gen_PerformanceTiming.rs index f1fc6e29b5a..926a905f433 100644 --- a/crates/web-sys/src/features/gen_PerformanceTiming.rs +++ b/crates/web-sys/src/features/gen_PerformanceTiming.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PeriodicWave.rs b/crates/web-sys/src/features/gen_PeriodicWave.rs index a9ffc385582..71f232b0adf 100644 --- a/crates/web-sys/src/features/gen_PeriodicWave.rs +++ b/crates/web-sys/src/features/gen_PeriodicWave.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PeriodicWaveConstraints.rs b/crates/web-sys/src/features/gen_PeriodicWaveConstraints.rs index 363337d8166..d861b30c138 100644 --- a/crates/web-sys/src/features/gen_PeriodicWaveConstraints.rs +++ b/crates/web-sys/src/features/gen_PeriodicWaveConstraints.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveConstraints`*"] pub type PeriodicWaveConstraints; + #[doc = "Get the `disableNormalization` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveConstraints`*"] + #[wasm_bindgen(method, getter = "disableNormalization")] + pub fn get_disable_normalization(this: &PeriodicWaveConstraints) -> Option; + #[doc = "Change the `disableNormalization` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveConstraints`*"] + #[wasm_bindgen(method, setter = "disableNormalization")] + pub fn set_disable_normalization(this: &PeriodicWaveConstraints, val: bool); } impl PeriodicWaveConstraints { #[doc = "Construct a new `PeriodicWaveConstraints`."] @@ -19,21 +30,9 @@ impl PeriodicWaveConstraints { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `disableNormalization` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveConstraints`*"] + #[deprecated = "Use `set_disable_normalization()` instead."] pub fn disable_normalization(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disableNormalization"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_disable_normalization(val); self } } diff --git a/crates/web-sys/src/features/gen_PeriodicWaveOptions.rs b/crates/web-sys/src/features/gen_PeriodicWaveOptions.rs index e4db19baaa4..d2adf3247e4 100644 --- a/crates/web-sys/src/features/gen_PeriodicWaveOptions.rs +++ b/crates/web-sys/src/features/gen_PeriodicWaveOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] pub type PeriodicWaveOptions; + #[doc = "Get the `disableNormalization` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[wasm_bindgen(method, getter = "disableNormalization")] + pub fn get_disable_normalization(this: &PeriodicWaveOptions) -> Option; + #[doc = "Change the `disableNormalization` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[wasm_bindgen(method, setter = "disableNormalization")] + pub fn set_disable_normalization(this: &PeriodicWaveOptions, val: bool); + #[doc = "Get the `imag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[wasm_bindgen(method, getter = "imag")] + pub fn get_imag(this: &PeriodicWaveOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `imag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[wasm_bindgen(method, setter = "imag")] + pub fn set_imag(this: &PeriodicWaveOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `real` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[wasm_bindgen(method, getter = "real")] + pub fn get_real(this: &PeriodicWaveOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `real` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[wasm_bindgen(method, setter = "real")] + pub fn set_real(this: &PeriodicWaveOptions, val: &::wasm_bindgen::JsValue); } impl PeriodicWaveOptions { #[doc = "Construct a new `PeriodicWaveOptions`."] @@ -19,47 +50,19 @@ impl PeriodicWaveOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `disableNormalization` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[deprecated = "Use `set_disable_normalization()` instead."] pub fn disable_normalization(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disableNormalization"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_disable_normalization(val); self } - #[doc = "Change the `imag` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[deprecated = "Use `set_imag()` instead."] pub fn imag(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("imag"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_imag(val); self } - #[doc = "Change the `real` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PeriodicWaveOptions`*"] + #[deprecated = "Use `set_real()` instead."] pub fn real(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("real"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_real(val); self } } diff --git a/crates/web-sys/src/features/gen_PermissionDescriptor.rs b/crates/web-sys/src/features/gen_PermissionDescriptor.rs index 4662732dfc8..3dff9f85e49 100644 --- a/crates/web-sys/src/features/gen_PermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_PermissionDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`*"] pub type PermissionDescriptor; + #[cfg(feature = "PermissionName")] + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`, `PermissionName`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &PermissionDescriptor) -> PermissionName; + #[cfg(feature = "PermissionName")] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`, `PermissionName`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &PermissionDescriptor, val: PermissionName); } impl PermissionDescriptor { #[cfg(feature = "PermissionName")] @@ -18,21 +31,13 @@ impl PermissionDescriptor { pub fn new(name: PermissionName) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); + ret.set_name(name); ret } #[cfg(feature = "PermissionName")] - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`, `PermissionName`*"] + #[deprecated = "Use `set_name()` instead."] pub fn name(&mut self, val: PermissionName) -> &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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_PermissionName.rs b/crates/web-sys/src/features/gen_PermissionName.rs index f919716020a..57887063a10 100644 --- a/crates/web-sys/src/features/gen_PermissionName.rs +++ b/crates/web-sys/src/features/gen_PermissionName.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PermissionName` enum."] diff --git a/crates/web-sys/src/features/gen_PermissionState.rs b/crates/web-sys/src/features/gen_PermissionState.rs index 0d4de492b2c..ad4dfe78af6 100644 --- a/crates/web-sys/src/features/gen_PermissionState.rs +++ b/crates/web-sys/src/features/gen_PermissionState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PermissionState` enum."] diff --git a/crates/web-sys/src/features/gen_PermissionStatus.rs b/crates/web-sys/src/features/gen_PermissionStatus.rs index 7b2cacd3487..2a9645cf2b7 100644 --- a/crates/web-sys/src/features/gen_PermissionStatus.rs +++ b/crates/web-sys/src/features/gen_PermissionStatus.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_Permissions.rs b/crates/web-sys/src/features/gen_Permissions.rs index 4d57a8dc10a..4170005db65 100644 --- a/crates/web-sys/src/features/gen_Permissions.rs +++ b/crates/web-sys/src/features/gen_Permissions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PlaneLayout.rs b/crates/web-sys/src/features/gen_PlaneLayout.rs index 9b9b4bf4e7b..288bd301dbb 100644 --- a/crates/web-sys/src/features/gen_PlaneLayout.rs +++ b/crates/web-sys/src/features/gen_PlaneLayout.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type PlaneLayout; -} -#[cfg(web_sys_unstable_apis)] -impl PlaneLayout { - #[doc = "Construct a new `PlaneLayout`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `offset` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PlaneLayout`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(offset: u32, stride: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.offset(offset); - ret.stride(stride); - ret - } + #[wasm_bindgen(method, getter = "offset")] + pub fn get_offset(this: &PlaneLayout) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `offset` field of this object."] #[doc = ""] @@ -36,17 +30,17 @@ impl PlaneLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn offset(&mut self, val: u32) -> &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 - } + #[wasm_bindgen(method, setter = "offset")] + pub fn set_offset(this: &PlaneLayout, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `stride` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PlaneLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stride")] + pub fn get_stride(this: &PlaneLayout) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `stride` field of this object."] #[doc = ""] @@ -54,15 +48,34 @@ impl PlaneLayout { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stride")] + pub fn set_stride(this: &PlaneLayout, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl PlaneLayout { + #[doc = "Construct a new `PlaneLayout`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PlaneLayout`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(offset: u32, stride: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_offset(offset); + ret.set_stride(stride); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_offset()` instead."] + pub fn offset(&mut self, val: u32) -> &mut Self { + self.set_offset(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stride()` instead."] pub fn stride(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stride"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stride(val); self } } diff --git a/crates/web-sys/src/features/gen_PlaybackDirection.rs b/crates/web-sys/src/features/gen_PlaybackDirection.rs index 94fe8e0ba42..5e3caabfad0 100644 --- a/crates/web-sys/src/features/gen_PlaybackDirection.rs +++ b/crates/web-sys/src/features/gen_PlaybackDirection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PlaybackDirection` enum."] diff --git a/crates/web-sys/src/features/gen_Plugin.rs b/crates/web-sys/src/features/gen_Plugin.rs index 5ca731a9057..4773f398dc7 100644 --- a/crates/web-sys/src/features/gen_Plugin.rs +++ b/crates/web-sys/src/features/gen_Plugin.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,28 +18,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Plugin/description)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Plugin`*"] - pub fn description(this: &Plugin) -> String; + pub fn description(this: &Plugin) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Plugin" , js_name = filename)] #[doc = "Getter for the `filename` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Plugin/filename)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Plugin`*"] - pub fn filename(this: &Plugin) -> String; + pub fn filename(this: &Plugin) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Plugin" , js_name = version)] #[doc = "Getter for the `version` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Plugin/version)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Plugin`*"] - pub fn version(this: &Plugin) -> String; + pub fn version(this: &Plugin) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Plugin" , 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/Plugin/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Plugin`*"] - pub fn name(this: &Plugin) -> String; + pub fn name(this: &Plugin) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Plugin" , js_name = length)] #[doc = "Getter for the `length` field of this object."] #[doc = ""] @@ -64,7 +65,7 @@ extern "C" { pub fn named_item(this: &Plugin, name: &str) -> Option; #[cfg(feature = "MimeType")] #[wasm_bindgen(method, structural, js_class = "Plugin", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] @@ -72,7 +73,7 @@ extern "C" { pub fn get_with_index(this: &Plugin, index: u32) -> Option; #[cfg(feature = "MimeType")] #[wasm_bindgen(method, structural, js_class = "Plugin", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PluginArray.rs b/crates/web-sys/src/features/gen_PluginArray.rs index e31d5458ed0..c9a64805200 100644 --- a/crates/web-sys/src/features/gen_PluginArray.rs +++ b/crates/web-sys/src/features/gen_PluginArray.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -50,7 +51,7 @@ extern "C" { pub fn refresh_with_reload_documents(this: &PluginArray, reload_documents: bool); #[cfg(feature = "Plugin")] #[wasm_bindgen(method, structural, js_class = "PluginArray", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] @@ -58,7 +59,7 @@ extern "C" { pub fn get_with_index(this: &PluginArray, index: u32) -> Option; #[cfg(feature = "Plugin")] #[wasm_bindgen(method, structural, js_class = "PluginArray", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PluginCrashedEventInit.rs b/crates/web-sys/src/features/gen_PluginCrashedEventInit.rs index b400555b55c..dadfa65101d 100644 --- a/crates/web-sys/src/features/gen_PluginCrashedEventInit.rs +++ b/crates/web-sys/src/features/gen_PluginCrashedEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,106 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] pub type PluginCrashedEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PluginCrashedEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PluginCrashedEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PluginCrashedEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PluginCrashedEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PluginCrashedEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PluginCrashedEventInit, val: bool); + #[doc = "Get the `browserDumpID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "browserDumpID")] + pub fn get_browser_dump_id(this: &PluginCrashedEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `browserDumpID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "browserDumpID")] + pub fn set_browser_dump_id(this: &PluginCrashedEventInit, val: Option<&str>); + #[doc = "Get the `gmpPlugin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "gmpPlugin")] + pub fn get_gmp_plugin(this: &PluginCrashedEventInit) -> Option; + #[doc = "Change the `gmpPlugin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "gmpPlugin")] + pub fn set_gmp_plugin(this: &PluginCrashedEventInit, val: bool); + #[doc = "Get the `pluginDumpID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "pluginDumpID")] + pub fn get_plugin_dump_id(this: &PluginCrashedEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `pluginDumpID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "pluginDumpID")] + pub fn set_plugin_dump_id(this: &PluginCrashedEventInit, val: &str); + #[doc = "Get the `pluginFilename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "pluginFilename")] + pub fn get_plugin_filename(this: &PluginCrashedEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `pluginFilename` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "pluginFilename")] + pub fn set_plugin_filename(this: &PluginCrashedEventInit, val: Option<&str>); + #[doc = "Get the `pluginID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "pluginID")] + pub fn get_plugin_id(this: &PluginCrashedEventInit) -> Option; + #[doc = "Change the `pluginID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "pluginID")] + pub fn set_plugin_id(this: &PluginCrashedEventInit, val: u32); + #[doc = "Get the `pluginName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "pluginName")] + pub fn get_plugin_name(this: &PluginCrashedEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `pluginName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "pluginName")] + pub fn set_plugin_name(this: &PluginCrashedEventInit, val: &str); + #[doc = "Get the `submittedCrashReport` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, getter = "submittedCrashReport")] + pub fn get_submitted_crash_report(this: &PluginCrashedEventInit) -> Option; + #[doc = "Change the `submittedCrashReport` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[wasm_bindgen(method, setter = "submittedCrashReport")] + pub fn set_submitted_crash_report(this: &PluginCrashedEventInit, val: bool); } impl PluginCrashedEventInit { #[doc = "Construct a new `PluginCrashedEventInit`."] @@ -19,174 +120,54 @@ impl PluginCrashedEventInit { 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: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `browserDumpID` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_browser_dump_id()` instead."] pub fn browser_dump_id(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("browserDumpID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_browser_dump_id(val); self } - #[doc = "Change the `gmpPlugin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_gmp_plugin()` instead."] pub fn gmp_plugin(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("gmpPlugin"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_gmp_plugin(val); self } - #[doc = "Change the `pluginDumpID` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_plugin_dump_id()` instead."] pub fn plugin_dump_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pluginDumpID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_plugin_dump_id(val); self } - #[doc = "Change the `pluginFilename` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_plugin_filename()` instead."] pub fn plugin_filename(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pluginFilename"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_plugin_filename(val); self } - #[doc = "Change the `pluginID` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_plugin_id()` instead."] pub fn plugin_id(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pluginID"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_plugin_id(val); self } - #[doc = "Change the `pluginName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_plugin_name()` instead."] pub fn plugin_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pluginName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_plugin_name(val); self } - #[doc = "Change the `submittedCrashReport` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PluginCrashedEventInit`*"] + #[deprecated = "Use `set_submitted_crash_report()` instead."] pub fn submitted_crash_report(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("submittedCrashReport"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_submitted_crash_report(val); self } } diff --git a/crates/web-sys/src/features/gen_PointerEvent.rs b/crates/web-sys/src/features/gen_PointerEvent.rs index 7bdd3c987c0..8fcffa74f08 100644 --- a/crates/web-sys/src/features/gen_PointerEvent.rs +++ b/crates/web-sys/src/features/gen_PointerEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -73,7 +74,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEvent`*"] - pub fn pointer_type(this: &PointerEvent) -> String; + pub fn pointer_type(this: &PointerEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PointerEvent" , js_name = isPrimary)] #[doc = "Getter for the `isPrimary` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PointerEventInit.rs b/crates/web-sys/src/features/gen_PointerEventInit.rs index 30655a4ab88..6f109e87931 100644 --- a/crates/web-sys/src/features/gen_PointerEventInit.rs +++ b/crates/web-sys/src/features/gen_PointerEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,390 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] pub type PointerEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PointerEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PointerEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PointerEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PointerEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PointerEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PointerEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &PointerEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &PointerEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &PointerEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &PointerEventInit, val: Option<&Window>); + #[doc = "Get the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "altKey")] + pub fn get_alt_key(this: &PointerEventInit) -> Option; + #[doc = "Change the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "altKey")] + pub fn set_alt_key(this: &PointerEventInit, val: bool); + #[doc = "Get the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "ctrlKey")] + pub fn get_ctrl_key(this: &PointerEventInit) -> Option; + #[doc = "Change the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "ctrlKey")] + pub fn set_ctrl_key(this: &PointerEventInit, val: bool); + #[doc = "Get the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "metaKey")] + pub fn get_meta_key(this: &PointerEventInit) -> Option; + #[doc = "Change the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "metaKey")] + pub fn set_meta_key(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierAltGraph")] + pub fn get_modifier_alt_graph(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierAltGraph")] + pub fn set_modifier_alt_graph(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierCapsLock")] + pub fn get_modifier_caps_lock(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierCapsLock")] + pub fn set_modifier_caps_lock(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFn")] + pub fn get_modifier_fn(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFn")] + pub fn set_modifier_fn(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFnLock")] + pub fn get_modifier_fn_lock(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFnLock")] + pub fn set_modifier_fn_lock(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierNumLock")] + pub fn get_modifier_num_lock(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierNumLock")] + pub fn set_modifier_num_lock(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierOS")] + pub fn get_modifier_os(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierOS")] + pub fn set_modifier_os(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierScrollLock")] + pub fn get_modifier_scroll_lock(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierScrollLock")] + pub fn set_modifier_scroll_lock(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbol")] + pub fn get_modifier_symbol(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbol")] + pub fn set_modifier_symbol(this: &PointerEventInit, val: bool); + #[doc = "Get the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbolLock")] + pub fn get_modifier_symbol_lock(this: &PointerEventInit) -> Option; + #[doc = "Change the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + pub fn set_modifier_symbol_lock(this: &PointerEventInit, val: bool); + #[doc = "Get the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "shiftKey")] + pub fn get_shift_key(this: &PointerEventInit) -> Option; + #[doc = "Change the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "shiftKey")] + pub fn set_shift_key(this: &PointerEventInit, val: bool); + #[doc = "Get the `button` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "button")] + pub fn get_button(this: &PointerEventInit) -> Option; + #[doc = "Change the `button` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "button")] + pub fn set_button(this: &PointerEventInit, val: i16); + #[doc = "Get the `buttons` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "buttons")] + pub fn get_buttons(this: &PointerEventInit) -> Option; + #[doc = "Change the `buttons` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "buttons")] + pub fn set_buttons(this: &PointerEventInit, val: u16); + #[doc = "Get the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "clientX")] + pub fn get_client_x(this: &PointerEventInit) -> Option; + #[doc = "Change the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "clientX")] + pub fn set_client_x(this: &PointerEventInit, val: i32); + #[doc = "Get the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "clientY")] + pub fn get_client_y(this: &PointerEventInit) -> Option; + #[doc = "Change the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "clientY")] + pub fn set_client_y(this: &PointerEventInit, val: i32); + #[doc = "Get the `movementX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "movementX")] + pub fn get_movement_x(this: &PointerEventInit) -> Option; + #[doc = "Change the `movementX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "movementX")] + pub fn set_movement_x(this: &PointerEventInit, val: i32); + #[doc = "Get the `movementY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "movementY")] + pub fn get_movement_y(this: &PointerEventInit) -> Option; + #[doc = "Change the `movementY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "movementY")] + pub fn set_movement_y(this: &PointerEventInit, val: i32); + #[cfg(feature = "EventTarget")] + #[doc = "Get the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "relatedTarget")] + pub fn get_related_target(this: &PointerEventInit) -> Option; + #[cfg(feature = "EventTarget")] + #[doc = "Change the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "relatedTarget")] + pub fn set_related_target(this: &PointerEventInit, val: Option<&EventTarget>); + #[doc = "Get the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "screenX")] + pub fn get_screen_x(this: &PointerEventInit) -> Option; + #[doc = "Change the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "screenX")] + pub fn set_screen_x(this: &PointerEventInit, val: i32); + #[doc = "Get the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "screenY")] + pub fn get_screen_y(this: &PointerEventInit) -> Option; + #[doc = "Change the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "screenY")] + pub fn set_screen_y(this: &PointerEventInit, val: i32); + #[doc = "Get the `coalescedEvents` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "coalescedEvents")] + pub fn get_coalesced_events(this: &PointerEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `coalescedEvents` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "coalescedEvents")] + pub fn set_coalesced_events(this: &PointerEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &PointerEventInit) -> Option; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &PointerEventInit, val: i32); + #[doc = "Get the `isPrimary` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "isPrimary")] + pub fn get_is_primary(this: &PointerEventInit) -> Option; + #[doc = "Change the `isPrimary` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "isPrimary")] + pub fn set_is_primary(this: &PointerEventInit, val: bool); + #[doc = "Get the `pointerId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "pointerId")] + pub fn get_pointer_id(this: &PointerEventInit) -> Option; + #[doc = "Change the `pointerId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "pointerId")] + pub fn set_pointer_id(this: &PointerEventInit, val: i32); + #[doc = "Get the `pointerType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "pointerType")] + pub fn get_pointer_type(this: &PointerEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `pointerType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "pointerType")] + pub fn set_pointer_type(this: &PointerEventInit, val: &str); + #[doc = "Get the `pressure` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "pressure")] + pub fn get_pressure(this: &PointerEventInit) -> Option; + #[doc = "Change the `pressure` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "pressure")] + pub fn set_pressure(this: &PointerEventInit, val: f32); + #[doc = "Get the `tangentialPressure` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "tangentialPressure")] + pub fn get_tangential_pressure(this: &PointerEventInit) -> Option; + #[doc = "Change the `tangentialPressure` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "tangentialPressure")] + pub fn set_tangential_pressure(this: &PointerEventInit, val: f32); + #[doc = "Get the `tiltX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "tiltX")] + pub fn get_tilt_x(this: &PointerEventInit) -> Option; + #[doc = "Change the `tiltX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "tiltX")] + pub fn set_tilt_x(this: &PointerEventInit, val: i32); + #[doc = "Get the `tiltY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "tiltY")] + pub fn get_tilt_y(this: &PointerEventInit) -> Option; + #[doc = "Change the `tiltY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "tiltY")] + pub fn set_tilt_y(this: &PointerEventInit, val: i32); + #[doc = "Get the `twist` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "twist")] + pub fn get_twist(this: &PointerEventInit) -> Option; + #[doc = "Change the `twist` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "twist")] + pub fn set_twist(this: &PointerEventInit, val: i32); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &PointerEventInit) -> Option; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &PointerEventInit, val: i32); } impl PointerEventInit { #[doc = "Construct a new `PointerEventInit`."] @@ -19,620 +404,196 @@ impl PointerEventInit { 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: `PointerEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `altKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_alt_key()` instead."] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alt_key(val); self } - #[doc = "Change the `ctrlKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_ctrl_key()` instead."] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ctrl_key(val); self } - #[doc = "Change the `metaKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_meta_key()` instead."] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_meta_key(val); self } - #[doc = "Change the `modifierAltGraph` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_alt_graph()` instead."] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_alt_graph(val); self } - #[doc = "Change the `modifierCapsLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_caps_lock()` instead."] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_caps_lock(val); self } - #[doc = "Change the `modifierFn` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_fn()` instead."] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn(val); self } - #[doc = "Change the `modifierFnLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_fn_lock()` instead."] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn_lock(val); self } - #[doc = "Change the `modifierNumLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_num_lock()` instead."] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_num_lock(val); self } - #[doc = "Change the `modifierOS` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_os()` instead."] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_os(val); self } - #[doc = "Change the `modifierScrollLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_scroll_lock()` instead."] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_scroll_lock(val); self } - #[doc = "Change the `modifierSymbol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_symbol()` instead."] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol(val); self } - #[doc = "Change the `modifierSymbolLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_modifier_symbol_lock()` instead."] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol_lock(val); self } - #[doc = "Change the `shiftKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_shift_key()` instead."] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shift_key(val); self } - #[doc = "Change the `button` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_button()` instead."] pub fn button(&mut self, val: i16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_button(val); self } - #[doc = "Change the `buttons` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_buttons()` instead."] pub fn buttons(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buttons"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_buttons(val); self } - #[doc = "Change the `clientX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_client_x()` instead."] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_x(val); self } - #[doc = "Change the `clientY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_client_y()` instead."] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_y(val); self } - #[doc = "Change the `movementX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_movement_x()` instead."] pub fn movement_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_movement_x(val); self } - #[doc = "Change the `movementY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_movement_y()` instead."] pub fn movement_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_movement_y(val); self } #[cfg(feature = "EventTarget")] - #[doc = "Change the `relatedTarget` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `PointerEventInit`*"] + #[deprecated = "Use `set_related_target()` instead."] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_related_target(val); self } - #[doc = "Change the `screenX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_screen_x()` instead."] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_x(val); self } - #[doc = "Change the `screenY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_screen_y()` instead."] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_y(val); self } - #[doc = "Change the `coalescedEvents` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_coalesced_events()` instead."] pub fn coalesced_events(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("coalescedEvents"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_coalesced_events(val); self } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `isPrimary` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_is_primary()` instead."] pub fn is_primary(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isPrimary"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_primary(val); self } - #[doc = "Change the `pointerId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_pointer_id()` instead."] pub fn pointer_id(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pointerId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pointer_id(val); self } - #[doc = "Change the `pointerType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_pointer_type()` instead."] pub fn pointer_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pointerType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pointer_type(val); self } - #[doc = "Change the `pressure` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_pressure()` instead."] pub fn pressure(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pressure"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pressure(val); self } - #[doc = "Change the `tangentialPressure` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_tangential_pressure()` instead."] pub fn tangential_pressure(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("tangentialPressure"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_tangential_pressure(val); self } - #[doc = "Change the `tiltX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_tilt_x()` instead."] pub fn tilt_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tiltX"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_tilt_x(val); self } - #[doc = "Change the `tiltY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_tilt_y()` instead."] pub fn tilt_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tiltY"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_tilt_y(val); self } - #[doc = "Change the `twist` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_twist()` instead."] pub fn twist(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("twist"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_twist(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PointerEventInit`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/crates/web-sys/src/features/gen_PopStateEvent.rs b/crates/web-sys/src/features/gen_PopStateEvent.rs index 5fac86918f5..7cc02cb5f83 100644 --- a/crates/web-sys/src/features/gen_PopStateEvent.rs +++ b/crates/web-sys/src/features/gen_PopStateEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PopStateEventInit.rs b/crates/web-sys/src/features/gen_PopStateEventInit.rs index f1a0653c717..61178cc017e 100644 --- a/crates/web-sys/src/features/gen_PopStateEventInit.rs +++ b/crates/web-sys/src/features/gen_PopStateEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] pub type PopStateEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PopStateEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PopStateEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PopStateEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PopStateEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PopStateEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PopStateEventInit, val: bool); + #[doc = "Get the `state` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[wasm_bindgen(method, getter = "state")] + pub fn get_state(this: &PopStateEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `state` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[wasm_bindgen(method, setter = "state")] + pub fn set_state(this: &PopStateEventInit, val: &::wasm_bindgen::JsValue); } impl PopStateEventInit { #[doc = "Construct a new `PopStateEventInit`."] @@ -19,68 +60,24 @@ impl PopStateEventInit { 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: `PopStateEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `state` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PopStateEventInit`*"] + #[deprecated = "Use `set_state()` instead."] pub fn state(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("state"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_state(val); self } } diff --git a/crates/web-sys/src/features/gen_PopupBlockedEvent.rs b/crates/web-sys/src/features/gen_PopupBlockedEvent.rs index 22b008868ac..b771da63948 100644 --- a/crates/web-sys/src/features/gen_PopupBlockedEvent.rs +++ b/crates/web-sys/src/features/gen_PopupBlockedEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,14 +26,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PopupBlockedEvent/popupWindowName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEvent`*"] - pub fn popup_window_name(this: &PopupBlockedEvent) -> Option; + pub fn popup_window_name(this: &PopupBlockedEvent) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "PopupBlockedEvent" , js_name = popupWindowFeatures)] #[doc = "Getter for the `popupWindowFeatures` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PopupBlockedEvent/popupWindowFeatures)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEvent`*"] - pub fn popup_window_features(this: &PopupBlockedEvent) -> Option; + pub fn popup_window_features(this: &PopupBlockedEvent) -> Option<::alloc::string::String>; #[wasm_bindgen(catch, constructor, js_class = "PopupBlockedEvent")] #[doc = "The `new PopupBlockedEvent(..)` constructor, creating a new instance of `PopupBlockedEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PopupBlockedEventInit.rs b/crates/web-sys/src/features/gen_PopupBlockedEventInit.rs index 81494ec06bb..045d903b4cc 100644 --- a/crates/web-sys/src/features/gen_PopupBlockedEventInit.rs +++ b/crates/web-sys/src/features/gen_PopupBlockedEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,70 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] pub type PopupBlockedEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PopupBlockedEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PopupBlockedEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PopupBlockedEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PopupBlockedEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PopupBlockedEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PopupBlockedEventInit, val: bool); + #[doc = "Get the `popupWindowFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, getter = "popupWindowFeatures")] + pub fn get_popup_window_features( + this: &PopupBlockedEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `popupWindowFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, setter = "popupWindowFeatures")] + pub fn set_popup_window_features(this: &PopupBlockedEventInit, val: &str); + #[doc = "Get the `popupWindowName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, getter = "popupWindowName")] + pub fn get_popup_window_name(this: &PopupBlockedEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `popupWindowName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[wasm_bindgen(method, setter = "popupWindowName")] + pub fn set_popup_window_name(this: &PopupBlockedEventInit, val: &str); + #[cfg(feature = "Window")] + #[doc = "Get the `requestingWindow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "requestingWindow")] + pub fn get_requesting_window(this: &PopupBlockedEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `requestingWindow` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "requestingWindow")] + pub fn set_requesting_window(this: &PopupBlockedEventInit, val: Option<&Window>); } impl PopupBlockedEventInit { #[doc = "Construct a new `PopupBlockedEventInit`."] @@ -19,107 +84,35 @@ impl PopupBlockedEventInit { 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: `PopupBlockedEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `popupWindowFeatures` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[deprecated = "Use `set_popup_window_features()` instead."] pub fn popup_window_features(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("popupWindowFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_popup_window_features(val); self } - #[doc = "Change the `popupWindowName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`*"] + #[deprecated = "Use `set_popup_window_name()` instead."] pub fn popup_window_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("popupWindowName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_popup_window_name(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `requestingWindow` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PopupBlockedEventInit`, `Window`*"] + #[deprecated = "Use `set_requesting_window()` instead."] pub fn requesting_window(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requestingWindow"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_requesting_window(val); self } } diff --git a/crates/web-sys/src/features/gen_Position.rs b/crates/web-sys/src/features/gen_Position.rs index b8e1dfaed53..a94777d0a9c 100644 --- a/crates/web-sys/src/features/gen_Position.rs +++ b/crates/web-sys/src/features/gen_Position.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PositionAlignSetting.rs b/crates/web-sys/src/features/gen_PositionAlignSetting.rs index d6db3f17b19..929f80840c9 100644 --- a/crates/web-sys/src/features/gen_PositionAlignSetting.rs +++ b/crates/web-sys/src/features/gen_PositionAlignSetting.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PositionAlignSetting` enum."] diff --git a/crates/web-sys/src/features/gen_PositionError.rs b/crates/web-sys/src/features/gen_PositionError.rs index b21b7586b33..8c6dc2ace34 100644 --- a/crates/web-sys/src/features/gen_PositionError.rs +++ b/crates/web-sys/src/features/gen_PositionError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PositionError/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PositionError`*"] - pub fn message(this: &PositionError) -> String; + pub fn message(this: &PositionError) -> ::alloc::string::String; } impl PositionError { #[doc = "The `PositionError.PERMISSION_DENIED` const."] diff --git a/crates/web-sys/src/features/gen_PositionOptions.rs b/crates/web-sys/src/features/gen_PositionOptions.rs index 30c0b106354..63806556d61 100644 --- a/crates/web-sys/src/features/gen_PositionOptions.rs +++ b/crates/web-sys/src/features/gen_PositionOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] pub type PositionOptions; + #[doc = "Get the `enableHighAccuracy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[wasm_bindgen(method, getter = "enableHighAccuracy")] + pub fn get_enable_high_accuracy(this: &PositionOptions) -> Option; + #[doc = "Change the `enableHighAccuracy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[wasm_bindgen(method, setter = "enableHighAccuracy")] + pub fn set_enable_high_accuracy(this: &PositionOptions, val: bool); + #[doc = "Get the `maximumAge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[wasm_bindgen(method, getter = "maximumAge")] + pub fn get_maximum_age(this: &PositionOptions) -> Option; + #[doc = "Change the `maximumAge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[wasm_bindgen(method, setter = "maximumAge")] + pub fn set_maximum_age(this: &PositionOptions, val: u32); + #[doc = "Get the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[wasm_bindgen(method, getter = "timeout")] + pub fn get_timeout(this: &PositionOptions) -> Option; + #[doc = "Change the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[wasm_bindgen(method, setter = "timeout")] + pub fn set_timeout(this: &PositionOptions, val: u32); } impl PositionOptions { #[doc = "Construct a new `PositionOptions`."] @@ -19,55 +50,19 @@ impl PositionOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `enableHighAccuracy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[deprecated = "Use `set_enable_high_accuracy()` instead."] pub fn enable_high_accuracy(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("enableHighAccuracy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_enable_high_accuracy(val); self } - #[doc = "Change the `maximumAge` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[deprecated = "Use `set_maximum_age()` instead."] pub fn maximum_age(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maximumAge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_maximum_age(val); self } - #[doc = "Change the `timeout` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"] + #[deprecated = "Use `set_timeout()` instead."] pub fn timeout(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeout"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timeout(val); self } } diff --git a/crates/web-sys/src/features/gen_PremultiplyAlpha.rs b/crates/web-sys/src/features/gen_PremultiplyAlpha.rs new file mode 100644 index 00000000000..603d77abef8 --- /dev/null +++ b/crates/web-sys/src/features/gen_PremultiplyAlpha.rs @@ -0,0 +1,13 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `PremultiplyAlpha` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `PremultiplyAlpha`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum PremultiplyAlpha { + None = "none", + Premultiply = "premultiply", + Default = "default", +} diff --git a/crates/web-sys/src/features/gen_Presentation.rs b/crates/web-sys/src/features/gen_Presentation.rs index 428975568de..b1c2da4d595 100644 --- a/crates/web-sys/src/features/gen_Presentation.rs +++ b/crates/web-sys/src/features/gen_Presentation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PresentationAvailability.rs b/crates/web-sys/src/features/gen_PresentationAvailability.rs index 90ea7c55cf1..bd68ff5413f 100644 --- a/crates/web-sys/src/features/gen_PresentationAvailability.rs +++ b/crates/web-sys/src/features/gen_PresentationAvailability.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PresentationConnection.rs b/crates/web-sys/src/features/gen_PresentationConnection.rs index 8c4977879fa..c3007756487 100644 --- a/crates/web-sys/src/features/gen_PresentationConnection.rs +++ b/crates/web-sys/src/features/gen_PresentationConnection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PresentationConnection/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnection`*"] - pub fn id(this: &PresentationConnection) -> String; + pub fn id(this: &PresentationConnection) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "PresentationConnection" , js_name = url)] #[doc = "Getter for the `url` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PresentationConnection/url)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnection`*"] - pub fn url(this: &PresentationConnection) -> String; + pub fn url(this: &PresentationConnection) -> ::alloc::string::String; #[cfg(feature = "PresentationConnectionState")] # [wasm_bindgen (structural , method , getter , js_class = "PresentationConnection" , js_name = state)] #[doc = "Getter for the `state` field of this object."] @@ -154,6 +155,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnection`*"] pub fn send_with_u8_array(this: &PresentationConnection, data: &[u8]) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "PresentationConnection" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PresentationConnection/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnection`*"] + pub fn send_with_js_u8_array( + this: &PresentationConnection, + data: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "PresentationConnection" , js_name = terminate)] #[doc = "The `terminate()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_PresentationConnectionAvailableEvent.rs b/crates/web-sys/src/features/gen_PresentationConnectionAvailableEvent.rs index 203c6b14aa3..b55188ddbea 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionAvailableEvent.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionAvailableEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PresentationConnectionAvailableEventInit.rs b/crates/web-sys/src/features/gen_PresentationConnectionAvailableEventInit.rs index 8ea8b696208..cc0e4689549 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionAvailableEventInit.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionAvailableEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,53 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] pub type PresentationConnectionAvailableEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PresentationConnectionAvailableEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PresentationConnectionAvailableEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PresentationConnectionAvailableEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PresentationConnectionAvailableEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PresentationConnectionAvailableEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PresentationConnectionAvailableEventInit, val: bool); + #[cfg(feature = "PresentationConnection")] + #[doc = "Get the `connection` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnection`, `PresentationConnectionAvailableEventInit`*"] + #[wasm_bindgen(method, getter = "connection")] + pub fn get_connection( + this: &PresentationConnectionAvailableEventInit, + ) -> PresentationConnection; + #[cfg(feature = "PresentationConnection")] + #[doc = "Change the `connection` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnection`, `PresentationConnectionAvailableEventInit`*"] + #[wasm_bindgen(method, setter = "connection")] + pub fn set_connection( + this: &PresentationConnectionAvailableEventInit, + val: &PresentationConnection, + ); } impl PresentationConnectionAvailableEventInit { #[cfg(feature = "PresentationConnection")] @@ -18,76 +66,28 @@ impl PresentationConnectionAvailableEventInit { pub fn new(connection: &PresentationConnection) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.connection(connection); + ret.set_connection(connection); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionAvailableEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "PresentationConnection")] - #[doc = "Change the `connection` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnection`, `PresentationConnectionAvailableEventInit`*"] + #[deprecated = "Use `set_connection()` instead."] pub fn connection(&mut self, val: &PresentationConnection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("connection"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_connection(val); self } } diff --git a/crates/web-sys/src/features/gen_PresentationConnectionBinaryType.rs b/crates/web-sys/src/features/gen_PresentationConnectionBinaryType.rs index 927c3791c4c..1170ee14ba9 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionBinaryType.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionBinaryType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PresentationConnectionBinaryType` enum."] diff --git a/crates/web-sys/src/features/gen_PresentationConnectionCloseEvent.rs b/crates/web-sys/src/features/gen_PresentationConnectionCloseEvent.rs index 405b2e59da6..338f15698fc 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionCloseEvent.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionCloseEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PresentationConnectionCloseEvent/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEvent`*"] - pub fn message(this: &PresentationConnectionCloseEvent) -> String; + pub fn message(this: &PresentationConnectionCloseEvent) -> ::alloc::string::String; #[cfg(feature = "PresentationConnectionCloseEventInit")] #[wasm_bindgen(catch, constructor, js_class = "PresentationConnectionCloseEvent")] #[doc = "The `new PresentationConnectionCloseEvent(..)` constructor, creating a new instance of `PresentationConnectionCloseEvent`."] diff --git a/crates/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs b/crates/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs index 9a7c221c232..caed706a7cb 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionCloseEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,65 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] pub type PresentationConnectionCloseEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PresentationConnectionCloseEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PresentationConnectionCloseEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PresentationConnectionCloseEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PresentationConnectionCloseEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PresentationConnectionCloseEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PresentationConnectionCloseEventInit, val: bool); + #[doc = "Get the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[wasm_bindgen(method, getter = "message")] + pub fn get_message( + this: &PresentationConnectionCloseEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[wasm_bindgen(method, setter = "message")] + pub fn set_message(this: &PresentationConnectionCloseEventInit, val: &str); + #[cfg(feature = "PresentationConnectionClosedReason")] + #[doc = "Get the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"] + #[wasm_bindgen(method, getter = "reason")] + pub fn get_reason( + this: &PresentationConnectionCloseEventInit, + ) -> PresentationConnectionClosedReason; + #[cfg(feature = "PresentationConnectionClosedReason")] + #[doc = "Change the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"] + #[wasm_bindgen(method, setter = "reason")] + pub fn set_reason( + this: &PresentationConnectionCloseEventInit, + val: PresentationConnectionClosedReason, + ); } impl PresentationConnectionCloseEventInit { #[cfg(feature = "PresentationConnectionClosedReason")] @@ -18,90 +78,33 @@ impl PresentationConnectionCloseEventInit { pub fn new(reason: PresentationConnectionClosedReason) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.reason(reason); + ret.set_reason(reason); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `message` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`*"] + #[deprecated = "Use `set_message()` instead."] pub fn message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_message(val); self } #[cfg(feature = "PresentationConnectionClosedReason")] - #[doc = "Change the `reason` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PresentationConnectionCloseEventInit`, `PresentationConnectionClosedReason`*"] + #[deprecated = "Use `set_reason()` instead."] pub fn reason(&mut self, val: PresentationConnectionClosedReason) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_reason(val); self } } diff --git a/crates/web-sys/src/features/gen_PresentationConnectionClosedReason.rs b/crates/web-sys/src/features/gen_PresentationConnectionClosedReason.rs index d478b097946..254175d5833 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionClosedReason.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionClosedReason.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PresentationConnectionClosedReason` enum."] diff --git a/crates/web-sys/src/features/gen_PresentationConnectionList.rs b/crates/web-sys/src/features/gen_PresentationConnectionList.rs index c1c95cba5bd..c23875ba08b 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionList.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PresentationConnectionState.rs b/crates/web-sys/src/features/gen_PresentationConnectionState.rs index 68e0905a295..4aa059497d7 100644 --- a/crates/web-sys/src/features/gen_PresentationConnectionState.rs +++ b/crates/web-sys/src/features/gen_PresentationConnectionState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PresentationConnectionState` enum."] diff --git a/crates/web-sys/src/features/gen_PresentationReceiver.rs b/crates/web-sys/src/features/gen_PresentationReceiver.rs index 5e1388a6e20..821ecb9076a 100644 --- a/crates/web-sys/src/features/gen_PresentationReceiver.rs +++ b/crates/web-sys/src/features/gen_PresentationReceiver.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PresentationRequest.rs b/crates/web-sys/src/features/gen_PresentationRequest.rs index 484b4c3f0b0..1bf4c2e1322 100644 --- a/crates/web-sys/src/features/gen_PresentationRequest.rs +++ b/crates/web-sys/src/features/gen_PresentationRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PresentationStyle.rs b/crates/web-sys/src/features/gen_PresentationStyle.rs index 3f45b29c97c..2c0573d8553 100644 --- a/crates/web-sys/src/features/gen_PresentationStyle.rs +++ b/crates/web-sys/src/features/gen_PresentationStyle.rs @@ -1,13 +1,10 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] #[doc = "The `PresentationStyle` enum."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PresentationStyle`*"] -#[doc = ""] -#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] -#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum PresentationStyle { Unspecified = "unspecified", diff --git a/crates/web-sys/src/features/gen_ProcessingInstruction.rs b/crates/web-sys/src/features/gen_ProcessingInstruction.rs index 158f56bf89e..a2487c06d90 100644 --- a/crates/web-sys/src/features/gen_ProcessingInstruction.rs +++ b/crates/web-sys/src/features/gen_ProcessingInstruction.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ProcessingInstruction/target)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProcessingInstruction`*"] - pub fn target(this: &ProcessingInstruction) -> String; + pub fn target(this: &ProcessingInstruction) -> ::alloc::string::String; #[cfg(feature = "StyleSheet")] # [wasm_bindgen (structural , method , getter , js_class = "ProcessingInstruction" , js_name = sheet)] #[doc = "Getter for the `sheet` field of this object."] diff --git a/crates/web-sys/src/features/gen_ProfileTimelineLayerRect.rs b/crates/web-sys/src/features/gen_ProfileTimelineLayerRect.rs index b16776e3f42..7dc5738b2d8 100644 --- a/crates/web-sys/src/features/gen_ProfileTimelineLayerRect.rs +++ b/crates/web-sys/src/features/gen_ProfileTimelineLayerRect.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] pub type ProfileTimelineLayerRect; + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &ProfileTimelineLayerRect) -> Option; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &ProfileTimelineLayerRect, val: i32); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &ProfileTimelineLayerRect) -> Option; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &ProfileTimelineLayerRect, val: i32); + #[doc = "Get the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[wasm_bindgen(method, getter = "x")] + pub fn get_x(this: &ProfileTimelineLayerRect) -> Option; + #[doc = "Change the `x` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[wasm_bindgen(method, setter = "x")] + pub fn set_x(this: &ProfileTimelineLayerRect, val: i32); + #[doc = "Get the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[wasm_bindgen(method, getter = "y")] + pub fn get_y(this: &ProfileTimelineLayerRect) -> Option; + #[doc = "Change the `y` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[wasm_bindgen(method, setter = "y")] + pub fn set_y(this: &ProfileTimelineLayerRect, val: i32); } impl ProfileTimelineLayerRect { #[doc = "Construct a new `ProfileTimelineLayerRect`."] @@ -19,57 +60,24 @@ impl ProfileTimelineLayerRect { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } - #[doc = "Change the `x` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[deprecated = "Use `set_x()` instead."] pub fn x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x(val); self } - #[doc = "Change the `y` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineLayerRect`*"] + #[deprecated = "Use `set_y()` instead."] pub fn y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_y(val); self } } diff --git a/crates/web-sys/src/features/gen_ProfileTimelineMarker.rs b/crates/web-sys/src/features/gen_ProfileTimelineMarker.rs index f12f1a6b08d..52796342058 100644 --- a/crates/web-sys/src/features/gen_ProfileTimelineMarker.rs +++ b/crates/web-sys/src/features/gen_ProfileTimelineMarker.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,170 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] pub type ProfileTimelineMarker; + #[doc = "Get the `causeName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "causeName")] + pub fn get_cause_name(this: &ProfileTimelineMarker) -> Option<::alloc::string::String>; + #[doc = "Change the `causeName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "causeName")] + pub fn set_cause_name(this: &ProfileTimelineMarker, val: &str); + #[doc = "Get the `end` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "end")] + pub fn get_end(this: &ProfileTimelineMarker) -> Option; + #[doc = "Change the `end` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "end")] + pub fn set_end(this: &ProfileTimelineMarker, val: f64); + #[doc = "Get the `endStack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "endStack")] + pub fn get_end_stack(this: &ProfileTimelineMarker) -> Option<::js_sys::Object>; + #[doc = "Change the `endStack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "endStack")] + pub fn set_end_stack(this: &ProfileTimelineMarker, val: Option<&::js_sys::Object>); + #[doc = "Get the `eventPhase` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "eventPhase")] + pub fn get_event_phase(this: &ProfileTimelineMarker) -> Option; + #[doc = "Change the `eventPhase` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "eventPhase")] + pub fn set_event_phase(this: &ProfileTimelineMarker, val: u16); + #[doc = "Get the `isAnimationOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "isAnimationOnly")] + pub fn get_is_animation_only(this: &ProfileTimelineMarker) -> Option; + #[doc = "Change the `isAnimationOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "isAnimationOnly")] + pub fn set_is_animation_only(this: &ProfileTimelineMarker, val: bool); + #[doc = "Get the `isOffMainThread` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "isOffMainThread")] + pub fn get_is_off_main_thread(this: &ProfileTimelineMarker) -> Option; + #[doc = "Change the `isOffMainThread` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "isOffMainThread")] + pub fn set_is_off_main_thread(this: &ProfileTimelineMarker, val: bool); + #[cfg(feature = "ProfileTimelineMessagePortOperationType")] + #[doc = "Get the `messagePortOperation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`, `ProfileTimelineMessagePortOperationType`*"] + #[wasm_bindgen(method, getter = "messagePortOperation")] + pub fn get_message_port_operation( + this: &ProfileTimelineMarker, + ) -> Option; + #[cfg(feature = "ProfileTimelineMessagePortOperationType")] + #[doc = "Change the `messagePortOperation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`, `ProfileTimelineMessagePortOperationType`*"] + #[wasm_bindgen(method, setter = "messagePortOperation")] + pub fn set_message_port_operation( + this: &ProfileTimelineMarker, + val: ProfileTimelineMessagePortOperationType, + ); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &ProfileTimelineMarker) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &ProfileTimelineMarker, val: &str); + #[doc = "Get the `processType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "processType")] + pub fn get_process_type(this: &ProfileTimelineMarker) -> Option; + #[doc = "Change the `processType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "processType")] + pub fn set_process_type(this: &ProfileTimelineMarker, val: u16); + #[doc = "Get the `rectangles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "rectangles")] + pub fn get_rectangles(this: &ProfileTimelineMarker) -> Option<::js_sys::Array>; + #[doc = "Change the `rectangles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "rectangles")] + pub fn set_rectangles(this: &ProfileTimelineMarker, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `stack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "stack")] + pub fn get_stack(this: &ProfileTimelineMarker) -> Option<::js_sys::Object>; + #[doc = "Change the `stack` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "stack")] + pub fn set_stack(this: &ProfileTimelineMarker, val: Option<&::js_sys::Object>); + #[doc = "Get the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "start")] + pub fn get_start(this: &ProfileTimelineMarker) -> Option; + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "start")] + pub fn set_start(this: &ProfileTimelineMarker, val: f64); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &ProfileTimelineMarker) -> Option<::alloc::string::String>; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &ProfileTimelineMarker, val: &str); + #[doc = "Get the `unixTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, getter = "unixTime")] + pub fn get_unix_time(this: &ProfileTimelineMarker) -> Option; + #[doc = "Change the `unixTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[wasm_bindgen(method, setter = "unixTime")] + pub fn set_unix_time(this: &ProfileTimelineMarker, val: f64); + #[cfg(feature = "ProfileTimelineWorkerOperationType")] + #[doc = "Get the `workerOperation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`, `ProfileTimelineWorkerOperationType`*"] + #[wasm_bindgen(method, getter = "workerOperation")] + pub fn get_worker_operation( + this: &ProfileTimelineMarker, + ) -> Option; + #[cfg(feature = "ProfileTimelineWorkerOperationType")] + #[doc = "Change the `workerOperation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`, `ProfileTimelineWorkerOperationType`*"] + #[wasm_bindgen(method, setter = "workerOperation")] + pub fn set_worker_operation( + this: &ProfileTimelineMarker, + val: ProfileTimelineWorkerOperationType, + ); } impl ProfileTimelineMarker { #[doc = "Construct a new `ProfileTimelineMarker`."] @@ -19,244 +184,84 @@ impl ProfileTimelineMarker { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `causeName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_cause_name()` instead."] pub fn cause_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("causeName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cause_name(val); self } - #[doc = "Change the `end` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_end()` instead."] pub fn end(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("end"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_end(val); self } - #[doc = "Change the `endStack` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_end_stack()` instead."] pub fn end_stack(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endStack"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_end_stack(val); self } - #[doc = "Change the `eventPhase` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_event_phase()` instead."] pub fn event_phase(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("eventPhase"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_event_phase(val); self } - #[doc = "Change the `isAnimationOnly` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_is_animation_only()` instead."] pub fn is_animation_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isAnimationOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_animation_only(val); self } - #[doc = "Change the `isOffMainThread` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_is_off_main_thread()` instead."] pub fn is_off_main_thread(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isOffMainThread"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_off_main_thread(val); self } #[cfg(feature = "ProfileTimelineMessagePortOperationType")] - #[doc = "Change the `messagePortOperation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`, `ProfileTimelineMessagePortOperationType`*"] + #[deprecated = "Use `set_message_port_operation()` instead."] pub fn message_port_operation( &mut self, val: ProfileTimelineMessagePortOperationType, ) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("messagePortOperation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_message_port_operation(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `processType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_process_type()` instead."] pub fn process_type(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("processType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_process_type(val); self } - #[doc = "Change the `rectangles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_rectangles()` instead."] pub fn rectangles(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rectangles"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rectangles(val); self } - #[doc = "Change the `stack` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_stack()` instead."] pub fn stack(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stack"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stack(val); self } - #[doc = "Change the `start` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_start()` instead."] pub fn start(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_start(val); self } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_type()` instead."] 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.set_type(val); self } - #[doc = "Change the `unixTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`*"] + #[deprecated = "Use `set_unix_time()` instead."] pub fn unix_time(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("unixTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_unix_time(val); self } #[cfg(feature = "ProfileTimelineWorkerOperationType")] - #[doc = "Change the `workerOperation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineMarker`, `ProfileTimelineWorkerOperationType`*"] + #[deprecated = "Use `set_worker_operation()` instead."] pub fn worker_operation(&mut self, val: ProfileTimelineWorkerOperationType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("workerOperation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_worker_operation(val); self } } diff --git a/crates/web-sys/src/features/gen_ProfileTimelineMessagePortOperationType.rs b/crates/web-sys/src/features/gen_ProfileTimelineMessagePortOperationType.rs index ef447a95fc2..95620b06492 100644 --- a/crates/web-sys/src/features/gen_ProfileTimelineMessagePortOperationType.rs +++ b/crates/web-sys/src/features/gen_ProfileTimelineMessagePortOperationType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ProfileTimelineMessagePortOperationType` enum."] diff --git a/crates/web-sys/src/features/gen_ProfileTimelineStackFrame.rs b/crates/web-sys/src/features/gen_ProfileTimelineStackFrame.rs index 79bd3b74f2d..7633949b205 100644 --- a/crates/web-sys/src/features/gen_ProfileTimelineStackFrame.rs +++ b/crates/web-sys/src/features/gen_ProfileTimelineStackFrame.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,78 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] pub type ProfileTimelineStackFrame; + #[doc = "Get the `asyncCause` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, getter = "asyncCause")] + pub fn get_async_cause(this: &ProfileTimelineStackFrame) -> Option<::alloc::string::String>; + #[doc = "Change the `asyncCause` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, setter = "asyncCause")] + pub fn set_async_cause(this: &ProfileTimelineStackFrame, val: &str); + #[doc = "Get the `asyncParent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, getter = "asyncParent")] + pub fn get_async_parent(this: &ProfileTimelineStackFrame) -> Option<::js_sys::Object>; + #[doc = "Change the `asyncParent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, setter = "asyncParent")] + pub fn set_async_parent(this: &ProfileTimelineStackFrame, val: Option<&::js_sys::Object>); + #[doc = "Get the `column` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, getter = "column")] + pub fn get_column(this: &ProfileTimelineStackFrame) -> Option; + #[doc = "Change the `column` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, setter = "column")] + pub fn set_column(this: &ProfileTimelineStackFrame, val: i32); + #[doc = "Get the `functionDisplayName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, getter = "functionDisplayName")] + pub fn get_function_display_name( + this: &ProfileTimelineStackFrame, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `functionDisplayName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, setter = "functionDisplayName")] + pub fn set_function_display_name(this: &ProfileTimelineStackFrame, val: &str); + #[doc = "Get the `line` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, getter = "line")] + pub fn get_line(this: &ProfileTimelineStackFrame) -> Option; + #[doc = "Change the `line` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, setter = "line")] + pub fn set_line(this: &ProfileTimelineStackFrame, val: i32); + #[doc = "Get the `parent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, getter = "parent")] + pub fn get_parent(this: &ProfileTimelineStackFrame) -> Option<::js_sys::Object>; + #[doc = "Change the `parent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, setter = "parent")] + pub fn set_parent(this: &ProfileTimelineStackFrame, val: Option<&::js_sys::Object>); + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &ProfileTimelineStackFrame) -> Option<::alloc::string::String>; + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &ProfileTimelineStackFrame, val: &str); } impl ProfileTimelineStackFrame { #[doc = "Construct a new `ProfileTimelineStackFrame`."] @@ -19,110 +92,39 @@ impl ProfileTimelineStackFrame { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `asyncCause` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[deprecated = "Use `set_async_cause()` instead."] pub fn async_cause(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("asyncCause"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_async_cause(val); self } - #[doc = "Change the `asyncParent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[deprecated = "Use `set_async_parent()` instead."] pub fn async_parent(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("asyncParent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_async_parent(val); self } - #[doc = "Change the `column` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[deprecated = "Use `set_column()` instead."] pub fn column(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("column"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_column(val); self } - #[doc = "Change the `functionDisplayName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[deprecated = "Use `set_function_display_name()` instead."] pub fn function_display_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("functionDisplayName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_function_display_name(val); self } - #[doc = "Change the `line` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[deprecated = "Use `set_line()` instead."] pub fn line(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("line"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_line(val); self } - #[doc = "Change the `parent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[deprecated = "Use `set_parent()` instead."] pub fn parent(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("parent"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_parent(val); self } - #[doc = "Change the `source` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProfileTimelineStackFrame`*"] + #[deprecated = "Use `set_source()` instead."] pub fn source(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source(val); self } } diff --git a/crates/web-sys/src/features/gen_ProfileTimelineWorkerOperationType.rs b/crates/web-sys/src/features/gen_ProfileTimelineWorkerOperationType.rs index 9006dda1228..25a50bfb973 100644 --- a/crates/web-sys/src/features/gen_ProfileTimelineWorkerOperationType.rs +++ b/crates/web-sys/src/features/gen_ProfileTimelineWorkerOperationType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ProfileTimelineWorkerOperationType` enum."] diff --git a/crates/web-sys/src/features/gen_ProgressEvent.rs b/crates/web-sys/src/features/gen_ProgressEvent.rs index 8ab6d36af81..2dd30ee0396 100644 --- a/crates/web-sys/src/features/gen_ProgressEvent.rs +++ b/crates/web-sys/src/features/gen_ProgressEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ProgressEventInit.rs b/crates/web-sys/src/features/gen_ProgressEventInit.rs index ea6a5fe1113..97a1fed65f7 100644 --- a/crates/web-sys/src/features/gen_ProgressEventInit.rs +++ b/crates/web-sys/src/features/gen_ProgressEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] pub type ProgressEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ProgressEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ProgressEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ProgressEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ProgressEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ProgressEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ProgressEventInit, val: bool); + #[doc = "Get the `lengthComputable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, getter = "lengthComputable")] + pub fn get_length_computable(this: &ProgressEventInit) -> Option; + #[doc = "Change the `lengthComputable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, setter = "lengthComputable")] + pub fn set_length_computable(this: &ProgressEventInit, val: bool); + #[doc = "Get the `loaded` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, getter = "loaded")] + pub fn get_loaded(this: &ProgressEventInit) -> Option; + #[doc = "Change the `loaded` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, setter = "loaded")] + pub fn set_loaded(this: &ProgressEventInit, val: f64); + #[doc = "Get the `total` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, getter = "total")] + pub fn get_total(this: &ProgressEventInit) -> Option; + #[doc = "Change the `total` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[wasm_bindgen(method, setter = "total")] + pub fn set_total(this: &ProgressEventInit, val: f64); } impl ProgressEventInit { #[doc = "Construct a new `ProgressEventInit`."] @@ -19,99 +80,34 @@ impl ProgressEventInit { 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: `ProgressEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `lengthComputable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[deprecated = "Use `set_length_computable()` instead."] pub fn length_computable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lengthComputable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_length_computable(val); self } - #[doc = "Change the `loaded` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[deprecated = "Use `set_loaded()` instead."] pub fn loaded(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("loaded"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_loaded(val); self } - #[doc = "Change the `total` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ProgressEventInit`*"] + #[deprecated = "Use `set_total()` instead."] pub fn total(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("total"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_total(val); self } } diff --git a/crates/web-sys/src/features/gen_PromiseNativeHandler.rs b/crates/web-sys/src/features/gen_PromiseNativeHandler.rs index 6fbf1acf5bc..f764dd1d68a 100644 --- a/crates/web-sys/src/features/gen_PromiseNativeHandler.rs +++ b/crates/web-sys/src/features/gen_PromiseNativeHandler.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PromiseRejectionEvent.rs b/crates/web-sys/src/features/gen_PromiseRejectionEvent.rs index 6d7361f694e..cd2921ae9df 100644 --- a/crates/web-sys/src/features/gen_PromiseRejectionEvent.rs +++ b/crates/web-sys/src/features/gen_PromiseRejectionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PromiseRejectionEventInit.rs b/crates/web-sys/src/features/gen_PromiseRejectionEventInit.rs index 30375764e86..2aa16f55ab4 100644 --- a/crates/web-sys/src/features/gen_PromiseRejectionEventInit.rs +++ b/crates/web-sys/src/features/gen_PromiseRejectionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] pub type PromiseRejectionEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PromiseRejectionEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PromiseRejectionEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PromiseRejectionEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PromiseRejectionEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PromiseRejectionEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PromiseRejectionEventInit, val: bool); + #[doc = "Get the `promise` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, getter = "promise")] + pub fn get_promise(this: &PromiseRejectionEventInit) -> ::js_sys::Promise; + #[doc = "Change the `promise` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, setter = "promise")] + pub fn set_promise(this: &PromiseRejectionEventInit, val: &::js_sys::Promise); + #[doc = "Get the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, getter = "reason")] + pub fn get_reason(this: &PromiseRejectionEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[wasm_bindgen(method, setter = "reason")] + pub fn set_reason(this: &PromiseRejectionEventInit, val: &::wasm_bindgen::JsValue); } impl PromiseRejectionEventInit { #[doc = "Construct a new `PromiseRejectionEventInit`."] @@ -17,89 +68,32 @@ impl PromiseRejectionEventInit { pub fn new(promise: &::js_sys::Promise) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.promise(promise); + ret.set_promise(promise); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `promise` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[deprecated = "Use `set_promise()` instead."] pub fn promise(&mut self, val: &::js_sys::Promise) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("promise"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_promise(val); self } - #[doc = "Change the `reason` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PromiseRejectionEventInit`*"] + #[deprecated = "Use `set_reason()` instead."] pub fn reason(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_reason(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredential.rs b/crates/web-sys/src/features/gen_PublicKeyCredential.rs index dd7f8cbd0d9..0b4a0a929aa 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredential.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredential.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -26,6 +27,17 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AuthenticatorResponse`, `PublicKeyCredential`*"] pub fn response(this: &PublicKeyCredential) -> AuthenticatorResponse; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "PublicKeyCredential" , js_name = authenticatorAttachment)] + #[doc = "Getter for the `authenticatorAttachment` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/authenticatorAttachment)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn authenticator_attachment(this: &PublicKeyCredential) -> Option<::alloc::string::String>; #[cfg(feature = "AuthenticationExtensionsClientOutputs")] # [wasm_bindgen (method , structural , js_class = "PublicKeyCredential" , js_name = getClientExtensionResults)] #[doc = "The `getClientExtensionResults()` method."] @@ -36,11 +48,78 @@ extern "C" { pub fn get_client_extension_results( this: &PublicKeyCredential, ) -> AuthenticationExtensionsClientOutputs; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = PublicKeyCredential , js_class = "PublicKeyCredential" , js_name = isConditionalMediationAvailable)] + #[doc = "The `isConditionalMediationAvailable()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/isConditionalMediationAvailable_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn is_conditional_mediation_available() -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = PublicKeyCredential , js_class = "PublicKeyCredential" , js_name = isPasskeyPlatformAuthenticatorAvailable)] + #[doc = "The `isPasskeyPlatformAuthenticatorAvailable()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/isPasskeyPlatformAuthenticatorAvailable_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn is_passkey_platform_authenticator_available() -> ::js_sys::Promise; # [wasm_bindgen (static_method_of = PublicKeyCredential , js_class = "PublicKeyCredential" , js_name = isUserVerifyingPlatformAuthenticatorAvailable)] #[doc = "The `isUserVerifyingPlatformAuthenticatorAvailable()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/isUserVerifyingPlatformAuthenticatorAvailable)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/isUserVerifyingPlatformAuthenticatorAvailable_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"] pub fn is_user_verifying_platform_authenticator_available() -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(all( + feature = "PublicKeyCredentialCreationOptions", + feature = "PublicKeyCredentialCreationOptionsJson", + ))] + # [wasm_bindgen (catch , static_method_of = PublicKeyCredential , js_class = "PublicKeyCredential" , js_name = parseCreationOptionsFromJSON)] + #[doc = "The `parseCreationOptionsFromJSON()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/parseCreationOptionsFromJSON_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`, `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn parse_creation_options_from_json( + options: &PublicKeyCredentialCreationOptionsJson, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(all( + feature = "PublicKeyCredentialRequestOptions", + feature = "PublicKeyCredentialRequestOptionsJson", + ))] + # [wasm_bindgen (catch , static_method_of = PublicKeyCredential , js_class = "PublicKeyCredential" , js_name = parseRequestOptionsFromJSON)] + #[doc = "The `parseRequestOptionsFromJSON()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/parseRequestOptionsFromJSON_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`, `PublicKeyCredentialRequestOptions`, `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn parse_request_options_from_json( + options: &PublicKeyCredentialRequestOptionsJson, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "PublicKeyCredential" , js_name = toJSON)] + #[doc = "The `toJSON()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/toJSON)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredential`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn to_json(this: &PublicKeyCredential) -> Result<::wasm_bindgen::JsValue, JsValue>; } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs index e1a1ed72d02..d2ccef27666 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,170 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] pub type PublicKeyCredentialCreationOptions; + #[cfg(feature = "AttestationConveyancePreference")] + #[doc = "Get the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AttestationConveyancePreference`, `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "attestation")] + pub fn get_attestation( + this: &PublicKeyCredentialCreationOptions, + ) -> Option; + #[cfg(feature = "AttestationConveyancePreference")] + #[doc = "Change the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AttestationConveyancePreference`, `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "attestation")] + pub fn set_attestation( + this: &PublicKeyCredentialCreationOptions, + val: AttestationConveyancePreference, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestationFormats")] + pub fn get_attestation_formats( + this: &PublicKeyCredentialCreationOptions, + ) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestationFormats")] + pub fn set_attestation_formats( + this: &PublicKeyCredentialCreationOptions, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "AuthenticatorSelectionCriteria")] + #[doc = "Get the `authenticatorSelection` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "authenticatorSelection")] + pub fn get_authenticator_selection( + this: &PublicKeyCredentialCreationOptions, + ) -> Option; + #[cfg(feature = "AuthenticatorSelectionCriteria")] + #[doc = "Change the `authenticatorSelection` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "authenticatorSelection")] + pub fn set_authenticator_selection( + this: &PublicKeyCredentialCreationOptions, + val: &AuthenticatorSelectionCriteria, + ); + #[doc = "Get the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "challenge")] + pub fn get_challenge(this: &PublicKeyCredentialCreationOptions) -> ::js_sys::Object; + #[doc = "Change the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "challenge")] + pub fn set_challenge(this: &PublicKeyCredentialCreationOptions, val: &::js_sys::Object); + #[doc = "Get the `excludeCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "excludeCredentials")] + pub fn get_exclude_credentials( + this: &PublicKeyCredentialCreationOptions, + ) -> Option<::js_sys::Array>; + #[doc = "Change the `excludeCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "excludeCredentials")] + pub fn set_exclude_credentials( + this: &PublicKeyCredentialCreationOptions, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[doc = "Get the `extensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "extensions")] + pub fn get_extensions( + this: &PublicKeyCredentialCreationOptions, + ) -> Option; + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[doc = "Change the `extensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "extensions")] + pub fn set_extensions( + this: &PublicKeyCredentialCreationOptions, + val: &AuthenticationExtensionsClientInputs, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `hints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "hints")] + pub fn get_hints(this: &PublicKeyCredentialCreationOptions) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `hints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "hints")] + pub fn set_hints(this: &PublicKeyCredentialCreationOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `pubKeyCredParams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "pubKeyCredParams")] + pub fn get_pub_key_cred_params(this: &PublicKeyCredentialCreationOptions) -> ::js_sys::Array; + #[doc = "Change the `pubKeyCredParams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "pubKeyCredParams")] + pub fn set_pub_key_cred_params( + this: &PublicKeyCredentialCreationOptions, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(feature = "PublicKeyCredentialRpEntity")] + #[doc = "Get the `rp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialRpEntity`*"] + #[wasm_bindgen(method, getter = "rp")] + pub fn get_rp(this: &PublicKeyCredentialCreationOptions) -> PublicKeyCredentialRpEntity; + #[cfg(feature = "PublicKeyCredentialRpEntity")] + #[doc = "Change the `rp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialRpEntity`*"] + #[wasm_bindgen(method, setter = "rp")] + pub fn set_rp(this: &PublicKeyCredentialCreationOptions, val: &PublicKeyCredentialRpEntity); + #[doc = "Get the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, getter = "timeout")] + pub fn get_timeout(this: &PublicKeyCredentialCreationOptions) -> Option; + #[doc = "Change the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[wasm_bindgen(method, setter = "timeout")] + pub fn set_timeout(this: &PublicKeyCredentialCreationOptions, val: u32); + #[cfg(feature = "PublicKeyCredentialUserEntity")] + #[doc = "Get the `user` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialUserEntity`*"] + #[wasm_bindgen(method, getter = "user")] + pub fn get_user(this: &PublicKeyCredentialCreationOptions) -> PublicKeyCredentialUserEntity; + #[cfg(feature = "PublicKeyCredentialUserEntity")] + #[doc = "Change the `user` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialUserEntity`*"] + #[wasm_bindgen(method, setter = "user")] + pub fn set_user(this: &PublicKeyCredentialCreationOptions, val: &PublicKeyCredentialUserEntity); } impl PublicKeyCredentialCreationOptions { #[cfg(all( @@ -26,160 +191,72 @@ impl PublicKeyCredentialCreationOptions { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.challenge(challenge); - ret.pub_key_cred_params(pub_key_cred_params); - ret.rp(rp); - ret.user(user); + ret.set_challenge(challenge); + ret.set_pub_key_cred_params(pub_key_cred_params); + ret.set_rp(rp); + ret.set_user(user); ret } #[cfg(feature = "AttestationConveyancePreference")] - #[doc = "Change the `attestation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AttestationConveyancePreference`, `PublicKeyCredentialCreationOptions`*"] + #[deprecated = "Use `set_attestation()` instead."] pub fn attestation(&mut self, val: AttestationConveyancePreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("attestation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_attestation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation_formats()` instead."] + pub fn attestation_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_attestation_formats(val); self } #[cfg(feature = "AuthenticatorSelectionCriteria")] - #[doc = "Change the `authenticatorSelection` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptions`*"] + #[deprecated = "Use `set_authenticator_selection()` instead."] pub fn authenticator_selection(&mut self, val: &AuthenticatorSelectionCriteria) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("authenticatorSelection"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_authenticator_selection(val); self } - #[doc = "Change the `challenge` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[deprecated = "Use `set_challenge()` instead."] pub fn challenge(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_challenge(val); self } - #[doc = "Change the `excludeCredentials` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[deprecated = "Use `set_exclude_credentials()` instead."] pub fn exclude_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("excludeCredentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_exclude_credentials(val); self } #[cfg(feature = "AuthenticationExtensionsClientInputs")] - #[doc = "Change the `extensions` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialCreationOptions`*"] + #[deprecated = "Use `set_extensions()` instead."] pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("extensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_extensions(val); self } - #[doc = "Change the `pubKeyCredParams` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_hints()` instead."] + pub fn hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_hints(val); + self + } + #[deprecated = "Use `set_pub_key_cred_params()` instead."] pub fn pub_key_cred_params(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pubKeyCredParams"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pub_key_cred_params(val); self } #[cfg(feature = "PublicKeyCredentialRpEntity")] - #[doc = "Change the `rp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialRpEntity`*"] + #[deprecated = "Use `set_rp()` instead."] pub fn rp(&mut self, val: &PublicKeyCredentialRpEntity) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rp(val); self } - #[doc = "Change the `timeout` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"] + #[deprecated = "Use `set_timeout()` instead."] pub fn timeout(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeout"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timeout(val); self } #[cfg(feature = "PublicKeyCredentialUserEntity")] - #[doc = "Change the `user` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialUserEntity`*"] + #[deprecated = "Use `set_user()` instead."] pub fn user(&mut self, val: &PublicKeyCredentialUserEntity) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("user"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_user(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptionsJson.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptionsJson.rs new file mode 100644 index 00000000000..6f458e7aef4 --- /dev/null +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialCreationOptionsJson.rs @@ -0,0 +1,352 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PublicKeyCredentialCreationOptionsJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `PublicKeyCredentialCreationOptionsJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type PublicKeyCredentialCreationOptionsJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestation")] + pub fn get_attestation( + this: &PublicKeyCredentialCreationOptionsJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestation")] + pub fn set_attestation(this: &PublicKeyCredentialCreationOptionsJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestationFormats")] + pub fn get_attestation_formats( + this: &PublicKeyCredentialCreationOptionsJson, + ) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestationFormats")] + pub fn set_attestation_formats( + this: &PublicKeyCredentialCreationOptionsJson, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorSelectionCriteria")] + #[doc = "Get the `authenticatorSelection` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "authenticatorSelection")] + pub fn get_authenticator_selection( + this: &PublicKeyCredentialCreationOptionsJson, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorSelectionCriteria")] + #[doc = "Change the `authenticatorSelection` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "authenticatorSelection")] + pub fn set_authenticator_selection( + this: &PublicKeyCredentialCreationOptionsJson, + val: &AuthenticatorSelectionCriteria, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "challenge")] + pub fn get_challenge(this: &PublicKeyCredentialCreationOptionsJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "challenge")] + pub fn set_challenge(this: &PublicKeyCredentialCreationOptionsJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `excludeCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "excludeCredentials")] + pub fn get_exclude_credentials( + this: &PublicKeyCredentialCreationOptionsJson, + ) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `excludeCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "excludeCredentials")] + pub fn set_exclude_credentials( + this: &PublicKeyCredentialCreationOptionsJson, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientInputsJson")] + #[doc = "Get the `extensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`, `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "extensions")] + pub fn get_extensions( + this: &PublicKeyCredentialCreationOptionsJson, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientInputsJson")] + #[doc = "Change the `extensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`, `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "extensions")] + pub fn set_extensions( + this: &PublicKeyCredentialCreationOptionsJson, + val: &AuthenticationExtensionsClientInputsJson, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `hints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "hints")] + pub fn get_hints(this: &PublicKeyCredentialCreationOptionsJson) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `hints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "hints")] + pub fn set_hints(this: &PublicKeyCredentialCreationOptionsJson, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `pubKeyCredParams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "pubKeyCredParams")] + pub fn get_pub_key_cred_params( + this: &PublicKeyCredentialCreationOptionsJson, + ) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `pubKeyCredParams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "pubKeyCredParams")] + pub fn set_pub_key_cred_params( + this: &PublicKeyCredentialCreationOptionsJson, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PublicKeyCredentialRpEntity")] + #[doc = "Get the `rp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialRpEntity`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rp")] + pub fn get_rp(this: &PublicKeyCredentialCreationOptionsJson) -> PublicKeyCredentialRpEntity; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PublicKeyCredentialRpEntity")] + #[doc = "Change the `rp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialRpEntity`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rp")] + pub fn set_rp(this: &PublicKeyCredentialCreationOptionsJson, val: &PublicKeyCredentialRpEntity); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timeout")] + pub fn get_timeout(this: &PublicKeyCredentialCreationOptionsJson) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timeout")] + pub fn set_timeout(this: &PublicKeyCredentialCreationOptionsJson, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PublicKeyCredentialUserEntityJson")] + #[doc = "Get the `user` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "user")] + pub fn get_user( + this: &PublicKeyCredentialCreationOptionsJson, + ) -> PublicKeyCredentialUserEntityJson; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PublicKeyCredentialUserEntityJson")] + #[doc = "Change the `user` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "user")] + pub fn set_user( + this: &PublicKeyCredentialCreationOptionsJson, + val: &PublicKeyCredentialUserEntityJson, + ); +} +#[cfg(web_sys_unstable_apis)] +impl PublicKeyCredentialCreationOptionsJson { + #[cfg(all( + feature = "PublicKeyCredentialRpEntity", + feature = "PublicKeyCredentialUserEntityJson", + ))] + #[doc = "Construct a new `PublicKeyCredentialCreationOptionsJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialRpEntity`, `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + challenge: &str, + pub_key_cred_params: &::wasm_bindgen::JsValue, + rp: &PublicKeyCredentialRpEntity, + user: &PublicKeyCredentialUserEntityJson, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_challenge(challenge); + ret.set_pub_key_cred_params(pub_key_cred_params); + ret.set_rp(rp); + ret.set_user(user); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation()` instead."] + pub fn attestation(&mut self, val: &str) -> &mut Self { + self.set_attestation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation_formats()` instead."] + pub fn attestation_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_attestation_formats(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorSelectionCriteria")] + #[deprecated = "Use `set_authenticator_selection()` instead."] + pub fn authenticator_selection(&mut self, val: &AuthenticatorSelectionCriteria) -> &mut Self { + self.set_authenticator_selection(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_challenge()` instead."] + pub fn challenge(&mut self, val: &str) -> &mut Self { + self.set_challenge(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_exclude_credentials()` instead."] + pub fn exclude_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_exclude_credentials(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientInputsJson")] + #[deprecated = "Use `set_extensions()` instead."] + pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputsJson) -> &mut Self { + self.set_extensions(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_hints()` instead."] + pub fn hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_hints(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_pub_key_cred_params()` instead."] + pub fn pub_key_cred_params(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_pub_key_cred_params(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PublicKeyCredentialRpEntity")] + #[deprecated = "Use `set_rp()` instead."] + pub fn rp(&mut self, val: &PublicKeyCredentialRpEntity) -> &mut Self { + self.set_rp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timeout()` instead."] + pub fn timeout(&mut self, val: u32) -> &mut Self { + self.set_timeout(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PublicKeyCredentialUserEntityJson")] + #[deprecated = "Use `set_user()` instead."] + pub fn user(&mut self, val: &PublicKeyCredentialUserEntityJson) -> &mut Self { + self.set_user(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptor.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptor.rs index 907d346a349..e249e9ad90e 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptor.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] pub type PublicKeyCredentialDescriptor; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &PublicKeyCredentialDescriptor) -> ::js_sys::Object; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &PublicKeyCredentialDescriptor, val: &::js_sys::Object); + #[doc = "Get the `transports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] + #[wasm_bindgen(method, getter = "transports")] + pub fn get_transports(this: &PublicKeyCredentialDescriptor) -> Option<::js_sys::Array>; + #[doc = "Change the `transports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] + #[wasm_bindgen(method, setter = "transports")] + pub fn set_transports(this: &PublicKeyCredentialDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "PublicKeyCredentialType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &PublicKeyCredentialDescriptor) -> PublicKeyCredentialType; + #[cfg(feature = "PublicKeyCredentialType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &PublicKeyCredentialDescriptor, val: PublicKeyCredentialType); } impl PublicKeyCredentialDescriptor { #[cfg(feature = "PublicKeyCredentialType")] @@ -18,52 +51,24 @@ impl PublicKeyCredentialDescriptor { pub fn new(id: &::js_sys::Object, type_: PublicKeyCredentialType) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.id(id); - ret.type_(type_); + ret.set_id(id); + ret.set_type(type_); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `transports` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`*"] + #[deprecated = "Use `set_transports()` instead."] pub fn transports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transports(val); self } #[cfg(feature = "PublicKeyCredentialType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptor`, `PublicKeyCredentialType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: PublicKeyCredentialType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptorJson.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptorJson.rs new file mode 100644 index 00000000000..1286331068a --- /dev/null +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialDescriptorJson.rs @@ -0,0 +1,105 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PublicKeyCredentialDescriptorJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `PublicKeyCredentialDescriptorJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type PublicKeyCredentialDescriptorJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &PublicKeyCredentialDescriptorJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &PublicKeyCredentialDescriptorJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `transports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "transports")] + pub fn get_transports(this: &PublicKeyCredentialDescriptorJson) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `transports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "transports")] + pub fn set_transports(this: &PublicKeyCredentialDescriptorJson, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &PublicKeyCredentialDescriptorJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &PublicKeyCredentialDescriptorJson, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl PublicKeyCredentialDescriptorJson { + #[doc = "Construct a new `PublicKeyCredentialDescriptorJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(id: &str, type_: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_id(id); + ret.set_type(type_); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_transports()` instead."] + pub fn transports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_transports(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: &str) -> &mut Self { + self.set_type(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialEntity.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialEntity.rs index d5ca9f981a9..1ba7d6d33cb 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialEntity.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialEntity.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] pub type PublicKeyCredentialEntity; + #[doc = "Get the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "icon")] + pub fn get_icon(this: &PublicKeyCredentialEntity) -> Option<::alloc::string::String>; + #[doc = "Change the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "icon")] + pub fn set_icon(this: &PublicKeyCredentialEntity, val: &str); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &PublicKeyCredentialEntity) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &PublicKeyCredentialEntity, val: &str); } impl PublicKeyCredentialEntity { #[doc = "Construct a new `PublicKeyCredentialEntity`."] @@ -17,33 +40,17 @@ impl PublicKeyCredentialEntity { 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.set_name(name); ret } - #[doc = "Change the `icon` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] + #[deprecated = "Use `set_icon()` instead."] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_icon(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialEntity`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialHints.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialHints.rs new file mode 100644 index 00000000000..a5aa405e64f --- /dev/null +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialHints.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `PublicKeyCredentialHints` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialHints`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum PublicKeyCredentialHints { + SecurityKey = "security-key", + ClientDevice = "client-device", + Hybrid = "hybrid", +} diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialParameters.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialParameters.rs index 9eac4922f98..4ce14e7be70 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialParameters.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"] pub type PublicKeyCredentialParameters; + #[doc = "Get the `alg` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"] + #[wasm_bindgen(method, getter = "alg")] + pub fn get_alg(this: &PublicKeyCredentialParameters) -> i32; + #[doc = "Change the `alg` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"] + #[wasm_bindgen(method, setter = "alg")] + pub fn set_alg(this: &PublicKeyCredentialParameters, val: i32); + #[cfg(feature = "PublicKeyCredentialType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`, `PublicKeyCredentialType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &PublicKeyCredentialParameters) -> PublicKeyCredentialType; + #[cfg(feature = "PublicKeyCredentialType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`, `PublicKeyCredentialType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &PublicKeyCredentialParameters, val: PublicKeyCredentialType); } impl PublicKeyCredentialParameters { #[cfg(feature = "PublicKeyCredentialType")] @@ -18,35 +41,19 @@ impl PublicKeyCredentialParameters { pub fn new(alg: i32, type_: PublicKeyCredentialType) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.alg(alg); - ret.type_(type_); + ret.set_alg(alg); + ret.set_type(type_); ret } - #[doc = "Change the `alg` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`*"] + #[deprecated = "Use `set_alg()` instead."] pub fn alg(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alg"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alg(val); self } #[cfg(feature = "PublicKeyCredentialType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialParameters`, `PublicKeyCredentialType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: PublicKeyCredentialType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptions.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptions.rs index 7db1ffdfe20..ba3395948ac 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptions.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,146 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] pub type PublicKeyCredentialRequestOptions; + #[doc = "Get the `allowCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, getter = "allowCredentials")] + pub fn get_allow_credentials( + this: &PublicKeyCredentialRequestOptions, + ) -> Option<::js_sys::Array>; + #[doc = "Change the `allowCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, setter = "allowCredentials")] + pub fn set_allow_credentials( + this: &PublicKeyCredentialRequestOptions, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestation")] + pub fn get_attestation( + this: &PublicKeyCredentialRequestOptions, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestation")] + pub fn set_attestation(this: &PublicKeyCredentialRequestOptions, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestationFormats")] + pub fn get_attestation_formats( + this: &PublicKeyCredentialRequestOptions, + ) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestationFormats")] + pub fn set_attestation_formats( + this: &PublicKeyCredentialRequestOptions, + val: &::wasm_bindgen::JsValue, + ); + #[doc = "Get the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, getter = "challenge")] + pub fn get_challenge(this: &PublicKeyCredentialRequestOptions) -> ::js_sys::Object; + #[doc = "Change the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, setter = "challenge")] + pub fn set_challenge(this: &PublicKeyCredentialRequestOptions, val: &::js_sys::Object); + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[doc = "Get the `extensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, getter = "extensions")] + pub fn get_extensions( + this: &PublicKeyCredentialRequestOptions, + ) -> Option; + #[cfg(feature = "AuthenticationExtensionsClientInputs")] + #[doc = "Change the `extensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, setter = "extensions")] + pub fn set_extensions( + this: &PublicKeyCredentialRequestOptions, + val: &AuthenticationExtensionsClientInputs, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `hints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "hints")] + pub fn get_hints(this: &PublicKeyCredentialRequestOptions) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `hints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "hints")] + pub fn set_hints(this: &PublicKeyCredentialRequestOptions, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `rpId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, getter = "rpId")] + pub fn get_rp_id(this: &PublicKeyCredentialRequestOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `rpId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, setter = "rpId")] + pub fn set_rp_id(this: &PublicKeyCredentialRequestOptions, val: &str); + #[doc = "Get the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, getter = "timeout")] + pub fn get_timeout(this: &PublicKeyCredentialRequestOptions) -> Option; + #[doc = "Change the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[wasm_bindgen(method, setter = "timeout")] + pub fn set_timeout(this: &PublicKeyCredentialRequestOptions, val: u32); + #[cfg(feature = "UserVerificationRequirement")] + #[doc = "Get the `userVerification` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"] + #[wasm_bindgen(method, getter = "userVerification")] + pub fn get_user_verification( + this: &PublicKeyCredentialRequestOptions, + ) -> Option; + #[cfg(feature = "UserVerificationRequirement")] + #[doc = "Change the `userVerification` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"] + #[wasm_bindgen(method, setter = "userVerification")] + pub fn set_user_verification( + this: &PublicKeyCredentialRequestOptions, + val: UserVerificationRequirement, + ); } impl PublicKeyCredentialRequestOptions { #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."] @@ -17,107 +158,57 @@ impl PublicKeyCredentialRequestOptions { pub fn new(challenge: &::js_sys::Object) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.challenge(challenge); + ret.set_challenge(challenge); ret } - #[doc = "Change the `allowCredentials` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[deprecated = "Use `set_allow_credentials()` instead."] pub fn allow_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowCredentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_allow_credentials(val); self } - #[doc = "Change the `challenge` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation()` instead."] + pub fn attestation(&mut self, val: &str) -> &mut Self { + self.set_attestation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation_formats()` instead."] + pub fn attestation_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_attestation_formats(val); + self + } + #[deprecated = "Use `set_challenge()` instead."] pub fn challenge(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_challenge(val); self } #[cfg(feature = "AuthenticationExtensionsClientInputs")] - #[doc = "Change the `extensions` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"] + #[deprecated = "Use `set_extensions()` instead."] pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("extensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_extensions(val); self } - #[doc = "Change the `rpId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_hints()` instead."] + pub fn hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_hints(val); + self + } + #[deprecated = "Use `set_rp_id()` instead."] pub fn rp_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rpId"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rp_id(val); self } - #[doc = "Change the `timeout` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"] + #[deprecated = "Use `set_timeout()` instead."] pub fn timeout(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timeout"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timeout(val); self } #[cfg(feature = "UserVerificationRequirement")] - #[doc = "Change the `userVerification` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"] + #[deprecated = "Use `set_user_verification()` instead."] 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.set_user_verification(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptionsJson.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptionsJson.rs new file mode 100644 index 00000000000..69fc82c203c --- /dev/null +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialRequestOptionsJson.rs @@ -0,0 +1,272 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PublicKeyCredentialRequestOptionsJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `PublicKeyCredentialRequestOptionsJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type PublicKeyCredentialRequestOptionsJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `allowCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "allowCredentials")] + pub fn get_allow_credentials( + this: &PublicKeyCredentialRequestOptionsJson, + ) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `allowCredentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "allowCredentials")] + pub fn set_allow_credentials( + this: &PublicKeyCredentialRequestOptionsJson, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestation")] + pub fn get_attestation( + this: &PublicKeyCredentialRequestOptionsJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestation")] + pub fn set_attestation(this: &PublicKeyCredentialRequestOptionsJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "attestationFormats")] + pub fn get_attestation_formats( + this: &PublicKeyCredentialRequestOptionsJson, + ) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `attestationFormats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "attestationFormats")] + pub fn set_attestation_formats( + this: &PublicKeyCredentialRequestOptionsJson, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "challenge")] + pub fn get_challenge(this: &PublicKeyCredentialRequestOptionsJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "challenge")] + pub fn set_challenge(this: &PublicKeyCredentialRequestOptionsJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientInputsJson")] + #[doc = "Get the `extensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`, `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "extensions")] + pub fn get_extensions( + this: &PublicKeyCredentialRequestOptionsJson, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientInputsJson")] + #[doc = "Change the `extensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`, `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "extensions")] + pub fn set_extensions( + this: &PublicKeyCredentialRequestOptionsJson, + val: &AuthenticationExtensionsClientInputsJson, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `hints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "hints")] + pub fn get_hints(this: &PublicKeyCredentialRequestOptionsJson) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `hints` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "hints")] + pub fn set_hints(this: &PublicKeyCredentialRequestOptionsJson, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rpId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rpId")] + pub fn get_rp_id( + this: &PublicKeyCredentialRequestOptionsJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rpId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rpId")] + pub fn set_rp_id(this: &PublicKeyCredentialRequestOptionsJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timeout")] + pub fn get_timeout(this: &PublicKeyCredentialRequestOptionsJson) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `timeout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timeout")] + pub fn set_timeout(this: &PublicKeyCredentialRequestOptionsJson, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `userVerification` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "userVerification")] + pub fn get_user_verification( + this: &PublicKeyCredentialRequestOptionsJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `userVerification` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "userVerification")] + pub fn set_user_verification(this: &PublicKeyCredentialRequestOptionsJson, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl PublicKeyCredentialRequestOptionsJson { + #[doc = "Construct a new `PublicKeyCredentialRequestOptionsJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(challenge: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_challenge(challenge); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_allow_credentials()` instead."] + pub fn allow_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_allow_credentials(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation()` instead."] + pub fn attestation(&mut self, val: &str) -> &mut Self { + self.set_attestation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_attestation_formats()` instead."] + pub fn attestation_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_attestation_formats(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_challenge()` instead."] + pub fn challenge(&mut self, val: &str) -> &mut Self { + self.set_challenge(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientInputsJson")] + #[deprecated = "Use `set_extensions()` instead."] + pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputsJson) -> &mut Self { + self.set_extensions(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_hints()` instead."] + pub fn hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_hints(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rp_id()` instead."] + pub fn rp_id(&mut self, val: &str) -> &mut Self { + self.set_rp_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timeout()` instead."] + pub fn timeout(&mut self, val: u32) -> &mut Self { + self.set_timeout(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_user_verification()` instead."] + pub fn user_verification(&mut self, val: &str) -> &mut Self { + self.set_user_verification(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialRpEntity.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialRpEntity.rs index a1152f87b23..9aa8f351787 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialRpEntity.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialRpEntity.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] pub type PublicKeyCredentialRpEntity; + #[doc = "Get the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "icon")] + pub fn get_icon(this: &PublicKeyCredentialRpEntity) -> Option<::alloc::string::String>; + #[doc = "Change the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "icon")] + pub fn set_icon(this: &PublicKeyCredentialRpEntity, val: &str); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &PublicKeyCredentialRpEntity) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &PublicKeyCredentialRpEntity, val: &str); + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &PublicKeyCredentialRpEntity) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &PublicKeyCredentialRpEntity, val: &str); } impl PublicKeyCredentialRpEntity { #[doc = "Construct a new `PublicKeyCredentialRpEntity`."] @@ -17,46 +50,22 @@ impl PublicKeyCredentialRpEntity { 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.set_name(name); ret } - #[doc = "Change the `icon` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[deprecated = "Use `set_icon()` instead."] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_icon(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRpEntity`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialType.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialType.rs index d75328e5733..2ba8cffe3b4 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialType.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PublicKeyCredentialType` enum."] diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntity.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntity.rs index d9e369cb00b..f53cbdc6e92 100644 --- a/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntity.rs +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntity.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] pub type PublicKeyCredentialUserEntity; + #[doc = "Get the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[deprecated] + #[wasm_bindgen(method, getter = "icon")] + pub fn get_icon(this: &PublicKeyCredentialUserEntity) -> Option<::alloc::string::String>; + #[doc = "Change the `icon` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[deprecated] + #[wasm_bindgen(method, setter = "icon")] + pub fn set_icon(this: &PublicKeyCredentialUserEntity, val: &str); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &PublicKeyCredentialUserEntity) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &PublicKeyCredentialUserEntity, val: &str); + #[doc = "Get the `displayName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[wasm_bindgen(method, getter = "displayName")] + pub fn get_display_name(this: &PublicKeyCredentialUserEntity) -> ::alloc::string::String; + #[doc = "Change the `displayName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[wasm_bindgen(method, setter = "displayName")] + pub fn set_display_name(this: &PublicKeyCredentialUserEntity, val: &str); + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &PublicKeyCredentialUserEntity) -> ::js_sys::Object; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &PublicKeyCredentialUserEntity, val: &::js_sys::Object); } impl PublicKeyCredentialUserEntity { #[doc = "Construct a new `PublicKeyCredentialUserEntity`."] @@ -17,65 +60,29 @@ impl PublicKeyCredentialUserEntity { pub fn new(name: &str, display_name: &str, id: &::js_sys::Object) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.display_name(display_name); - ret.id(id); + ret.set_name(name); + ret.set_display_name(display_name); + ret.set_id(id); ret } - #[doc = "Change the `icon` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[deprecated = "Use `set_icon()` instead."] pub fn icon(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("icon"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_icon(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `displayName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[deprecated = "Use `set_display_name()` instead."] pub fn display_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_display_name(val); self } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntity`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } } diff --git a/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntityJson.rs b/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntityJson.rs new file mode 100644 index 00000000000..19793f331b0 --- /dev/null +++ b/crates/web-sys/src/features/gen_PublicKeyCredentialUserEntityJson.rs @@ -0,0 +1,106 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PublicKeyCredentialUserEntityJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `PublicKeyCredentialUserEntityJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type PublicKeyCredentialUserEntityJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayName")] + pub fn get_display_name(this: &PublicKeyCredentialUserEntityJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `displayName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "displayName")] + pub fn set_display_name(this: &PublicKeyCredentialUserEntityJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &PublicKeyCredentialUserEntityJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &PublicKeyCredentialUserEntityJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &PublicKeyCredentialUserEntityJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &PublicKeyCredentialUserEntityJson, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl PublicKeyCredentialUserEntityJson { + #[doc = "Construct a new `PublicKeyCredentialUserEntityJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialUserEntityJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(display_name: &str, id: &str, name: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_display_name(display_name); + ret.set_id(id); + ret.set_name(name); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_name()` instead."] + pub fn display_name(&mut self, val: &str) -> &mut Self { + self.set_display_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: &str) -> &mut Self { + self.set_name(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_PushEncryptionKeyName.rs b/crates/web-sys/src/features/gen_PushEncryptionKeyName.rs index 426f7dba13c..328a69c6f0b 100644 --- a/crates/web-sys/src/features/gen_PushEncryptionKeyName.rs +++ b/crates/web-sys/src/features/gen_PushEncryptionKeyName.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PushEncryptionKeyName` enum."] diff --git a/crates/web-sys/src/features/gen_PushEvent.rs b/crates/web-sys/src/features/gen_PushEvent.rs index c22f03058c1..3583c2ee8f0 100644 --- a/crates/web-sys/src/features/gen_PushEvent.rs +++ b/crates/web-sys/src/features/gen_PushEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PushEventInit.rs b/crates/web-sys/src/features/gen_PushEventInit.rs index 35c41227270..80f525bbe2d 100644 --- a/crates/web-sys/src/features/gen_PushEventInit.rs +++ b/crates/web-sys/src/features/gen_PushEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] pub type PushEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &PushEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &PushEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &PushEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &PushEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &PushEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &PushEventInit, val: bool); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &PushEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &PushEventInit, val: &::wasm_bindgen::JsValue); } impl PushEventInit { #[doc = "Construct a new `PushEventInit`."] @@ -19,68 +60,24 @@ impl PushEventInit { 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: `PushEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `data` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushEventInit`*"] + #[deprecated = "Use `set_data()` instead."] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_data(val); self } } diff --git a/crates/web-sys/src/features/gen_PushManager.rs b/crates/web-sys/src/features/gen_PushManager.rs index b272c50677e..cee904a827c 100644 --- a/crates/web-sys/src/features/gen_PushManager.rs +++ b/crates/web-sys/src/features/gen_PushManager.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PushMessageData.rs b/crates/web-sys/src/features/gen_PushMessageData.rs index b641f968ec4..0d09c0d5198 100644 --- a/crates/web-sys/src/features/gen_PushMessageData.rs +++ b/crates/web-sys/src/features/gen_PushMessageData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -39,5 +40,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushMessageData/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushMessageData`*"] - pub fn text(this: &PushMessageData) -> String; + pub fn text(this: &PushMessageData) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_PushPermissionState.rs b/crates/web-sys/src/features/gen_PushPermissionState.rs index b86708f72f7..2053fb078f6 100644 --- a/crates/web-sys/src/features/gen_PushPermissionState.rs +++ b/crates/web-sys/src/features/gen_PushPermissionState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PushPermissionState` enum."] diff --git a/crates/web-sys/src/features/gen_PushSubscription.rs b/crates/web-sys/src/features/gen_PushSubscription.rs index 46d48290b37..317afa79a4c 100644 --- a/crates/web-sys/src/features/gen_PushSubscription.rs +++ b/crates/web-sys/src/features/gen_PushSubscription.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/endpoint)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscription`*"] - pub fn endpoint(this: &PushSubscription) -> String; + pub fn endpoint(this: &PushSubscription) -> ::alloc::string::String; #[cfg(feature = "PushSubscriptionOptions")] # [wasm_bindgen (structural , method , getter , js_class = "PushSubscription" , js_name = options)] #[doc = "Getter for the `options` field of this object."] diff --git a/crates/web-sys/src/features/gen_PushSubscriptionInit.rs b/crates/web-sys/src/features/gen_PushSubscriptionInit.rs index 9b7784a8e05..15eeb90b69a 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionInit.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] pub type PushSubscriptionInit; + #[doc = "Get the `appServerKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, getter = "appServerKey")] + pub fn get_app_server_key(this: &PushSubscriptionInit) -> Option<::js_sys::Object>; + #[doc = "Change the `appServerKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, setter = "appServerKey")] + pub fn set_app_server_key(this: &PushSubscriptionInit, val: Option<&::js_sys::Object>); + #[doc = "Get the `authSecret` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, getter = "authSecret")] + pub fn get_auth_secret(this: &PushSubscriptionInit) -> Option<::js_sys::ArrayBuffer>; + #[doc = "Change the `authSecret` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, setter = "authSecret")] + pub fn set_auth_secret(this: &PushSubscriptionInit, val: Option<&::js_sys::ArrayBuffer>); + #[doc = "Get the `endpoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, getter = "endpoint")] + pub fn get_endpoint(this: &PushSubscriptionInit) -> ::alloc::string::String; + #[doc = "Change the `endpoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, setter = "endpoint")] + pub fn set_endpoint(this: &PushSubscriptionInit, val: &str); + #[doc = "Get the `p256dhKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, getter = "p256dhKey")] + pub fn get_p256dh_key(this: &PushSubscriptionInit) -> Option<::js_sys::ArrayBuffer>; + #[doc = "Change the `p256dhKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, setter = "p256dhKey")] + pub fn set_p256dh_key(this: &PushSubscriptionInit, val: Option<&::js_sys::ArrayBuffer>); + #[doc = "Get the `scope` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, getter = "scope")] + pub fn get_scope(this: &PushSubscriptionInit) -> ::alloc::string::String; + #[doc = "Change the `scope` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[wasm_bindgen(method, setter = "scope")] + pub fn set_scope(this: &PushSubscriptionInit, val: &str); } impl PushSubscriptionInit { #[doc = "Construct a new `PushSubscriptionInit`."] @@ -17,89 +68,33 @@ impl PushSubscriptionInit { pub fn new(endpoint: &str, scope: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.endpoint(endpoint); - ret.scope(scope); + ret.set_endpoint(endpoint); + ret.set_scope(scope); ret } - #[doc = "Change the `appServerKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[deprecated = "Use `set_app_server_key()` instead."] pub fn app_server_key(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("appServerKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_app_server_key(val); self } - #[doc = "Change the `authSecret` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[deprecated = "Use `set_auth_secret()` instead."] pub fn auth_secret(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("authSecret"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_auth_secret(val); self } - #[doc = "Change the `endpoint` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[deprecated = "Use `set_endpoint()` instead."] pub fn endpoint(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endpoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_endpoint(val); self } - #[doc = "Change the `p256dhKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[deprecated = "Use `set_p256dh_key()` instead."] pub fn p256dh_key(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("p256dhKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p256dh_key(val); self } - #[doc = "Change the `scope` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"] + #[deprecated = "Use `set_scope()` instead."] pub fn scope(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("scope"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_scope(val); self } } diff --git a/crates/web-sys/src/features/gen_PushSubscriptionJson.rs b/crates/web-sys/src/features/gen_PushSubscriptionJson.rs index 6859af3f7c1..31e4df5e973 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionJson.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionJson.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`*"] pub type PushSubscriptionJson; + #[doc = "Get the `endpoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`*"] + #[wasm_bindgen(method, getter = "endpoint")] + pub fn get_endpoint(this: &PushSubscriptionJson) -> Option<::alloc::string::String>; + #[doc = "Change the `endpoint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`*"] + #[wasm_bindgen(method, setter = "endpoint")] + pub fn set_endpoint(this: &PushSubscriptionJson, val: &str); + #[cfg(feature = "PushSubscriptionKeys")] + #[doc = "Get the `keys` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`, `PushSubscriptionKeys`*"] + #[wasm_bindgen(method, getter = "keys")] + pub fn get_keys(this: &PushSubscriptionJson) -> Option; + #[cfg(feature = "PushSubscriptionKeys")] + #[doc = "Change the `keys` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`, `PushSubscriptionKeys`*"] + #[wasm_bindgen(method, setter = "keys")] + pub fn set_keys(this: &PushSubscriptionJson, val: &PushSubscriptionKeys); } impl PushSubscriptionJson { #[doc = "Construct a new `PushSubscriptionJson`."] @@ -19,35 +42,15 @@ impl PushSubscriptionJson { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `endpoint` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`*"] + #[deprecated = "Use `set_endpoint()` instead."] pub fn endpoint(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("endpoint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_endpoint(val); self } #[cfg(feature = "PushSubscriptionKeys")] - #[doc = "Change the `keys` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionJson`, `PushSubscriptionKeys`*"] + #[deprecated = "Use `set_keys()` instead."] pub fn keys(&mut self, val: &PushSubscriptionKeys) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("keys"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_keys(val); self } } diff --git a/crates/web-sys/src/features/gen_PushSubscriptionKeys.rs b/crates/web-sys/src/features/gen_PushSubscriptionKeys.rs index d42b47eacd7..dadba51e67a 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionKeys.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionKeys.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] pub type PushSubscriptionKeys; + #[doc = "Get the `auth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] + #[wasm_bindgen(method, getter = "auth")] + pub fn get_auth(this: &PushSubscriptionKeys) -> Option<::alloc::string::String>; + #[doc = "Change the `auth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] + #[wasm_bindgen(method, setter = "auth")] + pub fn set_auth(this: &PushSubscriptionKeys, val: &str); + #[doc = "Get the `p256dh` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] + #[wasm_bindgen(method, getter = "p256dh")] + pub fn get_p256dh(this: &PushSubscriptionKeys) -> Option<::alloc::string::String>; + #[doc = "Change the `p256dh` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] + #[wasm_bindgen(method, setter = "p256dh")] + pub fn set_p256dh(this: &PushSubscriptionKeys, val: &str); } impl PushSubscriptionKeys { #[doc = "Construct a new `PushSubscriptionKeys`."] @@ -19,31 +40,14 @@ impl PushSubscriptionKeys { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `auth` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] + #[deprecated = "Use `set_auth()` instead."] pub fn auth(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("auth"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_auth(val); self } - #[doc = "Change the `p256dh` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionKeys`*"] + #[deprecated = "Use `set_p256dh()` instead."] pub fn p256dh(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p256dh"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_p256dh(val); self } } diff --git a/crates/web-sys/src/features/gen_PushSubscriptionOptions.rs b/crates/web-sys/src/features/gen_PushSubscriptionOptions.rs index de64371c593..4452a1d3c33 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionOptions.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs b/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs index 1e9ae13ed27..507884a5c68 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,31 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] pub type PushSubscriptionOptionsInit; + #[doc = "Get the `applicationServerKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] + #[wasm_bindgen(method, getter = "applicationServerKey")] + pub fn get_application_server_key( + this: &PushSubscriptionOptionsInit, + ) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `applicationServerKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] + #[wasm_bindgen(method, setter = "applicationServerKey")] + pub fn set_application_server_key( + this: &PushSubscriptionOptionsInit, + val: &::wasm_bindgen::JsValue, + ); + #[doc = "Get the `userVisibleOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] + #[wasm_bindgen(method, getter = "userVisibleOnly")] + pub fn get_user_visible_only(this: &PushSubscriptionOptionsInit) -> Option; + #[doc = "Change the `userVisibleOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] + #[wasm_bindgen(method, setter = "userVisibleOnly")] + pub fn set_user_visible_only(this: &PushSubscriptionOptionsInit, val: bool); } impl PushSubscriptionOptionsInit { #[doc = "Construct a new `PushSubscriptionOptionsInit`."] @@ -19,38 +45,14 @@ impl PushSubscriptionOptionsInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `applicationServerKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] + #[deprecated = "Use `set_application_server_key()` instead."] pub fn application_server_key(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("applicationServerKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_application_server_key(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } - #[doc = "Change the `userVisibleOnly` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] + #[deprecated = "Use `set_user_visible_only()` instead."] pub fn user_visible_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("userVisibleOnly"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_user_visible_only(val); self } } diff --git a/crates/web-sys/src/features/gen_QueryOptions.rs b/crates/web-sys/src/features/gen_QueryOptions.rs new file mode 100644 index 00000000000..b1a58c5a564 --- /dev/null +++ b/crates/web-sys/src/features/gen_QueryOptions.rs @@ -0,0 +1,61 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = QueryOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `QueryOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueryOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type QueryOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `postscriptNames` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueryOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "postscriptNames")] + pub fn get_postscript_names(this: &QueryOptions) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `postscriptNames` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueryOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "postscriptNames")] + pub fn set_postscript_names(this: &QueryOptions, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl QueryOptions { + #[doc = "Construct a new `QueryOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueryOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_postscript_names()` instead."] + pub fn postscript_names(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_postscript_names(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for QueryOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_QueuingStrategy.rs b/crates/web-sys/src/features/gen_QueuingStrategy.rs index d94bdba8dce..6d22b29060a 100644 --- a/crates/web-sys/src/features/gen_QueuingStrategy.rs +++ b/crates/web-sys/src/features/gen_QueuingStrategy.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = QueuingStrategy)] @@ -9,64 +9,48 @@ extern "C" { #[doc = "The `QueuingStrategy` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type QueuingStrategy; + #[doc = "Get the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] + #[wasm_bindgen(method, getter = "highWaterMark")] + pub fn get_high_water_mark(this: &QueuingStrategy) -> Option; + #[doc = "Change the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] + #[wasm_bindgen(method, setter = "highWaterMark")] + pub fn set_high_water_mark(this: &QueuingStrategy, val: f64); + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &QueuingStrategy) -> Option<::js_sys::Function>; + #[doc = "Change the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &QueuingStrategy, val: &::js_sys::Function); } -#[cfg(web_sys_unstable_apis)] impl QueuingStrategy { #[doc = "Construct a new `QueuingStrategy`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `highWaterMark` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_high_water_mark()` instead."] pub fn high_water_mark(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("highWaterMark"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_high_water_mark(val); self } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `size` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_size()` instead."] pub fn size(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_size(val); self } } -#[cfg(web_sys_unstable_apis)] impl Default for QueuingStrategy { fn default() -> Self { Self::new() diff --git a/crates/web-sys/src/features/gen_QueuingStrategyInit.rs b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs new file mode 100644 index 00000000000..4a7917a8ed2 --- /dev/null +++ b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs @@ -0,0 +1,39 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = QueuingStrategyInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `QueuingStrategyInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub type QueuingStrategyInit; + #[doc = "Get the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + #[wasm_bindgen(method, getter = "highWaterMark")] + pub fn get_high_water_mark(this: &QueuingStrategyInit) -> f64; + #[doc = "Change the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + #[wasm_bindgen(method, setter = "highWaterMark")] + pub fn set_high_water_mark(this: &QueuingStrategyInit, val: f64); +} +impl QueuingStrategyInit { + #[doc = "Construct a new `QueuingStrategyInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub fn new(high_water_mark: f64) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_high_water_mark(high_water_mark); + ret + } + #[deprecated = "Use `set_high_water_mark()` instead."] + pub fn high_water_mark(&mut self, val: f64) -> &mut Self { + self.set_high_water_mark(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_RadioNodeList.rs b/crates/web-sys/src/features/gen_RadioNodeList.rs index 91c2398099e..062c056c7a5 100644 --- a/crates/web-sys/src/features/gen_RadioNodeList.rs +++ b/crates/web-sys/src/features/gen_RadioNodeList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RadioNodeList/value)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RadioNodeList`*"] - pub fn value(this: &RadioNodeList) -> String; + pub fn value(this: &RadioNodeList) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "RadioNodeList" , js_name = value)] #[doc = "Setter for the `value` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_Range.rs b/crates/web-sys/src/features/gen_Range.rs index 1aa1f937bfb..2d5b99f3a0e 100644 --- a/crates/web-sys/src/features/gen_Range.rs +++ b/crates/web-sys/src/features/gen_Range.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_RcwnPerfStats.rs b/crates/web-sys/src/features/gen_RcwnPerfStats.rs index 251053a13e7..b3cb7fd5b11 100644 --- a/crates/web-sys/src/features/gen_RcwnPerfStats.rs +++ b/crates/web-sys/src/features/gen_RcwnPerfStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] pub type RcwnPerfStats; + #[doc = "Get the `avgLong` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[wasm_bindgen(method, getter = "avgLong")] + pub fn get_avg_long(this: &RcwnPerfStats) -> Option; + #[doc = "Change the `avgLong` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[wasm_bindgen(method, setter = "avgLong")] + pub fn set_avg_long(this: &RcwnPerfStats, val: u32); + #[doc = "Get the `avgShort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[wasm_bindgen(method, getter = "avgShort")] + pub fn get_avg_short(this: &RcwnPerfStats) -> Option; + #[doc = "Change the `avgShort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[wasm_bindgen(method, setter = "avgShort")] + pub fn set_avg_short(this: &RcwnPerfStats, val: u32); + #[doc = "Get the `stddevLong` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[wasm_bindgen(method, getter = "stddevLong")] + pub fn get_stddev_long(this: &RcwnPerfStats) -> Option; + #[doc = "Change the `stddevLong` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[wasm_bindgen(method, setter = "stddevLong")] + pub fn set_stddev_long(this: &RcwnPerfStats, val: u32); } impl RcwnPerfStats { #[doc = "Construct a new `RcwnPerfStats`."] @@ -19,55 +50,19 @@ impl RcwnPerfStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `avgLong` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[deprecated = "Use `set_avg_long()` instead."] pub fn avg_long(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("avgLong"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_avg_long(val); self } - #[doc = "Change the `avgShort` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[deprecated = "Use `set_avg_short()` instead."] pub fn avg_short(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("avgShort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_avg_short(val); self } - #[doc = "Change the `stddevLong` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnPerfStats`*"] + #[deprecated = "Use `set_stddev_long()` instead."] pub fn stddev_long(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stddevLong"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stddev_long(val); self } } diff --git a/crates/web-sys/src/features/gen_RcwnStatus.rs b/crates/web-sys/src/features/gen_RcwnStatus.rs index 17c01013ff9..c6a0d927176 100644 --- a/crates/web-sys/src/features/gen_RcwnStatus.rs +++ b/crates/web-sys/src/features/gen_RcwnStatus.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] pub type RcwnStatus; + #[doc = "Get the `cacheNotSlowCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, getter = "cacheNotSlowCount")] + pub fn get_cache_not_slow_count(this: &RcwnStatus) -> Option; + #[doc = "Change the `cacheNotSlowCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, setter = "cacheNotSlowCount")] + pub fn set_cache_not_slow_count(this: &RcwnStatus, val: u32); + #[doc = "Get the `cacheSlowCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, getter = "cacheSlowCount")] + pub fn get_cache_slow_count(this: &RcwnStatus) -> Option; + #[doc = "Change the `cacheSlowCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, setter = "cacheSlowCount")] + pub fn set_cache_slow_count(this: &RcwnStatus, val: u32); + #[doc = "Get the `perfStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, getter = "perfStats")] + pub fn get_perf_stats(this: &RcwnStatus) -> Option<::js_sys::Array>; + #[doc = "Change the `perfStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, setter = "perfStats")] + pub fn set_perf_stats(this: &RcwnStatus, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `rcwnCacheWonCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, getter = "rcwnCacheWonCount")] + pub fn get_rcwn_cache_won_count(this: &RcwnStatus) -> Option; + #[doc = "Change the `rcwnCacheWonCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, setter = "rcwnCacheWonCount")] + pub fn set_rcwn_cache_won_count(this: &RcwnStatus, val: u32); + #[doc = "Get the `rcwnNetWonCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, getter = "rcwnNetWonCount")] + pub fn get_rcwn_net_won_count(this: &RcwnStatus) -> Option; + #[doc = "Change the `rcwnNetWonCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, setter = "rcwnNetWonCount")] + pub fn set_rcwn_net_won_count(this: &RcwnStatus, val: u32); + #[doc = "Get the `totalNetworkRequests` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, getter = "totalNetworkRequests")] + pub fn get_total_network_requests(this: &RcwnStatus) -> Option; + #[doc = "Change the `totalNetworkRequests` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[wasm_bindgen(method, setter = "totalNetworkRequests")] + pub fn set_total_network_requests(this: &RcwnStatus, val: u32); } impl RcwnStatus { #[doc = "Construct a new `RcwnStatus`."] @@ -19,106 +80,34 @@ impl RcwnStatus { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `cacheNotSlowCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[deprecated = "Use `set_cache_not_slow_count()` instead."] pub fn cache_not_slow_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cacheNotSlowCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cache_not_slow_count(val); self } - #[doc = "Change the `cacheSlowCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[deprecated = "Use `set_cache_slow_count()` instead."] pub fn cache_slow_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("cacheSlowCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cache_slow_count(val); self } - #[doc = "Change the `perfStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[deprecated = "Use `set_perf_stats()` instead."] pub fn perf_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("perfStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_perf_stats(val); self } - #[doc = "Change the `rcwnCacheWonCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[deprecated = "Use `set_rcwn_cache_won_count()` instead."] pub fn rcwn_cache_won_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rcwnCacheWonCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rcwn_cache_won_count(val); self } - #[doc = "Change the `rcwnNetWonCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[deprecated = "Use `set_rcwn_net_won_count()` instead."] pub fn rcwn_net_won_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rcwnNetWonCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rcwn_net_won_count(val); self } - #[doc = "Change the `totalNetworkRequests` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RcwnStatus`*"] + #[deprecated = "Use `set_total_network_requests()` instead."] pub fn total_network_requests(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("totalNetworkRequests"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_total_network_requests(val); self } } diff --git a/crates/web-sys/src/features/gen_ReadableByteStreamController.rs b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs new file mode 100644 index 00000000000..016d9436e5c --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs @@ -0,0 +1,81 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableByteStreamController , typescript_type = "ReadableByteStreamController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableByteStreamController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub type ReadableByteStreamController; + #[cfg(feature = "ReadableStreamByobRequest")] + # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = byobRequest)] + #[doc = "Getter for the `byobRequest` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/byobRequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`, `ReadableStreamByobRequest`*"] + pub fn byob_request(this: &ReadableByteStreamController) -> Option; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn desired_size(this: &ReadableByteStreamController) -> Option; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn close(this: &ReadableByteStreamController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn enqueue_with_array_buffer_view( + this: &ReadableByteStreamController, + chunk: &::js_sys::Object, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn enqueue_with_u8_array( + this: &ReadableByteStreamController, + chunk: &mut [u8], + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn enqueue_with_js_u8_array( + this: &ReadableByteStreamController, + chunk: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn error(this: &ReadableByteStreamController); + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn error_with_e(this: &ReadableByteStreamController, e: &::wasm_bindgen::JsValue); +} diff --git a/crates/web-sys/src/features/gen_ReadableStream.rs b/crates/web-sys/src/features/gen_ReadableStream.rs index a68f982b964..352be8a833b 100644 --- a/crates/web-sys/src/features/gen_ReadableStream.rs +++ b/crates/web-sys/src/features/gen_ReadableStream.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -18,31 +19,22 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] pub fn locked(this: &ReadableStream) -> bool; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")] #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Result; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")] #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_underlying_source( underlying_source: &::js_sys::Object, ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "QueuingStrategy")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")] #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."] @@ -50,9 +42,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `ReadableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_underlying_source_and_strategy( underlying_source: &::js_sys::Object, strategy: &QueuingStrategy, @@ -74,6 +63,13 @@ extern "C" { this: &ReadableStream, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] + pub fn entries(this: &ReadableStream) -> ::js_sys::AsyncIterator; # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = getReader)] #[doc = "The `getReader()` method."] #[doc = ""] @@ -92,6 +88,13 @@ extern "C" { this: &ReadableStream, options: &ReadableStreamGetReaderOptions, ) -> ::js_sys::Object; + # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] + pub fn keys(this: &ReadableStream) -> ::js_sys::AsyncIterator; #[cfg(feature = "ReadableWritablePair")] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeThrough)] #[doc = "The `pipeThrough()` method."] @@ -112,7 +115,6 @@ extern "C" { transform: &ReadableWritablePair, options: &StreamPipeOptions, ) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -120,11 +122,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to(this: &ReadableStream, destination: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "StreamPipeOptions", feature = "WritableStream",))] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -132,9 +130,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `StreamPipeOptions`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to_with_options( this: &ReadableStream, destination: &WritableStream, @@ -147,4 +142,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] pub fn tee(this: &ReadableStream) -> ::js_sys::Array; + # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"] + pub fn values(this: &ReadableStream) -> ::js_sys::AsyncIterator; } diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs index a630495bad7..fb169472383 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReader , typescript_type = "ReadableStreamBYOBReader")] @@ -11,22 +11,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamByobReader; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamByobReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamBYOBReader")] #[doc = "The `new ReadableStreamByobReader(..)` constructor, creating a new instance of `ReadableStreamByobReader`."] @@ -34,70 +26,37 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_array_buffer_view( this: &ReadableStreamByobReader, view: &::js_sys::Object, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] - #[doc = "The `read()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn read_with_u8_array( - this: &ReadableStreamByobReader, - view: &mut [u8], - ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &ReadableStreamByobReader); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamByobReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamByobReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs b/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs new file mode 100644 index 00000000000..5a8863bc90d --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs @@ -0,0 +1,72 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBRequest , typescript_type = "ReadableStreamBYOBRequest")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamByobRequest` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub type ReadableStreamByobRequest; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBRequest" , js_name = view)] + #[doc = "Getter for the `view` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/view)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn view(this: &ReadableStreamByobRequest) -> Option<::js_sys::Object>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respond)] + #[doc = "The `respond()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respond)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_u32( + this: &ReadableStreamByobRequest, + bytes_written: u32, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respond)] + #[doc = "The `respond()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respond)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_f64( + this: &ReadableStreamByobRequest, + bytes_written: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] + #[doc = "The `respondWithNewView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_new_view_with_array_buffer_view( + this: &ReadableStreamByobRequest, + view: &::js_sys::Object, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] + #[doc = "The `respondWithNewView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_new_view_with_u8_array( + this: &ReadableStreamByobRequest, + view: &mut [u8], + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] + #[doc = "The `respondWithNewView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_new_view_with_js_u8_array( + this: &ReadableStreamByobRequest, + view: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs new file mode 100644 index 00000000000..37f3f091d10 --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs @@ -0,0 +1,60 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultController , typescript_type = "ReadableStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub type ReadableStreamDefaultController; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn desired_size(this: &ReadableStreamDefaultController) -> Option; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn close(this: &ReadableStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn enqueue(this: &ReadableStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn enqueue_with_chunk( + this: &ReadableStreamDefaultController, + chunk: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn error(this: &ReadableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn error_with_e(this: &ReadableStreamDefaultController, e: &::wasm_bindgen::JsValue); +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs index e47c2a3073f..ab38d4376e1 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReader , typescript_type = "ReadableStreamDefaultReader")] @@ -11,22 +11,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamDefaultReader; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamDefaultReader")] #[doc = "The `new ReadableStreamDefaultReader(..)` constructor, creating a new instance of `ReadableStreamDefaultReader`."] @@ -34,53 +26,34 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &ReadableStreamDefaultReader); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamDefaultReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamGetReaderOptions.rs b/crates/web-sys/src/features/gen_ReadableStreamGetReaderOptions.rs index 632b8263402..0cf5d910ca9 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamGetReaderOptions.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamGetReaderOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamGetReaderOptions`*"] pub type ReadableStreamGetReaderOptions; + #[cfg(feature = "ReadableStreamReaderMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamGetReaderOptions`, `ReadableStreamReaderMode`*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &ReadableStreamGetReaderOptions) -> Option; + #[cfg(feature = "ReadableStreamReaderMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamGetReaderOptions`, `ReadableStreamReaderMode`*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &ReadableStreamGetReaderOptions, val: ReadableStreamReaderMode); } impl ReadableStreamGetReaderOptions { #[doc = "Construct a new `ReadableStreamGetReaderOptions`."] @@ -20,17 +33,9 @@ impl ReadableStreamGetReaderOptions { ret } #[cfg(feature = "ReadableStreamReaderMode")] - #[doc = "Change the `mode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamGetReaderOptions`, `ReadableStreamReaderMode`*"] + #[deprecated = "Use `set_mode()` instead."] pub fn mode(&mut self, val: ReadableStreamReaderMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mode(val); self } } diff --git a/crates/web-sys/src/features/gen_ReadableStreamIteratorOptions.rs b/crates/web-sys/src/features/gen_ReadableStreamIteratorOptions.rs index f1c2d65b6cc..cc5b87e0bd2 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamIteratorOptions.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamIteratorOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"] pub type ReadableStreamIteratorOptions; + #[doc = "Get the `preventCancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"] + #[wasm_bindgen(method, getter = "preventCancel")] + pub fn get_prevent_cancel(this: &ReadableStreamIteratorOptions) -> Option; + #[doc = "Change the `preventCancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"] + #[wasm_bindgen(method, setter = "preventCancel")] + pub fn set_prevent_cancel(this: &ReadableStreamIteratorOptions, val: bool); } impl ReadableStreamIteratorOptions { #[doc = "Construct a new `ReadableStreamIteratorOptions`."] @@ -19,21 +30,9 @@ impl ReadableStreamIteratorOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `preventCancel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"] + #[deprecated = "Use `set_prevent_cancel()` instead."] pub fn prevent_cancel(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preventCancel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prevent_cancel(val); self } } diff --git a/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs new file mode 100644 index 00000000000..9f22eb0a1eb --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs @@ -0,0 +1,58 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamReadResult)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamReadResult` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub type ReadableStreamReadResult; + #[doc = "Get the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + #[wasm_bindgen(method, getter = "done")] + pub fn get_done(this: &ReadableStreamReadResult) -> Option; + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + #[wasm_bindgen(method, setter = "done")] + pub fn set_done(this: &ReadableStreamReadResult, val: bool); + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &ReadableStreamReadResult) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &ReadableStreamReadResult, val: &::wasm_bindgen::JsValue); +} +impl ReadableStreamReadResult { + #[doc = "Construct a new `ReadableStreamReadResult`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_done()` instead."] + pub fn done(&mut self, val: bool) -> &mut Self { + self.set_done(val); + self + } + #[deprecated = "Use `set_value()` instead."] + pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_value(val); + self + } +} +impl Default for ReadableStreamReadResult { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamReaderMode.rs b/crates/web-sys/src/features/gen_ReadableStreamReaderMode.rs index a01a07dacc1..ed940741702 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamReaderMode.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamReaderMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ReadableStreamReaderMode` enum."] diff --git a/crates/web-sys/src/features/gen_GridDeclaration.rs b/crates/web-sys/src/features/gen_ReadableStreamType.rs similarity index 56% rename from crates/web-sys/src/features/gen_GridDeclaration.rs rename to crates/web-sys/src/features/gen_ReadableStreamType.rs index 325ac2bbc42..298c3eef697 100644 --- a/crates/web-sys/src/features/gen_GridDeclaration.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamType.rs @@ -1,11 +1,11 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] -#[doc = "The `GridDeclaration` enum."] +#[doc = "The `ReadableStreamType` enum."] #[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `GridDeclaration`*"] +#[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum GridDeclaration { - Explicit = "explicit", - Implicit = "implicit", +pub enum ReadableStreamType { + Bytes = "bytes", } diff --git a/crates/web-sys/src/features/gen_ReadableWritablePair.rs b/crates/web-sys/src/features/gen_ReadableWritablePair.rs index 0ce861e74ab..2c6af13c0fb 100644 --- a/crates/web-sys/src/features/gen_ReadableWritablePair.rs +++ b/crates/web-sys/src/features/gen_ReadableWritablePair.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,61 +10,53 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`*"] pub type ReadableWritablePair; + #[cfg(feature = "ReadableStream")] + #[doc = "Get the `readable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`*"] + #[wasm_bindgen(method, getter = "readable")] + pub fn get_readable(this: &ReadableWritablePair) -> ReadableStream; + #[cfg(feature = "ReadableStream")] + #[doc = "Change the `readable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`*"] + #[wasm_bindgen(method, setter = "readable")] + pub fn set_readable(this: &ReadableWritablePair, val: &ReadableStream); + #[cfg(feature = "WritableStream")] + #[doc = "Get the `writable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`, `WritableStream`*"] + #[wasm_bindgen(method, getter = "writable")] + pub fn get_writable(this: &ReadableWritablePair) -> WritableStream; + #[cfg(feature = "WritableStream")] + #[doc = "Change the `writable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`, `WritableStream`*"] + #[wasm_bindgen(method, setter = "writable")] + pub fn set_writable(this: &ReadableWritablePair, val: &WritableStream); } impl ReadableWritablePair { - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "ReadableStream", feature = "WritableStream",))] #[doc = "Construct a new `ReadableWritablePair`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(readable: &ReadableStream, writable: &WritableStream) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.readable(readable); - ret.writable(writable); + ret.set_readable(readable); + ret.set_writable(writable); ret } #[cfg(feature = "ReadableStream")] - #[doc = "Change the `readable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`*"] + #[deprecated = "Use `set_readable()` instead."] pub fn readable(&mut self, val: &ReadableStream) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("readable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_readable(val); self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] - #[doc = "Change the `writable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_writable()` instead."] pub fn writable(&mut self, val: &WritableStream) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("writable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_writable(val); self } } diff --git a/crates/web-sys/src/features/gen_RecordingState.rs b/crates/web-sys/src/features/gen_RecordingState.rs index b652faf7543..6aee4d1366e 100644 --- a/crates/web-sys/src/features/gen_RecordingState.rs +++ b/crates/web-sys/src/features/gen_RecordingState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RecordingState` enum."] diff --git a/crates/web-sys/src/features/gen_ReferrerPolicy.rs b/crates/web-sys/src/features/gen_ReferrerPolicy.rs index 8a04af575af..467695b2ef6 100644 --- a/crates/web-sys/src/features/gen_ReferrerPolicy.rs +++ b/crates/web-sys/src/features/gen_ReferrerPolicy.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ReferrerPolicy` enum."] diff --git a/crates/web-sys/src/features/gen_RegisterRequest.rs b/crates/web-sys/src/features/gen_RegisterRequest.rs index c3ef767057d..a7cfa8a517b 100644 --- a/crates/web-sys/src/features/gen_RegisterRequest.rs +++ b/crates/web-sys/src/features/gen_RegisterRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] pub type RegisterRequest; + #[doc = "Get the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] + #[wasm_bindgen(method, getter = "challenge")] + pub fn get_challenge(this: &RegisterRequest) -> Option<::alloc::string::String>; + #[doc = "Change the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] + #[wasm_bindgen(method, setter = "challenge")] + pub fn set_challenge(this: &RegisterRequest, val: &str); + #[doc = "Get the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] + #[wasm_bindgen(method, getter = "version")] + pub fn get_version(this: &RegisterRequest) -> Option<::alloc::string::String>; + #[doc = "Change the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] + #[wasm_bindgen(method, setter = "version")] + pub fn set_version(this: &RegisterRequest, val: &str); } impl RegisterRequest { #[doc = "Construct a new `RegisterRequest`."] @@ -19,38 +40,14 @@ impl RegisterRequest { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `challenge` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] + #[deprecated = "Use `set_challenge()` instead."] pub fn challenge(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_challenge(val); self } - #[doc = "Change the `version` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisterRequest`*"] + #[deprecated = "Use `set_version()` instead."] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_version(val); self } } diff --git a/crates/web-sys/src/features/gen_RegisterResponse.rs b/crates/web-sys/src/features/gen_RegisterResponse.rs index 19c324a2b9f..8c638b768de 100644 --- a/crates/web-sys/src/features/gen_RegisterResponse.rs +++ b/crates/web-sys/src/features/gen_RegisterResponse.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] pub type RegisterResponse; + #[doc = "Get the `clientData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, getter = "clientData")] + pub fn get_client_data(this: &RegisterResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `clientData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, setter = "clientData")] + pub fn set_client_data(this: &RegisterResponse, val: &str); + #[doc = "Get the `errorCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, getter = "errorCode")] + pub fn get_error_code(this: &RegisterResponse) -> Option; + #[doc = "Change the `errorCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, setter = "errorCode")] + pub fn set_error_code(this: &RegisterResponse, val: Option); + #[doc = "Get the `errorMessage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, getter = "errorMessage")] + pub fn get_error_message(this: &RegisterResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `errorMessage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, setter = "errorMessage")] + pub fn set_error_message(this: &RegisterResponse, val: Option<&str>); + #[doc = "Get the `registrationData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, getter = "registrationData")] + pub fn get_registration_data(this: &RegisterResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `registrationData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, setter = "registrationData")] + pub fn set_registration_data(this: &RegisterResponse, val: &str); + #[doc = "Get the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, getter = "version")] + pub fn get_version(this: &RegisterResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[wasm_bindgen(method, setter = "version")] + pub fn set_version(this: &RegisterResponse, val: &str); } impl RegisterResponse { #[doc = "Construct a new `RegisterResponse`."] @@ -19,89 +70,29 @@ impl RegisterResponse { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `clientData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[deprecated = "Use `set_client_data()` instead."] pub fn client_data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_data(val); self } - #[doc = "Change the `errorCode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[deprecated = "Use `set_error_code()` instead."] pub fn error_code(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("errorCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error_code(val); self } - #[doc = "Change the `errorMessage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[deprecated = "Use `set_error_message()` instead."] pub fn error_message(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("errorMessage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error_message(val); self } - #[doc = "Change the `registrationData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[deprecated = "Use `set_registration_data()` instead."] pub fn registration_data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("registrationData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_registration_data(val); self } - #[doc = "Change the `version` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisterResponse`*"] + #[deprecated = "Use `set_version()` instead."] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_version(val); self } } diff --git a/crates/web-sys/src/features/gen_RegisteredKey.rs b/crates/web-sys/src/features/gen_RegisteredKey.rs index d18b0085300..986374c4ebc 100644 --- a/crates/web-sys/src/features/gen_RegisteredKey.rs +++ b/crates/web-sys/src/features/gen_RegisteredKey.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] pub type RegisteredKey; + #[doc = "Get the `appId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[wasm_bindgen(method, getter = "appId")] + pub fn get_app_id(this: &RegisteredKey) -> Option<::alloc::string::String>; + #[doc = "Change the `appId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[wasm_bindgen(method, setter = "appId")] + pub fn set_app_id(this: &RegisteredKey, val: Option<&str>); + #[doc = "Get the `keyHandle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[wasm_bindgen(method, getter = "keyHandle")] + pub fn get_key_handle(this: &RegisteredKey) -> Option<::alloc::string::String>; + #[doc = "Change the `keyHandle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[wasm_bindgen(method, setter = "keyHandle")] + pub fn set_key_handle(this: &RegisteredKey, val: &str); + #[doc = "Get the `transports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[wasm_bindgen(method, getter = "transports")] + pub fn get_transports(this: &RegisteredKey) -> Option<::js_sys::Array>; + #[doc = "Change the `transports` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[wasm_bindgen(method, setter = "transports")] + pub fn set_transports(this: &RegisteredKey, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[wasm_bindgen(method, getter = "version")] + pub fn get_version(this: &RegisteredKey) -> Option<::alloc::string::String>; + #[doc = "Change the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[wasm_bindgen(method, setter = "version")] + pub fn set_version(this: &RegisteredKey, val: &str); } impl RegisteredKey { #[doc = "Construct a new `RegisteredKey`."] @@ -19,68 +60,24 @@ impl RegisteredKey { 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: `RegisteredKey`*"] + #[deprecated = "Use `set_app_id()` instead."] pub fn app_id(&mut self, val: Option<&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.set_app_id(val); self } - #[doc = "Change the `keyHandle` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[deprecated = "Use `set_key_handle()` instead."] pub fn key_handle(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyHandle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key_handle(val); self } - #[doc = "Change the `transports` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[deprecated = "Use `set_transports()` instead."] pub fn transports(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transports(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } - #[doc = "Change the `version` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegisteredKey`*"] + #[deprecated = "Use `set_version()` instead."] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_version(val); self } } diff --git a/crates/web-sys/src/features/gen_RegistrationOptions.rs b/crates/web-sys/src/features/gen_RegistrationOptions.rs index 9c186a6c8e6..70f285a09c1 100644 --- a/crates/web-sys/src/features/gen_RegistrationOptions.rs +++ b/crates/web-sys/src/features/gen_RegistrationOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] pub type RegistrationOptions; + #[doc = "Get the `scope` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] + #[wasm_bindgen(method, getter = "scope")] + pub fn get_scope(this: &RegistrationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `scope` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] + #[wasm_bindgen(method, setter = "scope")] + pub fn set_scope(this: &RegistrationOptions, val: &str); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RegistrationOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RegistrationOptions, val: &str); + #[cfg(feature = "ServiceWorkerUpdateViaCache")] + #[doc = "Get the `updateViaCache` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`, `ServiceWorkerUpdateViaCache`*"] + #[wasm_bindgen(method, getter = "updateViaCache")] + pub fn get_update_via_cache(this: &RegistrationOptions) -> Option; + #[cfg(feature = "ServiceWorkerUpdateViaCache")] + #[doc = "Change the `updateViaCache` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`, `ServiceWorkerUpdateViaCache`*"] + #[wasm_bindgen(method, setter = "updateViaCache")] + pub fn set_update_via_cache(this: &RegistrationOptions, val: ServiceWorkerUpdateViaCache); } impl RegistrationOptions { #[doc = "Construct a new `RegistrationOptions`."] @@ -19,35 +52,20 @@ impl RegistrationOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `scope` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`*"] + #[deprecated = "Use `set_scope()` instead."] pub fn scope(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("scope"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_scope(val); + self + } + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: &str) -> &mut Self { + self.set_type(val); self } #[cfg(feature = "ServiceWorkerUpdateViaCache")] - #[doc = "Change the `updateViaCache` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`, `ServiceWorkerUpdateViaCache`*"] + #[deprecated = "Use `set_update_via_cache()` instead."] pub fn update_via_cache(&mut self, val: ServiceWorkerUpdateViaCache) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("updateViaCache"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_update_via_cache(val); self } } diff --git a/crates/web-sys/src/features/gen_RegistrationResponseJson.rs b/crates/web-sys/src/features/gen_RegistrationResponseJson.rs new file mode 100644 index 00000000000..a4969714478 --- /dev/null +++ b/crates/web-sys/src/features/gen_RegistrationResponseJson.rs @@ -0,0 +1,209 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RegistrationResponseJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RegistrationResponseJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RegistrationResponseJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `authenticatorAttachment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "authenticatorAttachment")] + pub fn get_authenticator_attachment( + this: &RegistrationResponseJson, + ) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `authenticatorAttachment` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "authenticatorAttachment")] + pub fn set_authenticator_attachment(this: &RegistrationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientOutputsJson")] + #[doc = "Get the `clientExtensionResults` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputsJson`, `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "clientExtensionResults")] + pub fn get_client_extension_results( + this: &RegistrationResponseJson, + ) -> AuthenticationExtensionsClientOutputsJson; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientOutputsJson")] + #[doc = "Change the `clientExtensionResults` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputsJson`, `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "clientExtensionResults")] + pub fn set_client_extension_results( + this: &RegistrationResponseJson, + val: &AuthenticationExtensionsClientOutputsJson, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RegistrationResponseJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RegistrationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rawId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rawId")] + pub fn get_raw_id(this: &RegistrationResponseJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rawId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rawId")] + pub fn set_raw_id(this: &RegistrationResponseJson, val: &str); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorAttestationResponseJson")] + #[doc = "Get the `response` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`, `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "response")] + pub fn get_response(this: &RegistrationResponseJson) -> AuthenticatorAttestationResponseJson; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorAttestationResponseJson")] + #[doc = "Change the `response` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponseJson`, `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "response")] + pub fn set_response( + this: &RegistrationResponseJson, + val: &AuthenticatorAttestationResponseJson, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RegistrationResponseJson) -> ::alloc::string::String; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RegistrationResponseJson, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl RegistrationResponseJson { + #[cfg(all( + feature = "AuthenticationExtensionsClientOutputsJson", + feature = "AuthenticatorAttestationResponseJson", + ))] + #[doc = "Construct a new `RegistrationResponseJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputsJson`, `AuthenticatorAttestationResponseJson`, `RegistrationResponseJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + client_extension_results: &AuthenticationExtensionsClientOutputsJson, + id: &str, + raw_id: &str, + response: &AuthenticatorAttestationResponseJson, + type_: &str, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_client_extension_results(client_extension_results); + ret.set_id(id); + ret.set_raw_id(raw_id); + ret.set_response(response); + ret.set_type(type_); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_authenticator_attachment()` instead."] + pub fn authenticator_attachment(&mut self, val: &str) -> &mut Self { + self.set_authenticator_attachment(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticationExtensionsClientOutputsJson")] + #[deprecated = "Use `set_client_extension_results()` instead."] + pub fn client_extension_results( + &mut self, + val: &AuthenticationExtensionsClientOutputsJson, + ) -> &mut Self { + self.set_client_extension_results(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_raw_id()` instead."] + pub fn raw_id(&mut self, val: &str) -> &mut Self { + self.set_raw_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AuthenticatorAttestationResponseJson")] + #[deprecated = "Use `set_response()` instead."] + pub fn response(&mut self, val: &AuthenticatorAttestationResponseJson) -> &mut Self { + self.set_response(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: &str) -> &mut Self { + self.set_type(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_Request.rs b/crates/web-sys/src/features/gen_Request.rs index d83d86a2953..2561fb5dc66 100644 --- a/crates/web-sys/src/features/gen_Request.rs +++ b/crates/web-sys/src/features/gen_Request.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/method)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Request`*"] - pub fn method(this: &Request) -> String; + pub fn method(this: &Request) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = url)] #[doc = "Getter for the `url` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/url)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Request`*"] - pub fn url(this: &Request) -> String; + pub fn url(this: &Request) -> ::alloc::string::String; #[cfg(feature = "Headers")] # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = headers)] #[doc = "Getter for the `headers` field of this object."] @@ -47,7 +48,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/referrer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Request`*"] - pub fn referrer(this: &Request) -> String; + pub fn referrer(this: &Request) -> ::alloc::string::String; #[cfg(feature = "ReferrerPolicy")] # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = referrerPolicy)] #[doc = "Getter for the `referrerPolicy` field of this object."] @@ -94,7 +95,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Request/integrity)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Request`*"] - pub fn integrity(this: &Request) -> String; + pub fn integrity(this: &Request) -> ::alloc::string::String; #[cfg(feature = "AbortSignal")] # [wasm_bindgen (structural , method , getter , js_class = "Request" , js_name = signal)] #[doc = "Getter for the `signal` field of this object."] diff --git a/crates/web-sys/src/features/gen_RequestCache.rs b/crates/web-sys/src/features/gen_RequestCache.rs index 411fce685d4..e464cdfc201 100644 --- a/crates/web-sys/src/features/gen_RequestCache.rs +++ b/crates/web-sys/src/features/gen_RequestCache.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RequestCache` enum."] diff --git a/crates/web-sys/src/features/gen_RequestCredentials.rs b/crates/web-sys/src/features/gen_RequestCredentials.rs index 5c61d97a2fe..00f7a753385 100644 --- a/crates/web-sys/src/features/gen_RequestCredentials.rs +++ b/crates/web-sys/src/features/gen_RequestCredentials.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RequestCredentials` enum."] diff --git a/crates/web-sys/src/features/gen_RequestDestination.rs b/crates/web-sys/src/features/gen_RequestDestination.rs index e21089dc53a..143fadff1a4 100644 --- a/crates/web-sys/src/features/gen_RequestDestination.rs +++ b/crates/web-sys/src/features/gen_RequestDestination.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RequestDestination` enum."] diff --git a/crates/web-sys/src/features/gen_RequestDeviceOptions.rs b/crates/web-sys/src/features/gen_RequestDeviceOptions.rs index 02f230278a7..265dec607e0 100644 --- a/crates/web-sys/src/features/gen_RequestDeviceOptions.rs +++ b/crates/web-sys/src/features/gen_RequestDeviceOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type RequestDeviceOptions; -} -#[cfg(web_sys_unstable_apis)] -impl RequestDeviceOptions { - #[doc = "Construct a new `RequestDeviceOptions`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `acceptAllDevices` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "acceptAllDevices")] + pub fn get_accept_all_devices(this: &RequestDeviceOptions) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `acceptAllDevices` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl RequestDeviceOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn accept_all_devices(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("acceptAllDevices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "acceptAllDevices")] + pub fn set_accept_all_devices(this: &RequestDeviceOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "filters")] + pub fn get_filters(this: &RequestDeviceOptions) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `filters` field of this object."] #[doc = ""] @@ -55,20 +48,17 @@ impl RequestDeviceOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "filters")] + pub fn set_filters(this: &RequestDeviceOptions, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `optionalServices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "optionalServices")] + pub fn get_optional_services(this: &RequestDeviceOptions) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `optionalServices` field of this object."] #[doc = ""] @@ -76,18 +66,38 @@ impl RequestDeviceOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "optionalServices")] + pub fn set_optional_services(this: &RequestDeviceOptions, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl RequestDeviceOptions { + #[doc = "Construct a new `RequestDeviceOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestDeviceOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_accept_all_devices()` instead."] + pub fn accept_all_devices(&mut self, val: bool) -> &mut Self { + self.set_accept_all_devices(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_filters()` instead."] + pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_filters(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_optional_services()` instead."] pub fn optional_services(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optionalServices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_optional_services(val); self } } diff --git a/crates/web-sys/src/features/gen_RequestInit.rs b/crates/web-sys/src/features/gen_RequestInit.rs index 12ad7bf6151..83d48276202 100644 --- a/crates/web-sys/src/features/gen_RequestInit.rs +++ b/crates/web-sys/src/features/gen_RequestInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,140 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] pub type RequestInit; + #[doc = "Get the `body` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, getter = "body")] + pub fn get_body(this: &RequestInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `body` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, setter = "body")] + pub fn set_body(this: &RequestInit, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "RequestCache")] + #[doc = "Get the `cache` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestCache`, `RequestInit`*"] + #[wasm_bindgen(method, getter = "cache")] + pub fn get_cache(this: &RequestInit) -> Option; + #[cfg(feature = "RequestCache")] + #[doc = "Change the `cache` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestCache`, `RequestInit`*"] + #[wasm_bindgen(method, setter = "cache")] + pub fn set_cache(this: &RequestInit, val: RequestCache); + #[cfg(feature = "RequestCredentials")] + #[doc = "Get the `credentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `RequestInit`*"] + #[wasm_bindgen(method, getter = "credentials")] + pub fn get_credentials(this: &RequestInit) -> Option; + #[cfg(feature = "RequestCredentials")] + #[doc = "Change the `credentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `RequestInit`*"] + #[wasm_bindgen(method, setter = "credentials")] + pub fn set_credentials(this: &RequestInit, val: RequestCredentials); + #[doc = "Get the `headers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, getter = "headers")] + pub fn get_headers(this: &RequestInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `headers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, setter = "headers")] + pub fn set_headers(this: &RequestInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `integrity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, getter = "integrity")] + pub fn get_integrity(this: &RequestInit) -> Option<::alloc::string::String>; + #[doc = "Change the `integrity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, setter = "integrity")] + pub fn set_integrity(this: &RequestInit, val: &str); + #[doc = "Get the `method` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, getter = "method")] + pub fn get_method(this: &RequestInit) -> Option<::alloc::string::String>; + #[doc = "Change the `method` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, setter = "method")] + pub fn set_method(this: &RequestInit, val: &str); + #[cfg(feature = "RequestMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`, `RequestMode`*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &RequestInit) -> Option; + #[cfg(feature = "RequestMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`, `RequestMode`*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &RequestInit, val: RequestMode); + #[cfg(feature = "ObserverCallback")] + #[doc = "Get the `observe` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`, `RequestInit`*"] + #[wasm_bindgen(method, getter = "observe")] + pub fn get_observe(this: &RequestInit) -> Option; + #[cfg(feature = "ObserverCallback")] + #[doc = "Change the `observe` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`, `RequestInit`*"] + #[wasm_bindgen(method, setter = "observe")] + pub fn set_observe(this: &RequestInit, val: &ObserverCallback); + #[cfg(feature = "RequestRedirect")] + #[doc = "Get the `redirect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`, `RequestRedirect`*"] + #[wasm_bindgen(method, getter = "redirect")] + pub fn get_redirect(this: &RequestInit) -> Option; + #[cfg(feature = "RequestRedirect")] + #[doc = "Change the `redirect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`, `RequestRedirect`*"] + #[wasm_bindgen(method, setter = "redirect")] + pub fn set_redirect(this: &RequestInit, val: RequestRedirect); + #[doc = "Get the `referrer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, getter = "referrer")] + pub fn get_referrer(this: &RequestInit) -> Option<::alloc::string::String>; + #[doc = "Change the `referrer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[wasm_bindgen(method, setter = "referrer")] + pub fn set_referrer(this: &RequestInit, val: &str); + #[cfg(feature = "ReferrerPolicy")] + #[doc = "Get the `referrerPolicy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReferrerPolicy`, `RequestInit`*"] + #[wasm_bindgen(method, getter = "referrerPolicy")] + pub fn get_referrer_policy(this: &RequestInit) -> Option; + #[cfg(feature = "ReferrerPolicy")] + #[doc = "Change the `referrerPolicy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReferrerPolicy`, `RequestInit`*"] + #[wasm_bindgen(method, setter = "referrerPolicy")] + pub fn set_referrer_policy(this: &RequestInit, val: ReferrerPolicy); + #[cfg(feature = "AbortSignal")] + #[doc = "Get the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `RequestInit`*"] + #[wasm_bindgen(method, getter = "signal")] + pub fn get_signal(this: &RequestInit) -> Option; + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `RequestInit`*"] + #[wasm_bindgen(method, setter = "signal")] + pub fn set_signal(this: &RequestInit, val: Option<&AbortSignal>); } impl RequestInit { #[doc = "Construct a new `RequestInit`."] @@ -19,197 +154,71 @@ impl RequestInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `body` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[deprecated = "Use `set_body()` instead."] pub fn body(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("body"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_body(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } #[cfg(feature = "RequestCache")] - #[doc = "Change the `cache` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestCache`, `RequestInit`*"] + #[deprecated = "Use `set_cache()` instead."] pub fn cache(&mut self, val: RequestCache) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cache"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cache(val); self } #[cfg(feature = "RequestCredentials")] - #[doc = "Change the `credentials` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `RequestInit`*"] + #[deprecated = "Use `set_credentials()` instead."] pub fn credentials(&mut self, val: RequestCredentials) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_credentials(val); self } - #[doc = "Change the `headers` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[deprecated = "Use `set_headers()` instead."] pub fn headers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("headers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_headers(val); self } - #[doc = "Change the `integrity` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[deprecated = "Use `set_integrity()` instead."] pub fn integrity(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("integrity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_integrity(val); self } - #[doc = "Change the `method` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[deprecated = "Use `set_method()` instead."] pub fn method(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("method"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_method(val); self } #[cfg(feature = "RequestMode")] - #[doc = "Change the `mode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestInit`, `RequestMode`*"] + #[deprecated = "Use `set_mode()` instead."] pub fn mode(&mut self, val: RequestMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mode(val); self } #[cfg(feature = "ObserverCallback")] - #[doc = "Change the `observe` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ObserverCallback`, `RequestInit`*"] + #[deprecated = "Use `set_observe()` instead."] pub fn observe(&mut self, val: &ObserverCallback) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("observe"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_observe(val); self } #[cfg(feature = "RequestRedirect")] - #[doc = "Change the `redirect` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestInit`, `RequestRedirect`*"] + #[deprecated = "Use `set_redirect()` instead."] pub fn redirect(&mut self, val: RequestRedirect) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("redirect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_redirect(val); self } - #[doc = "Change the `referrer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestInit`*"] + #[deprecated = "Use `set_referrer()` instead."] pub fn referrer(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_referrer(val); self } #[cfg(feature = "ReferrerPolicy")] - #[doc = "Change the `referrerPolicy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReferrerPolicy`, `RequestInit`*"] + #[deprecated = "Use `set_referrer_policy()` instead."] pub fn referrer_policy(&mut self, val: ReferrerPolicy) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrerPolicy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_referrer_policy(val); self } #[cfg(feature = "AbortSignal")] - #[doc = "Change the `signal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `RequestInit`*"] + #[deprecated = "Use `set_signal()` instead."] pub fn signal(&mut self, val: Option<&AbortSignal>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_signal(val); self } } diff --git a/crates/web-sys/src/features/gen_RequestMediaKeySystemAccessNotification.rs b/crates/web-sys/src/features/gen_RequestMediaKeySystemAccessNotification.rs index 2af8ca81280..41e36acc87a 100644 --- a/crates/web-sys/src/features/gen_RequestMediaKeySystemAccessNotification.rs +++ b/crates/web-sys/src/features/gen_RequestMediaKeySystemAccessNotification.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,30 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"] pub type RequestMediaKeySystemAccessNotification; + #[doc = "Get the `keySystem` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"] + #[wasm_bindgen(method, getter = "keySystem")] + pub fn get_key_system( + this: &RequestMediaKeySystemAccessNotification, + ) -> ::alloc::string::String; + #[doc = "Change the `keySystem` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"] + #[wasm_bindgen(method, setter = "keySystem")] + pub fn set_key_system(this: &RequestMediaKeySystemAccessNotification, val: &str); + #[cfg(feature = "MediaKeySystemStatus")] + #[doc = "Get the `status` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"] + #[wasm_bindgen(method, getter = "status")] + pub fn get_status(this: &RequestMediaKeySystemAccessNotification) -> MediaKeySystemStatus; + #[cfg(feature = "MediaKeySystemStatus")] + #[doc = "Change the `status` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"] + #[wasm_bindgen(method, setter = "status")] + pub fn set_status(this: &RequestMediaKeySystemAccessNotification, val: MediaKeySystemStatus); } impl RequestMediaKeySystemAccessNotification { #[cfg(feature = "MediaKeySystemStatus")] @@ -18,40 +43,19 @@ impl RequestMediaKeySystemAccessNotification { pub fn new(key_system: &str, status: MediaKeySystemStatus) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.key_system(key_system); - ret.status(status); + ret.set_key_system(key_system); + ret.set_status(status); ret } - #[doc = "Change the `keySystem` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestMediaKeySystemAccessNotification`*"] + #[deprecated = "Use `set_key_system()` instead."] pub fn key_system(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keySystem"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key_system(val); self } #[cfg(feature = "MediaKeySystemStatus")] - #[doc = "Change the `status` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaKeySystemStatus`, `RequestMediaKeySystemAccessNotification`*"] + #[deprecated = "Use `set_status()` instead."] pub fn status(&mut self, val: MediaKeySystemStatus) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("status"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_status(val); self } } diff --git a/crates/web-sys/src/features/gen_RequestMode.rs b/crates/web-sys/src/features/gen_RequestMode.rs index cd129397922..82842b5e082 100644 --- a/crates/web-sys/src/features/gen_RequestMode.rs +++ b/crates/web-sys/src/features/gen_RequestMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RequestMode` enum."] diff --git a/crates/web-sys/src/features/gen_RequestRedirect.rs b/crates/web-sys/src/features/gen_RequestRedirect.rs index ae6cc92adea..528d777d651 100644 --- a/crates/web-sys/src/features/gen_RequestRedirect.rs +++ b/crates/web-sys/src/features/gen_RequestRedirect.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RequestRedirect` enum."] diff --git a/crates/web-sys/src/features/gen_ResidentKeyRequirement.rs b/crates/web-sys/src/features/gen_ResidentKeyRequirement.rs new file mode 100644 index 00000000000..453e8363b21 --- /dev/null +++ b/crates/web-sys/src/features/gen_ResidentKeyRequirement.rs @@ -0,0 +1,13 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `ResidentKeyRequirement` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `ResidentKeyRequirement`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ResidentKeyRequirement { + Discouraged = "discouraged", + Preferred = "preferred", + Required = "required", +} diff --git a/crates/web-sys/src/features/gen_ResizeObserver.rs b/crates/web-sys/src/features/gen_ResizeObserver.rs index 8b3ef38d228..5243b438d72 100644 --- a/crates/web-sys/src/features/gen_ResizeObserver.rs +++ b/crates/web-sys/src/features/gen_ResizeObserver.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserver , typescript_type = "ResizeObserver")] @@ -11,33 +11,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ResizeObserver; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "ResizeObserver")] #[doc = "The `new ResizeObserver(..)` constructor, creating a new instance of `ResizeObserver`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(callback: &::js_sys::Function) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = disconnect)] #[doc = "The `disconnect()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/disconnect)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn disconnect(this: &ResizeObserver); - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Element")] # [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = observe)] #[doc = "The `observe()` method."] @@ -45,11 +33,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn observe(this: &ResizeObserver, target: &Element); - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "Element", feature = "ResizeObserverOptions",))] # [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = observe)] #[doc = "The `observe()` method."] @@ -57,15 +41,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`, `ResizeObserverOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn observe_with_options( this: &ResizeObserver, target: &Element, options: &ResizeObserverOptions, ); - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Element")] # [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = unobserve)] #[doc = "The `unobserve()` method."] @@ -73,8 +53,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/unobserve)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn unobserve(this: &ResizeObserver, target: &Element); } diff --git a/crates/web-sys/src/features/gen_ResizeObserverBoxOptions.rs b/crates/web-sys/src/features/gen_ResizeObserverBoxOptions.rs index fb8f3e1941f..827b3d99d84 100644 --- a/crates/web-sys/src/features/gen_ResizeObserverBoxOptions.rs +++ b/crates/web-sys/src/features/gen_ResizeObserverBoxOptions.rs @@ -1,13 +1,10 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] #[doc = "The `ResizeObserverBoxOptions` enum."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`*"] -#[doc = ""] -#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] -#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ResizeObserverBoxOptions { BorderBox = "border-box", diff --git a/crates/web-sys/src/features/gen_ResizeObserverEntry.rs b/crates/web-sys/src/features/gen_ResizeObserverEntry.rs index 7b912228039..fd7ed79e845 100644 --- a/crates/web-sys/src/features/gen_ResizeObserverEntry.rs +++ b/crates/web-sys/src/features/gen_ResizeObserverEntry.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverEntry , typescript_type = "ResizeObserverEntry")] @@ -11,11 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ResizeObserverEntry; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Element")] # [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = target)] #[doc = "Getter for the `target` field of this object."] @@ -23,11 +19,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/target)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserverEntry`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn target(this: &ResizeObserverEntry) -> Element; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DomRectReadOnly")] # [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = contentRect)] #[doc = "Getter for the `contentRect` field of this object."] @@ -35,41 +27,26 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentRect)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `DomRectReadOnly`, `ResizeObserverEntry`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn content_rect(this: &ResizeObserverEntry) -> DomRectReadOnly; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = borderBoxSize)] #[doc = "Getter for the `borderBoxSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/borderBoxSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn border_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = contentBoxSize)] #[doc = "Getter for the `contentBoxSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentBoxSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn content_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = devicePixelContentBoxSize)] #[doc = "Getter for the `devicePixelContentBoxSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/devicePixelContentBoxSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn device_pixel_content_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array; } diff --git a/crates/web-sys/src/features/gen_ResizeObserverOptions.rs b/crates/web-sys/src/features/gen_ResizeObserverOptions.rs index e5f60a39255..07d824be9ac 100644 --- a/crates/web-sys/src/features/gen_ResizeObserverOptions.rs +++ b/crates/web-sys/src/features/gen_ResizeObserverOptions.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverOptions)] @@ -9,44 +9,36 @@ extern "C" { #[doc = "The `ResizeObserverOptions` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ResizeObserverOptions; + #[cfg(feature = "ResizeObserverBoxOptions")] + #[doc = "Get the `box` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`, `ResizeObserverOptions`*"] + #[wasm_bindgen(method, getter = "box")] + pub fn get_box(this: &ResizeObserverOptions) -> Option; + #[cfg(feature = "ResizeObserverBoxOptions")] + #[doc = "Change the `box` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`, `ResizeObserverOptions`*"] + #[wasm_bindgen(method, setter = "box")] + pub fn set_box(this: &ResizeObserverOptions, val: ResizeObserverBoxOptions); } -#[cfg(web_sys_unstable_apis)] impl ResizeObserverOptions { #[doc = "Construct a new `ResizeObserverOptions`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ResizeObserverBoxOptions")] - #[doc = "Change the `box` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`, `ResizeObserverOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_box()` instead."] pub fn box_(&mut self, val: ResizeObserverBoxOptions) -> &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.set_box(val); self } } -#[cfg(web_sys_unstable_apis)] impl Default for ResizeObserverOptions { fn default() -> Self { Self::new() diff --git a/crates/web-sys/src/features/gen_ResizeObserverSize.rs b/crates/web-sys/src/features/gen_ResizeObserverSize.rs index fbe899f69bc..c7a52499fde 100644 --- a/crates/web-sys/src/features/gen_ResizeObserverSize.rs +++ b/crates/web-sys/src/features/gen_ResizeObserverSize.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverSize , typescript_type = "ResizeObserverSize")] @@ -11,30 +11,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ResizeObserverSize; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverSize" , js_name = inlineSize)] #[doc = "Getter for the `inlineSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize/inlineSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn inline_size(this: &ResizeObserverSize) -> f64; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverSize" , js_name = blockSize)] #[doc = "Getter for the `blockSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize/blockSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn block_size(this: &ResizeObserverSize) -> f64; } diff --git a/crates/web-sys/src/features/gen_ResizeQuality.rs b/crates/web-sys/src/features/gen_ResizeQuality.rs new file mode 100644 index 00000000000..606867badca --- /dev/null +++ b/crates/web-sys/src/features/gen_ResizeQuality.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `ResizeQuality` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `ResizeQuality`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ResizeQuality { + Pixelated = "pixelated", + Low = "low", + Medium = "medium", + High = "high", +} diff --git a/crates/web-sys/src/features/gen_Response.rs b/crates/web-sys/src/features/gen_Response.rs index 028c14206b9..d569ae4df11 100644 --- a/crates/web-sys/src/features/gen_Response.rs +++ b/crates/web-sys/src/features/gen_Response.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/url)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Response`*"] - pub fn url(this: &Response) -> String; + pub fn url(this: &Response) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = redirected)] #[doc = "Getter for the `redirected` field of this object."] #[doc = ""] @@ -53,7 +54,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Response`*"] - pub fn status_text(this: &Response) -> String; + pub fn status_text(this: &Response) -> ::alloc::string::String; #[cfg(feature = "Headers")] # [wasm_bindgen (structural , method , getter , js_class = "Response" , js_name = headers)] #[doc = "Getter for the `headers` field of this object."] @@ -107,6 +108,15 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Response`*"] pub fn new_with_opt_u8_array(body: Option<&mut [u8]>) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "Response")] + #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Response`*"] + pub fn new_with_opt_js_u8_array( + body: Option<&::js_sys::Uint8Array>, + ) -> Result; #[cfg(feature = "FormData")] #[wasm_bindgen(catch, constructor, js_class = "Response")] #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."] @@ -174,6 +184,17 @@ extern "C" { body: Option<&mut [u8]>, init: &ResponseInit, ) -> Result; + #[cfg(feature = "ResponseInit")] + #[wasm_bindgen(catch, constructor, js_class = "Response")] + #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Response`, `ResponseInit`*"] + pub fn new_with_opt_js_u8_array_and_init( + body: Option<&::js_sys::Uint8Array>, + init: &ResponseInit, + ) -> Result; #[cfg(all(feature = "FormData", feature = "ResponseInit",))] #[wasm_bindgen(catch, constructor, js_class = "Response")] #[doc = "The `new Response(..)` constructor, creating a new instance of `Response`."] @@ -228,21 +249,21 @@ extern "C" { # [wasm_bindgen (static_method_of = Response , js_class = "Response" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/error)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/error_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Response`*"] pub fn error() -> Response; # [wasm_bindgen (catch , static_method_of = Response , js_class = "Response" , js_name = redirect)] #[doc = "The `redirect()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Response`*"] pub fn redirect(url: &str) -> Result; # [wasm_bindgen (catch , static_method_of = Response , js_class = "Response" , js_name = redirect)] #[doc = "The `redirect()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Response`*"] pub fn redirect_with_status(url: &str, status: u16) -> Result; diff --git a/crates/web-sys/src/features/gen_ResponseInit.rs b/crates/web-sys/src/features/gen_ResponseInit.rs index 14b2653505f..8323983698f 100644 --- a/crates/web-sys/src/features/gen_ResponseInit.rs +++ b/crates/web-sys/src/features/gen_ResponseInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] pub type ResponseInit; + #[doc = "Get the `headers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[wasm_bindgen(method, getter = "headers")] + pub fn get_headers(this: &ResponseInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `headers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[wasm_bindgen(method, setter = "headers")] + pub fn set_headers(this: &ResponseInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `status` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[wasm_bindgen(method, getter = "status")] + pub fn get_status(this: &ResponseInit) -> Option; + #[doc = "Change the `status` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[wasm_bindgen(method, setter = "status")] + pub fn set_status(this: &ResponseInit, val: u16); + #[doc = "Get the `statusText` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[wasm_bindgen(method, getter = "statusText")] + pub fn get_status_text(this: &ResponseInit) -> Option<::alloc::string::String>; + #[doc = "Change the `statusText` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[wasm_bindgen(method, setter = "statusText")] + pub fn set_status_text(this: &ResponseInit, val: &str); } impl ResponseInit { #[doc = "Construct a new `ResponseInit`."] @@ -19,52 +50,19 @@ impl ResponseInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `headers` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[deprecated = "Use `set_headers()` instead."] pub fn headers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("headers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_headers(val); self } - #[doc = "Change the `status` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[deprecated = "Use `set_status()` instead."] pub fn status(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("status"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_status(val); self } - #[doc = "Change the `statusText` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ResponseInit`*"] + #[deprecated = "Use `set_status_text()` instead."] pub fn status_text(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("statusText"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_status_text(val); self } } diff --git a/crates/web-sys/src/features/gen_ResponseType.rs b/crates/web-sys/src/features/gen_ResponseType.rs index 2ff543a7511..7f123fb915c 100644 --- a/crates/web-sys/src/features/gen_ResponseType.rs +++ b/crates/web-sys/src/features/gen_ResponseType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ResponseType` enum."] diff --git a/crates/web-sys/src/features/gen_RsaHashedImportParams.rs b/crates/web-sys/src/features/gen_RsaHashedImportParams.rs index d98141c4554..9914e446111 100644 --- a/crates/web-sys/src/features/gen_RsaHashedImportParams.rs +++ b/crates/web-sys/src/features/gen_RsaHashedImportParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaHashedImportParams`*"] pub type RsaHashedImportParams; + #[doc = "Get the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaHashedImportParams`*"] + #[wasm_bindgen(method, getter = "hash")] + pub fn get_hash(this: &RsaHashedImportParams) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `hash` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaHashedImportParams`*"] + #[wasm_bindgen(method, setter = "hash")] + pub fn set_hash(this: &RsaHashedImportParams, val: &::wasm_bindgen::JsValue); } impl RsaHashedImportParams { #[doc = "Construct a new `RsaHashedImportParams`."] @@ -17,20 +28,12 @@ impl RsaHashedImportParams { pub fn new(hash: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.hash(hash); + ret.set_hash(hash); ret } - #[doc = "Change the `hash` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RsaHashedImportParams`*"] + #[deprecated = "Use `set_hash()` instead."] pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hash(val); self } } diff --git a/crates/web-sys/src/features/gen_RsaOaepParams.rs b/crates/web-sys/src/features/gen_RsaOaepParams.rs index fd50a473733..a2e5647fd48 100644 --- a/crates/web-sys/src/features/gen_RsaOaepParams.rs +++ b/crates/web-sys/src/features/gen_RsaOaepParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] pub type RsaOaepParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &RsaOaepParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &RsaOaepParams, val: &str); + #[doc = "Get the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] + #[wasm_bindgen(method, getter = "label")] + pub fn get_label(this: &RsaOaepParams) -> Option<::js_sys::Object>; + #[doc = "Change the `label` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] + #[wasm_bindgen(method, setter = "label")] + pub fn set_label(this: &RsaOaepParams, val: &::js_sys::Object); } impl RsaOaepParams { #[doc = "Construct a new `RsaOaepParams`."] @@ -17,33 +38,17 @@ impl RsaOaepParams { 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.set_name(name); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `label` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RsaOaepParams`*"] + #[deprecated = "Use `set_label()` instead."] pub fn label(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_label(val); self } } diff --git a/crates/web-sys/src/features/gen_RsaOtherPrimesInfo.rs b/crates/web-sys/src/features/gen_RsaOtherPrimesInfo.rs index 7f9ceb816cf..23c1d5cb4ee 100644 --- a/crates/web-sys/src/features/gen_RsaOtherPrimesInfo.rs +++ b/crates/web-sys/src/features/gen_RsaOtherPrimesInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] pub type RsaOtherPrimesInfo; + #[doc = "Get the `d` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[wasm_bindgen(method, getter = "d")] + pub fn get_d(this: &RsaOtherPrimesInfo) -> ::alloc::string::String; + #[doc = "Change the `d` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[wasm_bindgen(method, setter = "d")] + pub fn set_d(this: &RsaOtherPrimesInfo, val: &str); + #[doc = "Get the `r` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[wasm_bindgen(method, getter = "r")] + pub fn get_r(this: &RsaOtherPrimesInfo) -> ::alloc::string::String; + #[doc = "Change the `r` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[wasm_bindgen(method, setter = "r")] + pub fn set_r(this: &RsaOtherPrimesInfo, val: &str); + #[doc = "Get the `t` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[wasm_bindgen(method, getter = "t")] + pub fn get_t(this: &RsaOtherPrimesInfo) -> ::alloc::string::String; + #[doc = "Change the `t` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[wasm_bindgen(method, setter = "t")] + pub fn set_t(this: &RsaOtherPrimesInfo, val: &str); } impl RsaOtherPrimesInfo { #[doc = "Construct a new `RsaOtherPrimesInfo`."] @@ -17,48 +48,24 @@ impl RsaOtherPrimesInfo { pub fn new(d: &str, r: &str, t: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.d(d); - ret.r(r); - ret.t(t); + ret.set_d(d); + ret.set_r(r); + ret.set_t(t); ret } - #[doc = "Change the `d` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[deprecated = "Use `set_d()` instead."] pub fn d(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("d"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_d(val); self } - #[doc = "Change the `r` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[deprecated = "Use `set_r()` instead."] pub fn r(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("r"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_r(val); self } - #[doc = "Change the `t` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RsaOtherPrimesInfo`*"] + #[deprecated = "Use `set_t()` instead."] pub fn t(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("t"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_t(val); self } } diff --git a/crates/web-sys/src/features/gen_RsaPssParams.rs b/crates/web-sys/src/features/gen_RsaPssParams.rs index cddd994e4cc..85b1e134af0 100644 --- a/crates/web-sys/src/features/gen_RsaPssParams.rs +++ b/crates/web-sys/src/features/gen_RsaPssParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] pub type RsaPssParams; + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &RsaPssParams) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &RsaPssParams, val: &str); + #[doc = "Get the `saltLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] + #[wasm_bindgen(method, getter = "saltLength")] + pub fn get_salt_length(this: &RsaPssParams) -> u32; + #[doc = "Change the `saltLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] + #[wasm_bindgen(method, setter = "saltLength")] + pub fn set_salt_length(this: &RsaPssParams, val: u32); } impl RsaPssParams { #[doc = "Construct a new `RsaPssParams`."] @@ -17,38 +38,18 @@ impl RsaPssParams { pub fn new(name: &str, salt_length: u32) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret.salt_length(salt_length); + ret.set_name(name); + ret.set_salt_length(salt_length); ret } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `saltLength` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RsaPssParams`*"] + #[deprecated = "Use `set_salt_length()` instead."] pub fn salt_length(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("saltLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_salt_length(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcAnswerOptions.rs b/crates/web-sys/src/features/gen_RtcAnswerOptions.rs index a3d7bcea5ea..de165d0a419 100644 --- a/crates/web-sys/src/features/gen_RtcAnswerOptions.rs +++ b/crates/web-sys/src/features/gen_RtcAnswerOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_RtcBundlePolicy.rs b/crates/web-sys/src/features/gen_RtcBundlePolicy.rs index 261c153e183..e4a5a7a3359 100644 --- a/crates/web-sys/src/features/gen_RtcBundlePolicy.rs +++ b/crates/web-sys/src/features/gen_RtcBundlePolicy.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcBundlePolicy` enum."] diff --git a/crates/web-sys/src/features/gen_RtcCertificate.rs b/crates/web-sys/src/features/gen_RtcCertificate.rs index fe4bffb42f3..9e0cd8864a8 100644 --- a/crates/web-sys/src/features/gen_RtcCertificate.rs +++ b/crates/web-sys/src/features/gen_RtcCertificate.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_RtcCertificateExpiration.rs b/crates/web-sys/src/features/gen_RtcCertificateExpiration.rs index 141c99548c7..e11293272df 100644 --- a/crates/web-sys/src/features/gen_RtcCertificateExpiration.rs +++ b/crates/web-sys/src/features/gen_RtcCertificateExpiration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCertificateExpiration`*"] pub type RtcCertificateExpiration; + #[doc = "Get the `expires` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCertificateExpiration`*"] + #[wasm_bindgen(method, getter = "expires")] + pub fn get_expires(this: &RtcCertificateExpiration) -> Option; + #[doc = "Change the `expires` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCertificateExpiration`*"] + #[wasm_bindgen(method, setter = "expires")] + pub fn set_expires(this: &RtcCertificateExpiration, val: f64); } impl RtcCertificateExpiration { #[doc = "Construct a new `RtcCertificateExpiration`."] @@ -19,21 +30,9 @@ impl RtcCertificateExpiration { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `expires` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCertificateExpiration`*"] + #[deprecated = "Use `set_expires()` instead."] pub fn expires(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("expires"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_expires(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcCodecStats.rs b/crates/web-sys/src/features/gen_RtcCodecStats.rs index 3ffe6ae5fea..e9a3ef90a70 100644 --- a/crates/web-sys/src/features/gen_RtcCodecStats.rs +++ b/crates/web-sys/src/features/gen_RtcCodecStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,88 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] pub type RtcCodecStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcCodecStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcCodecStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcCodecStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcCodecStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcCodecStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcCodecStats, val: RtcStatsType); + #[doc = "Get the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, getter = "channels")] + pub fn get_channels(this: &RtcCodecStats) -> Option; + #[doc = "Change the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, setter = "channels")] + pub fn set_channels(this: &RtcCodecStats, val: u32); + #[doc = "Get the `clockRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, getter = "clockRate")] + pub fn get_clock_rate(this: &RtcCodecStats) -> Option; + #[doc = "Change the `clockRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, setter = "clockRate")] + pub fn set_clock_rate(this: &RtcCodecStats, val: u32); + #[doc = "Get the `codec` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, getter = "codec")] + pub fn get_codec(this: &RtcCodecStats) -> Option<::alloc::string::String>; + #[doc = "Change the `codec` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, setter = "codec")] + pub fn set_codec(this: &RtcCodecStats, val: &str); + #[doc = "Get the `parameters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, getter = "parameters")] + pub fn get_parameters(this: &RtcCodecStats) -> Option<::alloc::string::String>; + #[doc = "Change the `parameters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, setter = "parameters")] + pub fn set_parameters(this: &RtcCodecStats, val: &str); + #[doc = "Get the `payloadType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, getter = "payloadType")] + pub fn get_payload_type(this: &RtcCodecStats) -> Option; + #[doc = "Change the `payloadType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[wasm_bindgen(method, setter = "payloadType")] + pub fn set_payload_type(this: &RtcCodecStats, val: u32); } impl RtcCodecStats { #[doc = "Construct a new `RtcCodecStats`."] @@ -19,129 +102,45 @@ impl RtcCodecStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `channels` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[deprecated = "Use `set_channels()` instead."] pub fn channels(&mut self, val: u32) -> &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.set_channels(val); self } - #[doc = "Change the `clockRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[deprecated = "Use `set_clock_rate()` instead."] pub fn clock_rate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clockRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_clock_rate(val); self } - #[doc = "Change the `codec` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[deprecated = "Use `set_codec()` instead."] pub fn codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_codec(val); self } - #[doc = "Change the `parameters` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[deprecated = "Use `set_parameters()` instead."] pub fn parameters(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("parameters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_parameters(val); self } - #[doc = "Change the `payloadType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcCodecStats`*"] + #[deprecated = "Use `set_payload_type()` instead."] pub fn payload_type(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("payloadType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_payload_type(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcConfiguration.rs b/crates/web-sys/src/features/gen_RtcConfiguration.rs index 284b6e295c8..3d70b68dbfd 100644 --- a/crates/web-sys/src/features/gen_RtcConfiguration.rs +++ b/crates/web-sys/src/features/gen_RtcConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,60 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] pub type RtcConfiguration; + #[cfg(feature = "RtcBundlePolicy")] + #[doc = "Get the `bundlePolicy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcBundlePolicy`, `RtcConfiguration`*"] + #[wasm_bindgen(method, getter = "bundlePolicy")] + pub fn get_bundle_policy(this: &RtcConfiguration) -> Option; + #[cfg(feature = "RtcBundlePolicy")] + #[doc = "Change the `bundlePolicy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcBundlePolicy`, `RtcConfiguration`*"] + #[wasm_bindgen(method, setter = "bundlePolicy")] + pub fn set_bundle_policy(this: &RtcConfiguration, val: RtcBundlePolicy); + #[doc = "Get the `certificates` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[wasm_bindgen(method, getter = "certificates")] + pub fn get_certificates(this: &RtcConfiguration) -> Option<::js_sys::Array>; + #[doc = "Change the `certificates` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[wasm_bindgen(method, setter = "certificates")] + pub fn set_certificates(this: &RtcConfiguration, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `iceServers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[wasm_bindgen(method, getter = "iceServers")] + pub fn get_ice_servers(this: &RtcConfiguration) -> Option<::js_sys::Array>; + #[doc = "Change the `iceServers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[wasm_bindgen(method, setter = "iceServers")] + pub fn set_ice_servers(this: &RtcConfiguration, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "RtcIceTransportPolicy")] + #[doc = "Get the `iceTransportPolicy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`, `RtcIceTransportPolicy`*"] + #[wasm_bindgen(method, getter = "iceTransportPolicy")] + pub fn get_ice_transport_policy(this: &RtcConfiguration) -> Option; + #[cfg(feature = "RtcIceTransportPolicy")] + #[doc = "Change the `iceTransportPolicy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`, `RtcIceTransportPolicy`*"] + #[wasm_bindgen(method, setter = "iceTransportPolicy")] + pub fn set_ice_transport_policy(this: &RtcConfiguration, val: RtcIceTransportPolicy); + #[doc = "Get the `peerIdentity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[wasm_bindgen(method, getter = "peerIdentity")] + pub fn get_peer_identity(this: &RtcConfiguration) -> Option<::alloc::string::String>; + #[doc = "Change the `peerIdentity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[wasm_bindgen(method, setter = "peerIdentity")] + pub fn set_peer_identity(this: &RtcConfiguration, val: Option<&str>); } impl RtcConfiguration { #[doc = "Construct a new `RtcConfiguration`."] @@ -20,90 +75,30 @@ impl RtcConfiguration { ret } #[cfg(feature = "RtcBundlePolicy")] - #[doc = "Change the `bundlePolicy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcBundlePolicy`, `RtcConfiguration`*"] + #[deprecated = "Use `set_bundle_policy()` instead."] pub fn bundle_policy(&mut self, val: RtcBundlePolicy) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bundlePolicy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bundle_policy(val); self } - #[doc = "Change the `certificates` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[deprecated = "Use `set_certificates()` instead."] pub fn certificates(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("certificates"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_certificates(val); self } - #[doc = "Change the `iceServers` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[deprecated = "Use `set_ice_servers()` instead."] pub fn ice_servers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceServers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ice_servers(val); self } #[cfg(feature = "RtcIceTransportPolicy")] - #[doc = "Change the `iceTransportPolicy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`, `RtcIceTransportPolicy`*"] + #[deprecated = "Use `set_ice_transport_policy()` instead."] pub fn ice_transport_policy(&mut self, val: RtcIceTransportPolicy) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceTransportPolicy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ice_transport_policy(val); self } - #[doc = "Change the `peerIdentity` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] + #[deprecated = "Use `set_peer_identity()` instead."] pub fn peer_identity(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("peerIdentity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_peer_identity(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcDataChannel.rs b/crates/web-sys/src/features/gen_RtcDataChannel.rs index 8f991858c16..690721a3c1d 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannel.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] - pub fn label(this: &RtcDataChannel) -> String; + pub fn label(this: &RtcDataChannel) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , 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/RTCDataChannel/id)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn id(this: &RtcDataChannel) -> Option; # [wasm_bindgen (structural , method , getter , js_class = "RTCDataChannel" , js_name = reliable)] #[doc = "Getter for the `reliable` field of this object."] #[doc = ""] @@ -203,4 +211,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] pub fn send_with_u8_array(this: &RtcDataChannel, data: &[u8]) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "RTCDataChannel" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"] + pub fn send_with_js_u8_array( + this: &RtcDataChannel, + data: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_RtcDataChannelEvent.rs b/crates/web-sys/src/features/gen_RtcDataChannelEvent.rs index 7782c81b5ce..d250f4d2bc3 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannelEvent.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannelEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_RtcDataChannelEventInit.rs b/crates/web-sys/src/features/gen_RtcDataChannelEventInit.rs index 16f0bb782b0..83d82534274 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannelEventInit.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannelEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] pub type RtcDataChannelEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &RtcDataChannelEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &RtcDataChannelEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &RtcDataChannelEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &RtcDataChannelEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &RtcDataChannelEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &RtcDataChannelEventInit, val: bool); + #[cfg(feature = "RtcDataChannel")] + #[doc = "Get the `channel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelEventInit`*"] + #[wasm_bindgen(method, getter = "channel")] + pub fn get_channel(this: &RtcDataChannelEventInit) -> RtcDataChannel; + #[cfg(feature = "RtcDataChannel")] + #[doc = "Change the `channel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelEventInit`*"] + #[wasm_bindgen(method, setter = "channel")] + pub fn set_channel(this: &RtcDataChannelEventInit, val: &RtcDataChannel); } impl RtcDataChannelEventInit { #[cfg(feature = "RtcDataChannel")] @@ -18,76 +61,28 @@ impl RtcDataChannelEventInit { pub fn new(channel: &RtcDataChannel) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.channel(channel); + ret.set_channel(channel); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "RtcDataChannel")] - #[doc = "Change the `channel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelEventInit`*"] + #[deprecated = "Use `set_channel()` instead."] pub fn channel(&mut self, val: &RtcDataChannel) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("channel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_channel(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcDataChannelInit.rs b/crates/web-sys/src/features/gen_RtcDataChannelInit.rs index b8e2751e5f8..44f94a1acab 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannelInit.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannelInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,76 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] pub type RtcDataChannelInit; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcDataChannelInit) -> Option; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcDataChannelInit, val: u16); + #[doc = "Get the `maxPacketLifeTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, getter = "maxPacketLifeTime")] + pub fn get_max_packet_life_time(this: &RtcDataChannelInit) -> Option; + #[doc = "Change the `maxPacketLifeTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, setter = "maxPacketLifeTime")] + pub fn set_max_packet_life_time(this: &RtcDataChannelInit, val: u16); + #[doc = "Get the `maxRetransmitTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, getter = "maxRetransmitTime")] + pub fn get_max_retransmit_time(this: &RtcDataChannelInit) -> Option; + #[doc = "Change the `maxRetransmitTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, setter = "maxRetransmitTime")] + pub fn set_max_retransmit_time(this: &RtcDataChannelInit, val: u16); + #[doc = "Get the `maxRetransmits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, getter = "maxRetransmits")] + pub fn get_max_retransmits(this: &RtcDataChannelInit) -> Option; + #[doc = "Change the `maxRetransmits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, setter = "maxRetransmits")] + pub fn set_max_retransmits(this: &RtcDataChannelInit, val: u16); + #[doc = "Get the `negotiated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, getter = "negotiated")] + pub fn get_negotiated(this: &RtcDataChannelInit) -> Option; + #[doc = "Change the `negotiated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, setter = "negotiated")] + pub fn set_negotiated(this: &RtcDataChannelInit, val: bool); + #[doc = "Get the `ordered` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, getter = "ordered")] + pub fn get_ordered(this: &RtcDataChannelInit) -> Option; + #[doc = "Change the `ordered` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, setter = "ordered")] + pub fn set_ordered(this: &RtcDataChannelInit, val: bool); + #[doc = "Get the `protocol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, getter = "protocol")] + pub fn get_protocol(this: &RtcDataChannelInit) -> Option<::alloc::string::String>; + #[doc = "Change the `protocol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[wasm_bindgen(method, setter = "protocol")] + pub fn set_protocol(this: &RtcDataChannelInit, val: &str); } impl RtcDataChannelInit { #[doc = "Construct a new `RtcDataChannelInit`."] @@ -19,119 +90,39 @@ impl RtcDataChannelInit { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `maxPacketLifeTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[deprecated = "Use `set_max_packet_life_time()` instead."] pub fn max_packet_life_time(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxPacketLifeTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max_packet_life_time(val); self } - #[doc = "Change the `maxRetransmitTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[deprecated = "Use `set_max_retransmit_time()` instead."] pub fn max_retransmit_time(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxRetransmitTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max_retransmit_time(val); self } - #[doc = "Change the `maxRetransmits` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[deprecated = "Use `set_max_retransmits()` instead."] pub fn max_retransmits(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxRetransmits"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max_retransmits(val); self } - #[doc = "Change the `negotiated` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[deprecated = "Use `set_negotiated()` instead."] pub fn negotiated(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("negotiated"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_negotiated(val); self } - #[doc = "Change the `ordered` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[deprecated = "Use `set_ordered()` instead."] pub fn ordered(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ordered"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ordered(val); self } - #[doc = "Change the `protocol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"] + #[deprecated = "Use `set_protocol()` instead."] pub fn protocol(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_protocol(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcDataChannelState.rs b/crates/web-sys/src/features/gen_RtcDataChannelState.rs index 4c999cad066..3acc26cfa3b 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannelState.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannelState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcDataChannelState` enum."] diff --git a/crates/web-sys/src/features/gen_RtcDataChannelType.rs b/crates/web-sys/src/features/gen_RtcDataChannelType.rs index e2089d4e25e..018743abbbf 100644 --- a/crates/web-sys/src/features/gen_RtcDataChannelType.rs +++ b/crates/web-sys/src/features/gen_RtcDataChannelType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcDataChannelType` enum."] diff --git a/crates/web-sys/src/features/gen_RtcDegradationPreference.rs b/crates/web-sys/src/features/gen_RtcDegradationPreference.rs index 118c3ed7a0b..5886bb9ff00 100644 --- a/crates/web-sys/src/features/gen_RtcDegradationPreference.rs +++ b/crates/web-sys/src/features/gen_RtcDegradationPreference.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcDegradationPreference` enum."] diff --git a/crates/web-sys/src/features/gen_RtcEncodedAudioFrame.rs b/crates/web-sys/src/features/gen_RtcEncodedAudioFrame.rs new file mode 100644 index 00000000000..e670d5bd6a6 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcEncodedAudioFrame.rs @@ -0,0 +1,79 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCEncodedAudioFrame , typescript_type = "RTCEncodedAudioFrame")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcEncodedAudioFrame` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedAudioFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RtcEncodedAudioFrame; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "RTCEncodedAudioFrame" , 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/RTCEncodedAudioFrame/data)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn data(this: &RtcEncodedAudioFrame) -> ::js_sys::ArrayBuffer; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "RTCEncodedAudioFrame" , js_name = data)] + #[doc = "Setter for the `data` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedAudioFrame/data)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_data(this: &RtcEncodedAudioFrame, value: &::js_sys::ArrayBuffer); + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "RTCEncodedAudioFrame")] + #[doc = "The `new RtcEncodedAudioFrame(..)` constructor, creating a new instance of `RtcEncodedAudioFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedAudioFrame/RTCEncodedAudioFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(original_frame: &RtcEncodedAudioFrame) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedAudioFrameOptions")] + #[wasm_bindgen(catch, constructor, js_class = "RTCEncodedAudioFrame")] + #[doc = "The `new RtcEncodedAudioFrame(..)` constructor, creating a new instance of `RtcEncodedAudioFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedAudioFrame/RTCEncodedAudioFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrame`, `RtcEncodedAudioFrameOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_options( + original_frame: &RtcEncodedAudioFrame, + options: &RtcEncodedAudioFrameOptions, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedAudioFrameMetadata")] + # [wasm_bindgen (method , structural , js_class = "RTCEncodedAudioFrame" , js_name = getMetadata)] + #[doc = "The `getMetadata()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedAudioFrame/getMetadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrame`, `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_metadata(this: &RtcEncodedAudioFrame) -> RtcEncodedAudioFrameMetadata; +} diff --git a/crates/web-sys/src/features/gen_RtcEncodedAudioFrameMetadata.rs b/crates/web-sys/src/features/gen_RtcEncodedAudioFrameMetadata.rs new file mode 100644 index 00000000000..40f1de3bf2c --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcEncodedAudioFrameMetadata.rs @@ -0,0 +1,185 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCEncodedAudioFrameMetadata)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcEncodedAudioFrameMetadata` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RtcEncodedAudioFrameMetadata; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `contributingSources` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "contributingSources")] + pub fn get_contributing_sources(this: &RtcEncodedAudioFrameMetadata) + -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `contributingSources` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "contributingSources")] + pub fn set_contributing_sources( + this: &RtcEncodedAudioFrameMetadata, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mimeType")] + pub fn get_mime_type(this: &RtcEncodedAudioFrameMetadata) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mimeType")] + pub fn set_mime_type(this: &RtcEncodedAudioFrameMetadata, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `payloadType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "payloadType")] + pub fn get_payload_type(this: &RtcEncodedAudioFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `payloadType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "payloadType")] + pub fn set_payload_type(this: &RtcEncodedAudioFrameMetadata, val: u8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rtpTimestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rtpTimestamp")] + pub fn get_rtp_timestamp(this: &RtcEncodedAudioFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rtpTimestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rtpTimestamp")] + pub fn set_rtp_timestamp(this: &RtcEncodedAudioFrameMetadata, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sequenceNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sequenceNumber")] + pub fn get_sequence_number(this: &RtcEncodedAudioFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `sequenceNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sequenceNumber")] + pub fn set_sequence_number(this: &RtcEncodedAudioFrameMetadata, val: i16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `synchronizationSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "synchronizationSource")] + pub fn get_synchronization_source(this: &RtcEncodedAudioFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `synchronizationSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "synchronizationSource")] + pub fn set_synchronization_source(this: &RtcEncodedAudioFrameMetadata, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl RtcEncodedAudioFrameMetadata { + #[doc = "Construct a new `RtcEncodedAudioFrameMetadata`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_contributing_sources()` instead."] + pub fn contributing_sources(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_contributing_sources(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mime_type()` instead."] + pub fn mime_type(&mut self, val: &str) -> &mut Self { + self.set_mime_type(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_payload_type()` instead."] + pub fn payload_type(&mut self, val: u8) -> &mut Self { + self.set_payload_type(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rtp_timestamp()` instead."] + pub fn rtp_timestamp(&mut self, val: u32) -> &mut Self { + self.set_rtp_timestamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_sequence_number()` instead."] + pub fn sequence_number(&mut self, val: i16) -> &mut Self { + self.set_sequence_number(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_synchronization_source()` instead."] + pub fn synchronization_source(&mut self, val: u32) -> &mut Self { + self.set_synchronization_source(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for RtcEncodedAudioFrameMetadata { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs b/crates/web-sys/src/features/gen_RtcEncodedAudioFrameOptions.rs similarity index 58% rename from crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs rename to crates/web-sys/src/features/gen_RtcEncodedAudioFrameOptions.rs index eb58aeca844..23fb8cdd1f6 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs +++ b/crates/web-sys/src/features/gen_RtcEncodedAudioFrameOptions.rs @@ -1,69 +1,64 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReadResult)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCEncodedAudioFrameOptions)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamByobReadResult` dictionary."] + #[doc = "The `RtcEncodedAudioFrameOptions` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type ReadableStreamByobReadResult; -} -#[cfg(web_sys_unstable_apis)] -impl ReadableStreamByobReadResult { - #[doc = "Construct a new `ReadableStreamByobReadResult`."] + pub type RtcEncodedAudioFrameOptions; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedAudioFrameMetadata")] + #[doc = "Get the `metadata` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`, `RtcEncodedAudioFrameOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "metadata")] + pub fn get_metadata(this: &RtcEncodedAudioFrameOptions) + -> Option; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `done` field of this object."] + #[cfg(feature = "RtcEncodedAudioFrameMetadata")] + #[doc = "Change the `metadata` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameMetadata`, `RtcEncodedAudioFrameOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `value` field of this object."] + #[wasm_bindgen(method, setter = "metadata")] + pub fn set_metadata(this: &RtcEncodedAudioFrameOptions, val: &RtcEncodedAudioFrameMetadata); +} +#[cfg(web_sys_unstable_apis)] +impl RtcEncodedAudioFrameOptions { + #[doc = "Construct a new `RtcEncodedAudioFrameOptions`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedAudioFrameOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn value(&mut self, val: &::js_sys::Object) -> &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; + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedAudioFrameMetadata")] + #[deprecated = "Use `set_metadata()` instead."] + pub fn metadata(&mut self, val: &RtcEncodedAudioFrameMetadata) -> &mut Self { + self.set_metadata(val); self } } #[cfg(web_sys_unstable_apis)] -impl Default for ReadableStreamByobReadResult { +impl Default for RtcEncodedAudioFrameOptions { fn default() -> Self { Self::new() } diff --git a/crates/web-sys/src/features/gen_RtcEncodedVideoFrame.rs b/crates/web-sys/src/features/gen_RtcEncodedVideoFrame.rs new file mode 100644 index 00000000000..3e78b749670 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcEncodedVideoFrame.rs @@ -0,0 +1,91 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCEncodedVideoFrame , typescript_type = "RTCEncodedVideoFrame")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcEncodedVideoFrame` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedVideoFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RtcEncodedVideoFrame; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedVideoFrameType")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCEncodedVideoFrame" , 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/RTCEncodedVideoFrame/type)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrame`, `RtcEncodedVideoFrameType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn type_(this: &RtcEncodedVideoFrame) -> RtcEncodedVideoFrameType; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "RTCEncodedVideoFrame" , 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/RTCEncodedVideoFrame/data)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn data(this: &RtcEncodedVideoFrame) -> ::js_sys::ArrayBuffer; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "RTCEncodedVideoFrame" , js_name = data)] + #[doc = "Setter for the `data` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedVideoFrame/data)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_data(this: &RtcEncodedVideoFrame, value: &::js_sys::ArrayBuffer); + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "RTCEncodedVideoFrame")] + #[doc = "The `new RtcEncodedVideoFrame(..)` constructor, creating a new instance of `RtcEncodedVideoFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedVideoFrame/RTCEncodedVideoFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(original_frame: &RtcEncodedVideoFrame) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedVideoFrameOptions")] + #[wasm_bindgen(catch, constructor, js_class = "RTCEncodedVideoFrame")] + #[doc = "The `new RtcEncodedVideoFrame(..)` constructor, creating a new instance of `RtcEncodedVideoFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedVideoFrame/RTCEncodedVideoFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrame`, `RtcEncodedVideoFrameOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_options( + original_frame: &RtcEncodedVideoFrame, + options: &RtcEncodedVideoFrameOptions, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedVideoFrameMetadata")] + # [wasm_bindgen (method , structural , js_class = "RTCEncodedVideoFrame" , js_name = getMetadata)] + #[doc = "The `getMetadata()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCEncodedVideoFrame/getMetadata)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrame`, `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_metadata(this: &RtcEncodedVideoFrame) -> RtcEncodedVideoFrameMetadata; +} diff --git a/crates/web-sys/src/features/gen_RtcEncodedVideoFrameMetadata.rs b/crates/web-sys/src/features/gen_RtcEncodedVideoFrameMetadata.rs new file mode 100644 index 00000000000..c5cb3e80493 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcEncodedVideoFrameMetadata.rs @@ -0,0 +1,329 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCEncodedVideoFrameMetadata)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcEncodedVideoFrameMetadata` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RtcEncodedVideoFrameMetadata; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `contributingSources` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "contributingSources")] + pub fn get_contributing_sources(this: &RtcEncodedVideoFrameMetadata) + -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `contributingSources` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "contributingSources")] + pub fn set_contributing_sources( + this: &RtcEncodedVideoFrameMetadata, + val: &::wasm_bindgen::JsValue, + ); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `dependencies` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dependencies")] + pub fn get_dependencies(this: &RtcEncodedVideoFrameMetadata) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `dependencies` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "dependencies")] + pub fn set_dependencies(this: &RtcEncodedVideoFrameMetadata, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `frameId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "frameId")] + pub fn get_frame_id(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `frameId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "frameId")] + pub fn set_frame_id(this: &RtcEncodedVideoFrameMetadata, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &RtcEncodedVideoFrameMetadata, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mimeType")] + pub fn get_mime_type(this: &RtcEncodedVideoFrameMetadata) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mimeType")] + pub fn set_mime_type(this: &RtcEncodedVideoFrameMetadata, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `payloadType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "payloadType")] + pub fn get_payload_type(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `payloadType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "payloadType")] + pub fn set_payload_type(this: &RtcEncodedVideoFrameMetadata, val: u8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rtpTimestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rtpTimestamp")] + pub fn get_rtp_timestamp(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rtpTimestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rtpTimestamp")] + pub fn set_rtp_timestamp(this: &RtcEncodedVideoFrameMetadata, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `spatialIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "spatialIndex")] + pub fn get_spatial_index(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `spatialIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "spatialIndex")] + pub fn set_spatial_index(this: &RtcEncodedVideoFrameMetadata, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `synchronizationSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "synchronizationSource")] + pub fn get_synchronization_source(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `synchronizationSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "synchronizationSource")] + pub fn set_synchronization_source(this: &RtcEncodedVideoFrameMetadata, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `temporalIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "temporalIndex")] + pub fn get_temporal_index(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `temporalIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "temporalIndex")] + pub fn set_temporal_index(this: &RtcEncodedVideoFrameMetadata, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcEncodedVideoFrameMetadata, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &RtcEncodedVideoFrameMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &RtcEncodedVideoFrameMetadata, val: u16); +} +#[cfg(web_sys_unstable_apis)] +impl RtcEncodedVideoFrameMetadata { + #[doc = "Construct a new `RtcEncodedVideoFrameMetadata`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_contributing_sources()` instead."] + pub fn contributing_sources(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_contributing_sources(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_dependencies()` instead."] + pub fn dependencies(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_dependencies(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_frame_id()` instead."] + pub fn frame_id(&mut self, val: f64) -> &mut Self { + self.set_frame_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_height()` instead."] + pub fn height(&mut self, val: u16) -> &mut Self { + self.set_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mime_type()` instead."] + pub fn mime_type(&mut self, val: &str) -> &mut Self { + self.set_mime_type(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_payload_type()` instead."] + pub fn payload_type(&mut self, val: u8) -> &mut Self { + self.set_payload_type(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rtp_timestamp()` instead."] + pub fn rtp_timestamp(&mut self, val: u32) -> &mut Self { + self.set_rtp_timestamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_spatial_index()` instead."] + pub fn spatial_index(&mut self, val: u32) -> &mut Self { + self.set_spatial_index(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_synchronization_source()` instead."] + pub fn synchronization_source(&mut self, val: u32) -> &mut Self { + self.set_synchronization_source(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_temporal_index()` instead."] + pub fn temporal_index(&mut self, val: u32) -> &mut Self { + self.set_temporal_index(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_width()` instead."] + pub fn width(&mut self, val: u16) -> &mut Self { + self.set_width(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for RtcEncodedVideoFrameMetadata { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs b/crates/web-sys/src/features/gen_RtcEncodedVideoFrameOptions.rs similarity index 58% rename from crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs rename to crates/web-sys/src/features/gen_RtcEncodedVideoFrameOptions.rs index 82bbf8ca1e1..080cd6dc37e 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs +++ b/crates/web-sys/src/features/gen_RtcEncodedVideoFrameOptions.rs @@ -1,69 +1,64 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReadResult)] + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCEncodedVideoFrameOptions)] #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamDefaultReadResult` dictionary."] + #[doc = "The `RtcEncodedVideoFrameOptions` dictionary."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type ReadableStreamDefaultReadResult; -} -#[cfg(web_sys_unstable_apis)] -impl ReadableStreamDefaultReadResult { - #[doc = "Construct a new `ReadableStreamDefaultReadResult`."] + pub type RtcEncodedVideoFrameOptions; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedVideoFrameMetadata")] + #[doc = "Get the `metadata` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`, `RtcEncodedVideoFrameOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "metadata")] + pub fn get_metadata(this: &RtcEncodedVideoFrameOptions) + -> Option; #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `done` field of this object."] + #[cfg(feature = "RtcEncodedVideoFrameMetadata")] + #[doc = "Change the `metadata` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameMetadata`, `RtcEncodedVideoFrameOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `value` field of this object."] + #[wasm_bindgen(method, setter = "metadata")] + pub fn set_metadata(this: &RtcEncodedVideoFrameOptions, val: &RtcEncodedVideoFrameMetadata); +} +#[cfg(web_sys_unstable_apis)] +impl RtcEncodedVideoFrameOptions { + #[doc = "Construct a new `RtcEncodedVideoFrameOptions`."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] + #[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &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; + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcEncodedVideoFrameMetadata")] + #[deprecated = "Use `set_metadata()` instead."] + pub fn metadata(&mut self, val: &RtcEncodedVideoFrameMetadata) -> &mut Self { + self.set_metadata(val); self } } #[cfg(web_sys_unstable_apis)] -impl Default for ReadableStreamDefaultReadResult { +impl Default for RtcEncodedVideoFrameOptions { fn default() -> Self { Self::new() } diff --git a/crates/web-sys/src/features/gen_RtcEncodedVideoFrameType.rs b/crates/web-sys/src/features/gen_RtcEncodedVideoFrameType.rs new file mode 100644 index 00000000000..3874a7f483f --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcEncodedVideoFrameType.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `RtcEncodedVideoFrameType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `RtcEncodedVideoFrameType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum RtcEncodedVideoFrameType { + Empty = "empty", + Key = "key", + Delta = "delta", +} diff --git a/crates/web-sys/src/features/gen_RtcFecParameters.rs b/crates/web-sys/src/features/gen_RtcFecParameters.rs index d5b1a5487ca..b72b25c9095 100644 --- a/crates/web-sys/src/features/gen_RtcFecParameters.rs +++ b/crates/web-sys/src/features/gen_RtcFecParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`*"] pub type RtcFecParameters; + #[doc = "Get the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`*"] + #[wasm_bindgen(method, getter = "ssrc")] + pub fn get_ssrc(this: &RtcFecParameters) -> Option; + #[doc = "Change the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`*"] + #[wasm_bindgen(method, setter = "ssrc")] + pub fn set_ssrc(this: &RtcFecParameters, val: u32); } impl RtcFecParameters { #[doc = "Construct a new `RtcFecParameters`."] @@ -19,17 +30,9 @@ impl RtcFecParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `ssrc` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`*"] + #[deprecated = "Use `set_ssrc()` instead."] pub fn ssrc(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssrc(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceCandidate.rs b/crates/web-sys/src/features/gen_RtcIceCandidate.rs index ca7424e9914..ef7762e2d04 100644 --- a/crates/web-sys/src/features/gen_RtcIceCandidate.rs +++ b/crates/web-sys/src/features/gen_RtcIceCandidate.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/candidate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidate`*"] - pub fn candidate(this: &RtcIceCandidate) -> String; + pub fn candidate(this: &RtcIceCandidate) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "RTCIceCandidate" , js_name = candidate)] #[doc = "Setter for the `candidate` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/sdpMid)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidate`*"] - pub fn sdp_mid(this: &RtcIceCandidate) -> Option; + pub fn sdp_mid(this: &RtcIceCandidate) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "RTCIceCandidate" , js_name = sdpMid)] #[doc = "Setter for the `sdpMid` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_RtcIceCandidateInit.rs b/crates/web-sys/src/features/gen_RtcIceCandidateInit.rs index a23091f6be6..0397145de9e 100644 --- a/crates/web-sys/src/features/gen_RtcIceCandidateInit.rs +++ b/crates/web-sys/src/features/gen_RtcIceCandidateInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] pub type RtcIceCandidateInit; + #[doc = "Get the `candidate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[wasm_bindgen(method, getter = "candidate")] + pub fn get_candidate(this: &RtcIceCandidateInit) -> ::alloc::string::String; + #[doc = "Change the `candidate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[wasm_bindgen(method, setter = "candidate")] + pub fn set_candidate(this: &RtcIceCandidateInit, val: &str); + #[doc = "Get the `sdpMLineIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[wasm_bindgen(method, getter = "sdpMLineIndex")] + pub fn get_sdp_m_line_index(this: &RtcIceCandidateInit) -> Option; + #[doc = "Change the `sdpMLineIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[wasm_bindgen(method, setter = "sdpMLineIndex")] + pub fn set_sdp_m_line_index(this: &RtcIceCandidateInit, val: Option); + #[doc = "Get the `sdpMid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[wasm_bindgen(method, getter = "sdpMid")] + pub fn get_sdp_mid(this: &RtcIceCandidateInit) -> Option<::alloc::string::String>; + #[doc = "Change the `sdpMid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[wasm_bindgen(method, setter = "sdpMid")] + pub fn set_sdp_mid(this: &RtcIceCandidateInit, val: Option<&str>); } impl RtcIceCandidateInit { #[doc = "Construct a new `RtcIceCandidateInit`."] @@ -17,55 +48,22 @@ impl RtcIceCandidateInit { pub fn new(candidate: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.candidate(candidate); + ret.set_candidate(candidate); ret } - #[doc = "Change the `candidate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[deprecated = "Use `set_candidate()` instead."] pub fn candidate(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("candidate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_candidate(val); self } - #[doc = "Change the `sdpMLineIndex` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[deprecated = "Use `set_sdp_m_line_index()` instead."] pub fn sdp_m_line_index(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sdpMLineIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sdp_m_line_index(val); self } - #[doc = "Change the `sdpMid` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"] + #[deprecated = "Use `set_sdp_mid()` instead."] pub fn sdp_mid(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sdpMid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sdp_mid(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceCandidatePairStats.rs b/crates/web-sys/src/features/gen_RtcIceCandidatePairStats.rs index 8fa447ae8a5..09b70f0eb49 100644 --- a/crates/web-sys/src/features/gen_RtcIceCandidatePairStats.rs +++ b/crates/web-sys/src/features/gen_RtcIceCandidatePairStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,184 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] pub type RtcIceCandidatePairStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcIceCandidatePairStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcIceCandidatePairStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcIceCandidatePairStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcIceCandidatePairStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcIceCandidatePairStats, val: RtcStatsType); + #[doc = "Get the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "bytesReceived")] + pub fn get_bytes_received(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "bytesReceived")] + pub fn set_bytes_received(this: &RtcIceCandidatePairStats, val: f64); + #[doc = "Get the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "bytesSent")] + pub fn get_bytes_sent(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "bytesSent")] + pub fn set_bytes_sent(this: &RtcIceCandidatePairStats, val: f64); + #[doc = "Get the `componentId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "componentId")] + pub fn get_component_id(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `componentId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "componentId")] + pub fn set_component_id(this: &RtcIceCandidatePairStats, val: u32); + #[doc = "Get the `lastPacketReceivedTimestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "lastPacketReceivedTimestamp")] + pub fn get_last_packet_received_timestamp(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `lastPacketReceivedTimestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "lastPacketReceivedTimestamp")] + pub fn set_last_packet_received_timestamp(this: &RtcIceCandidatePairStats, val: f64); + #[doc = "Get the `lastPacketSentTimestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "lastPacketSentTimestamp")] + pub fn get_last_packet_sent_timestamp(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `lastPacketSentTimestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "lastPacketSentTimestamp")] + pub fn set_last_packet_sent_timestamp(this: &RtcIceCandidatePairStats, val: f64); + #[doc = "Get the `localCandidateId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "localCandidateId")] + pub fn get_local_candidate_id( + this: &RtcIceCandidatePairStats, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `localCandidateId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "localCandidateId")] + pub fn set_local_candidate_id(this: &RtcIceCandidatePairStats, val: &str); + #[doc = "Get the `nominated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "nominated")] + pub fn get_nominated(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `nominated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "nominated")] + pub fn set_nominated(this: &RtcIceCandidatePairStats, val: bool); + #[doc = "Get the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "priority")] + pub fn get_priority(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "priority")] + pub fn set_priority(this: &RtcIceCandidatePairStats, val: f64); + #[doc = "Get the `readable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "readable")] + pub fn get_readable(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `readable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "readable")] + pub fn set_readable(this: &RtcIceCandidatePairStats, val: bool); + #[doc = "Get the `remoteCandidateId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "remoteCandidateId")] + pub fn get_remote_candidate_id( + this: &RtcIceCandidatePairStats, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `remoteCandidateId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "remoteCandidateId")] + pub fn set_remote_candidate_id(this: &RtcIceCandidatePairStats, val: &str); + #[doc = "Get the `selected` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "selected")] + pub fn get_selected(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `selected` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "selected")] + pub fn set_selected(this: &RtcIceCandidatePairStats, val: bool); + #[cfg(feature = "RtcStatsIceCandidatePairState")] + #[doc = "Get the `state` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`, `RtcStatsIceCandidatePairState`*"] + #[wasm_bindgen(method, getter = "state")] + pub fn get_state(this: &RtcIceCandidatePairStats) -> Option; + #[cfg(feature = "RtcStatsIceCandidatePairState")] + #[doc = "Change the `state` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`, `RtcStatsIceCandidatePairState`*"] + #[wasm_bindgen(method, setter = "state")] + pub fn set_state(this: &RtcIceCandidatePairStats, val: RtcStatsIceCandidatePairState); + #[doc = "Get the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "transportId")] + pub fn get_transport_id(this: &RtcIceCandidatePairStats) -> Option<::alloc::string::String>; + #[doc = "Change the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "transportId")] + pub fn set_transport_id(this: &RtcIceCandidatePairStats, val: &str); + #[doc = "Get the `writable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, getter = "writable")] + pub fn get_writable(this: &RtcIceCandidatePairStats) -> Option; + #[doc = "Change the `writable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[wasm_bindgen(method, setter = "writable")] + pub fn set_writable(this: &RtcIceCandidatePairStats, val: bool); } impl RtcIceCandidatePairStats { #[doc = "Construct a new `RtcIceCandidatePairStats`."] @@ -19,283 +198,91 @@ impl RtcIceCandidatePairStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `bytesReceived` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_bytes_received()` instead."] pub fn bytes_received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes_received(val); self } - #[doc = "Change the `bytesSent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_bytes_sent()` instead."] pub fn bytes_sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes_sent(val); self } - #[doc = "Change the `componentId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_component_id()` instead."] pub fn component_id(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("componentId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_component_id(val); self } - #[doc = "Change the `lastPacketReceivedTimestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_last_packet_received_timestamp()` instead."] pub fn last_packet_received_timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastPacketReceivedTimestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_last_packet_received_timestamp(val); self } - #[doc = "Change the `lastPacketSentTimestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_last_packet_sent_timestamp()` instead."] pub fn last_packet_sent_timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lastPacketSentTimestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_last_packet_sent_timestamp(val); self } - #[doc = "Change the `localCandidateId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_local_candidate_id()` instead."] pub fn local_candidate_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localCandidateId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_local_candidate_id(val); self } - #[doc = "Change the `nominated` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_nominated()` instead."] pub fn nominated(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nominated"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_nominated(val); self } - #[doc = "Change the `priority` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_priority()` instead."] pub fn priority(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("priority"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_priority(val); self } - #[doc = "Change the `readable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_readable()` instead."] pub fn readable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("readable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_readable(val); self } - #[doc = "Change the `remoteCandidateId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_remote_candidate_id()` instead."] pub fn remote_candidate_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteCandidateId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_candidate_id(val); self } - #[doc = "Change the `selected` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_selected()` instead."] pub fn selected(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("selected"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_selected(val); self } #[cfg(feature = "RtcStatsIceCandidatePairState")] - #[doc = "Change the `state` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`, `RtcStatsIceCandidatePairState`*"] + #[deprecated = "Use `set_state()` instead."] pub fn state(&mut self, val: RtcStatsIceCandidatePairState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("state"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_state(val); self } - #[doc = "Change the `transportId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_transport_id()` instead."] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transport_id(val); self } - #[doc = "Change the `writable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidatePairStats`*"] + #[deprecated = "Use `set_writable()` instead."] pub fn writable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("writable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_writable(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceCandidateStats.rs b/crates/web-sys/src/features/gen_RtcIceCandidateStats.rs index 8d9c3a9506d..cae28c69282 100644 --- a/crates/web-sys/src/features/gen_RtcIceCandidateStats.rs +++ b/crates/web-sys/src/features/gen_RtcIceCandidateStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,100 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] pub type RtcIceCandidateStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcIceCandidateStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcIceCandidateStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcIceCandidateStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcIceCandidateStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcIceCandidateStats, val: RtcStatsType); + #[doc = "Get the `candidateId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, getter = "candidateId")] + pub fn get_candidate_id(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>; + #[doc = "Change the `candidateId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, setter = "candidateId")] + pub fn set_candidate_id(this: &RtcIceCandidateStats, val: &str); + #[cfg(feature = "RtcStatsIceCandidateType")] + #[doc = "Get the `candidateType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsIceCandidateType`*"] + #[wasm_bindgen(method, getter = "candidateType")] + pub fn get_candidate_type(this: &RtcIceCandidateStats) -> Option; + #[cfg(feature = "RtcStatsIceCandidateType")] + #[doc = "Change the `candidateType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsIceCandidateType`*"] + #[wasm_bindgen(method, setter = "candidateType")] + pub fn set_candidate_type(this: &RtcIceCandidateStats, val: RtcStatsIceCandidateType); + #[doc = "Get the `componentId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, getter = "componentId")] + pub fn get_component_id(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>; + #[doc = "Change the `componentId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, setter = "componentId")] + pub fn set_component_id(this: &RtcIceCandidateStats, val: &str); + #[doc = "Get the `ipAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, getter = "ipAddress")] + pub fn get_ip_address(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>; + #[doc = "Change the `ipAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, setter = "ipAddress")] + pub fn set_ip_address(this: &RtcIceCandidateStats, val: &str); + #[doc = "Get the `portNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, getter = "portNumber")] + pub fn get_port_number(this: &RtcIceCandidateStats) -> Option; + #[doc = "Change the `portNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, setter = "portNumber")] + pub fn set_port_number(this: &RtcIceCandidateStats, val: i32); + #[doc = "Get the `transport` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, getter = "transport")] + pub fn get_transport(this: &RtcIceCandidateStats) -> Option<::alloc::string::String>; + #[doc = "Change the `transport` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[wasm_bindgen(method, setter = "transport")] + pub fn set_transport(this: &RtcIceCandidateStats, val: &str); } impl RtcIceCandidateStats { #[doc = "Construct a new `RtcIceCandidateStats`."] @@ -19,151 +114,51 @@ impl RtcIceCandidateStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `candidateId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[deprecated = "Use `set_candidate_id()` instead."] pub fn candidate_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("candidateId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_candidate_id(val); self } #[cfg(feature = "RtcStatsIceCandidateType")] - #[doc = "Change the `candidateType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`, `RtcStatsIceCandidateType`*"] + #[deprecated = "Use `set_candidate_type()` instead."] pub fn candidate_type(&mut self, val: RtcStatsIceCandidateType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("candidateType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_candidate_type(val); self } - #[doc = "Change the `componentId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[deprecated = "Use `set_component_id()` instead."] pub fn component_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("componentId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_component_id(val); self } - #[doc = "Change the `ipAddress` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[deprecated = "Use `set_ip_address()` instead."] pub fn ip_address(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ipAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ip_address(val); self } - #[doc = "Change the `portNumber` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[deprecated = "Use `set_port_number()` instead."] pub fn port_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("portNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_port_number(val); self } - #[doc = "Change the `transport` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateStats`*"] + #[deprecated = "Use `set_transport()` instead."] pub fn transport(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transport"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transport(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceComponentStats.rs b/crates/web-sys/src/features/gen_RtcIceComponentStats.rs index ec7d27bda60..33f5d6f6af7 100644 --- a/crates/web-sys/src/features/gen_RtcIceComponentStats.rs +++ b/crates/web-sys/src/features/gen_RtcIceComponentStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,88 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] pub type RtcIceComponentStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcIceComponentStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcIceComponentStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcIceComponentStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcIceComponentStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcIceComponentStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcIceComponentStats, val: RtcStatsType); + #[doc = "Get the `activeConnection` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, getter = "activeConnection")] + pub fn get_active_connection(this: &RtcIceComponentStats) -> Option; + #[doc = "Change the `activeConnection` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, setter = "activeConnection")] + pub fn set_active_connection(this: &RtcIceComponentStats, val: bool); + #[doc = "Get the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, getter = "bytesReceived")] + pub fn get_bytes_received(this: &RtcIceComponentStats) -> Option; + #[doc = "Change the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, setter = "bytesReceived")] + pub fn set_bytes_received(this: &RtcIceComponentStats, val: u32); + #[doc = "Get the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, getter = "bytesSent")] + pub fn get_bytes_sent(this: &RtcIceComponentStats) -> Option; + #[doc = "Change the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, setter = "bytesSent")] + pub fn set_bytes_sent(this: &RtcIceComponentStats, val: u32); + #[doc = "Get the `component` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, getter = "component")] + pub fn get_component(this: &RtcIceComponentStats) -> Option; + #[doc = "Change the `component` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, setter = "component")] + pub fn set_component(this: &RtcIceComponentStats, val: i32); + #[doc = "Get the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, getter = "transportId")] + pub fn get_transport_id(this: &RtcIceComponentStats) -> Option<::alloc::string::String>; + #[doc = "Change the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[wasm_bindgen(method, setter = "transportId")] + pub fn set_transport_id(this: &RtcIceComponentStats, val: &str); } impl RtcIceComponentStats { #[doc = "Construct a new `RtcIceComponentStats`."] @@ -19,133 +102,45 @@ impl RtcIceComponentStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `activeConnection` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[deprecated = "Use `set_active_connection()` instead."] pub fn active_connection(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("activeConnection"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_active_connection(val); self } - #[doc = "Change the `bytesReceived` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[deprecated = "Use `set_bytes_received()` instead."] pub fn bytes_received(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes_received(val); self } - #[doc = "Change the `bytesSent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[deprecated = "Use `set_bytes_sent()` instead."] pub fn bytes_sent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes_sent(val); self } - #[doc = "Change the `component` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[deprecated = "Use `set_component()` instead."] pub fn component(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("component"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_component(val); self } - #[doc = "Change the `transportId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceComponentStats`*"] + #[deprecated = "Use `set_transport_id()` instead."] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transport_id(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceConnectionState.rs b/crates/web-sys/src/features/gen_RtcIceConnectionState.rs index fae44d72282..d7d9004b7c7 100644 --- a/crates/web-sys/src/features/gen_RtcIceConnectionState.rs +++ b/crates/web-sys/src/features/gen_RtcIceConnectionState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcIceConnectionState` enum."] diff --git a/crates/web-sys/src/features/gen_RtcIceCredentialType.rs b/crates/web-sys/src/features/gen_RtcIceCredentialType.rs index a04b720a786..1b51f1c5c04 100644 --- a/crates/web-sys/src/features/gen_RtcIceCredentialType.rs +++ b/crates/web-sys/src/features/gen_RtcIceCredentialType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcIceCredentialType` enum."] diff --git a/crates/web-sys/src/features/gen_RtcIceGatheringState.rs b/crates/web-sys/src/features/gen_RtcIceGatheringState.rs index ce6db0abed5..d3f83bfc5f6 100644 --- a/crates/web-sys/src/features/gen_RtcIceGatheringState.rs +++ b/crates/web-sys/src/features/gen_RtcIceGatheringState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcIceGatheringState` enum."] diff --git a/crates/web-sys/src/features/gen_RtcIceServer.rs b/crates/web-sys/src/features/gen_RtcIceServer.rs index ebdd79d8a8b..cc3e8785725 100644 --- a/crates/web-sys/src/features/gen_RtcIceServer.rs +++ b/crates/web-sys/src/features/gen_RtcIceServer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] pub type RtcIceServer; + #[doc = "Get the `credential` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[wasm_bindgen(method, getter = "credential")] + pub fn get_credential(this: &RtcIceServer) -> Option<::alloc::string::String>; + #[doc = "Change the `credential` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[wasm_bindgen(method, setter = "credential")] + pub fn set_credential(this: &RtcIceServer, val: &str); + #[cfg(feature = "RtcIceCredentialType")] + #[doc = "Get the `credentialType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCredentialType`, `RtcIceServer`*"] + #[wasm_bindgen(method, getter = "credentialType")] + pub fn get_credential_type(this: &RtcIceServer) -> Option; + #[cfg(feature = "RtcIceCredentialType")] + #[doc = "Change the `credentialType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCredentialType`, `RtcIceServer`*"] + #[wasm_bindgen(method, setter = "credentialType")] + pub fn set_credential_type(this: &RtcIceServer, val: RtcIceCredentialType); + #[doc = "Get the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[wasm_bindgen(method, getter = "url")] + pub fn get_url(this: &RtcIceServer) -> Option<::alloc::string::String>; + #[doc = "Change the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[wasm_bindgen(method, setter = "url")] + pub fn set_url(this: &RtcIceServer, val: &str); + #[doc = "Get the `urls` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[wasm_bindgen(method, getter = "urls")] + pub fn get_urls(this: &RtcIceServer) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `urls` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[wasm_bindgen(method, setter = "urls")] + pub fn set_urls(this: &RtcIceServer, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `username` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[wasm_bindgen(method, getter = "username")] + pub fn get_username(this: &RtcIceServer) -> Option<::alloc::string::String>; + #[doc = "Change the `username` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[wasm_bindgen(method, setter = "username")] + pub fn set_username(this: &RtcIceServer, val: &str); } impl RtcIceServer { #[doc = "Construct a new `RtcIceServer`."] @@ -19,82 +72,30 @@ impl RtcIceServer { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `credential` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[deprecated = "Use `set_credential()` instead."] pub fn credential(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credential"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_credential(val); self } #[cfg(feature = "RtcIceCredentialType")] - #[doc = "Change the `credentialType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCredentialType`, `RtcIceServer`*"] + #[deprecated = "Use `set_credential_type()` instead."] pub fn credential_type(&mut self, val: RtcIceCredentialType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credentialType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_credential_type(val); self } - #[doc = "Change the `url` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[deprecated = "Use `set_url()` instead."] pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_url(val); self } - #[doc = "Change the `urls` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[deprecated = "Use `set_urls()` instead."] pub fn urls(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("urls"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_urls(val); self } - #[doc = "Change the `username` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceServer`*"] + #[deprecated = "Use `set_username()` instead."] pub fn username(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("username"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_username(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIceTransportPolicy.rs b/crates/web-sys/src/features/gen_RtcIceTransportPolicy.rs index c3f2124cf0a..350c510aac8 100644 --- a/crates/web-sys/src/features/gen_RtcIceTransportPolicy.rs +++ b/crates/web-sys/src/features/gen_RtcIceTransportPolicy.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcIceTransportPolicy` enum."] diff --git a/crates/web-sys/src/features/gen_RtcIdentityAssertion.rs b/crates/web-sys/src/features/gen_RtcIdentityAssertion.rs index aa1fc60f149..0b38bd9d8c5 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityAssertion.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityAssertion.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] pub type RtcIdentityAssertion; + #[doc = "Get the `idp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] + #[wasm_bindgen(method, getter = "idp")] + pub fn get_idp(this: &RtcIdentityAssertion) -> Option<::alloc::string::String>; + #[doc = "Change the `idp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] + #[wasm_bindgen(method, setter = "idp")] + pub fn set_idp(this: &RtcIdentityAssertion, val: &str); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &RtcIdentityAssertion) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &RtcIdentityAssertion, val: &str); } impl RtcIdentityAssertion { #[doc = "Construct a new `RtcIdentityAssertion`."] @@ -19,30 +40,14 @@ impl RtcIdentityAssertion { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `idp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] + #[deprecated = "Use `set_idp()` instead."] pub fn idp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("idp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_idp(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertion`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityAssertionResult.rs b/crates/web-sys/src/features/gen_RtcIdentityAssertionResult.rs index 98d9af7c861..bf40c88aff1 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityAssertionResult.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityAssertionResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`*"] pub type RtcIdentityAssertionResult; + #[doc = "Get the `assertion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`*"] + #[wasm_bindgen(method, getter = "assertion")] + pub fn get_assertion(this: &RtcIdentityAssertionResult) -> ::alloc::string::String; + #[doc = "Change the `assertion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`*"] + #[wasm_bindgen(method, setter = "assertion")] + pub fn set_assertion(this: &RtcIdentityAssertionResult, val: &str); + #[cfg(feature = "RtcIdentityProviderDetails")] + #[doc = "Get the `idp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`, `RtcIdentityProviderDetails`*"] + #[wasm_bindgen(method, getter = "idp")] + pub fn get_idp(this: &RtcIdentityAssertionResult) -> RtcIdentityProviderDetails; + #[cfg(feature = "RtcIdentityProviderDetails")] + #[doc = "Change the `idp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`, `RtcIdentityProviderDetails`*"] + #[wasm_bindgen(method, setter = "idp")] + pub fn set_idp(this: &RtcIdentityAssertionResult, val: &RtcIdentityProviderDetails); } impl RtcIdentityAssertionResult { #[cfg(feature = "RtcIdentityProviderDetails")] @@ -18,39 +41,19 @@ impl RtcIdentityAssertionResult { pub fn new(assertion: &str, idp: &RtcIdentityProviderDetails) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.assertion(assertion); - ret.idp(idp); + ret.set_assertion(assertion); + ret.set_idp(idp); ret } - #[doc = "Change the `assertion` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`*"] + #[deprecated = "Use `set_assertion()` instead."] pub fn assertion(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("assertion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_assertion(val); self } #[cfg(feature = "RtcIdentityProviderDetails")] - #[doc = "Change the `idp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityAssertionResult`, `RtcIdentityProviderDetails`*"] + #[deprecated = "Use `set_idp()` instead."] pub fn idp(&mut self, val: &RtcIdentityProviderDetails) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("idp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_idp(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityProvider.rs b/crates/web-sys/src/features/gen_RtcIdentityProvider.rs index bf64f976b7e..7a5176f0217 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityProvider.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityProvider.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] pub type RtcIdentityProvider; + #[doc = "Get the `generateAssertion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] + #[wasm_bindgen(method, getter = "generateAssertion")] + pub fn get_generate_assertion(this: &RtcIdentityProvider) -> ::js_sys::Function; + #[doc = "Change the `generateAssertion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] + #[wasm_bindgen(method, setter = "generateAssertion")] + pub fn set_generate_assertion(this: &RtcIdentityProvider, val: &::js_sys::Function); + #[doc = "Get the `validateAssertion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] + #[wasm_bindgen(method, getter = "validateAssertion")] + pub fn get_validate_assertion(this: &RtcIdentityProvider) -> ::js_sys::Function; + #[doc = "Change the `validateAssertion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] + #[wasm_bindgen(method, setter = "validateAssertion")] + pub fn set_validate_assertion(this: &RtcIdentityProvider, val: &::js_sys::Function); } impl RtcIdentityProvider { #[doc = "Construct a new `RtcIdentityProvider`."] @@ -20,42 +41,18 @@ impl RtcIdentityProvider { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.generate_assertion(generate_assertion); - ret.validate_assertion(validate_assertion); + ret.set_generate_assertion(generate_assertion); + ret.set_validate_assertion(validate_assertion); ret } - #[doc = "Change the `generateAssertion` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] + #[deprecated = "Use `set_generate_assertion()` instead."] pub fn generate_assertion(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("generateAssertion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_generate_assertion(val); self } - #[doc = "Change the `validateAssertion` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProvider`*"] + #[deprecated = "Use `set_validate_assertion()` instead."] pub fn validate_assertion(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("validateAssertion"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_validate_assertion(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityProviderDetails.rs b/crates/web-sys/src/features/gen_RtcIdentityProviderDetails.rs index dda6cbc9bc8..b4f33a40ba9 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityProviderDetails.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityProviderDetails.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] pub type RtcIdentityProviderDetails; + #[doc = "Get the `domain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] + #[wasm_bindgen(method, getter = "domain")] + pub fn get_domain(this: &RtcIdentityProviderDetails) -> ::alloc::string::String; + #[doc = "Change the `domain` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] + #[wasm_bindgen(method, setter = "domain")] + pub fn set_domain(this: &RtcIdentityProviderDetails, val: &str); + #[doc = "Get the `protocol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] + #[wasm_bindgen(method, getter = "protocol")] + pub fn get_protocol(this: &RtcIdentityProviderDetails) -> Option<::alloc::string::String>; + #[doc = "Change the `protocol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] + #[wasm_bindgen(method, setter = "protocol")] + pub fn set_protocol(this: &RtcIdentityProviderDetails, val: &str); } impl RtcIdentityProviderDetails { #[doc = "Construct a new `RtcIdentityProviderDetails`."] @@ -17,38 +38,17 @@ impl RtcIdentityProviderDetails { pub fn new(domain: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.domain(domain); + ret.set_domain(domain); ret } - #[doc = "Change the `domain` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] + #[deprecated = "Use `set_domain()` instead."] pub fn domain(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("domain"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_domain(val); self } - #[doc = "Change the `protocol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderDetails`*"] + #[deprecated = "Use `set_protocol()` instead."] pub fn protocol(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_protocol(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityProviderOptions.rs b/crates/web-sys/src/features/gen_RtcIdentityProviderOptions.rs index cdb594b4e09..4b6e6cb03b0 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityProviderOptions.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityProviderOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] pub type RtcIdentityProviderOptions; + #[doc = "Get the `peerIdentity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[wasm_bindgen(method, getter = "peerIdentity")] + pub fn get_peer_identity(this: &RtcIdentityProviderOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `peerIdentity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[wasm_bindgen(method, setter = "peerIdentity")] + pub fn set_peer_identity(this: &RtcIdentityProviderOptions, val: &str); + #[doc = "Get the `protocol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[wasm_bindgen(method, getter = "protocol")] + pub fn get_protocol(this: &RtcIdentityProviderOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `protocol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[wasm_bindgen(method, setter = "protocol")] + pub fn set_protocol(this: &RtcIdentityProviderOptions, val: &str); + #[doc = "Get the `usernameHint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[wasm_bindgen(method, getter = "usernameHint")] + pub fn get_username_hint(this: &RtcIdentityProviderOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `usernameHint` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[wasm_bindgen(method, setter = "usernameHint")] + pub fn set_username_hint(this: &RtcIdentityProviderOptions, val: &str); } impl RtcIdentityProviderOptions { #[doc = "Construct a new `RtcIdentityProviderOptions`."] @@ -19,55 +50,19 @@ impl RtcIdentityProviderOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `peerIdentity` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[deprecated = "Use `set_peer_identity()` instead."] pub fn peer_identity(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("peerIdentity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_peer_identity(val); self } - #[doc = "Change the `protocol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[deprecated = "Use `set_protocol()` instead."] pub fn protocol(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_protocol(val); self } - #[doc = "Change the `usernameHint` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityProviderOptions`*"] + #[deprecated = "Use `set_username_hint()` instead."] pub fn username_hint(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("usernameHint"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_username_hint(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcIdentityProviderRegistrar.rs b/crates/web-sys/src/features/gen_RtcIdentityProviderRegistrar.rs index 86a4f2be05c..a876fca7703 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityProviderRegistrar.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityProviderRegistrar.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_RtcIdentityValidationResult.rs b/crates/web-sys/src/features/gen_RtcIdentityValidationResult.rs index cd5ba8e16df..545ad230d04 100644 --- a/crates/web-sys/src/features/gen_RtcIdentityValidationResult.rs +++ b/crates/web-sys/src/features/gen_RtcIdentityValidationResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] pub type RtcIdentityValidationResult; + #[doc = "Get the `contents` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] + #[wasm_bindgen(method, getter = "contents")] + pub fn get_contents(this: &RtcIdentityValidationResult) -> ::alloc::string::String; + #[doc = "Change the `contents` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] + #[wasm_bindgen(method, setter = "contents")] + pub fn set_contents(this: &RtcIdentityValidationResult, val: &str); + #[doc = "Get the `identity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] + #[wasm_bindgen(method, getter = "identity")] + pub fn get_identity(this: &RtcIdentityValidationResult) -> ::alloc::string::String; + #[doc = "Change the `identity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] + #[wasm_bindgen(method, setter = "identity")] + pub fn set_identity(this: &RtcIdentityValidationResult, val: &str); } impl RtcIdentityValidationResult { #[doc = "Construct a new `RtcIdentityValidationResult`."] @@ -17,42 +38,18 @@ impl RtcIdentityValidationResult { pub fn new(contents: &str, identity: &str) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.contents(contents); - ret.identity(identity); + ret.set_contents(contents); + ret.set_identity(identity); ret } - #[doc = "Change the `contents` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] + #[deprecated = "Use `set_contents()` instead."] pub fn contents(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("contents"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_contents(val); self } - #[doc = "Change the `identity` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIdentityValidationResult`*"] + #[deprecated = "Use `set_identity()` instead."] pub fn identity(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("identity"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_identity(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcInboundRtpStreamStats.rs b/crates/web-sys/src/features/gen_RtcInboundRtpStreamStats.rs index 41091b2b2e8..c1d37aac0cf 100644 --- a/crates/web-sys/src/features/gen_RtcInboundRtpStreamStats.rs +++ b/crates/web-sys/src/features/gen_RtcInboundRtpStreamStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,248 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] pub type RtcInboundRtpStreamStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcInboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcInboundRtpStreamStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcInboundRtpStreamStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcInboundRtpStreamStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcInboundRtpStreamStats, val: RtcStatsType); + #[doc = "Get the `bitrateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "bitrateMean")] + pub fn get_bitrate_mean(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `bitrateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "bitrateMean")] + pub fn set_bitrate_mean(this: &RtcInboundRtpStreamStats, val: f64); + #[doc = "Get the `bitrateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "bitrateStdDev")] + pub fn get_bitrate_std_dev(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `bitrateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "bitrateStdDev")] + pub fn set_bitrate_std_dev(this: &RtcInboundRtpStreamStats, val: f64); + #[doc = "Get the `codecId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "codecId")] + pub fn get_codec_id(this: &RtcInboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `codecId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "codecId")] + pub fn set_codec_id(this: &RtcInboundRtpStreamStats, val: &str); + #[doc = "Get the `firCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "firCount")] + pub fn get_fir_count(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `firCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "firCount")] + pub fn set_fir_count(this: &RtcInboundRtpStreamStats, val: u32); + #[doc = "Get the `framerateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "framerateMean")] + pub fn get_framerate_mean(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `framerateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "framerateMean")] + pub fn set_framerate_mean(this: &RtcInboundRtpStreamStats, val: f64); + #[doc = "Get the `framerateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "framerateStdDev")] + pub fn get_framerate_std_dev(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `framerateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "framerateStdDev")] + pub fn set_framerate_std_dev(this: &RtcInboundRtpStreamStats, val: f64); + #[doc = "Get the `isRemote` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "isRemote")] + pub fn get_is_remote(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `isRemote` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "isRemote")] + pub fn set_is_remote(this: &RtcInboundRtpStreamStats, val: bool); + #[doc = "Get the `mediaTrackId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "mediaTrackId")] + pub fn get_media_track_id(this: &RtcInboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `mediaTrackId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "mediaTrackId")] + pub fn set_media_track_id(this: &RtcInboundRtpStreamStats, val: &str); + #[doc = "Get the `mediaType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "mediaType")] + pub fn get_media_type(this: &RtcInboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `mediaType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "mediaType")] + pub fn set_media_type(this: &RtcInboundRtpStreamStats, val: &str); + #[doc = "Get the `nackCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "nackCount")] + pub fn get_nack_count(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `nackCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "nackCount")] + pub fn set_nack_count(this: &RtcInboundRtpStreamStats, val: u32); + #[doc = "Get the `pliCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "pliCount")] + pub fn get_pli_count(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `pliCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "pliCount")] + pub fn set_pli_count(this: &RtcInboundRtpStreamStats, val: u32); + #[doc = "Get the `remoteId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "remoteId")] + pub fn get_remote_id(this: &RtcInboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `remoteId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "remoteId")] + pub fn set_remote_id(this: &RtcInboundRtpStreamStats, val: &str); + #[doc = "Get the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "ssrc")] + pub fn get_ssrc(this: &RtcInboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "ssrc")] + pub fn set_ssrc(this: &RtcInboundRtpStreamStats, val: &str); + #[doc = "Get the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "transportId")] + pub fn get_transport_id(this: &RtcInboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "transportId")] + pub fn set_transport_id(this: &RtcInboundRtpStreamStats, val: &str); + #[doc = "Get the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "bytesReceived")] + pub fn get_bytes_received(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "bytesReceived")] + pub fn set_bytes_received(this: &RtcInboundRtpStreamStats, val: f64); + #[doc = "Get the `discardedPackets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "discardedPackets")] + pub fn get_discarded_packets(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `discardedPackets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "discardedPackets")] + pub fn set_discarded_packets(this: &RtcInboundRtpStreamStats, val: u32); + #[doc = "Get the `framesDecoded` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "framesDecoded")] + pub fn get_frames_decoded(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `framesDecoded` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "framesDecoded")] + pub fn set_frames_decoded(this: &RtcInboundRtpStreamStats, val: u32); + #[doc = "Get the `jitter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "jitter")] + pub fn get_jitter(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `jitter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "jitter")] + pub fn set_jitter(this: &RtcInboundRtpStreamStats, val: f64); + #[doc = "Get the `packetsLost` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "packetsLost")] + pub fn get_packets_lost(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `packetsLost` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "packetsLost")] + pub fn set_packets_lost(this: &RtcInboundRtpStreamStats, val: u32); + #[doc = "Get the `packetsReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "packetsReceived")] + pub fn get_packets_received(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `packetsReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "packetsReceived")] + pub fn set_packets_received(this: &RtcInboundRtpStreamStats, val: u32); + #[doc = "Get the `roundTripTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "roundTripTime")] + pub fn get_round_trip_time(this: &RtcInboundRtpStreamStats) -> Option; + #[doc = "Change the `roundTripTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "roundTripTime")] + pub fn set_round_trip_time(this: &RtcInboundRtpStreamStats, val: i32); } impl RtcInboundRtpStreamStats { #[doc = "Construct a new `RtcInboundRtpStreamStats`."] @@ -19,398 +262,125 @@ impl RtcInboundRtpStreamStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `bitrateMean` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_bitrate_mean()` instead."] pub fn bitrate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bitrate_mean(val); self } - #[doc = "Change the `bitrateStdDev` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_bitrate_std_dev()` instead."] pub fn bitrate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bitrate_std_dev(val); self } - #[doc = "Change the `codecId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_codec_id()` instead."] pub fn codec_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codecId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_codec_id(val); self } - #[doc = "Change the `firCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_fir_count()` instead."] pub fn fir_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("firCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fir_count(val); self } - #[doc = "Change the `framerateMean` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_framerate_mean()` instead."] pub fn framerate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_framerate_mean(val); self } - #[doc = "Change the `framerateStdDev` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_framerate_std_dev()` instead."] pub fn framerate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_framerate_std_dev(val); self } - #[doc = "Change the `isRemote` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_is_remote()` instead."] pub fn is_remote(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isRemote"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_remote(val); self } - #[doc = "Change the `mediaTrackId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_media_track_id()` instead."] pub fn media_track_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaTrackId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_track_id(val); self } - #[doc = "Change the `mediaType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_media_type()` instead."] pub fn media_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_type(val); self } - #[doc = "Change the `nackCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_nack_count()` instead."] pub fn nack_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nackCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_nack_count(val); self } - #[doc = "Change the `pliCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_pli_count()` instead."] pub fn pli_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pliCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pli_count(val); self } - #[doc = "Change the `remoteId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_remote_id()` instead."] pub fn remote_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_id(val); self } - #[doc = "Change the `ssrc` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_ssrc()` instead."] pub fn ssrc(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssrc(val); self } - #[doc = "Change the `transportId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_transport_id()` instead."] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transport_id(val); self } - #[doc = "Change the `bytesReceived` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_bytes_received()` instead."] pub fn bytes_received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes_received(val); self } - #[doc = "Change the `discardedPackets` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_discarded_packets()` instead."] pub fn discarded_packets(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("discardedPackets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_discarded_packets(val); self } - #[doc = "Change the `framesDecoded` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_frames_decoded()` instead."] pub fn frames_decoded(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesDecoded"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frames_decoded(val); self } - #[doc = "Change the `jitter` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_jitter()` instead."] pub fn jitter(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("jitter"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_jitter(val); self } - #[doc = "Change the `packetsLost` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_packets_lost()` instead."] pub fn packets_lost(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsLost"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_packets_lost(val); self } - #[doc = "Change the `packetsReceived` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_packets_received()` instead."] pub fn packets_received(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_packets_received(val); self } - #[doc = "Change the `roundTripTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcInboundRtpStreamStats`*"] + #[deprecated = "Use `set_round_trip_time()` instead."] pub fn round_trip_time(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("roundTripTime"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_round_trip_time(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcLifecycleEvent.rs b/crates/web-sys/src/features/gen_RtcLifecycleEvent.rs deleted file mode 100644 index c8094e51482..00000000000 --- a/crates/web-sys/src/features/gen_RtcLifecycleEvent.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![allow(unused_imports)] -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -#[doc = "The `RtcLifecycleEvent` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `RtcLifecycleEvent`*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum RtcLifecycleEvent { - Initialized = "initialized", - Icegatheringstatechange = "icegatheringstatechange", - Iceconnectionstatechange = "iceconnectionstatechange", -} diff --git a/crates/web-sys/src/features/gen_RtcMediaStreamStats.rs b/crates/web-sys/src/features/gen_RtcMediaStreamStats.rs index a226113198c..7ffbb3b8fc5 100644 --- a/crates/web-sys/src/features/gen_RtcMediaStreamStats.rs +++ b/crates/web-sys/src/features/gen_RtcMediaStreamStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] pub type RtcMediaStreamStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcMediaStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcMediaStreamStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcMediaStreamStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcMediaStreamStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcMediaStreamStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcMediaStreamStats, val: RtcStatsType); + #[doc = "Get the `streamIdentifier` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[wasm_bindgen(method, getter = "streamIdentifier")] + pub fn get_stream_identifier(this: &RtcMediaStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `streamIdentifier` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[wasm_bindgen(method, setter = "streamIdentifier")] + pub fn set_stream_identifier(this: &RtcMediaStreamStats, val: &str); + #[doc = "Get the `trackIds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[wasm_bindgen(method, getter = "trackIds")] + pub fn get_track_ids(this: &RtcMediaStreamStats) -> Option<::js_sys::Array>; + #[doc = "Change the `trackIds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[wasm_bindgen(method, setter = "trackIds")] + pub fn set_track_ids(this: &RtcMediaStreamStats, val: &::wasm_bindgen::JsValue); } impl RtcMediaStreamStats { #[doc = "Construct a new `RtcMediaStreamStats`."] @@ -19,82 +72,30 @@ impl RtcMediaStreamStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `streamIdentifier` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[deprecated = "Use `set_stream_identifier()` instead."] pub fn stream_identifier(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("streamIdentifier"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stream_identifier(val); self } - #[doc = "Change the `trackIds` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamStats`*"] + #[deprecated = "Use `set_track_ids()` instead."] pub fn track_ids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("trackIds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_track_ids(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcMediaStreamTrackStats.rs b/crates/web-sys/src/features/gen_RtcMediaStreamTrackStats.rs index 8caa058070e..093c30d645a 100644 --- a/crates/web-sys/src/features/gen_RtcMediaStreamTrackStats.rs +++ b/crates/web-sys/src/features/gen_RtcMediaStreamTrackStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,179 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] pub type RtcMediaStreamTrackStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcMediaStreamTrackStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcMediaStreamTrackStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcMediaStreamTrackStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcMediaStreamTrackStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcMediaStreamTrackStats, val: RtcStatsType); + #[doc = "Get the `audioLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "audioLevel")] + pub fn get_audio_level(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `audioLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "audioLevel")] + pub fn set_audio_level(this: &RtcMediaStreamTrackStats, val: f64); + #[doc = "Get the `echoReturnLoss` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "echoReturnLoss")] + pub fn get_echo_return_loss(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `echoReturnLoss` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "echoReturnLoss")] + pub fn set_echo_return_loss(this: &RtcMediaStreamTrackStats, val: f64); + #[doc = "Get the `echoReturnLossEnhancement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "echoReturnLossEnhancement")] + pub fn get_echo_return_loss_enhancement(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `echoReturnLossEnhancement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "echoReturnLossEnhancement")] + pub fn set_echo_return_loss_enhancement(this: &RtcMediaStreamTrackStats, val: f64); + #[doc = "Get the `frameHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "frameHeight")] + pub fn get_frame_height(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `frameHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "frameHeight")] + pub fn set_frame_height(this: &RtcMediaStreamTrackStats, val: u32); + #[doc = "Get the `frameWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "frameWidth")] + pub fn get_frame_width(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `frameWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "frameWidth")] + pub fn set_frame_width(this: &RtcMediaStreamTrackStats, val: u32); + #[doc = "Get the `framesCorrupted` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "framesCorrupted")] + pub fn get_frames_corrupted(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `framesCorrupted` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "framesCorrupted")] + pub fn set_frames_corrupted(this: &RtcMediaStreamTrackStats, val: u32); + #[doc = "Get the `framesDecoded` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "framesDecoded")] + pub fn get_frames_decoded(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `framesDecoded` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "framesDecoded")] + pub fn set_frames_decoded(this: &RtcMediaStreamTrackStats, val: u32); + #[doc = "Get the `framesDropped` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "framesDropped")] + pub fn get_frames_dropped(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `framesDropped` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "framesDropped")] + pub fn set_frames_dropped(this: &RtcMediaStreamTrackStats, val: u32); + #[doc = "Get the `framesPerSecond` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "framesPerSecond")] + pub fn get_frames_per_second(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `framesPerSecond` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "framesPerSecond")] + pub fn set_frames_per_second(this: &RtcMediaStreamTrackStats, val: f64); + #[doc = "Get the `framesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "framesReceived")] + pub fn get_frames_received(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `framesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "framesReceived")] + pub fn set_frames_received(this: &RtcMediaStreamTrackStats, val: u32); + #[doc = "Get the `framesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "framesSent")] + pub fn get_frames_sent(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `framesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "framesSent")] + pub fn set_frames_sent(this: &RtcMediaStreamTrackStats, val: u32); + #[doc = "Get the `remoteSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "remoteSource")] + pub fn get_remote_source(this: &RtcMediaStreamTrackStats) -> Option; + #[doc = "Change the `remoteSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "remoteSource")] + pub fn set_remote_source(this: &RtcMediaStreamTrackStats, val: bool); + #[doc = "Get the `ssrcIds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "ssrcIds")] + pub fn get_ssrc_ids(this: &RtcMediaStreamTrackStats) -> Option<::js_sys::Array>; + #[doc = "Change the `ssrcIds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "ssrcIds")] + pub fn set_ssrc_ids(this: &RtcMediaStreamTrackStats, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `trackIdentifier` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, getter = "trackIdentifier")] + pub fn get_track_identifier(this: &RtcMediaStreamTrackStats) + -> Option<::alloc::string::String>; + #[doc = "Change the `trackIdentifier` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[wasm_bindgen(method, setter = "trackIdentifier")] + pub fn set_track_identifier(this: &RtcMediaStreamTrackStats, val: &str); } impl RtcMediaStreamTrackStats { #[doc = "Construct a new `RtcMediaStreamTrackStats`."] @@ -19,286 +193,90 @@ impl RtcMediaStreamTrackStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `audioLevel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_audio_level()` instead."] pub fn audio_level(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio_level(val); self } - #[doc = "Change the `echoReturnLoss` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_echo_return_loss()` instead."] pub fn echo_return_loss(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoReturnLoss"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_echo_return_loss(val); self } - #[doc = "Change the `echoReturnLossEnhancement` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_echo_return_loss_enhancement()` instead."] pub fn echo_return_loss_enhancement(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("echoReturnLossEnhancement"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_echo_return_loss_enhancement(val); self } - #[doc = "Change the `frameHeight` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_frame_height()` instead."] pub fn frame_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frame_height(val); self } - #[doc = "Change the `frameWidth` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_frame_width()` instead."] pub fn frame_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frameWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frame_width(val); self } - #[doc = "Change the `framesCorrupted` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_frames_corrupted()` instead."] pub fn frames_corrupted(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesCorrupted"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frames_corrupted(val); self } - #[doc = "Change the `framesDecoded` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_frames_decoded()` instead."] pub fn frames_decoded(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesDecoded"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frames_decoded(val); self } - #[doc = "Change the `framesDropped` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_frames_dropped()` instead."] pub fn frames_dropped(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesDropped"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frames_dropped(val); self } - #[doc = "Change the `framesPerSecond` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_frames_per_second()` instead."] pub fn frames_per_second(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesPerSecond"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frames_per_second(val); self } - #[doc = "Change the `framesReceived` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_frames_received()` instead."] pub fn frames_received(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frames_received(val); self } - #[doc = "Change the `framesSent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_frames_sent()` instead."] pub fn frames_sent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frames_sent(val); self } - #[doc = "Change the `remoteSource` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_remote_source()` instead."] pub fn remote_source(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteSource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_source(val); self } - #[doc = "Change the `ssrcIds` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_ssrc_ids()` instead."] pub fn ssrc_ids(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ssrcIds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssrc_ids(val); self } - #[doc = "Change the `trackIdentifier` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcMediaStreamTrackStats`*"] + #[deprecated = "Use `set_track_identifier()` instead."] pub fn track_identifier(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("trackIdentifier"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_track_identifier(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcOfferAnswerOptions.rs b/crates/web-sys/src/features/gen_RtcOfferAnswerOptions.rs index 9c84bcf9229..dc4330d9cd4 100644 --- a/crates/web-sys/src/features/gen_RtcOfferAnswerOptions.rs +++ b/crates/web-sys/src/features/gen_RtcOfferAnswerOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_RtcOfferOptions.rs b/crates/web-sys/src/features/gen_RtcOfferOptions.rs index 4130baa257b..ba2db197fcb 100644 --- a/crates/web-sys/src/features/gen_RtcOfferOptions.rs +++ b/crates/web-sys/src/features/gen_RtcOfferOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] pub type RtcOfferOptions; + #[doc = "Get the `iceRestart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[wasm_bindgen(method, getter = "iceRestart")] + pub fn get_ice_restart(this: &RtcOfferOptions) -> Option; + #[doc = "Change the `iceRestart` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[wasm_bindgen(method, setter = "iceRestart")] + pub fn set_ice_restart(this: &RtcOfferOptions, val: bool); + #[doc = "Get the `offerToReceiveAudio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[wasm_bindgen(method, getter = "offerToReceiveAudio")] + pub fn get_offer_to_receive_audio(this: &RtcOfferOptions) -> Option; + #[doc = "Change the `offerToReceiveAudio` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[wasm_bindgen(method, setter = "offerToReceiveAudio")] + pub fn set_offer_to_receive_audio(this: &RtcOfferOptions, val: bool); + #[doc = "Get the `offerToReceiveVideo` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[wasm_bindgen(method, getter = "offerToReceiveVideo")] + pub fn get_offer_to_receive_video(this: &RtcOfferOptions) -> Option; + #[doc = "Change the `offerToReceiveVideo` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[wasm_bindgen(method, setter = "offerToReceiveVideo")] + pub fn set_offer_to_receive_video(this: &RtcOfferOptions, val: bool); } impl RtcOfferOptions { #[doc = "Construct a new `RtcOfferOptions`."] @@ -19,55 +50,19 @@ impl RtcOfferOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `iceRestart` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[deprecated = "Use `set_ice_restart()` instead."] pub fn ice_restart(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceRestart"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ice_restart(val); self } - #[doc = "Change the `offerToReceiveAudio` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[deprecated = "Use `set_offer_to_receive_audio()` instead."] pub fn offer_to_receive_audio(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("offerToReceiveAudio"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_offer_to_receive_audio(val); self } - #[doc = "Change the `offerToReceiveVideo` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOfferOptions`*"] + #[deprecated = "Use `set_offer_to_receive_video()` instead."] pub fn offer_to_receive_video(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("offerToReceiveVideo"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_offer_to_receive_video(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcOutboundRtpStreamStats.rs b/crates/web-sys/src/features/gen_RtcOutboundRtpStreamStats.rs index 7630d96cab7..06ebf0bcd0f 100644 --- a/crates/web-sys/src/features/gen_RtcOutboundRtpStreamStats.rs +++ b/crates/web-sys/src/features/gen_RtcOutboundRtpStreamStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,228 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] pub type RtcOutboundRtpStreamStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcOutboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcOutboundRtpStreamStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcOutboundRtpStreamStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcOutboundRtpStreamStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcOutboundRtpStreamStats, val: RtcStatsType); + #[doc = "Get the `bitrateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "bitrateMean")] + pub fn get_bitrate_mean(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `bitrateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "bitrateMean")] + pub fn set_bitrate_mean(this: &RtcOutboundRtpStreamStats, val: f64); + #[doc = "Get the `bitrateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "bitrateStdDev")] + pub fn get_bitrate_std_dev(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `bitrateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "bitrateStdDev")] + pub fn set_bitrate_std_dev(this: &RtcOutboundRtpStreamStats, val: f64); + #[doc = "Get the `codecId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "codecId")] + pub fn get_codec_id(this: &RtcOutboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `codecId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "codecId")] + pub fn set_codec_id(this: &RtcOutboundRtpStreamStats, val: &str); + #[doc = "Get the `firCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "firCount")] + pub fn get_fir_count(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `firCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "firCount")] + pub fn set_fir_count(this: &RtcOutboundRtpStreamStats, val: u32); + #[doc = "Get the `framerateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "framerateMean")] + pub fn get_framerate_mean(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `framerateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "framerateMean")] + pub fn set_framerate_mean(this: &RtcOutboundRtpStreamStats, val: f64); + #[doc = "Get the `framerateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "framerateStdDev")] + pub fn get_framerate_std_dev(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `framerateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "framerateStdDev")] + pub fn set_framerate_std_dev(this: &RtcOutboundRtpStreamStats, val: f64); + #[doc = "Get the `isRemote` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "isRemote")] + pub fn get_is_remote(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `isRemote` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "isRemote")] + pub fn set_is_remote(this: &RtcOutboundRtpStreamStats, val: bool); + #[doc = "Get the `mediaTrackId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "mediaTrackId")] + pub fn get_media_track_id(this: &RtcOutboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `mediaTrackId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "mediaTrackId")] + pub fn set_media_track_id(this: &RtcOutboundRtpStreamStats, val: &str); + #[doc = "Get the `mediaType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "mediaType")] + pub fn get_media_type(this: &RtcOutboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `mediaType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "mediaType")] + pub fn set_media_type(this: &RtcOutboundRtpStreamStats, val: &str); + #[doc = "Get the `nackCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "nackCount")] + pub fn get_nack_count(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `nackCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "nackCount")] + pub fn set_nack_count(this: &RtcOutboundRtpStreamStats, val: u32); + #[doc = "Get the `pliCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "pliCount")] + pub fn get_pli_count(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `pliCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "pliCount")] + pub fn set_pli_count(this: &RtcOutboundRtpStreamStats, val: u32); + #[doc = "Get the `remoteId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "remoteId")] + pub fn get_remote_id(this: &RtcOutboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `remoteId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "remoteId")] + pub fn set_remote_id(this: &RtcOutboundRtpStreamStats, val: &str); + #[doc = "Get the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "ssrc")] + pub fn get_ssrc(this: &RtcOutboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "ssrc")] + pub fn set_ssrc(this: &RtcOutboundRtpStreamStats, val: &str); + #[doc = "Get the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "transportId")] + pub fn get_transport_id(this: &RtcOutboundRtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "transportId")] + pub fn set_transport_id(this: &RtcOutboundRtpStreamStats, val: &str); + #[doc = "Get the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "bytesSent")] + pub fn get_bytes_sent(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "bytesSent")] + pub fn set_bytes_sent(this: &RtcOutboundRtpStreamStats, val: f64); + #[doc = "Get the `droppedFrames` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "droppedFrames")] + pub fn get_dropped_frames(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `droppedFrames` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "droppedFrames")] + pub fn set_dropped_frames(this: &RtcOutboundRtpStreamStats, val: u32); + #[doc = "Get the `framesEncoded` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "framesEncoded")] + pub fn get_frames_encoded(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `framesEncoded` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "framesEncoded")] + pub fn set_frames_encoded(this: &RtcOutboundRtpStreamStats, val: u32); + #[doc = "Get the `packetsSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "packetsSent")] + pub fn get_packets_sent(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `packetsSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "packetsSent")] + pub fn set_packets_sent(this: &RtcOutboundRtpStreamStats, val: u32); + #[doc = "Get the `targetBitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, getter = "targetBitrate")] + pub fn get_target_bitrate(this: &RtcOutboundRtpStreamStats) -> Option; + #[doc = "Change the `targetBitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[wasm_bindgen(method, setter = "targetBitrate")] + pub fn set_target_bitrate(this: &RtcOutboundRtpStreamStats, val: f64); } impl RtcOutboundRtpStreamStats { #[doc = "Construct a new `RtcOutboundRtpStreamStats`."] @@ -19,367 +242,115 @@ impl RtcOutboundRtpStreamStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `bitrateMean` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_bitrate_mean()` instead."] pub fn bitrate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bitrate_mean(val); self } - #[doc = "Change the `bitrateStdDev` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_bitrate_std_dev()` instead."] pub fn bitrate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bitrate_std_dev(val); self } - #[doc = "Change the `codecId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_codec_id()` instead."] pub fn codec_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codecId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_codec_id(val); self } - #[doc = "Change the `firCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_fir_count()` instead."] pub fn fir_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("firCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fir_count(val); self } - #[doc = "Change the `framerateMean` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_framerate_mean()` instead."] pub fn framerate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_framerate_mean(val); self } - #[doc = "Change the `framerateStdDev` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_framerate_std_dev()` instead."] pub fn framerate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_framerate_std_dev(val); self } - #[doc = "Change the `isRemote` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_is_remote()` instead."] pub fn is_remote(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isRemote"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_remote(val); self } - #[doc = "Change the `mediaTrackId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_media_track_id()` instead."] pub fn media_track_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaTrackId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_track_id(val); self } - #[doc = "Change the `mediaType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_media_type()` instead."] pub fn media_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_type(val); self } - #[doc = "Change the `nackCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_nack_count()` instead."] pub fn nack_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nackCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_nack_count(val); self } - #[doc = "Change the `pliCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_pli_count()` instead."] pub fn pli_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pliCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pli_count(val); self } - #[doc = "Change the `remoteId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_remote_id()` instead."] pub fn remote_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_id(val); self } - #[doc = "Change the `ssrc` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_ssrc()` instead."] pub fn ssrc(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssrc(val); self } - #[doc = "Change the `transportId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_transport_id()` instead."] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transport_id(val); self } - #[doc = "Change the `bytesSent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_bytes_sent()` instead."] pub fn bytes_sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes_sent(val); self } - #[doc = "Change the `droppedFrames` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_dropped_frames()` instead."] pub fn dropped_frames(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("droppedFrames"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_dropped_frames(val); self } - #[doc = "Change the `framesEncoded` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_frames_encoded()` instead."] pub fn frames_encoded(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framesEncoded"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_frames_encoded(val); self } - #[doc = "Change the `packetsSent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_packets_sent()` instead."] pub fn packets_sent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("packetsSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_packets_sent(val); self } - #[doc = "Change the `targetBitrate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcOutboundRtpStreamStats`*"] + #[deprecated = "Use `set_target_bitrate()` instead."] pub fn target_bitrate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targetBitrate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_target_bitrate(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcPeerConnection.rs b/crates/web-sys/src/features/gen_RtcPeerConnection.rs index 455a8820beb..9a96c5b3e7b 100644 --- a/crates/web-sys/src/features/gen_RtcPeerConnection.rs +++ b/crates/web-sys/src/features/gen_RtcPeerConnection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -90,6 +91,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcIceConnectionState`, `RtcPeerConnection`*"] pub fn ice_connection_state(this: &RtcPeerConnection) -> RtcIceConnectionState; + #[cfg(feature = "RtcPeerConnectionState")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnection" , js_name = connectionState)] + #[doc = "Getter for the `connectionState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnection`, `RtcPeerConnectionState`*"] + pub fn connection_state(this: &RtcPeerConnection) -> RtcPeerConnectionState; # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnection" , js_name = peerIdentity)] #[doc = "Getter for the `peerIdentity` field of this object."] #[doc = ""] @@ -103,7 +112,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/idpLoginUrl)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnection`*"] - pub fn idp_login_url(this: &RtcPeerConnection) -> Option; + pub fn idp_login_url(this: &RtcPeerConnection) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnection" , js_name = onnegotiationneeded)] #[doc = "Getter for the `onnegotiationneeded` field of this object."] #[doc = ""] @@ -236,6 +245,23 @@ extern "C" { this: &RtcPeerConnection, value: Option<&::js_sys::Function>, ); + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnection" , js_name = onconnectionstatechange)] + #[doc = "Getter for the `onconnectionstatechange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/onconnectionstatechange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnection`*"] + pub fn onconnectionstatechange(this: &RtcPeerConnection) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "RTCPeerConnection" , js_name = onconnectionstatechange)] + #[doc = "Setter for the `onconnectionstatechange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/onconnectionstatechange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnection`*"] + pub fn set_onconnectionstatechange( + this: &RtcPeerConnection, + value: Option<&::js_sys::Function>, + ); # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnection" , js_name = ondatachannel)] #[doc = "Getter for the `ondatachannel` field of this object."] #[doc = ""] @@ -645,7 +671,7 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = RtcPeerConnection , js_class = "RTCPeerConnection" , js_name = generateCertificate)] #[doc = "The `generateCertificate()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/generateCertificate)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/generateCertificate_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnection`*"] pub fn generate_certificate_with_object( @@ -654,7 +680,7 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = RtcPeerConnection , js_class = "RTCPeerConnection" , js_name = generateCertificate)] #[doc = "The `generateCertificate()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/generateCertificate)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/generateCertificate_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnection`*"] pub fn generate_certificate_with_str( @@ -749,6 +775,24 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnection`, `RtcRtpSender`*"] pub fn remove_track(this: &RtcPeerConnection, sender: &RtcRtpSender); + # [wasm_bindgen (catch , method , structural , js_class = "RTCPeerConnection" , js_name = setConfiguration)] + #[doc = "The `setConfiguration()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/setConfiguration)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnection`*"] + pub fn set_configuration(this: &RtcPeerConnection) -> Result<(), JsValue>; + #[cfg(feature = "RtcConfiguration")] + # [wasm_bindgen (catch , method , structural , js_class = "RTCPeerConnection" , js_name = setConfiguration)] + #[doc = "The `setConfiguration()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/setConfiguration)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`, `RtcPeerConnection`*"] + pub fn set_configuration_with_configuration( + this: &RtcPeerConnection, + configuration: &RtcConfiguration, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "RTCPeerConnection" , js_name = setIdentityProvider)] #[doc = "The `setIdentityProvider()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_RtcPeerConnectionIceErrorEvent.rs b/crates/web-sys/src/features/gen_RtcPeerConnectionIceErrorEvent.rs new file mode 100644 index 00000000000..c5200370741 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcPeerConnectionIceErrorEvent.rs @@ -0,0 +1,50 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = RTCPeerConnectionIceErrorEvent , typescript_type = "RTCPeerConnectionIceErrorEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcPeerConnectionIceErrorEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub type RtcPeerConnectionIceErrorEvent; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = address)] + #[doc = "Getter for the `address` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/address)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn address(this: &RtcPeerConnectionIceErrorEvent) -> Option<::alloc::string::String>; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , 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/RTCPeerConnectionIceErrorEvent/port)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn port(this: &RtcPeerConnectionIceErrorEvent) -> Option; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = url)] + #[doc = "Getter for the `url` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/url)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn url(this: &RtcPeerConnectionIceErrorEvent) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = errorCode)] + #[doc = "Getter for the `errorCode` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/errorCode)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn error_code(this: &RtcPeerConnectionIceErrorEvent) -> u16; + # [wasm_bindgen (structural , method , getter , js_class = "RTCPeerConnectionIceErrorEvent" , js_name = errorText)] + #[doc = "Getter for the `errorText` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/errorText)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceErrorEvent`*"] + pub fn error_text(this: &RtcPeerConnectionIceErrorEvent) -> ::alloc::string::String; +} diff --git a/crates/web-sys/src/features/gen_RtcPeerConnectionIceEvent.rs b/crates/web-sys/src/features/gen_RtcPeerConnectionIceEvent.rs index 3a59c593b76..d98c253f908 100644 --- a/crates/web-sys/src/features/gen_RtcPeerConnectionIceEvent.rs +++ b/crates/web-sys/src/features/gen_RtcPeerConnectionIceEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_RtcPeerConnectionIceEventInit.rs b/crates/web-sys/src/features/gen_RtcPeerConnectionIceEventInit.rs index 2847f6ed77a..17b0a63b4d2 100644 --- a/crates/web-sys/src/features/gen_RtcPeerConnectionIceEventInit.rs +++ b/crates/web-sys/src/features/gen_RtcPeerConnectionIceEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] pub type RtcPeerConnectionIceEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &RtcPeerConnectionIceEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &RtcPeerConnectionIceEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &RtcPeerConnectionIceEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &RtcPeerConnectionIceEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &RtcPeerConnectionIceEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &RtcPeerConnectionIceEventInit, val: bool); + #[cfg(feature = "RtcIceCandidate")] + #[doc = "Get the `candidate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidate`, `RtcPeerConnectionIceEventInit`*"] + #[wasm_bindgen(method, getter = "candidate")] + pub fn get_candidate(this: &RtcPeerConnectionIceEventInit) -> Option; + #[cfg(feature = "RtcIceCandidate")] + #[doc = "Change the `candidate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidate`, `RtcPeerConnectionIceEventInit`*"] + #[wasm_bindgen(method, setter = "candidate")] + pub fn set_candidate(this: &RtcPeerConnectionIceEventInit, val: Option<&RtcIceCandidate>); } impl RtcPeerConnectionIceEventInit { #[doc = "Construct a new `RtcPeerConnectionIceEventInit`."] @@ -19,73 +62,25 @@ impl RtcPeerConnectionIceEventInit { 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: `RtcPeerConnectionIceEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionIceEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "RtcIceCandidate")] - #[doc = "Change the `candidate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidate`, `RtcPeerConnectionIceEventInit`*"] + #[deprecated = "Use `set_candidate()` instead."] pub fn candidate(&mut self, val: Option<&RtcIceCandidate>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("candidate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_candidate(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcPeerConnectionState.rs b/crates/web-sys/src/features/gen_RtcPeerConnectionState.rs new file mode 100644 index 00000000000..5647845cb42 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcPeerConnectionState.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `RtcPeerConnectionState` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `RtcPeerConnectionState`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum RtcPeerConnectionState { + Closed = "closed", + Failed = "failed", + Disconnected = "disconnected", + New = "new", + Connecting = "connecting", + Connected = "connected", +} diff --git a/crates/web-sys/src/features/gen_RtcPriorityType.rs b/crates/web-sys/src/features/gen_RtcPriorityType.rs index ddd712e4c72..325b66c970b 100644 --- a/crates/web-sys/src/features/gen_RtcPriorityType.rs +++ b/crates/web-sys/src/features/gen_RtcPriorityType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcPriorityType` enum."] diff --git a/crates/web-sys/src/features/gen_RtcRtcpParameters.rs b/crates/web-sys/src/features/gen_RtcRtcpParameters.rs index 85df471a0d8..2810d163ab8 100644 --- a/crates/web-sys/src/features/gen_RtcRtcpParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtcpParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] pub type RtcRtcpParameters; + #[doc = "Get the `cname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] + #[wasm_bindgen(method, getter = "cname")] + pub fn get_cname(this: &RtcRtcpParameters) -> Option<::alloc::string::String>; + #[doc = "Change the `cname` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] + #[wasm_bindgen(method, setter = "cname")] + pub fn set_cname(this: &RtcRtcpParameters, val: &str); + #[doc = "Get the `reducedSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] + #[wasm_bindgen(method, getter = "reducedSize")] + pub fn get_reduced_size(this: &RtcRtcpParameters) -> Option; + #[doc = "Change the `reducedSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] + #[wasm_bindgen(method, setter = "reducedSize")] + pub fn set_reduced_size(this: &RtcRtcpParameters, val: bool); } impl RtcRtcpParameters { #[doc = "Construct a new `RtcRtcpParameters`."] @@ -19,34 +40,14 @@ impl RtcRtcpParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `cname` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] + #[deprecated = "Use `set_cname()` instead."] pub fn cname(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cname"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_cname(val); self } - #[doc = "Change the `reducedSize` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`*"] + #[deprecated = "Use `set_reduced_size()` instead."] pub fn reduced_size(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reducedSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_reduced_size(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpCapabilities.rs b/crates/web-sys/src/features/gen_RtcRtpCapabilities.rs new file mode 100644 index 00000000000..462e8835106 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcRtpCapabilities.rs @@ -0,0 +1,58 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpCapabilities)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcRtpCapabilities` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + pub type RtcRtpCapabilities; + #[doc = "Get the `codecs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + #[wasm_bindgen(method, getter = "codecs")] + pub fn get_codecs(this: &RtcRtpCapabilities) -> ::js_sys::Array; + #[doc = "Change the `codecs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + #[wasm_bindgen(method, setter = "codecs")] + pub fn set_codecs(this: &RtcRtpCapabilities, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `headerExtensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + #[wasm_bindgen(method, getter = "headerExtensions")] + pub fn get_header_extensions(this: &RtcRtpCapabilities) -> ::js_sys::Array; + #[doc = "Change the `headerExtensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + #[wasm_bindgen(method, setter = "headerExtensions")] + pub fn set_header_extensions(this: &RtcRtpCapabilities, val: &::wasm_bindgen::JsValue); +} +impl RtcRtpCapabilities { + #[doc = "Construct a new `RtcRtpCapabilities`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`*"] + pub fn new( + codecs: &::wasm_bindgen::JsValue, + header_extensions: &::wasm_bindgen::JsValue, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_codecs(codecs); + ret.set_header_extensions(header_extensions); + ret + } + #[deprecated = "Use `set_codecs()` instead."] + pub fn codecs(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_codecs(val); + self + } + #[deprecated = "Use `set_header_extensions()` instead."] + pub fn header_extensions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_header_extensions(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_RtcRtpCodecCapability.rs b/crates/web-sys/src/features/gen_RtcRtpCodecCapability.rs new file mode 100644 index 00000000000..dd3f9dde19e --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcRtpCodecCapability.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpCodecCapability)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcRtpCodecCapability` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + pub type RtcRtpCodecCapability; + #[doc = "Get the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + #[wasm_bindgen(method, getter = "channels")] + pub fn get_channels(this: &RtcRtpCodecCapability) -> Option; + #[doc = "Change the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + #[wasm_bindgen(method, setter = "channels")] + pub fn set_channels(this: &RtcRtpCodecCapability, val: u16); + #[doc = "Get the `clockRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + #[wasm_bindgen(method, getter = "clockRate")] + pub fn get_clock_rate(this: &RtcRtpCodecCapability) -> u32; + #[doc = "Change the `clockRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + #[wasm_bindgen(method, setter = "clockRate")] + pub fn set_clock_rate(this: &RtcRtpCodecCapability, val: u32); + #[doc = "Get the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + #[wasm_bindgen(method, getter = "mimeType")] + pub fn get_mime_type(this: &RtcRtpCodecCapability) -> ::alloc::string::String; + #[doc = "Change the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + #[wasm_bindgen(method, setter = "mimeType")] + pub fn set_mime_type(this: &RtcRtpCodecCapability, val: &str); + #[doc = "Get the `sdpFmtpLine` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + #[wasm_bindgen(method, getter = "sdpFmtpLine")] + pub fn get_sdp_fmtp_line(this: &RtcRtpCodecCapability) -> Option<::alloc::string::String>; + #[doc = "Change the `sdpFmtpLine` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + #[wasm_bindgen(method, setter = "sdpFmtpLine")] + pub fn set_sdp_fmtp_line(this: &RtcRtpCodecCapability, val: &str); +} +impl RtcRtpCodecCapability { + #[doc = "Construct a new `RtcRtpCodecCapability`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] + pub fn new(clock_rate: u32, mime_type: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_clock_rate(clock_rate); + ret.set_mime_type(mime_type); + ret + } + #[deprecated = "Use `set_channels()` instead."] + pub fn channels(&mut self, val: u16) -> &mut Self { + self.set_channels(val); + self + } + #[deprecated = "Use `set_clock_rate()` instead."] + pub fn clock_rate(&mut self, val: u32) -> &mut Self { + self.set_clock_rate(val); + self + } + #[deprecated = "Use `set_mime_type()` instead."] + pub fn mime_type(&mut self, val: &str) -> &mut Self { + self.set_mime_type(val); + self + } + #[deprecated = "Use `set_sdp_fmtp_line()` instead."] + pub fn sdp_fmtp_line(&mut self, val: &str) -> &mut Self { + self.set_sdp_fmtp_line(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_RtcRtpCodecParameters.rs b/crates/web-sys/src/features/gen_RtcRtpCodecParameters.rs index 1292d7cac6c..c4a0aa007ee 100644 --- a/crates/web-sys/src/features/gen_RtcRtpCodecParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtpCodecParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] pub type RtcRtpCodecParameters; + #[doc = "Get the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, getter = "channels")] + pub fn get_channels(this: &RtcRtpCodecParameters) -> Option; + #[doc = "Change the `channels` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, setter = "channels")] + pub fn set_channels(this: &RtcRtpCodecParameters, val: u16); + #[doc = "Get the `clockRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, getter = "clockRate")] + pub fn get_clock_rate(this: &RtcRtpCodecParameters) -> Option; + #[doc = "Change the `clockRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, setter = "clockRate")] + pub fn set_clock_rate(this: &RtcRtpCodecParameters, val: u32); + #[doc = "Get the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, getter = "mimeType")] + pub fn get_mime_type(this: &RtcRtpCodecParameters) -> Option<::alloc::string::String>; + #[doc = "Change the `mimeType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, setter = "mimeType")] + pub fn set_mime_type(this: &RtcRtpCodecParameters, val: &str); + #[doc = "Get the `payloadType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, getter = "payloadType")] + pub fn get_payload_type(this: &RtcRtpCodecParameters) -> Option; + #[doc = "Change the `payloadType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, setter = "payloadType")] + pub fn set_payload_type(this: &RtcRtpCodecParameters, val: u16); + #[doc = "Get the `sdpFmtpLine` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, getter = "sdpFmtpLine")] + pub fn get_sdp_fmtp_line(this: &RtcRtpCodecParameters) -> Option<::alloc::string::String>; + #[doc = "Change the `sdpFmtpLine` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[wasm_bindgen(method, setter = "sdpFmtpLine")] + pub fn set_sdp_fmtp_line(this: &RtcRtpCodecParameters, val: &str); } impl RtcRtpCodecParameters { #[doc = "Construct a new `RtcRtpCodecParameters`."] @@ -19,89 +70,29 @@ impl RtcRtpCodecParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `channels` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[deprecated = "Use `set_channels()` instead."] pub fn channels(&mut self, val: u16) -> &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.set_channels(val); self } - #[doc = "Change the `clockRate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[deprecated = "Use `set_clock_rate()` instead."] pub fn clock_rate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clockRate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_clock_rate(val); self } - #[doc = "Change the `mimeType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[deprecated = "Use `set_mime_type()` instead."] pub fn mime_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mimeType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mime_type(val); self } - #[doc = "Change the `payloadType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[deprecated = "Use `set_payload_type()` instead."] pub fn payload_type(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("payloadType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_payload_type(val); self } - #[doc = "Change the `sdpFmtpLine` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecParameters`*"] + #[deprecated = "Use `set_sdp_fmtp_line()` instead."] pub fn sdp_fmtp_line(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sdpFmtpLine"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sdp_fmtp_line(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpContributingSource.rs b/crates/web-sys/src/features/gen_RtcRtpContributingSource.rs index 6f32c2053b8..27e2f10f628 100644 --- a/crates/web-sys/src/features/gen_RtcRtpContributingSource.rs +++ b/crates/web-sys/src/features/gen_RtcRtpContributingSource.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] pub type RtcRtpContributingSource; + #[doc = "Get the `audioLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[wasm_bindgen(method, getter = "audioLevel")] + pub fn get_audio_level(this: &RtcRtpContributingSource) -> Option; + #[doc = "Change the `audioLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[wasm_bindgen(method, setter = "audioLevel")] + pub fn set_audio_level(this: &RtcRtpContributingSource, val: f64); + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &RtcRtpContributingSource) -> u32; + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &RtcRtpContributingSource, val: u32); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcRtpContributingSource) -> f64; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcRtpContributingSource, val: f64); } impl RtcRtpContributingSource { #[doc = "Construct a new `RtcRtpContributingSource`."] @@ -17,56 +48,23 @@ impl RtcRtpContributingSource { pub fn new(source: u32, timestamp: f64) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.source(source); - ret.timestamp(timestamp); + ret.set_source(source); + ret.set_timestamp(timestamp); ret } - #[doc = "Change the `audioLevel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[deprecated = "Use `set_audio_level()` instead."] pub fn audio_level(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio_level(val); self } - #[doc = "Change the `source` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[deprecated = "Use `set_source()` instead."] pub fn source(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs b/crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs index 339ec385af5..f9779b34757 100644 --- a/crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtpEncodingParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,128 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] pub type RtcRtpEncodingParameters; + #[doc = "Get the `active` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, getter = "active")] + pub fn get_active(this: &RtcRtpEncodingParameters) -> Option; + #[doc = "Change the `active` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, setter = "active")] + pub fn set_active(this: &RtcRtpEncodingParameters, val: bool); + #[cfg(feature = "RtcDegradationPreference")] + #[doc = "Get the `degradationPreference` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDegradationPreference`, `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, getter = "degradationPreference")] + pub fn get_degradation_preference( + this: &RtcRtpEncodingParameters, + ) -> Option; + #[cfg(feature = "RtcDegradationPreference")] + #[doc = "Change the `degradationPreference` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcDegradationPreference`, `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, setter = "degradationPreference")] + pub fn set_degradation_preference( + this: &RtcRtpEncodingParameters, + val: RtcDegradationPreference, + ); + #[cfg(feature = "RtcFecParameters")] + #[doc = "Get the `fec` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`, `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, getter = "fec")] + pub fn get_fec(this: &RtcRtpEncodingParameters) -> Option; + #[cfg(feature = "RtcFecParameters")] + #[doc = "Change the `fec` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`, `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, setter = "fec")] + pub fn set_fec(this: &RtcRtpEncodingParameters, val: &RtcFecParameters); + #[doc = "Get the `maxBitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, getter = "maxBitrate")] + pub fn get_max_bitrate(this: &RtcRtpEncodingParameters) -> Option; + #[doc = "Change the `maxBitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, setter = "maxBitrate")] + pub fn set_max_bitrate(this: &RtcRtpEncodingParameters, val: u32); + #[cfg(feature = "RtcPriorityType")] + #[doc = "Get the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPriorityType`, `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, getter = "priority")] + pub fn get_priority(this: &RtcRtpEncodingParameters) -> Option; + #[cfg(feature = "RtcPriorityType")] + #[doc = "Change the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcPriorityType`, `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, setter = "priority")] + pub fn set_priority(this: &RtcRtpEncodingParameters, val: RtcPriorityType); + #[doc = "Get the `rid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, getter = "rid")] + pub fn get_rid(this: &RtcRtpEncodingParameters) -> Option<::alloc::string::String>; + #[doc = "Change the `rid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, setter = "rid")] + pub fn set_rid(this: &RtcRtpEncodingParameters, val: &str); + #[cfg(feature = "RtcRtxParameters")] + #[doc = "Get the `rtx` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`, `RtcRtxParameters`*"] + #[wasm_bindgen(method, getter = "rtx")] + pub fn get_rtx(this: &RtcRtpEncodingParameters) -> Option; + #[cfg(feature = "RtcRtxParameters")] + #[doc = "Change the `rtx` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`, `RtcRtxParameters`*"] + #[wasm_bindgen(method, setter = "rtx")] + pub fn set_rtx(this: &RtcRtpEncodingParameters, val: &RtcRtxParameters); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `scalabilityMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "scalabilityMode")] + pub fn get_scalability_mode(this: &RtcRtpEncodingParameters) + -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `scalabilityMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "scalabilityMode")] + pub fn set_scalability_mode(this: &RtcRtpEncodingParameters, val: &str); + #[doc = "Get the `scaleResolutionDownBy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, getter = "scaleResolutionDownBy")] + pub fn get_scale_resolution_down_by(this: &RtcRtpEncodingParameters) -> Option; + #[doc = "Change the `scaleResolutionDownBy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, setter = "scaleResolutionDownBy")] + pub fn set_scale_resolution_down_by(this: &RtcRtpEncodingParameters, val: f32); + #[doc = "Get the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, getter = "ssrc")] + pub fn get_ssrc(this: &RtcRtpEncodingParameters) -> Option; + #[doc = "Change the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[wasm_bindgen(method, setter = "ssrc")] + pub fn set_ssrc(this: &RtcRtpEncodingParameters, val: u32); } impl RtcRtpEncodingParameters { #[doc = "Construct a new `RtcRtpEncodingParameters`."] @@ -19,142 +142,59 @@ impl RtcRtpEncodingParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `active` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[deprecated = "Use `set_active()` instead."] pub fn active(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("active"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_active(val); self } #[cfg(feature = "RtcDegradationPreference")] - #[doc = "Change the `degradationPreference` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcDegradationPreference`, `RtcRtpEncodingParameters`*"] + #[deprecated = "Use `set_degradation_preference()` instead."] pub fn degradation_preference(&mut self, val: RtcDegradationPreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("degradationPreference"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_degradation_preference(val); self } #[cfg(feature = "RtcFecParameters")] - #[doc = "Change the `fec` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`, `RtcRtpEncodingParameters`*"] + #[deprecated = "Use `set_fec()` instead."] pub fn fec(&mut self, val: &RtcFecParameters) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fec(val); self } - #[doc = "Change the `maxBitrate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[deprecated = "Use `set_max_bitrate()` instead."] pub fn max_bitrate(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("maxBitrate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_max_bitrate(val); self } #[cfg(feature = "RtcPriorityType")] - #[doc = "Change the `priority` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcPriorityType`, `RtcRtpEncodingParameters`*"] + #[deprecated = "Use `set_priority()` instead."] pub fn priority(&mut self, val: RtcPriorityType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("priority"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_priority(val); self } - #[doc = "Change the `rid` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[deprecated = "Use `set_rid()` instead."] pub fn rid(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rid(val); self } #[cfg(feature = "RtcRtxParameters")] - #[doc = "Change the `rtx` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`, `RtcRtxParameters`*"] + #[deprecated = "Use `set_rtx()` instead."] pub fn rtx(&mut self, val: &RtcRtxParameters) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rtx"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rtx(val); self } - #[doc = "Change the `scaleResolutionDownBy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_scalability_mode()` instead."] + pub fn scalability_mode(&mut self, val: &str) -> &mut Self { + self.set_scalability_mode(val); + self + } + #[deprecated = "Use `set_scale_resolution_down_by()` instead."] pub fn scale_resolution_down_by(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scaleResolutionDownBy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_scale_resolution_down_by(val); self } - #[doc = "Change the `ssrc` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"] + #[deprecated = "Use `set_ssrc()` instead."] pub fn ssrc(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssrc(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs b/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs new file mode 100644 index 00000000000..d5558465825 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionCapability.rs @@ -0,0 +1,39 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpHeaderExtensionCapability)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcRtpHeaderExtensionCapability` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] + pub type RtcRtpHeaderExtensionCapability; + #[doc = "Get the `uri` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] + #[wasm_bindgen(method, getter = "uri")] + pub fn get_uri(this: &RtcRtpHeaderExtensionCapability) -> ::alloc::string::String; + #[doc = "Change the `uri` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] + #[wasm_bindgen(method, setter = "uri")] + pub fn set_uri(this: &RtcRtpHeaderExtensionCapability, val: &str); +} +impl RtcRtpHeaderExtensionCapability { + #[doc = "Construct a new `RtcRtpHeaderExtensionCapability`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionCapability`*"] + pub fn new(uri: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_uri(uri); + ret + } + #[deprecated = "Use `set_uri()` instead."] + pub fn uri(&mut self, val: &str) -> &mut Self { + self.set_uri(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionParameters.rs b/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionParameters.rs index 5523869a37d..c4818dc3e5f 100644 --- a/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtpHeaderExtensionParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] pub type RtcRtpHeaderExtensionParameters; + #[doc = "Get the `encrypted` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[wasm_bindgen(method, getter = "encrypted")] + pub fn get_encrypted(this: &RtcRtpHeaderExtensionParameters) -> Option; + #[doc = "Change the `encrypted` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[wasm_bindgen(method, setter = "encrypted")] + pub fn set_encrypted(this: &RtcRtpHeaderExtensionParameters, val: bool); + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcRtpHeaderExtensionParameters) -> Option; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcRtpHeaderExtensionParameters, val: u16); + #[doc = "Get the `uri` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[wasm_bindgen(method, getter = "uri")] + pub fn get_uri(this: &RtcRtpHeaderExtensionParameters) -> Option<::alloc::string::String>; + #[doc = "Change the `uri` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[wasm_bindgen(method, setter = "uri")] + pub fn set_uri(this: &RtcRtpHeaderExtensionParameters, val: &str); } impl RtcRtpHeaderExtensionParameters { #[doc = "Construct a new `RtcRtpHeaderExtensionParameters`."] @@ -19,47 +50,19 @@ impl RtcRtpHeaderExtensionParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `encrypted` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[deprecated = "Use `set_encrypted()` instead."] pub fn encrypted(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("encrypted"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_encrypted(val); self } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpHeaderExtensionParameters`*"] + #[deprecated = "Use `set_uri()` instead."] pub fn uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("uri"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_uri(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpParameters.rs b/crates/web-sys/src/features/gen_RtcRtpParameters.rs index 7b413d27512..cd4bd2fa35a 100644 --- a/crates/web-sys/src/features/gen_RtcRtpParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtpParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] pub type RtcRtpParameters; + #[doc = "Get the `codecs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[wasm_bindgen(method, getter = "codecs")] + pub fn get_codecs(this: &RtcRtpParameters) -> Option<::js_sys::Array>; + #[doc = "Change the `codecs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[wasm_bindgen(method, setter = "codecs")] + pub fn set_codecs(this: &RtcRtpParameters, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `encodings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[wasm_bindgen(method, getter = "encodings")] + pub fn get_encodings(this: &RtcRtpParameters) -> Option<::js_sys::Array>; + #[doc = "Change the `encodings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[wasm_bindgen(method, setter = "encodings")] + pub fn set_encodings(this: &RtcRtpParameters, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `headerExtensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[wasm_bindgen(method, getter = "headerExtensions")] + pub fn get_header_extensions(this: &RtcRtpParameters) -> Option<::js_sys::Array>; + #[doc = "Change the `headerExtensions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[wasm_bindgen(method, setter = "headerExtensions")] + pub fn set_header_extensions(this: &RtcRtpParameters, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "RtcRtcpParameters")] + #[doc = "Get the `rtcp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`, `RtcRtpParameters`*"] + #[wasm_bindgen(method, getter = "rtcp")] + pub fn get_rtcp(this: &RtcRtpParameters) -> Option; + #[cfg(feature = "RtcRtcpParameters")] + #[doc = "Change the `rtcp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`, `RtcRtpParameters`*"] + #[wasm_bindgen(method, setter = "rtcp")] + pub fn set_rtcp(this: &RtcRtpParameters, val: &RtcRtcpParameters); } impl RtcRtpParameters { #[doc = "Construct a new `RtcRtpParameters`."] @@ -19,66 +62,25 @@ impl RtcRtpParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `codecs` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[deprecated = "Use `set_codecs()` instead."] pub fn codecs(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codecs"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_codecs(val); self } - #[doc = "Change the `encodings` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[deprecated = "Use `set_encodings()` instead."] pub fn encodings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("encodings"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_encodings(val); self } - #[doc = "Change the `headerExtensions` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpParameters`*"] + #[deprecated = "Use `set_header_extensions()` instead."] pub fn header_extensions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("headerExtensions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_header_extensions(val); self } #[cfg(feature = "RtcRtcpParameters")] - #[doc = "Change the `rtcp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtcpParameters`, `RtcRtpParameters`*"] + #[deprecated = "Use `set_rtcp()` instead."] pub fn rtcp(&mut self, val: &RtcRtcpParameters) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rtcp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rtcp(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpReceiver.rs b/crates/web-sys/src/features/gen_RtcRtpReceiver.rs index ee09e08053a..424f32a5ada 100644 --- a/crates/web-sys/src/features/gen_RtcRtpReceiver.rs +++ b/crates/web-sys/src/features/gen_RtcRtpReceiver.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -19,6 +20,80 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcRtpReceiver`*"] pub fn track(this: &RtcRtpReceiver) -> MediaStreamTrack; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "RTCRtpReceiver" , js_name = jitterBufferTarget)] + #[doc = "Getter for the `jitterBufferTarget` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/jitterBufferTarget)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn jitter_buffer_target(this: &RtcRtpReceiver) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , catch , method , setter , js_class = "RTCRtpReceiver" , js_name = jitterBufferTarget)] + #[doc = "Setter for the `jitterBufferTarget` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/jitterBufferTarget)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_jitter_buffer_target( + this: &RtcRtpReceiver, + value: Option, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "RTCRtpReceiver" , js_name = transform)] + #[doc = "Getter for the `transform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn transform(this: &RtcRtpReceiver) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransform")] + # [wasm_bindgen (structural , method , setter , js_class = "RTCRtpReceiver" , js_name = transform)] + #[doc = "Setter for the `transform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_transform_opt_s_frame_transform( + this: &RtcRtpReceiver, + value: Option<&SFrameTransform>, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcRtpScriptTransform")] + # [wasm_bindgen (structural , method , setter , js_class = "RTCRtpReceiver" , js_name = transform)] + #[doc = "Setter for the `transform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `RtcRtpScriptTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_transform_opt_rtc_rtp_script_transform( + this: &RtcRtpReceiver, + value: Option<&RtcRtpScriptTransform>, + ); + #[cfg(feature = "RtcRtpCapabilities")] + # [wasm_bindgen (static_method_of = RtcRtpReceiver , js_class = "RTCRtpReceiver" , js_name = getCapabilities)] + #[doc = "The `getCapabilities()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getCapabilities_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`, `RtcRtpReceiver`*"] + pub fn get_capabilities(kind: &str) -> Option; # [wasm_bindgen (method , structural , js_class = "RTCRtpReceiver" , js_name = getContributingSources)] #[doc = "The `getContributingSources()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_RtcRtpScriptTransform.rs b/crates/web-sys/src/features/gen_RtcRtpScriptTransform.rs new file mode 100644 index 00000000000..196091bf213 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcRtpScriptTransform.rs @@ -0,0 +1,62 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpScriptTransform , typescript_type = "RTCRtpScriptTransform")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcRtpScriptTransform` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RtcRtpScriptTransform; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Worker")] + #[wasm_bindgen(catch, constructor, js_class = "RTCRtpScriptTransform")] + #[doc = "The `new RtcRtpScriptTransform(..)` constructor, creating a new instance of `RtcRtpScriptTransform`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransform/RTCRtpScriptTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransform`, `Worker`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(worker: &Worker) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Worker")] + #[wasm_bindgen(catch, constructor, js_class = "RTCRtpScriptTransform")] + #[doc = "The `new RtcRtpScriptTransform(..)` constructor, creating a new instance of `RtcRtpScriptTransform`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransform/RTCRtpScriptTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransform`, `Worker`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_options( + worker: &Worker, + options: &::wasm_bindgen::JsValue, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Worker")] + #[wasm_bindgen(catch, constructor, js_class = "RTCRtpScriptTransform")] + #[doc = "The `new RtcRtpScriptTransform(..)` constructor, creating a new instance of `RtcRtpScriptTransform`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransform/RTCRtpScriptTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransform`, `Worker`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_options_and_transfer( + worker: &Worker, + options: &::wasm_bindgen::JsValue, + transfer: &::wasm_bindgen::JsValue, + ) -> Result; +} diff --git a/crates/web-sys/src/features/gen_RtcRtpScriptTransformer.rs b/crates/web-sys/src/features/gen_RtcRtpScriptTransformer.rs new file mode 100644 index 00000000000..77a39edbe77 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcRtpScriptTransformer.rs @@ -0,0 +1,115 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = RTCRtpScriptTransformer , typescript_type = "RTCRtpScriptTransformer")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcRtpScriptTransformer` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RtcRtpScriptTransformer; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCRtpScriptTransformer" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `RtcRtpScriptTransformer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &RtcRtpScriptTransformer) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCRtpScriptTransformer" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &RtcRtpScriptTransformer) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "RTCRtpScriptTransformer" , js_name = onkeyframerequest)] + #[doc = "Getter for the `onkeyframerequest` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer/onkeyframerequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onkeyframerequest(this: &RtcRtpScriptTransformer) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "RTCRtpScriptTransformer" , js_name = onkeyframerequest)] + #[doc = "Setter for the `onkeyframerequest` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer/onkeyframerequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onkeyframerequest( + this: &RtcRtpScriptTransformer, + value: Option<&::js_sys::Function>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "RTCRtpScriptTransformer" , js_name = options)] + #[doc = "Getter for the `options` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer/options)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn options(this: &RtcRtpScriptTransformer) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "RTCRtpScriptTransformer" , js_name = generateKeyFrame)] + #[doc = "The `generateKeyFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer/generateKeyFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn generate_key_frame(this: &RtcRtpScriptTransformer) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "RTCRtpScriptTransformer" , js_name = generateKeyFrame)] + #[doc = "The `generateKeyFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer/generateKeyFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn generate_key_frame_with_rid( + this: &RtcRtpScriptTransformer, + rid: &str, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "RTCRtpScriptTransformer" , js_name = sendKeyFrameRequest)] + #[doc = "The `sendKeyFrameRequest()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpScriptTransformer/sendKeyFrameRequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn send_key_frame_request(this: &RtcRtpScriptTransformer) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_RtcRtpSender.rs b/crates/web-sys/src/features/gen_RtcRtpSender.rs index 8de87c61b10..f01fbedf868 100644 --- a/crates/web-sys/src/features/gen_RtcRtpSender.rs +++ b/crates/web-sys/src/features/gen_RtcRtpSender.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -27,6 +28,80 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSender`, `RtcdtmfSender`*"] pub fn dtmf(this: &RtcRtpSender) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "RTCRtpSender" , js_name = transform)] + #[doc = "Getter for the `transform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/transform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSender`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn transform(this: &RtcRtpSender) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransform")] + # [wasm_bindgen (structural , method , setter , js_class = "RTCRtpSender" , js_name = transform)] + #[doc = "Setter for the `transform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/transform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSender`, `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_transform_opt_s_frame_transform( + this: &RtcRtpSender, + value: Option<&SFrameTransform>, + ); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcRtpScriptTransform")] + # [wasm_bindgen (structural , method , setter , js_class = "RTCRtpSender" , js_name = transform)] + #[doc = "Setter for the `transform` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/transform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransform`, `RtcRtpSender`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_transform_opt_rtc_rtp_script_transform( + this: &RtcRtpSender, + value: Option<&RtcRtpScriptTransform>, + ); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "RTCRtpSender" , js_name = generateKeyFrame)] + #[doc = "The `generateKeyFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/generateKeyFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSender`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn generate_key_frame(this: &RtcRtpSender) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "RTCRtpSender" , js_name = generateKeyFrame)] + #[doc = "The `generateKeyFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/generateKeyFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSender`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn generate_key_frame_with_rids( + this: &RtcRtpSender, + rids: &::wasm_bindgen::JsValue, + ) -> ::js_sys::Promise; + #[cfg(feature = "RtcRtpCapabilities")] + # [wasm_bindgen (static_method_of = RtcRtpSender , js_class = "RTCRtpSender" , js_name = getCapabilities)] + #[doc = "The `getCapabilities()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/getCapabilities_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCapabilities`, `RtcRtpSender`*"] + pub fn get_capabilities(kind: &str) -> Option; #[cfg(feature = "RtcRtpParameters")] # [wasm_bindgen (method , structural , js_class = "RTCRtpSender" , js_name = getParameters)] #[doc = "The `getParameters()` method."] diff --git a/crates/web-sys/src/features/gen_RtcRtpSourceEntry.rs b/crates/web-sys/src/features/gen_RtcRtpSourceEntry.rs index a4673ba5200..49f4cd6976a 100644 --- a/crates/web-sys/src/features/gen_RtcRtpSourceEntry.rs +++ b/crates/web-sys/src/features/gen_RtcRtpSourceEntry.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] pub type RtcRtpSourceEntry; + #[doc = "Get the `audioLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[wasm_bindgen(method, getter = "audioLevel")] + pub fn get_audio_level(this: &RtcRtpSourceEntry) -> Option; + #[doc = "Change the `audioLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[wasm_bindgen(method, setter = "audioLevel")] + pub fn set_audio_level(this: &RtcRtpSourceEntry, val: f64); + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &RtcRtpSourceEntry) -> u32; + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &RtcRtpSourceEntry, val: u32); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcRtpSourceEntry) -> f64; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcRtpSourceEntry, val: f64); + #[doc = "Get the `voiceActivityFlag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[wasm_bindgen(method, getter = "voiceActivityFlag")] + pub fn get_voice_activity_flag(this: &RtcRtpSourceEntry) -> Option; + #[doc = "Change the `voiceActivityFlag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[wasm_bindgen(method, setter = "voiceActivityFlag")] + pub fn set_voice_activity_flag(this: &RtcRtpSourceEntry, val: Option); + #[cfg(feature = "RtcRtpSourceEntryType")] + #[doc = "Get the `sourceType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`, `RtcRtpSourceEntryType`*"] + #[wasm_bindgen(method, getter = "sourceType")] + pub fn get_source_type(this: &RtcRtpSourceEntry) -> RtcRtpSourceEntryType; + #[cfg(feature = "RtcRtpSourceEntryType")] + #[doc = "Change the `sourceType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`, `RtcRtpSourceEntryType`*"] + #[wasm_bindgen(method, setter = "sourceType")] + pub fn set_source_type(this: &RtcRtpSourceEntry, val: RtcRtpSourceEntryType); } impl RtcRtpSourceEntry { #[cfg(feature = "RtcRtpSourceEntryType")] @@ -18,92 +71,35 @@ impl RtcRtpSourceEntry { pub fn new(source: u32, timestamp: f64, source_type: RtcRtpSourceEntryType) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.source(source); - ret.timestamp(timestamp); - ret.source_type(source_type); + ret.set_source(source); + ret.set_timestamp(timestamp); + ret.set_source_type(source_type); ret } - #[doc = "Change the `audioLevel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[deprecated = "Use `set_audio_level()` instead."] pub fn audio_level(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio_level(val); self } - #[doc = "Change the `source` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[deprecated = "Use `set_source()` instead."] pub fn source(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } - #[doc = "Change the `voiceActivityFlag` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"] + #[deprecated = "Use `set_voice_activity_flag()` instead."] pub fn voice_activity_flag(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("voiceActivityFlag"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_voice_activity_flag(val); self } #[cfg(feature = "RtcRtpSourceEntryType")] - #[doc = "Change the `sourceType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`, `RtcRtpSourceEntryType`*"] + #[deprecated = "Use `set_source_type()` instead."] pub fn source_type(&mut self, val: RtcRtpSourceEntryType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sourceType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source_type(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpSourceEntryType.rs b/crates/web-sys/src/features/gen_RtcRtpSourceEntryType.rs index e9c709edb01..e1e26ef677c 100644 --- a/crates/web-sys/src/features/gen_RtcRtpSourceEntryType.rs +++ b/crates/web-sys/src/features/gen_RtcRtpSourceEntryType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcRtpSourceEntryType` enum."] diff --git a/crates/web-sys/src/features/gen_RtcRtpSynchronizationSource.rs b/crates/web-sys/src/features/gen_RtcRtpSynchronizationSource.rs index dcab4408333..df855761ab6 100644 --- a/crates/web-sys/src/features/gen_RtcRtpSynchronizationSource.rs +++ b/crates/web-sys/src/features/gen_RtcRtpSynchronizationSource.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] pub type RtcRtpSynchronizationSource; + #[doc = "Get the `audioLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[wasm_bindgen(method, getter = "audioLevel")] + pub fn get_audio_level(this: &RtcRtpSynchronizationSource) -> Option; + #[doc = "Change the `audioLevel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[wasm_bindgen(method, setter = "audioLevel")] + pub fn set_audio_level(this: &RtcRtpSynchronizationSource, val: f64); + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &RtcRtpSynchronizationSource) -> u32; + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &RtcRtpSynchronizationSource, val: u32); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcRtpSynchronizationSource) -> f64; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcRtpSynchronizationSource, val: f64); + #[doc = "Get the `voiceActivityFlag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[wasm_bindgen(method, getter = "voiceActivityFlag")] + pub fn get_voice_activity_flag(this: &RtcRtpSynchronizationSource) -> Option; + #[doc = "Change the `voiceActivityFlag` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[wasm_bindgen(method, setter = "voiceActivityFlag")] + pub fn set_voice_activity_flag(this: &RtcRtpSynchronizationSource, val: Option); } impl RtcRtpSynchronizationSource { #[doc = "Construct a new `RtcRtpSynchronizationSource`."] @@ -17,73 +58,28 @@ impl RtcRtpSynchronizationSource { pub fn new(source: u32, timestamp: f64) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.source(source); - ret.timestamp(timestamp); + ret.set_source(source); + ret.set_timestamp(timestamp); ret } - #[doc = "Change the `audioLevel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[deprecated = "Use `set_audio_level()` instead."] pub fn audio_level(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("audioLevel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_audio_level(val); self } - #[doc = "Change the `source` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[deprecated = "Use `set_source()` instead."] pub fn source(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } - #[doc = "Change the `voiceActivityFlag` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"] + #[deprecated = "Use `set_voice_activity_flag()` instead."] pub fn voice_activity_flag(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("voiceActivityFlag"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_voice_activity_flag(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtpTransceiver.rs b/crates/web-sys/src/features/gen_RtcRtpTransceiver.rs index 6d6eaf25159..1f7ddb8ceff 100644 --- a/crates/web-sys/src/features/gen_RtcRtpTransceiver.rs +++ b/crates/web-sys/src/features/gen_RtcRtpTransceiver.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver/mid)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`*"] - pub fn mid(this: &RtcRtpTransceiver) -> Option; + pub fn mid(this: &RtcRtpTransceiver) -> Option<::alloc::string::String>; #[cfg(feature = "RtcRtpSender")] # [wasm_bindgen (structural , method , getter , js_class = "RTCRtpTransceiver" , js_name = sender)] #[doc = "Getter for the `sender` field of this object."] @@ -71,7 +72,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver/getRemoteTrackId)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`*"] - pub fn get_remote_track_id(this: &RtcRtpTransceiver) -> String; + pub fn get_remote_track_id(this: &RtcRtpTransceiver) -> ::alloc::string::String; + # [wasm_bindgen (method , structural , js_class = "RTCRtpTransceiver" , js_name = setCodecPreferences)] + #[doc = "The `setCodecPreferences()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver/setCodecPreferences)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`*"] + pub fn set_codec_preferences(this: &RtcRtpTransceiver, codecs: &::wasm_bindgen::JsValue); # [wasm_bindgen (method , structural , js_class = "RTCRtpTransceiver" , js_name = stop)] #[doc = "The `stop()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_RtcRtpTransceiverDirection.rs b/crates/web-sys/src/features/gen_RtcRtpTransceiverDirection.rs index 60a8f98f9ad..cdbbdd8c522 100644 --- a/crates/web-sys/src/features/gen_RtcRtpTransceiverDirection.rs +++ b/crates/web-sys/src/features/gen_RtcRtpTransceiverDirection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcRtpTransceiverDirection` enum."] @@ -10,4 +11,5 @@ pub enum RtcRtpTransceiverDirection { Sendonly = "sendonly", Recvonly = "recvonly", Inactive = "inactive", + Stopped = "stopped", } diff --git a/crates/web-sys/src/features/gen_RtcRtpTransceiverInit.rs b/crates/web-sys/src/features/gen_RtcRtpTransceiverInit.rs index 3f6836a6b24..e0aae6edc7c 100644 --- a/crates/web-sys/src/features/gen_RtcRtpTransceiverInit.rs +++ b/crates/web-sys/src/features/gen_RtcRtpTransceiverInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] pub type RtcRtpTransceiverInit; + #[cfg(feature = "RtcRtpTransceiverDirection")] + #[doc = "Get the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverDirection`, `RtcRtpTransceiverInit`*"] + #[wasm_bindgen(method, getter = "direction")] + pub fn get_direction(this: &RtcRtpTransceiverInit) -> Option; + #[cfg(feature = "RtcRtpTransceiverDirection")] + #[doc = "Change the `direction` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverDirection`, `RtcRtpTransceiverInit`*"] + #[wasm_bindgen(method, setter = "direction")] + pub fn set_direction(this: &RtcRtpTransceiverInit, val: RtcRtpTransceiverDirection); + #[doc = "Get the `sendEncodings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] + #[wasm_bindgen(method, getter = "sendEncodings")] + pub fn get_send_encodings(this: &RtcRtpTransceiverInit) -> Option<::js_sys::Array>; + #[doc = "Change the `sendEncodings` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] + #[wasm_bindgen(method, setter = "sendEncodings")] + pub fn set_send_encodings(this: &RtcRtpTransceiverInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `streams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] + #[wasm_bindgen(method, getter = "streams")] + pub fn get_streams(this: &RtcRtpTransceiverInit) -> Option<::js_sys::Array>; + #[doc = "Change the `streams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] + #[wasm_bindgen(method, setter = "streams")] + pub fn set_streams(this: &RtcRtpTransceiverInit, val: &::wasm_bindgen::JsValue); } impl RtcRtpTransceiverInit { #[doc = "Construct a new `RtcRtpTransceiverInit`."] @@ -20,38 +53,19 @@ impl RtcRtpTransceiverInit { ret } #[cfg(feature = "RtcRtpTransceiverDirection")] - #[doc = "Change the `direction` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverDirection`, `RtcRtpTransceiverInit`*"] + #[deprecated = "Use `set_direction()` instead."] pub fn direction(&mut self, val: RtcRtpTransceiverDirection) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("direction"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_direction(val); self } - #[doc = "Change the `streams` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiverInit`*"] + #[deprecated = "Use `set_send_encodings()` instead."] + pub fn send_encodings(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_send_encodings(val); + self + } + #[deprecated = "Use `set_streams()` instead."] pub fn streams(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("streams"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_streams(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcRtxParameters.rs b/crates/web-sys/src/features/gen_RtcRtxParameters.rs index 7540a981321..6fef2de956b 100644 --- a/crates/web-sys/src/features/gen_RtcRtxParameters.rs +++ b/crates/web-sys/src/features/gen_RtcRtxParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcRtxParameters`*"] pub type RtcRtxParameters; + #[doc = "Get the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtxParameters`*"] + #[wasm_bindgen(method, getter = "ssrc")] + pub fn get_ssrc(this: &RtcRtxParameters) -> Option; + #[doc = "Change the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtxParameters`*"] + #[wasm_bindgen(method, setter = "ssrc")] + pub fn set_ssrc(this: &RtcRtxParameters, val: u32); } impl RtcRtxParameters { #[doc = "Construct a new `RtcRtxParameters`."] @@ -19,17 +30,9 @@ impl RtcRtxParameters { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `ssrc` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtxParameters`*"] + #[deprecated = "Use `set_ssrc()` instead."] pub fn ssrc(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssrc(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcSdpType.rs b/crates/web-sys/src/features/gen_RtcSdpType.rs index deaa3430956..4babb126b88 100644 --- a/crates/web-sys/src/features/gen_RtcSdpType.rs +++ b/crates/web-sys/src/features/gen_RtcSdpType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcSdpType` enum."] diff --git a/crates/web-sys/src/features/gen_RtcSessionDescription.rs b/crates/web-sys/src/features/gen_RtcSessionDescription.rs index 975d098e5e8..6f3df92d131 100644 --- a/crates/web-sys/src/features/gen_RtcSessionDescription.rs +++ b/crates/web-sys/src/features/gen_RtcSessionDescription.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -33,7 +34,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription/sdp)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescription`*"] - pub fn sdp(this: &RtcSessionDescription) -> String; + pub fn sdp(this: &RtcSessionDescription) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "RTCSessionDescription" , js_name = sdp)] #[doc = "Setter for the `sdp` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_RtcSessionDescriptionInit.rs b/crates/web-sys/src/features/gen_RtcSessionDescriptionInit.rs index 72ed9cc342d..c1ecf69cad2 100644 --- a/crates/web-sys/src/features/gen_RtcSessionDescriptionInit.rs +++ b/crates/web-sys/src/features/gen_RtcSessionDescriptionInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"] pub type RtcSessionDescriptionInit; + #[doc = "Get the `sdp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"] + #[wasm_bindgen(method, getter = "sdp")] + pub fn get_sdp(this: &RtcSessionDescriptionInit) -> Option<::alloc::string::String>; + #[doc = "Change the `sdp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"] + #[wasm_bindgen(method, setter = "sdp")] + pub fn set_sdp(this: &RtcSessionDescriptionInit, val: &str); + #[cfg(feature = "RtcSdpType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcSdpType`, `RtcSessionDescriptionInit`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcSessionDescriptionInit) -> RtcSdpType; + #[cfg(feature = "RtcSdpType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcSdpType`, `RtcSessionDescriptionInit`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcSessionDescriptionInit, val: RtcSdpType); } impl RtcSessionDescriptionInit { #[cfg(feature = "RtcSdpType")] @@ -18,34 +41,18 @@ impl RtcSessionDescriptionInit { pub fn new(type_: RtcSdpType) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.type_(type_); + ret.set_type(type_); ret } - #[doc = "Change the `sdp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"] + #[deprecated = "Use `set_sdp()` instead."] pub fn sdp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sdp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sdp(val); self } #[cfg(feature = "RtcSdpType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcSdpType`, `RtcSessionDescriptionInit`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcSdpType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcSignalingState.rs b/crates/web-sys/src/features/gen_RtcSignalingState.rs index 9fa4c48e6e1..a735f367086 100644 --- a/crates/web-sys/src/features/gen_RtcSignalingState.rs +++ b/crates/web-sys/src/features/gen_RtcSignalingState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcSignalingState` enum."] diff --git a/crates/web-sys/src/features/gen_RtcStats.rs b/crates/web-sys/src/features/gen_RtcStats.rs index fc54145da8a..3c9d2245f87 100644 --- a/crates/web-sys/src/features/gen_RtcStats.rs +++ b/crates/web-sys/src/features/gen_RtcStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] pub type RtcStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStats`, `RtcStatsType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcStats, val: RtcStatsType); } impl RtcStats { #[doc = "Construct a new `RtcStats`."] @@ -19,48 +52,20 @@ impl RtcStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStats`, `RtcStatsType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcStatsIceCandidatePairState.rs b/crates/web-sys/src/features/gen_RtcStatsIceCandidatePairState.rs index 0cad390dc39..fe5b41e58a8 100644 --- a/crates/web-sys/src/features/gen_RtcStatsIceCandidatePairState.rs +++ b/crates/web-sys/src/features/gen_RtcStatsIceCandidatePairState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcStatsIceCandidatePairState` enum."] diff --git a/crates/web-sys/src/features/gen_RtcStatsIceCandidateType.rs b/crates/web-sys/src/features/gen_RtcStatsIceCandidateType.rs index 0756f85e3c1..3d6084246c0 100644 --- a/crates/web-sys/src/features/gen_RtcStatsIceCandidateType.rs +++ b/crates/web-sys/src/features/gen_RtcStatsIceCandidateType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcStatsIceCandidateType` enum."] diff --git a/crates/web-sys/src/features/gen_RtcStatsReport.rs b/crates/web-sys/src/features/gen_RtcStatsReport.rs index 5d419f22854..ae199acb573 100644 --- a/crates/web-sys/src/features/gen_RtcStatsReport.rs +++ b/crates/web-sys/src/features/gen_RtcStatsReport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -11,4 +12,53 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReport`*"] pub type RtcStatsReport; + # [wasm_bindgen (structural , method , getter , js_class = "RTCStatsReport" , 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/RTCStatsReport/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReport`*"] + pub fn size(this: &RtcStatsReport) -> u32; + # [wasm_bindgen (method , structural , js_class = "RTCStatsReport" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReport`*"] + pub fn entries(this: &RtcStatsReport) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "RTCStatsReport" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReport`*"] + pub fn for_each(this: &RtcStatsReport, callback: &::js_sys::Function) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "RTCStatsReport" , js_name = get)] + #[doc = "The `get()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport/get)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReport`*"] + pub fn get(this: &RtcStatsReport, key: &str) -> Option<::js_sys::Object>; + # [wasm_bindgen (method , structural , js_class = "RTCStatsReport" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReport`*"] + pub fn has(this: &RtcStatsReport, key: &str) -> bool; + # [wasm_bindgen (method , structural , js_class = "RTCStatsReport" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReport`*"] + pub fn keys(this: &RtcStatsReport) -> ::js_sys::Iterator; + # [wasm_bindgen (method , structural , js_class = "RTCStatsReport" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReport`*"] + pub fn values(this: &RtcStatsReport) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_RtcStatsReportInternal.rs b/crates/web-sys/src/features/gen_RtcStatsReportInternal.rs index 5b285c2b590..1f363bf7bcf 100644 --- a/crates/web-sys/src/features/gen_RtcStatsReportInternal.rs +++ b/crates/web-sys/src/features/gen_RtcStatsReportInternal.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,238 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] pub type RtcStatsReportInternal; + #[doc = "Get the `closed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "closed")] + pub fn get_closed(this: &RtcStatsReportInternal) -> Option; + #[doc = "Change the `closed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "closed")] + pub fn set_closed(this: &RtcStatsReportInternal, val: bool); + #[doc = "Get the `codecStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "codecStats")] + pub fn get_codec_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `codecStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "codecStats")] + pub fn set_codec_stats(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `iceCandidatePairStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "iceCandidatePairStats")] + pub fn get_ice_candidate_pair_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `iceCandidatePairStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "iceCandidatePairStats")] + pub fn set_ice_candidate_pair_stats( + this: &RtcStatsReportInternal, + val: &::wasm_bindgen::JsValue, + ); + #[doc = "Get the `iceCandidateStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "iceCandidateStats")] + pub fn get_ice_candidate_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `iceCandidateStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "iceCandidateStats")] + pub fn set_ice_candidate_stats(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `iceComponentStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "iceComponentStats")] + pub fn get_ice_component_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `iceComponentStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "iceComponentStats")] + pub fn set_ice_component_stats(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `iceRestarts` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "iceRestarts")] + pub fn get_ice_restarts(this: &RtcStatsReportInternal) -> Option; + #[doc = "Change the `iceRestarts` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "iceRestarts")] + pub fn set_ice_restarts(this: &RtcStatsReportInternal, val: u32); + #[doc = "Get the `iceRollbacks` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "iceRollbacks")] + pub fn get_ice_rollbacks(this: &RtcStatsReportInternal) -> Option; + #[doc = "Change the `iceRollbacks` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "iceRollbacks")] + pub fn set_ice_rollbacks(this: &RtcStatsReportInternal, val: u32); + #[doc = "Get the `inboundRTPStreamStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "inboundRTPStreamStats")] + pub fn get_inbound_rtp_stream_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `inboundRTPStreamStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "inboundRTPStreamStats")] + pub fn set_inbound_rtp_stream_stats( + this: &RtcStatsReportInternal, + val: &::wasm_bindgen::JsValue, + ); + #[doc = "Get the `localSdp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "localSdp")] + pub fn get_local_sdp(this: &RtcStatsReportInternal) -> Option<::alloc::string::String>; + #[doc = "Change the `localSdp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "localSdp")] + pub fn set_local_sdp(this: &RtcStatsReportInternal, val: &str); + #[doc = "Get the `mediaStreamStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "mediaStreamStats")] + pub fn get_media_stream_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `mediaStreamStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "mediaStreamStats")] + pub fn set_media_stream_stats(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `mediaStreamTrackStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "mediaStreamTrackStats")] + pub fn get_media_stream_track_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `mediaStreamTrackStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "mediaStreamTrackStats")] + pub fn set_media_stream_track_stats( + this: &RtcStatsReportInternal, + val: &::wasm_bindgen::JsValue, + ); + #[doc = "Get the `offerer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "offerer")] + pub fn get_offerer(this: &RtcStatsReportInternal) -> Option; + #[doc = "Change the `offerer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "offerer")] + pub fn set_offerer(this: &RtcStatsReportInternal, val: bool); + #[doc = "Get the `outboundRTPStreamStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "outboundRTPStreamStats")] + pub fn get_outbound_rtp_stream_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `outboundRTPStreamStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "outboundRTPStreamStats")] + pub fn set_outbound_rtp_stream_stats( + this: &RtcStatsReportInternal, + val: &::wasm_bindgen::JsValue, + ); + #[doc = "Get the `pcid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "pcid")] + pub fn get_pcid(this: &RtcStatsReportInternal) -> Option<::alloc::string::String>; + #[doc = "Change the `pcid` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "pcid")] + pub fn set_pcid(this: &RtcStatsReportInternal, val: &str); + #[doc = "Get the `rawLocalCandidates` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "rawLocalCandidates")] + pub fn get_raw_local_candidates(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `rawLocalCandidates` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "rawLocalCandidates")] + pub fn set_raw_local_candidates(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `rawRemoteCandidates` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "rawRemoteCandidates")] + pub fn get_raw_remote_candidates(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `rawRemoteCandidates` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "rawRemoteCandidates")] + pub fn set_raw_remote_candidates(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `remoteSdp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "remoteSdp")] + pub fn get_remote_sdp(this: &RtcStatsReportInternal) -> Option<::alloc::string::String>; + #[doc = "Change the `remoteSdp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "remoteSdp")] + pub fn set_remote_sdp(this: &RtcStatsReportInternal, val: &str); + #[doc = "Get the `rtpContributingSourceStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "rtpContributingSourceStats")] + pub fn get_rtp_contributing_source_stats( + this: &RtcStatsReportInternal, + ) -> Option<::js_sys::Array>; + #[doc = "Change the `rtpContributingSourceStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "rtpContributingSourceStats")] + pub fn set_rtp_contributing_source_stats( + this: &RtcStatsReportInternal, + val: &::wasm_bindgen::JsValue, + ); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcStatsReportInternal) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcStatsReportInternal, val: f64); + #[doc = "Get the `transportStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "transportStats")] + pub fn get_transport_stats(this: &RtcStatsReportInternal) -> Option<::js_sys::Array>; + #[doc = "Change the `transportStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "transportStats")] + pub fn set_transport_stats(this: &RtcStatsReportInternal, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `trickledIceCandidateStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, getter = "trickledIceCandidateStats")] + pub fn get_trickled_ice_candidate_stats( + this: &RtcStatsReportInternal, + ) -> Option<::js_sys::Array>; + #[doc = "Change the `trickledIceCandidateStats` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[wasm_bindgen(method, setter = "trickledIceCandidateStats")] + pub fn set_trickled_ice_candidate_stats( + this: &RtcStatsReportInternal, + val: &::wasm_bindgen::JsValue, + ); } impl RtcStatsReportInternal { #[doc = "Construct a new `RtcStatsReportInternal`."] @@ -19,354 +252,109 @@ impl RtcStatsReportInternal { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `closed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_closed()` instead."] pub fn closed(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("closed"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_closed(val); self } - #[doc = "Change the `codecStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_codec_stats()` instead."] pub fn codec_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codecStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_codec_stats(val); self } - #[doc = "Change the `iceCandidatePairStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_ice_candidate_pair_stats()` instead."] pub fn ice_candidate_pair_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceCandidatePairStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ice_candidate_pair_stats(val); self } - #[doc = "Change the `iceCandidateStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_ice_candidate_stats()` instead."] pub fn ice_candidate_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceCandidateStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ice_candidate_stats(val); self } - #[doc = "Change the `iceComponentStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_ice_component_stats()` instead."] pub fn ice_component_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceComponentStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ice_component_stats(val); self } - #[doc = "Change the `iceRestarts` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_ice_restarts()` instead."] pub fn ice_restarts(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceRestarts"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ice_restarts(val); self } - #[doc = "Change the `iceRollbacks` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_ice_rollbacks()` instead."] pub fn ice_rollbacks(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("iceRollbacks"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ice_rollbacks(val); self } - #[doc = "Change the `inboundRTPStreamStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_inbound_rtp_stream_stats()` instead."] pub fn inbound_rtp_stream_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inboundRTPStreamStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_inbound_rtp_stream_stats(val); self } - #[doc = "Change the `localSdp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_local_sdp()` instead."] pub fn local_sdp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localSdp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_local_sdp(val); self } - #[doc = "Change the `mediaStreamStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_media_stream_stats()` instead."] pub fn media_stream_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaStreamStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_stream_stats(val); self } - #[doc = "Change the `mediaStreamTrackStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_media_stream_track_stats()` instead."] pub fn media_stream_track_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaStreamTrackStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_stream_track_stats(val); self } - #[doc = "Change the `offerer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_offerer()` instead."] pub fn offerer(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("offerer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_offerer(val); self } - #[doc = "Change the `outboundRTPStreamStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_outbound_rtp_stream_stats()` instead."] pub fn outbound_rtp_stream_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("outboundRTPStreamStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_outbound_rtp_stream_stats(val); self } - #[doc = "Change the `pcid` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_pcid()` instead."] pub fn pcid(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pcid"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pcid(val); self } - #[doc = "Change the `rawLocalCandidates` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_raw_local_candidates()` instead."] pub fn raw_local_candidates(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rawLocalCandidates"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_raw_local_candidates(val); self } - #[doc = "Change the `rawRemoteCandidates` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_raw_remote_candidates()` instead."] pub fn raw_remote_candidates(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rawRemoteCandidates"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_raw_remote_candidates(val); self } - #[doc = "Change the `remoteSdp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_remote_sdp()` instead."] pub fn remote_sdp(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteSdp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_sdp(val); self } - #[doc = "Change the `rtpContributingSourceStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_rtp_contributing_source_stats()` instead."] pub fn rtp_contributing_source_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rtpContributingSourceStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rtp_contributing_source_stats(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } - #[doc = "Change the `transportStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_transport_stats()` instead."] pub fn transport_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transport_stats(val); self } - #[doc = "Change the `trickledIceCandidateStats` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsReportInternal`*"] + #[deprecated = "Use `set_trickled_ice_candidate_stats()` instead."] pub fn trickled_ice_candidate_stats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("trickledIceCandidateStats"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_trickled_ice_candidate_stats(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcStatsType.rs b/crates/web-sys/src/features/gen_RtcStatsType.rs index 777c8d17816..2670a3a879b 100644 --- a/crates/web-sys/src/features/gen_RtcStatsType.rs +++ b/crates/web-sys/src/features/gen_RtcStatsType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `RtcStatsType` enum."] diff --git a/crates/web-sys/src/features/gen_RtcTrackEvent.rs b/crates/web-sys/src/features/gen_RtcTrackEvent.rs index 69870c1a305..ef00b497f8d 100644 --- a/crates/web-sys/src/features/gen_RtcTrackEvent.rs +++ b/crates/web-sys/src/features/gen_RtcTrackEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_RtcTrackEventInit.rs b/crates/web-sys/src/features/gen_RtcTrackEventInit.rs index a8c8031da0b..ef9451b3105 100644 --- a/crates/web-sys/src/features/gen_RtcTrackEventInit.rs +++ b/crates/web-sys/src/features/gen_RtcTrackEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,82 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] pub type RtcTrackEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &RtcTrackEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &RtcTrackEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &RtcTrackEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &RtcTrackEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &RtcTrackEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &RtcTrackEventInit, val: bool); + #[cfg(feature = "RtcRtpReceiver")] + #[doc = "Get the `receiver` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `RtcTrackEventInit`*"] + #[wasm_bindgen(method, getter = "receiver")] + pub fn get_receiver(this: &RtcTrackEventInit) -> RtcRtpReceiver; + #[cfg(feature = "RtcRtpReceiver")] + #[doc = "Change the `receiver` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `RtcTrackEventInit`*"] + #[wasm_bindgen(method, setter = "receiver")] + pub fn set_receiver(this: &RtcTrackEventInit, val: &RtcRtpReceiver); + #[doc = "Get the `streams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[wasm_bindgen(method, getter = "streams")] + pub fn get_streams(this: &RtcTrackEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `streams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[wasm_bindgen(method, setter = "streams")] + pub fn set_streams(this: &RtcTrackEventInit, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "MediaStreamTrack")] + #[doc = "Get the `track` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcTrackEventInit`*"] + #[wasm_bindgen(method, getter = "track")] + pub fn get_track(this: &RtcTrackEventInit) -> MediaStreamTrack; + #[cfg(feature = "MediaStreamTrack")] + #[doc = "Change the `track` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcTrackEventInit`*"] + #[wasm_bindgen(method, setter = "track")] + pub fn set_track(this: &RtcTrackEventInit, val: &MediaStreamTrack); + #[cfg(feature = "RtcRtpTransceiver")] + #[doc = "Get the `transceiver` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`, `RtcTrackEventInit`*"] + #[wasm_bindgen(method, getter = "transceiver")] + pub fn get_transceiver(this: &RtcTrackEventInit) -> RtcRtpTransceiver; + #[cfg(feature = "RtcRtpTransceiver")] + #[doc = "Change the `transceiver` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`, `RtcTrackEventInit`*"] + #[wasm_bindgen(method, setter = "transceiver")] + pub fn set_transceiver(this: &RtcTrackEventInit, val: &RtcRtpTransceiver); } impl RtcTrackEventInit { #[cfg(all( @@ -26,127 +103,47 @@ impl RtcTrackEventInit { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.receiver(receiver); - ret.track(track); - ret.transceiver(transceiver); + ret.set_receiver(receiver); + ret.set_track(track); + ret.set_transceiver(transceiver); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "RtcRtpReceiver")] - #[doc = "Change the `receiver` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpReceiver`, `RtcTrackEventInit`*"] + #[deprecated = "Use `set_receiver()` instead."] pub fn receiver(&mut self, val: &RtcRtpReceiver) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("receiver"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_receiver(val); self } - #[doc = "Change the `streams` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcTrackEventInit`*"] + #[deprecated = "Use `set_streams()` instead."] pub fn streams(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("streams"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_streams(val); self } #[cfg(feature = "MediaStreamTrack")] - #[doc = "Change the `track` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `RtcTrackEventInit`*"] + #[deprecated = "Use `set_track()` instead."] pub fn track(&mut self, val: &MediaStreamTrack) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("track"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_track(val); self } #[cfg(feature = "RtcRtpTransceiver")] - #[doc = "Change the `transceiver` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcRtpTransceiver`, `RtcTrackEventInit`*"] + #[deprecated = "Use `set_transceiver()` instead."] pub fn transceiver(&mut self, val: &RtcRtpTransceiver) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transceiver"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transceiver(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcTransformEvent.rs b/crates/web-sys/src/features/gen_RtcTransformEvent.rs new file mode 100644 index 00000000000..68975654017 --- /dev/null +++ b/crates/web-sys/src/features/gen_RtcTransformEvent.rs @@ -0,0 +1,31 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = RTCTransformEvent , typescript_type = "RTCTransformEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `RtcTransformEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCTransformEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransformEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type RtcTransformEvent; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "RtcRtpScriptTransformer")] + # [wasm_bindgen (structural , method , getter , js_class = "RTCTransformEvent" , js_name = transformer)] + #[doc = "Getter for the `transformer` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCTransformEvent/transformer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcRtpScriptTransformer`, `RtcTransformEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn transformer(this: &RtcTransformEvent) -> RtcRtpScriptTransformer; +} diff --git a/crates/web-sys/src/features/gen_RtcTransportStats.rs b/crates/web-sys/src/features/gen_RtcTransportStats.rs index bfe856e27fe..b0ef75d0eba 100644 --- a/crates/web-sys/src/features/gen_RtcTransportStats.rs +++ b/crates/web-sys/src/features/gen_RtcTransportStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] pub type RtcTransportStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcTransportStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcTransportStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcTransportStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcTransportStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcTransportStats`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcTransportStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcTransportStats`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcTransportStats, val: RtcStatsType); + #[doc = "Get the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[wasm_bindgen(method, getter = "bytesReceived")] + pub fn get_bytes_received(this: &RtcTransportStats) -> Option; + #[doc = "Change the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[wasm_bindgen(method, setter = "bytesReceived")] + pub fn set_bytes_received(this: &RtcTransportStats, val: u32); + #[doc = "Get the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[wasm_bindgen(method, getter = "bytesSent")] + pub fn get_bytes_sent(this: &RtcTransportStats) -> Option; + #[doc = "Change the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[wasm_bindgen(method, setter = "bytesSent")] + pub fn set_bytes_sent(this: &RtcTransportStats, val: u32); } impl RtcTransportStats { #[doc = "Construct a new `RtcTransportStats`."] @@ -19,82 +72,30 @@ impl RtcTransportStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcTransportStats`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `bytesReceived` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[deprecated = "Use `set_bytes_received()` instead."] pub fn bytes_received(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesReceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes_received(val); self } - #[doc = "Change the `bytesSent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcTransportStats`*"] + #[deprecated = "Use `set_bytes_sent()` instead."] pub fn bytes_sent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bytesSent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bytes_sent(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcdtmfSender.rs b/crates/web-sys/src/features/gen_RtcdtmfSender.rs index 8feda592ed0..78a92e9db17 100644 --- a/crates/web-sys/src/features/gen_RtcdtmfSender.rs +++ b/crates/web-sys/src/features/gen_RtcdtmfSender.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFSender/toneBuffer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcdtmfSender`*"] - pub fn tone_buffer(this: &RtcdtmfSender) -> String; + pub fn tone_buffer(this: &RtcdtmfSender) -> ::alloc::string::String; # [wasm_bindgen (method , structural , js_class = "RTCDTMFSender" , js_name = insertDTMF)] #[doc = "The `insertDTMF()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_RtcdtmfToneChangeEvent.rs b/crates/web-sys/src/features/gen_RtcdtmfToneChangeEvent.rs index 3d513d29484..c85f9982f22 100644 --- a/crates/web-sys/src/features/gen_RtcdtmfToneChangeEvent.rs +++ b/crates/web-sys/src/features/gen_RtcdtmfToneChangeEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFToneChangeEvent/tone)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEvent`*"] - pub fn tone(this: &RtcdtmfToneChangeEvent) -> String; + pub fn tone(this: &RtcdtmfToneChangeEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "RTCDTMFToneChangeEvent")] #[doc = "The `new RtcdtmfToneChangeEvent(..)` constructor, creating a new instance of `RtcdtmfToneChangeEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_RtcdtmfToneChangeEventInit.rs b/crates/web-sys/src/features/gen_RtcdtmfToneChangeEventInit.rs index eb6479aa456..40d76056c2b 100644 --- a/crates/web-sys/src/features/gen_RtcdtmfToneChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_RtcdtmfToneChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] pub type RtcdtmfToneChangeEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &RtcdtmfToneChangeEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &RtcdtmfToneChangeEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &RtcdtmfToneChangeEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &RtcdtmfToneChangeEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &RtcdtmfToneChangeEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &RtcdtmfToneChangeEventInit, val: bool); + #[doc = "Get the `tone` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[wasm_bindgen(method, getter = "tone")] + pub fn get_tone(this: &RtcdtmfToneChangeEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `tone` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[wasm_bindgen(method, setter = "tone")] + pub fn set_tone(this: &RtcdtmfToneChangeEventInit, val: &str); } impl RtcdtmfToneChangeEventInit { #[doc = "Construct a new `RtcdtmfToneChangeEventInit`."] @@ -19,68 +60,24 @@ impl RtcdtmfToneChangeEventInit { 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: `RtcdtmfToneChangeEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `tone` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcdtmfToneChangeEventInit`*"] + #[deprecated = "Use `set_tone()` instead."] pub fn tone(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tone"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_tone(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcrtpContributingSourceStats.rs b/crates/web-sys/src/features/gen_RtcrtpContributingSourceStats.rs index 46b293ae005..cfc4afcd035 100644 --- a/crates/web-sys/src/features/gen_RtcrtpContributingSourceStats.rs +++ b/crates/web-sys/src/features/gen_RtcrtpContributingSourceStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,60 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] pub type RtcrtpContributingSourceStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcrtpContributingSourceStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcrtpContributingSourceStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcrtpContributingSourceStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcrtpContributingSourceStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcrtpContributingSourceStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcrtpContributingSourceStats, val: RtcStatsType); + #[doc = "Get the `contributorSsrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, getter = "contributorSsrc")] + pub fn get_contributor_ssrc(this: &RtcrtpContributingSourceStats) -> Option; + #[doc = "Change the `contributorSsrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, setter = "contributorSsrc")] + pub fn set_contributor_ssrc(this: &RtcrtpContributingSourceStats, val: u32); + #[doc = "Get the `inboundRtpStreamId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, getter = "inboundRtpStreamId")] + pub fn get_inbound_rtp_stream_id( + this: &RtcrtpContributingSourceStats, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `inboundRtpStreamId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[wasm_bindgen(method, setter = "inboundRtpStreamId")] + pub fn set_inbound_rtp_stream_id(this: &RtcrtpContributingSourceStats, val: &str); } impl RtcrtpContributingSourceStats { #[doc = "Construct a new `RtcrtpContributingSourceStats`."] @@ -19,82 +74,30 @@ impl RtcrtpContributingSourceStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpContributingSourceStats`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `contributorSsrc` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[deprecated = "Use `set_contributor_ssrc()` instead."] pub fn contributor_ssrc(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("contributorSsrc"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_contributor_ssrc(val); self } - #[doc = "Change the `inboundRtpStreamId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"] + #[deprecated = "Use `set_inbound_rtp_stream_id()` instead."] pub fn inbound_rtp_stream_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inboundRtpStreamId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_inbound_rtp_stream_id(val); self } } diff --git a/crates/web-sys/src/features/gen_RtcrtpStreamStats.rs b/crates/web-sys/src/features/gen_RtcrtpStreamStats.rs index 8982a8eaece..c2941657c1a 100644 --- a/crates/web-sys/src/features/gen_RtcrtpStreamStats.rs +++ b/crates/web-sys/src/features/gen_RtcrtpStreamStats.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,178 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] pub type RtcrtpStreamStats; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &RtcrtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &RtcrtpStreamStats, val: &str); + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &RtcrtpStreamStats, val: f64); + #[cfg(feature = "RtcStatsType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &RtcrtpStreamStats) -> Option; + #[cfg(feature = "RtcStatsType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &RtcrtpStreamStats, val: RtcStatsType); + #[doc = "Get the `bitrateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "bitrateMean")] + pub fn get_bitrate_mean(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `bitrateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "bitrateMean")] + pub fn set_bitrate_mean(this: &RtcrtpStreamStats, val: f64); + #[doc = "Get the `bitrateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "bitrateStdDev")] + pub fn get_bitrate_std_dev(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `bitrateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "bitrateStdDev")] + pub fn set_bitrate_std_dev(this: &RtcrtpStreamStats, val: f64); + #[doc = "Get the `codecId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "codecId")] + pub fn get_codec_id(this: &RtcrtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `codecId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "codecId")] + pub fn set_codec_id(this: &RtcrtpStreamStats, val: &str); + #[doc = "Get the `firCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "firCount")] + pub fn get_fir_count(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `firCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "firCount")] + pub fn set_fir_count(this: &RtcrtpStreamStats, val: u32); + #[doc = "Get the `framerateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "framerateMean")] + pub fn get_framerate_mean(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `framerateMean` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "framerateMean")] + pub fn set_framerate_mean(this: &RtcrtpStreamStats, val: f64); + #[doc = "Get the `framerateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "framerateStdDev")] + pub fn get_framerate_std_dev(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `framerateStdDev` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "framerateStdDev")] + pub fn set_framerate_std_dev(this: &RtcrtpStreamStats, val: f64); + #[doc = "Get the `isRemote` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "isRemote")] + pub fn get_is_remote(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `isRemote` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "isRemote")] + pub fn set_is_remote(this: &RtcrtpStreamStats, val: bool); + #[doc = "Get the `mediaTrackId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "mediaTrackId")] + pub fn get_media_track_id(this: &RtcrtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `mediaTrackId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "mediaTrackId")] + pub fn set_media_track_id(this: &RtcrtpStreamStats, val: &str); + #[doc = "Get the `mediaType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "mediaType")] + pub fn get_media_type(this: &RtcrtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `mediaType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "mediaType")] + pub fn set_media_type(this: &RtcrtpStreamStats, val: &str); + #[doc = "Get the `nackCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "nackCount")] + pub fn get_nack_count(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `nackCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "nackCount")] + pub fn set_nack_count(this: &RtcrtpStreamStats, val: u32); + #[doc = "Get the `pliCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "pliCount")] + pub fn get_pli_count(this: &RtcrtpStreamStats) -> Option; + #[doc = "Change the `pliCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "pliCount")] + pub fn set_pli_count(this: &RtcrtpStreamStats, val: u32); + #[doc = "Get the `remoteId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "remoteId")] + pub fn get_remote_id(this: &RtcrtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `remoteId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "remoteId")] + pub fn set_remote_id(this: &RtcrtpStreamStats, val: &str); + #[doc = "Get the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "ssrc")] + pub fn get_ssrc(this: &RtcrtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `ssrc` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "ssrc")] + pub fn set_ssrc(this: &RtcrtpStreamStats, val: &str); + #[doc = "Get the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, getter = "transportId")] + pub fn get_transport_id(this: &RtcrtpStreamStats) -> Option<::alloc::string::String>; + #[doc = "Change the `transportId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[wasm_bindgen(method, setter = "transportId")] + pub fn set_transport_id(this: &RtcrtpStreamStats, val: &str); } impl RtcrtpStreamStats { #[doc = "Construct a new `RtcrtpStreamStats`."] @@ -19,282 +192,90 @@ impl RtcrtpStreamStats { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `id` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_id()` instead."] pub fn id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("id"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_id(val); self } - #[doc = "Change the `timestamp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_timestamp()` instead."] pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_timestamp(val); self } #[cfg(feature = "RtcStatsType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: RtcStatsType) -> &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.set_type(val); self } - #[doc = "Change the `bitrateMean` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_bitrate_mean()` instead."] pub fn bitrate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bitrate_mean(val); self } - #[doc = "Change the `bitrateStdDev` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_bitrate_std_dev()` instead."] pub fn bitrate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("bitrateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_bitrate_std_dev(val); self } - #[doc = "Change the `codecId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_codec_id()` instead."] pub fn codec_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codecId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_codec_id(val); self } - #[doc = "Change the `firCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_fir_count()` instead."] pub fn fir_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("firCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fir_count(val); self } - #[doc = "Change the `framerateMean` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_framerate_mean()` instead."] pub fn framerate_mean(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateMean"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_framerate_mean(val); self } - #[doc = "Change the `framerateStdDev` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_framerate_std_dev()` instead."] pub fn framerate_std_dev(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerateStdDev"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_framerate_std_dev(val); self } - #[doc = "Change the `isRemote` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_is_remote()` instead."] pub fn is_remote(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("isRemote"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_is_remote(val); self } - #[doc = "Change the `mediaTrackId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_media_track_id()` instead."] pub fn media_track_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaTrackId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_track_id(val); self } - #[doc = "Change the `mediaType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_media_type()` instead."] pub fn media_type(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("mediaType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_media_type(val); self } - #[doc = "Change the `nackCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_nack_count()` instead."] pub fn nack_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("nackCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_nack_count(val); self } - #[doc = "Change the `pliCount` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_pli_count()` instead."] pub fn pli_count(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("pliCount"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pli_count(val); self } - #[doc = "Change the `remoteId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_remote_id()` instead."] pub fn remote_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_id(val); self } - #[doc = "Change the `ssrc` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_ssrc()` instead."] pub fn ssrc(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ssrc(val); self } - #[doc = "Change the `transportId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RtcrtpStreamStats`*"] + #[deprecated = "Use `set_transport_id()` instead."] pub fn transport_id(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transportId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transport_id(val); self } } diff --git a/crates/web-sys/src/features/gen_SFrameTransform.rs b/crates/web-sys/src/features/gen_SFrameTransform.rs new file mode 100644 index 00000000000..ade06fff155 --- /dev/null +++ b/crates/web-sys/src/features/gen_SFrameTransform.rs @@ -0,0 +1,132 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = SFrameTransform , typescript_type = "SFrameTransform")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SFrameTransform` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SFrameTransform; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "SFrameTransform" , js_name = onerror)] + #[doc = "Getter for the `onerror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/onerror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onerror(this: &SFrameTransform) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "SFrameTransform" , js_name = onerror)] + #[doc = "Setter for the `onerror` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/onerror)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onerror(this: &SFrameTransform, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "SFrameTransform" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &SFrameTransform) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "SFrameTransform" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransform`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &SFrameTransform) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "SFrameTransform")] + #[doc = "The `new SFrameTransform(..)` constructor, creating a new instance of `SFrameTransform`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/SFrameTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformOptions")] + #[wasm_bindgen(catch, constructor, js_class = "SFrameTransform")] + #[doc = "The `new SFrameTransform(..)` constructor, creating a new instance of `SFrameTransform`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/SFrameTransform)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransform`, `SFrameTransformOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_options(options: &SFrameTransformOptions) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (method , structural , js_class = "SFrameTransform" , js_name = setEncryptionKey)] + #[doc = "The `setEncryptionKey()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/setEncryptionKey)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_encryption_key(this: &SFrameTransform, key: &CryptoKey) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (method , structural , js_class = "SFrameTransform" , js_name = setEncryptionKey)] + #[doc = "The `setEncryptionKey()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/setEncryptionKey)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_encryption_key_with_u32( + this: &SFrameTransform, + key: &CryptoKey, + key_id: u32, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (method , structural , js_class = "SFrameTransform" , js_name = setEncryptionKey)] + #[doc = "The `setEncryptionKey()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransform/setEncryptionKey)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SFrameTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_encryption_key_with_f64( + this: &SFrameTransform, + key: &CryptoKey, + key_id: f64, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_SFrameTransformErrorEvent.rs b/crates/web-sys/src/features/gen_SFrameTransformErrorEvent.rs new file mode 100644 index 00000000000..51b78448c26 --- /dev/null +++ b/crates/web-sys/src/features/gen_SFrameTransformErrorEvent.rs @@ -0,0 +1,68 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = SFrameTransformErrorEvent , typescript_type = "SFrameTransformErrorEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SFrameTransformErrorEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransformErrorEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SFrameTransformErrorEvent; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformErrorEventType")] + # [wasm_bindgen (structural , method , getter , js_class = "SFrameTransformErrorEvent" , js_name = errorType)] + #[doc = "Getter for the `errorType` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransformErrorEvent/errorType)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEvent`, `SFrameTransformErrorEventType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn error_type(this: &SFrameTransformErrorEvent) -> SFrameTransformErrorEventType; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "SFrameTransformErrorEvent" , js_name = keyID)] + #[doc = "Getter for the `keyID` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransformErrorEvent/keyID)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn key_id(this: &SFrameTransformErrorEvent) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "SFrameTransformErrorEvent" , js_name = frame)] + #[doc = "Getter for the `frame` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransformErrorEvent/frame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn frame(this: &SFrameTransformErrorEvent) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformErrorEventInit")] + #[wasm_bindgen(catch, constructor, js_class = "SFrameTransformErrorEvent")] + #[doc = "The `new SFrameTransformErrorEvent(..)` constructor, creating a new instance of `SFrameTransformErrorEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SFrameTransformErrorEvent/SFrameTransformErrorEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEvent`, `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + type_: &str, + event_init_dict: &SFrameTransformErrorEventInit, + ) -> Result; +} diff --git a/crates/web-sys/src/features/gen_SFrameTransformErrorEventInit.rs b/crates/web-sys/src/features/gen_SFrameTransformErrorEventInit.rs new file mode 100644 index 00000000000..790305d64ee --- /dev/null +++ b/crates/web-sys/src/features/gen_SFrameTransformErrorEventInit.rs @@ -0,0 +1,181 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SFrameTransformErrorEventInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SFrameTransformErrorEventInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SFrameTransformErrorEventInit; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &SFrameTransformErrorEventInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &SFrameTransformErrorEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &SFrameTransformErrorEventInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &SFrameTransformErrorEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &SFrameTransformErrorEventInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &SFrameTransformErrorEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformErrorEventType")] + #[doc = "Get the `errorType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`, `SFrameTransformErrorEventType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "errorType")] + pub fn get_error_type(this: &SFrameTransformErrorEventInit) -> SFrameTransformErrorEventType; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformErrorEventType")] + #[doc = "Change the `errorType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`, `SFrameTransformErrorEventType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "errorType")] + pub fn set_error_type(this: &SFrameTransformErrorEventInit, val: SFrameTransformErrorEventType); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `frame` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "frame")] + pub fn get_frame(this: &SFrameTransformErrorEventInit) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `frame` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "frame")] + pub fn set_frame(this: &SFrameTransformErrorEventInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `keyID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "keyID")] + pub fn get_key_id(this: &SFrameTransformErrorEventInit) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `keyID` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "keyID")] + pub fn set_key_id(this: &SFrameTransformErrorEventInit, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl SFrameTransformErrorEventInit { + #[cfg(feature = "SFrameTransformErrorEventType")] + #[doc = "Construct a new `SFrameTransformErrorEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventInit`, `SFrameTransformErrorEventType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(error_type: SFrameTransformErrorEventType, frame: &::wasm_bindgen::JsValue) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_error_type(error_type); + ret.set_frame(frame); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformErrorEventType")] + #[deprecated = "Use `set_error_type()` instead."] + pub fn error_type(&mut self, val: SFrameTransformErrorEventType) -> &mut Self { + self.set_error_type(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_frame()` instead."] + pub fn frame(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_frame(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_key_id()` instead."] + pub fn key_id(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { + self.set_key_id(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); + self + } +} diff --git a/crates/web-sys/src/features/gen_SFrameTransformErrorEventType.rs b/crates/web-sys/src/features/gen_SFrameTransformErrorEventType.rs new file mode 100644 index 00000000000..9bd1e81e9f1 --- /dev/null +++ b/crates/web-sys/src/features/gen_SFrameTransformErrorEventType.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `SFrameTransformErrorEventType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `SFrameTransformErrorEventType`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum SFrameTransformErrorEventType { + Authentication = "authentication", + KeyId = "keyID", + Syntax = "syntax", +} diff --git a/crates/web-sys/src/features/gen_SFrameTransformOptions.rs b/crates/web-sys/src/features/gen_SFrameTransformOptions.rs new file mode 100644 index 00000000000..eca2ad5f175 --- /dev/null +++ b/crates/web-sys/src/features/gen_SFrameTransformOptions.rs @@ -0,0 +1,64 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SFrameTransformOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SFrameTransformOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SFrameTransformOptions; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformRole")] + #[doc = "Get the `role` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformOptions`, `SFrameTransformRole`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "role")] + pub fn get_role(this: &SFrameTransformOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformRole")] + #[doc = "Change the `role` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformOptions`, `SFrameTransformRole`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "role")] + pub fn set_role(this: &SFrameTransformOptions, val: SFrameTransformRole); +} +#[cfg(web_sys_unstable_apis)] +impl SFrameTransformOptions { + #[doc = "Construct a new `SFrameTransformOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SFrameTransformOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SFrameTransformRole")] + #[deprecated = "Use `set_role()` instead."] + pub fn role(&mut self, val: SFrameTransformRole) -> &mut Self { + self.set_role(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for SFrameTransformOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_SFrameTransformRole.rs b/crates/web-sys/src/features/gen_SFrameTransformRole.rs new file mode 100644 index 00000000000..7556496670e --- /dev/null +++ b/crates/web-sys/src/features/gen_SFrameTransformRole.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `SFrameTransformRole` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `SFrameTransformRole`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum SFrameTransformRole { + Encrypt = "encrypt", + Decrypt = "decrypt", +} diff --git a/crates/web-sys/src/features/gen_SaveFilePickerOptions.rs b/crates/web-sys/src/features/gen_SaveFilePickerOptions.rs new file mode 100644 index 00000000000..efff6185b3a --- /dev/null +++ b/crates/web-sys/src/features/gen_SaveFilePickerOptions.rs @@ -0,0 +1,157 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SaveFilePickerOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SaveFilePickerOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SaveFilePickerOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `excludeAcceptAllOption` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "excludeAcceptAllOption")] + pub fn get_exclude_accept_all_option(this: &SaveFilePickerOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `excludeAcceptAllOption` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "excludeAcceptAllOption")] + pub fn set_exclude_accept_all_option(this: &SaveFilePickerOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &SaveFilePickerOptions) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &SaveFilePickerOptions, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `startIn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "startIn")] + pub fn get_start_in(this: &SaveFilePickerOptions) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `startIn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "startIn")] + pub fn set_start_in(this: &SaveFilePickerOptions, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `types` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "types")] + pub fn get_types(this: &SaveFilePickerOptions) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `types` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "types")] + pub fn set_types(this: &SaveFilePickerOptions, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `suggestedName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "suggestedName")] + pub fn get_suggested_name(this: &SaveFilePickerOptions) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `suggestedName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "suggestedName")] + pub fn set_suggested_name(this: &SaveFilePickerOptions, val: Option<&str>); +} +#[cfg(web_sys_unstable_apis)] +impl SaveFilePickerOptions { + #[doc = "Construct a new `SaveFilePickerOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_exclude_accept_all_option()` instead."] + pub fn exclude_accept_all_option(&mut self, val: bool) -> &mut Self { + self.set_exclude_accept_all_option(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_start_in()` instead."] + pub fn start_in(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_start_in(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_types()` instead."] + pub fn types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_types(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_suggested_name()` instead."] + pub fn suggested_name(&mut self, val: Option<&str>) -> &mut Self { + self.set_suggested_name(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for SaveFilePickerOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_Scheduler.rs b/crates/web-sys/src/features/gen_Scheduler.rs new file mode 100644 index 00000000000..09966ed0c61 --- /dev/null +++ b/crates/web-sys/src/features/gen_Scheduler.rs @@ -0,0 +1,46 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Scheduler , typescript_type = "Scheduler")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Scheduler` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Scheduler)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Scheduler`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type Scheduler; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Scheduler" , js_name = postTask)] + #[doc = "The `postTask()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Scheduler/postTask)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Scheduler`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn post_task(this: &Scheduler, callback: &::js_sys::Function) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SchedulerPostTaskOptions")] + # [wasm_bindgen (method , structural , js_class = "Scheduler" , js_name = postTask)] + #[doc = "The `postTask()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Scheduler/postTask)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Scheduler`, `SchedulerPostTaskOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn post_task_with_options( + this: &Scheduler, + callback: &::js_sys::Function, + options: &SchedulerPostTaskOptions, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_SchedulerPostTaskOptions.rs b/crates/web-sys/src/features/gen_SchedulerPostTaskOptions.rs new file mode 100644 index 00000000000..367acaf5a16 --- /dev/null +++ b/crates/web-sys/src/features/gen_SchedulerPostTaskOptions.rs @@ -0,0 +1,115 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SchedulerPostTaskOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SchedulerPostTaskOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SchedulerPostTaskOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SchedulerPostTaskOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SchedulerPostTaskOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "delay")] + pub fn get_delay(this: &SchedulerPostTaskOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `delay` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SchedulerPostTaskOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "delay")] + pub fn set_delay(this: &SchedulerPostTaskOptions, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[doc = "Get the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SchedulerPostTaskOptions`, `TaskPriority`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "priority")] + pub fn get_priority(this: &SchedulerPostTaskOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[doc = "Change the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SchedulerPostTaskOptions`, `TaskPriority`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "priority")] + pub fn set_priority(this: &SchedulerPostTaskOptions, val: TaskPriority); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[doc = "Get the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `SchedulerPostTaskOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "signal")] + pub fn get_signal(this: &SchedulerPostTaskOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `SchedulerPostTaskOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "signal")] + pub fn set_signal(this: &SchedulerPostTaskOptions, val: &AbortSignal); +} +#[cfg(web_sys_unstable_apis)] +impl SchedulerPostTaskOptions { + #[doc = "Construct a new `SchedulerPostTaskOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SchedulerPostTaskOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_delay()` instead."] + pub fn delay(&mut self, val: f64) -> &mut Self { + self.set_delay(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[deprecated = "Use `set_priority()` instead."] + pub fn priority(&mut self, val: TaskPriority) -> &mut Self { + self.set_priority(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[deprecated = "Use `set_signal()` instead."] + pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { + self.set_signal(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for SchedulerPostTaskOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_Scheduling.rs b/crates/web-sys/src/features/gen_Scheduling.rs new file mode 100644 index 00000000000..a6f0748e0d6 --- /dev/null +++ b/crates/web-sys/src/features/gen_Scheduling.rs @@ -0,0 +1,45 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Scheduling , typescript_type = "Scheduling")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Scheduling` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Scheduling)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Scheduling`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type Scheduling; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Scheduling" , js_name = isInputPending)] + #[doc = "The `isInputPending()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Scheduling/isInputPending)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Scheduling`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn is_input_pending(this: &Scheduling) -> bool; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "IsInputPendingOptions")] + # [wasm_bindgen (method , structural , js_class = "Scheduling" , js_name = isInputPending)] + #[doc = "The `isInputPending()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Scheduling/isInputPending)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IsInputPendingOptions`, `Scheduling`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn is_input_pending_with_is_input_pending_options( + this: &Scheduling, + is_input_pending_options: &IsInputPendingOptions, + ) -> bool; +} diff --git a/crates/web-sys/src/features/gen_Screen.rs b/crates/web-sys/src/features/gen_Screen.rs index fc2b7a54e2a..ba311afbaf0 100644 --- a/crates/web-sys/src/features/gen_Screen.rs +++ b/crates/web-sys/src/features/gen_Screen.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ScreenColorGamut.rs b/crates/web-sys/src/features/gen_ScreenColorGamut.rs index 354af5c6eb2..d6e752fe5f3 100644 --- a/crates/web-sys/src/features/gen_ScreenColorGamut.rs +++ b/crates/web-sys/src/features/gen_ScreenColorGamut.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ScreenColorGamut` enum."] diff --git a/crates/web-sys/src/features/gen_ScreenLuminance.rs b/crates/web-sys/src/features/gen_ScreenLuminance.rs index 8bdb1ba167f..beb8dbf8f41 100644 --- a/crates/web-sys/src/features/gen_ScreenLuminance.rs +++ b/crates/web-sys/src/features/gen_ScreenLuminance.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ScreenOrientation.rs b/crates/web-sys/src/features/gen_ScreenOrientation.rs index 1e26c3b90b4..2770eb43247 100644 --- a/crates/web-sys/src/features/gen_ScreenOrientation.rs +++ b/crates/web-sys/src/features/gen_ScreenOrientation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ScriptProcessorNode.rs b/crates/web-sys/src/features/gen_ScriptProcessorNode.rs index c213227403f..f89fc872d0e 100644 --- a/crates/web-sys/src/features/gen_ScriptProcessorNode.rs +++ b/crates/web-sys/src/features/gen_ScriptProcessorNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ScrollAreaEvent.rs b/crates/web-sys/src/features/gen_ScrollAreaEvent.rs index c4c5103e4a9..1ddb9eb4c61 100644 --- a/crates/web-sys/src/features/gen_ScrollAreaEvent.rs +++ b/crates/web-sys/src/features/gen_ScrollAreaEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ScrollBehavior.rs b/crates/web-sys/src/features/gen_ScrollBehavior.rs index 9df43cc7391..9170db49c00 100644 --- a/crates/web-sys/src/features/gen_ScrollBehavior.rs +++ b/crates/web-sys/src/features/gen_ScrollBehavior.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ScrollBehavior` enum."] diff --git a/crates/web-sys/src/features/gen_ScrollBoxObject.rs b/crates/web-sys/src/features/gen_ScrollBoxObject.rs index 36749f197e3..83b52feeabf 100644 --- a/crates/web-sys/src/features/gen_ScrollBoxObject.rs +++ b/crates/web-sys/src/features/gen_ScrollBoxObject.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ScrollIntoViewOptions.rs b/crates/web-sys/src/features/gen_ScrollIntoViewOptions.rs index 41bbe879445..ec98659e7e3 100644 --- a/crates/web-sys/src/features/gen_ScrollIntoViewOptions.rs +++ b/crates/web-sys/src/features/gen_ScrollIntoViewOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,42 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`*"] pub type ScrollIntoViewOptions; + #[cfg(feature = "ScrollBehavior")] + #[doc = "Get the `behavior` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollIntoViewOptions`*"] + #[wasm_bindgen(method, getter = "behavior")] + pub fn get_behavior(this: &ScrollIntoViewOptions) -> Option; + #[cfg(feature = "ScrollBehavior")] + #[doc = "Change the `behavior` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollIntoViewOptions`*"] + #[wasm_bindgen(method, setter = "behavior")] + pub fn set_behavior(this: &ScrollIntoViewOptions, val: ScrollBehavior); + #[cfg(feature = "ScrollLogicalPosition")] + #[doc = "Get the `block` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"] + #[wasm_bindgen(method, getter = "block")] + pub fn get_block(this: &ScrollIntoViewOptions) -> Option; + #[cfg(feature = "ScrollLogicalPosition")] + #[doc = "Change the `block` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"] + #[wasm_bindgen(method, setter = "block")] + pub fn set_block(this: &ScrollIntoViewOptions, val: ScrollLogicalPosition); + #[cfg(feature = "ScrollLogicalPosition")] + #[doc = "Get the `inline` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"] + #[wasm_bindgen(method, getter = "inline")] + pub fn get_inline(this: &ScrollIntoViewOptions) -> Option; + #[cfg(feature = "ScrollLogicalPosition")] + #[doc = "Change the `inline` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"] + #[wasm_bindgen(method, setter = "inline")] + pub fn set_inline(this: &ScrollIntoViewOptions, val: ScrollLogicalPosition); } impl ScrollIntoViewOptions { #[doc = "Construct a new `ScrollIntoViewOptions`."] @@ -20,50 +57,21 @@ impl ScrollIntoViewOptions { ret } #[cfg(feature = "ScrollBehavior")] - #[doc = "Change the `behavior` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollIntoViewOptions`*"] + #[deprecated = "Use `set_behavior()` instead."] pub fn behavior(&mut self, val: ScrollBehavior) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("behavior"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_behavior(val); self } #[cfg(feature = "ScrollLogicalPosition")] - #[doc = "Change the `block` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"] + #[deprecated = "Use `set_block()` instead."] pub fn block(&mut self, val: ScrollLogicalPosition) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("block"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_block(val); self } #[cfg(feature = "ScrollLogicalPosition")] - #[doc = "Change the `inline` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollIntoViewOptions`, `ScrollLogicalPosition`*"] + #[deprecated = "Use `set_inline()` instead."] pub fn inline(&mut self, val: ScrollLogicalPosition) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("inline"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_inline(val); self } } diff --git a/crates/web-sys/src/features/gen_ScrollLogicalPosition.rs b/crates/web-sys/src/features/gen_ScrollLogicalPosition.rs index a3643a4fa49..5a3d088688d 100644 --- a/crates/web-sys/src/features/gen_ScrollLogicalPosition.rs +++ b/crates/web-sys/src/features/gen_ScrollLogicalPosition.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ScrollLogicalPosition` enum."] diff --git a/crates/web-sys/src/features/gen_ScrollOptions.rs b/crates/web-sys/src/features/gen_ScrollOptions.rs index 8248151ed3b..0d960dadc0b 100644 --- a/crates/web-sys/src/features/gen_ScrollOptions.rs +++ b/crates/web-sys/src/features/gen_ScrollOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollOptions`*"] pub type ScrollOptions; + #[cfg(feature = "ScrollBehavior")] + #[doc = "Get the `behavior` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollOptions`*"] + #[wasm_bindgen(method, getter = "behavior")] + pub fn get_behavior(this: &ScrollOptions) -> Option; + #[cfg(feature = "ScrollBehavior")] + #[doc = "Change the `behavior` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollOptions`*"] + #[wasm_bindgen(method, setter = "behavior")] + pub fn set_behavior(this: &ScrollOptions, val: ScrollBehavior); } impl ScrollOptions { #[doc = "Construct a new `ScrollOptions`."] @@ -20,21 +33,9 @@ impl ScrollOptions { ret } #[cfg(feature = "ScrollBehavior")] - #[doc = "Change the `behavior` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollOptions`*"] + #[deprecated = "Use `set_behavior()` instead."] pub fn behavior(&mut self, val: ScrollBehavior) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("behavior"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_behavior(val); self } } diff --git a/crates/web-sys/src/features/gen_ScrollRestoration.rs b/crates/web-sys/src/features/gen_ScrollRestoration.rs index 615878089f4..62d6d116d74 100644 --- a/crates/web-sys/src/features/gen_ScrollRestoration.rs +++ b/crates/web-sys/src/features/gen_ScrollRestoration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ScrollRestoration` enum."] diff --git a/crates/web-sys/src/features/gen_ScrollSetting.rs b/crates/web-sys/src/features/gen_ScrollSetting.rs index d4ba6cbf7c1..7f30f8a851f 100644 --- a/crates/web-sys/src/features/gen_ScrollSetting.rs +++ b/crates/web-sys/src/features/gen_ScrollSetting.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ScrollSetting` enum."] diff --git a/crates/web-sys/src/features/gen_ScrollState.rs b/crates/web-sys/src/features/gen_ScrollState.rs index 2af8c7aa4c4..c06431714f8 100644 --- a/crates/web-sys/src/features/gen_ScrollState.rs +++ b/crates/web-sys/src/features/gen_ScrollState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ScrollState` enum."] diff --git a/crates/web-sys/src/features/gen_ScrollToOptions.rs b/crates/web-sys/src/features/gen_ScrollToOptions.rs index 3458f6d5c34..497fdb92371 100644 --- a/crates/web-sys/src/features/gen_ScrollToOptions.rs +++ b/crates/web-sys/src/features/gen_ScrollToOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] pub type ScrollToOptions; + #[cfg(feature = "ScrollBehavior")] + #[doc = "Get the `behavior` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollToOptions`*"] + #[wasm_bindgen(method, getter = "behavior")] + pub fn get_behavior(this: &ScrollToOptions) -> Option; + #[cfg(feature = "ScrollBehavior")] + #[doc = "Change the `behavior` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollToOptions`*"] + #[wasm_bindgen(method, setter = "behavior")] + pub fn set_behavior(this: &ScrollToOptions, val: ScrollBehavior); + #[doc = "Get the `left` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] + #[wasm_bindgen(method, getter = "left")] + pub fn get_left(this: &ScrollToOptions) -> Option; + #[doc = "Change the `left` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] + #[wasm_bindgen(method, setter = "left")] + pub fn set_left(this: &ScrollToOptions, val: f64); + #[doc = "Get the `top` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] + #[wasm_bindgen(method, getter = "top")] + pub fn get_top(this: &ScrollToOptions) -> Option; + #[doc = "Change the `top` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] + #[wasm_bindgen(method, setter = "top")] + pub fn set_top(this: &ScrollToOptions, val: f64); } impl ScrollToOptions { #[doc = "Construct a new `ScrollToOptions`."] @@ -20,47 +53,19 @@ impl ScrollToOptions { ret } #[cfg(feature = "ScrollBehavior")] - #[doc = "Change the `behavior` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`, `ScrollToOptions`*"] + #[deprecated = "Use `set_behavior()` instead."] pub fn behavior(&mut self, val: ScrollBehavior) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("behavior"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_behavior(val); self } - #[doc = "Change the `left` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] + #[deprecated = "Use `set_left()` instead."] pub fn left(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("left"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_left(val); self } - #[doc = "Change the `top` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`*"] + #[deprecated = "Use `set_top()` instead."] pub fn top(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("top"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_top(val); self } } diff --git a/crates/web-sys/src/features/gen_ScrollViewChangeEventInit.rs b/crates/web-sys/src/features/gen_ScrollViewChangeEventInit.rs index 8ea656b578c..1160275d1c0 100644 --- a/crates/web-sys/src/features/gen_ScrollViewChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_ScrollViewChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] pub type ScrollViewChangeEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ScrollViewChangeEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ScrollViewChangeEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ScrollViewChangeEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ScrollViewChangeEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ScrollViewChangeEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ScrollViewChangeEventInit, val: bool); + #[cfg(feature = "ScrollState")] + #[doc = "Get the `state` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollState`, `ScrollViewChangeEventInit`*"] + #[wasm_bindgen(method, getter = "state")] + pub fn get_state(this: &ScrollViewChangeEventInit) -> Option; + #[cfg(feature = "ScrollState")] + #[doc = "Change the `state` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ScrollState`, `ScrollViewChangeEventInit`*"] + #[wasm_bindgen(method, setter = "state")] + pub fn set_state(this: &ScrollViewChangeEventInit, val: ScrollState); } impl ScrollViewChangeEventInit { #[doc = "Construct a new `ScrollViewChangeEventInit`."] @@ -19,69 +62,25 @@ impl ScrollViewChangeEventInit { 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: `ScrollViewChangeEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollViewChangeEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "ScrollState")] - #[doc = "Change the `state` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ScrollState`, `ScrollViewChangeEventInit`*"] + #[deprecated = "Use `set_state()` instead."] pub fn state(&mut self, val: ScrollState) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("state"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_state(val); self } } diff --git a/crates/web-sys/src/features/gen_SecurityPolicyViolationEvent.rs b/crates/web-sys/src/features/gen_SecurityPolicyViolationEvent.rs index 65b354d56a7..139a7501f34 100644 --- a/crates/web-sys/src/features/gen_SecurityPolicyViolationEvent.rs +++ b/crates/web-sys/src/features/gen_SecurityPolicyViolationEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,56 +18,56 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent/documentURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEvent`*"] - pub fn document_uri(this: &SecurityPolicyViolationEvent) -> String; + pub fn document_uri(this: &SecurityPolicyViolationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SecurityPolicyViolationEvent" , js_name = referrer)] #[doc = "Getter for the `referrer` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent/referrer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEvent`*"] - pub fn referrer(this: &SecurityPolicyViolationEvent) -> String; + pub fn referrer(this: &SecurityPolicyViolationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SecurityPolicyViolationEvent" , js_name = blockedURI)] #[doc = "Getter for the `blockedURI` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent/blockedURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEvent`*"] - pub fn blocked_uri(this: &SecurityPolicyViolationEvent) -> String; + pub fn blocked_uri(this: &SecurityPolicyViolationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SecurityPolicyViolationEvent" , js_name = violatedDirective)] #[doc = "Getter for the `violatedDirective` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent/violatedDirective)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEvent`*"] - pub fn violated_directive(this: &SecurityPolicyViolationEvent) -> String; + pub fn violated_directive(this: &SecurityPolicyViolationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SecurityPolicyViolationEvent" , js_name = effectiveDirective)] #[doc = "Getter for the `effectiveDirective` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent/effectiveDirective)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEvent`*"] - pub fn effective_directive(this: &SecurityPolicyViolationEvent) -> String; + pub fn effective_directive(this: &SecurityPolicyViolationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SecurityPolicyViolationEvent" , js_name = originalPolicy)] #[doc = "Getter for the `originalPolicy` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent/originalPolicy)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEvent`*"] - pub fn original_policy(this: &SecurityPolicyViolationEvent) -> String; + pub fn original_policy(this: &SecurityPolicyViolationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SecurityPolicyViolationEvent" , js_name = sourceFile)] #[doc = "Getter for the `sourceFile` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent/sourceFile)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEvent`*"] - pub fn source_file(this: &SecurityPolicyViolationEvent) -> String; + pub fn source_file(this: &SecurityPolicyViolationEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SecurityPolicyViolationEvent" , js_name = sample)] #[doc = "Getter for the `sample` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent/sample)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEvent`*"] - pub fn sample(this: &SecurityPolicyViolationEvent) -> String; + pub fn sample(this: &SecurityPolicyViolationEvent) -> ::alloc::string::String; #[cfg(feature = "SecurityPolicyViolationEventDisposition")] # [wasm_bindgen (structural , method , getter , js_class = "SecurityPolicyViolationEvent" , js_name = disposition)] #[doc = "Getter for the `disposition` field of this object."] diff --git a/crates/web-sys/src/features/gen_SecurityPolicyViolationEventDisposition.rs b/crates/web-sys/src/features/gen_SecurityPolicyViolationEventDisposition.rs index 749e43da59c..38f01f8c441 100644 --- a/crates/web-sys/src/features/gen_SecurityPolicyViolationEventDisposition.rs +++ b/crates/web-sys/src/features/gen_SecurityPolicyViolationEventDisposition.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `SecurityPolicyViolationEventDisposition` enum."] diff --git a/crates/web-sys/src/features/gen_SecurityPolicyViolationEventInit.rs b/crates/web-sys/src/features/gen_SecurityPolicyViolationEventInit.rs index 8170d05ed63..4a798b55318 100644 --- a/crates/web-sys/src/features/gen_SecurityPolicyViolationEventInit.rs +++ b/crates/web-sys/src/features/gen_SecurityPolicyViolationEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,176 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] pub type SecurityPolicyViolationEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &SecurityPolicyViolationEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &SecurityPolicyViolationEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &SecurityPolicyViolationEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &SecurityPolicyViolationEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &SecurityPolicyViolationEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &SecurityPolicyViolationEventInit, val: bool); + #[doc = "Get the `blockedURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "blockedURI")] + pub fn get_blocked_uri( + this: &SecurityPolicyViolationEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `blockedURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "blockedURI")] + pub fn set_blocked_uri(this: &SecurityPolicyViolationEventInit, val: &str); + #[doc = "Get the `columnNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "columnNumber")] + pub fn get_column_number(this: &SecurityPolicyViolationEventInit) -> Option; + #[doc = "Change the `columnNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "columnNumber")] + pub fn set_column_number(this: &SecurityPolicyViolationEventInit, val: i32); + #[cfg(feature = "SecurityPolicyViolationEventDisposition")] + #[doc = "Get the `disposition` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventDisposition`, `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "disposition")] + pub fn get_disposition( + this: &SecurityPolicyViolationEventInit, + ) -> Option; + #[cfg(feature = "SecurityPolicyViolationEventDisposition")] + #[doc = "Change the `disposition` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventDisposition`, `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "disposition")] + pub fn set_disposition( + this: &SecurityPolicyViolationEventInit, + val: SecurityPolicyViolationEventDisposition, + ); + #[doc = "Get the `documentURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "documentURI")] + pub fn get_document_uri( + this: &SecurityPolicyViolationEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `documentURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "documentURI")] + pub fn set_document_uri(this: &SecurityPolicyViolationEventInit, val: &str); + #[doc = "Get the `effectiveDirective` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "effectiveDirective")] + pub fn get_effective_directive( + this: &SecurityPolicyViolationEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `effectiveDirective` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "effectiveDirective")] + pub fn set_effective_directive(this: &SecurityPolicyViolationEventInit, val: &str); + #[doc = "Get the `lineNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "lineNumber")] + pub fn get_line_number(this: &SecurityPolicyViolationEventInit) -> Option; + #[doc = "Change the `lineNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "lineNumber")] + pub fn set_line_number(this: &SecurityPolicyViolationEventInit, val: i32); + #[doc = "Get the `originalPolicy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "originalPolicy")] + pub fn get_original_policy( + this: &SecurityPolicyViolationEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `originalPolicy` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "originalPolicy")] + pub fn set_original_policy(this: &SecurityPolicyViolationEventInit, val: &str); + #[doc = "Get the `referrer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "referrer")] + pub fn get_referrer(this: &SecurityPolicyViolationEventInit) + -> Option<::alloc::string::String>; + #[doc = "Change the `referrer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "referrer")] + pub fn set_referrer(this: &SecurityPolicyViolationEventInit, val: &str); + #[doc = "Get the `sample` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "sample")] + pub fn get_sample(this: &SecurityPolicyViolationEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `sample` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "sample")] + pub fn set_sample(this: &SecurityPolicyViolationEventInit, val: &str); + #[doc = "Get the `sourceFile` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "sourceFile")] + pub fn get_source_file( + this: &SecurityPolicyViolationEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `sourceFile` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "sourceFile")] + pub fn set_source_file(this: &SecurityPolicyViolationEventInit, val: &str); + #[doc = "Get the `statusCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "statusCode")] + pub fn get_status_code(this: &SecurityPolicyViolationEventInit) -> Option; + #[doc = "Change the `statusCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "statusCode")] + pub fn set_status_code(this: &SecurityPolicyViolationEventInit, val: u16); + #[doc = "Get the `violatedDirective` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, getter = "violatedDirective")] + pub fn get_violated_directive( + this: &SecurityPolicyViolationEventInit, + ) -> Option<::alloc::string::String>; + #[doc = "Change the `violatedDirective` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[wasm_bindgen(method, setter = "violatedDirective")] + pub fn set_violated_directive(this: &SecurityPolicyViolationEventInit, val: &str); } impl SecurityPolicyViolationEventInit { #[doc = "Construct a new `SecurityPolicyViolationEventInit`."] @@ -19,257 +190,80 @@ impl SecurityPolicyViolationEventInit { 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: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `blockedURI` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_blocked_uri()` instead."] pub fn blocked_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("blockedURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_blocked_uri(val); self } - #[doc = "Change the `columnNumber` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_column_number()` instead."] pub fn column_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("columnNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_column_number(val); self } #[cfg(feature = "SecurityPolicyViolationEventDisposition")] - #[doc = "Change the `disposition` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventDisposition`, `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_disposition()` instead."] pub fn disposition(&mut self, val: SecurityPolicyViolationEventDisposition) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("disposition"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_disposition(val); self } - #[doc = "Change the `documentURI` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_document_uri()` instead."] pub fn document_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("documentURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_document_uri(val); self } - #[doc = "Change the `effectiveDirective` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_effective_directive()` instead."] pub fn effective_directive(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("effectiveDirective"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_effective_directive(val); self } - #[doc = "Change the `lineNumber` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_line_number()` instead."] pub fn line_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lineNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_line_number(val); self } - #[doc = "Change the `originalPolicy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_original_policy()` instead."] pub fn original_policy(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("originalPolicy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_original_policy(val); self } - #[doc = "Change the `referrer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_referrer()` instead."] pub fn referrer(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_referrer(val); self } - #[doc = "Change the `sample` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_sample()` instead."] pub fn sample(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sample"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sample(val); self } - #[doc = "Change the `sourceFile` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_source_file()` instead."] pub fn source_file(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sourceFile"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source_file(val); self } - #[doc = "Change the `statusCode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_status_code()` instead."] pub fn status_code(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("statusCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_status_code(val); self } - #[doc = "Change the `violatedDirective` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"] + #[deprecated = "Use `set_violated_directive()` instead."] pub fn violated_directive(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("violatedDirective"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_violated_directive(val); self } } diff --git a/crates/web-sys/src/features/gen_Selection.rs b/crates/web-sys/src/features/gen_Selection.rs index d4636464b9b..bd361871871 100644 --- a/crates/web-sys/src/features/gen_Selection.rs +++ b/crates/web-sys/src/features/gen_Selection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -61,7 +62,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Selection`*"] - pub fn type_(this: &Selection) -> String; + pub fn type_(this: &Selection) -> ::alloc::string::String; # [wasm_bindgen (structural , catch , method , getter , js_class = "Selection" , js_name = caretBidiLevel)] #[doc = "Getter for the `caretBidiLevel` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SelectionMode.rs b/crates/web-sys/src/features/gen_SelectionMode.rs new file mode 100644 index 00000000000..5d32722ab2c --- /dev/null +++ b/crates/web-sys/src/features/gen_SelectionMode.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `SelectionMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `SelectionMode`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum SelectionMode { + Select = "select", + Start = "start", + End = "end", + Preserve = "preserve", +} diff --git a/crates/web-sys/src/features/gen_Serial.rs b/crates/web-sys/src/features/gen_Serial.rs new file mode 100644 index 00000000000..1cda2aa4ada --- /dev/null +++ b/crates/web-sys/src/features/gen_Serial.rs @@ -0,0 +1,100 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = Serial , typescript_type = "Serial")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Serial` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Serial)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type Serial; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Serial" , js_name = onconnect)] + #[doc = "Getter for the `onconnect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Serial/onconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onconnect(this: &Serial) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Serial" , js_name = onconnect)] + #[doc = "Setter for the `onconnect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Serial/onconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onconnect(this: &Serial, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Serial" , js_name = ondisconnect)] + #[doc = "Getter for the `ondisconnect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Serial/ondisconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ondisconnect(this: &Serial) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Serial" , js_name = ondisconnect)] + #[doc = "Setter for the `ondisconnect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Serial/ondisconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ondisconnect(this: &Serial, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Serial" , js_name = getPorts)] + #[doc = "The `getPorts()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Serial/getPorts)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_ports(this: &Serial) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "Serial" , js_name = requestPort)] + #[doc = "The `requestPort()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Serial/requestPort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_port(this: &Serial) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SerialPortRequestOptions")] + # [wasm_bindgen (method , structural , js_class = "Serial" , js_name = requestPort)] + #[doc = "The `requestPort()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Serial/requestPort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`, `SerialPortRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_port_with_options( + this: &Serial, + options: &SerialPortRequestOptions, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_SerialInputSignals.rs b/crates/web-sys/src/features/gen_SerialInputSignals.rs new file mode 100644 index 00000000000..74058bb3536 --- /dev/null +++ b/crates/web-sys/src/features/gen_SerialInputSignals.rs @@ -0,0 +1,136 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SerialInputSignals)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SerialInputSignals` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SerialInputSignals; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `clearToSend` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "clearToSend")] + pub fn get_clear_to_send(this: &SerialInputSignals) -> bool; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `clearToSend` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "clearToSend")] + pub fn set_clear_to_send(this: &SerialInputSignals, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `dataCarrierDetect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dataCarrierDetect")] + pub fn get_data_carrier_detect(this: &SerialInputSignals) -> bool; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `dataCarrierDetect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "dataCarrierDetect")] + pub fn set_data_carrier_detect(this: &SerialInputSignals, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `dataSetReady` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dataSetReady")] + pub fn get_data_set_ready(this: &SerialInputSignals) -> bool; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `dataSetReady` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "dataSetReady")] + pub fn set_data_set_ready(this: &SerialInputSignals, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `ringIndicator` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "ringIndicator")] + pub fn get_ring_indicator(this: &SerialInputSignals) -> bool; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `ringIndicator` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "ringIndicator")] + pub fn set_ring_indicator(this: &SerialInputSignals, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl SerialInputSignals { + #[doc = "Construct a new `SerialInputSignals`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialInputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + clear_to_send: bool, + data_carrier_detect: bool, + data_set_ready: bool, + ring_indicator: bool, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_clear_to_send(clear_to_send); + ret.set_data_carrier_detect(data_carrier_detect); + ret.set_data_set_ready(data_set_ready); + ret.set_ring_indicator(ring_indicator); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_clear_to_send()` instead."] + pub fn clear_to_send(&mut self, val: bool) -> &mut Self { + self.set_clear_to_send(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data_carrier_detect()` instead."] + pub fn data_carrier_detect(&mut self, val: bool) -> &mut Self { + self.set_data_carrier_detect(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data_set_ready()` instead."] + pub fn data_set_ready(&mut self, val: bool) -> &mut Self { + self.set_data_set_ready(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_ring_indicator()` instead."] + pub fn ring_indicator(&mut self, val: bool) -> &mut Self { + self.set_ring_indicator(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_SerialOptions.rs b/crates/web-sys/src/features/gen_SerialOptions.rs new file mode 100644 index 00000000000..e82d4e7fe15 --- /dev/null +++ b/crates/web-sys/src/features/gen_SerialOptions.rs @@ -0,0 +1,182 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SerialOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SerialOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SerialOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `baudRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "baudRate")] + pub fn get_baud_rate(this: &SerialOptions) -> u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `baudRate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "baudRate")] + pub fn set_baud_rate(this: &SerialOptions, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bufferSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bufferSize")] + pub fn get_buffer_size(this: &SerialOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bufferSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bufferSize")] + pub fn set_buffer_size(this: &SerialOptions, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `dataBits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dataBits")] + pub fn get_data_bits(this: &SerialOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `dataBits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "dataBits")] + pub fn set_data_bits(this: &SerialOptions, val: u8); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FlowControlType")] + #[doc = "Get the `flowControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FlowControlType`, `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "flowControl")] + pub fn get_flow_control(this: &SerialOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FlowControlType")] + #[doc = "Change the `flowControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FlowControlType`, `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "flowControl")] + pub fn set_flow_control(this: &SerialOptions, val: FlowControlType); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ParityType")] + #[doc = "Get the `parity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ParityType`, `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "parity")] + pub fn get_parity(this: &SerialOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ParityType")] + #[doc = "Change the `parity` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ParityType`, `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "parity")] + pub fn set_parity(this: &SerialOptions, val: ParityType); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `stopBits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stopBits")] + pub fn get_stop_bits(this: &SerialOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `stopBits` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stopBits")] + pub fn set_stop_bits(this: &SerialOptions, val: u8); +} +#[cfg(web_sys_unstable_apis)] +impl SerialOptions { + #[doc = "Construct a new `SerialOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(baud_rate: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_baud_rate(baud_rate); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_baud_rate()` instead."] + pub fn baud_rate(&mut self, val: u32) -> &mut Self { + self.set_baud_rate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_buffer_size()` instead."] + pub fn buffer_size(&mut self, val: u32) -> &mut Self { + self.set_buffer_size(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data_bits()` instead."] + pub fn data_bits(&mut self, val: u8) -> &mut Self { + self.set_data_bits(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "FlowControlType")] + #[deprecated = "Use `set_flow_control()` instead."] + pub fn flow_control(&mut self, val: FlowControlType) -> &mut Self { + self.set_flow_control(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ParityType")] + #[deprecated = "Use `set_parity()` instead."] + pub fn parity(&mut self, val: ParityType) -> &mut Self { + self.set_parity(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stop_bits()` instead."] + pub fn stop_bits(&mut self, val: u8) -> &mut Self { + self.set_stop_bits(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_SerialOutputSignals.rs b/crates/web-sys/src/features/gen_SerialOutputSignals.rs new file mode 100644 index 00000000000..02a850f6621 --- /dev/null +++ b/crates/web-sys/src/features/gen_SerialOutputSignals.rs @@ -0,0 +1,109 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SerialOutputSignals)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SerialOutputSignals` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SerialOutputSignals; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `break` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "break")] + pub fn get_break(this: &SerialOutputSignals) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `break` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "break")] + pub fn set_break(this: &SerialOutputSignals, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `dataTerminalReady` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "dataTerminalReady")] + pub fn get_data_terminal_ready(this: &SerialOutputSignals) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `dataTerminalReady` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "dataTerminalReady")] + pub fn set_data_terminal_ready(this: &SerialOutputSignals, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `requestToSend` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requestToSend")] + pub fn get_request_to_send(this: &SerialOutputSignals) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `requestToSend` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "requestToSend")] + pub fn set_request_to_send(this: &SerialOutputSignals, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl SerialOutputSignals { + #[doc = "Construct a new `SerialOutputSignals`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_break()` instead."] + pub fn break_(&mut self, val: bool) -> &mut Self { + self.set_break(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_data_terminal_ready()` instead."] + pub fn data_terminal_ready(&mut self, val: bool) -> &mut Self { + self.set_data_terminal_ready(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_request_to_send()` instead."] + pub fn request_to_send(&mut self, val: bool) -> &mut Self { + self.set_request_to_send(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for SerialOutputSignals { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_SerialPort.rs b/crates/web-sys/src/features/gen_SerialPort.rs new file mode 100644 index 00000000000..7df4fe5fb5c --- /dev/null +++ b/crates/web-sys/src/features/gen_SerialPort.rs @@ -0,0 +1,170 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = SerialPort , typescript_type = "SerialPort")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SerialPort` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SerialPort; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "SerialPort" , js_name = onconnect)] + #[doc = "Getter for the `onconnect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/onconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onconnect(this: &SerialPort) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "SerialPort" , js_name = onconnect)] + #[doc = "Setter for the `onconnect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/onconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onconnect(this: &SerialPort, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "SerialPort" , js_name = ondisconnect)] + #[doc = "Getter for the `ondisconnect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/ondisconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ondisconnect(this: &SerialPort) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "SerialPort" , js_name = ondisconnect)] + #[doc = "Setter for the `ondisconnect` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/ondisconnect)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ondisconnect(this: &SerialPort, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "SerialPort" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &SerialPort) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "SerialPort" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &SerialPort) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn close(this: &SerialPort) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = forget)] + #[doc = "The `forget()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/forget)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn forget(this: &SerialPort) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SerialPortInfo")] + # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = getInfo)] + #[doc = "The `getInfo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/getInfo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`, `SerialPortInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_info(this: &SerialPort) -> SerialPortInfo; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = getSignals)] + #[doc = "The `getSignals()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/getSignals)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_signals(this: &SerialPort) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SerialOptions")] + # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = open)] + #[doc = "The `open()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/open)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOptions`, `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn open(this: &SerialPort, options: &SerialOptions) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = setSignals)] + #[doc = "The `setSignals()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/setSignals)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_signals(this: &SerialPort) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SerialOutputSignals")] + # [wasm_bindgen (method , structural , js_class = "SerialPort" , js_name = setSignals)] + #[doc = "The `setSignals()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SerialPort/setSignals)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialOutputSignals`, `SerialPort`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_signals_with_signals( + this: &SerialPort, + signals: &SerialOutputSignals, + ) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_SerialPortFilter.rs b/crates/web-sys/src/features/gen_SerialPortFilter.rs new file mode 100644 index 00000000000..99fb46cb5dc --- /dev/null +++ b/crates/web-sys/src/features/gen_SerialPortFilter.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SerialPortFilter)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SerialPortFilter` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SerialPortFilter; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usbProductId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usbProductId")] + pub fn get_usb_product_id(this: &SerialPortFilter) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `usbProductId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usbProductId")] + pub fn set_usb_product_id(this: &SerialPortFilter, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usbVendorId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usbVendorId")] + pub fn get_usb_vendor_id(this: &SerialPortFilter) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `usbVendorId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usbVendorId")] + pub fn set_usb_vendor_id(this: &SerialPortFilter, val: u16); +} +#[cfg(web_sys_unstable_apis)] +impl SerialPortFilter { + #[doc = "Construct a new `SerialPortFilter`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usb_product_id()` instead."] + pub fn usb_product_id(&mut self, val: u16) -> &mut Self { + self.set_usb_product_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usb_vendor_id()` instead."] + pub fn usb_vendor_id(&mut self, val: u16) -> &mut Self { + self.set_usb_vendor_id(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for SerialPortFilter { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_SerialPortInfo.rs b/crates/web-sys/src/features/gen_SerialPortInfo.rs new file mode 100644 index 00000000000..07f598e29e7 --- /dev/null +++ b/crates/web-sys/src/features/gen_SerialPortInfo.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SerialPortInfo)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SerialPortInfo` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SerialPortInfo; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usbProductId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usbProductId")] + pub fn get_usb_product_id(this: &SerialPortInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `usbProductId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usbProductId")] + pub fn set_usb_product_id(this: &SerialPortInfo, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `usbVendorId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "usbVendorId")] + pub fn get_usb_vendor_id(this: &SerialPortInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `usbVendorId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "usbVendorId")] + pub fn set_usb_vendor_id(this: &SerialPortInfo, val: u16); +} +#[cfg(web_sys_unstable_apis)] +impl SerialPortInfo { + #[doc = "Construct a new `SerialPortInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usb_product_id()` instead."] + pub fn usb_product_id(&mut self, val: u16) -> &mut Self { + self.set_usb_product_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_usb_vendor_id()` instead."] + pub fn usb_vendor_id(&mut self, val: u16) -> &mut Self { + self.set_usb_vendor_id(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for SerialPortInfo { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_SerialPortRequestOptions.rs b/crates/web-sys/src/features/gen_SerialPortRequestOptions.rs new file mode 100644 index 00000000000..b00ff33fb63 --- /dev/null +++ b/crates/web-sys/src/features/gen_SerialPortRequestOptions.rs @@ -0,0 +1,61 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SerialPortRequestOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SerialPortRequestOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type SerialPortRequestOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "filters")] + pub fn get_filters(this: &SerialPortRequestOptions) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "filters")] + pub fn set_filters(this: &SerialPortRequestOptions, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl SerialPortRequestOptions { + #[doc = "Construct a new `SerialPortRequestOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SerialPortRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_filters()` instead."] + pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_filters(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for SerialPortRequestOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ServerSocketOptions.rs b/crates/web-sys/src/features/gen_ServerSocketOptions.rs index c347b90a051..803b7d63e11 100644 --- a/crates/web-sys/src/features/gen_ServerSocketOptions.rs +++ b/crates/web-sys/src/features/gen_ServerSocketOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ServerSocketOptions`*"] pub type ServerSocketOptions; + #[cfg(feature = "TcpSocketBinaryType")] + #[doc = "Get the `binaryType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ServerSocketOptions`, `TcpSocketBinaryType`*"] + #[wasm_bindgen(method, getter = "binaryType")] + pub fn get_binary_type(this: &ServerSocketOptions) -> Option; + #[cfg(feature = "TcpSocketBinaryType")] + #[doc = "Change the `binaryType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ServerSocketOptions`, `TcpSocketBinaryType`*"] + #[wasm_bindgen(method, setter = "binaryType")] + pub fn set_binary_type(this: &ServerSocketOptions, val: TcpSocketBinaryType); } impl ServerSocketOptions { #[doc = "Construct a new `ServerSocketOptions`."] @@ -20,21 +33,9 @@ impl ServerSocketOptions { ret } #[cfg(feature = "TcpSocketBinaryType")] - #[doc = "Change the `binaryType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ServerSocketOptions`, `TcpSocketBinaryType`*"] + #[deprecated = "Use `set_binary_type()` instead."] pub fn binary_type(&mut self, val: TcpSocketBinaryType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binaryType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_binary_type(val); self } } diff --git a/crates/web-sys/src/features/gen_ServiceWorker.rs b/crates/web-sys/src/features/gen_ServiceWorker.rs index 7e006d764a6..268362b6443 100644 --- a/crates/web-sys/src/features/gen_ServiceWorker.rs +++ b/crates/web-sys/src/features/gen_ServiceWorker.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/scriptURL)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ServiceWorker`*"] - pub fn script_url(this: &ServiceWorker) -> String; + pub fn script_url(this: &ServiceWorker) -> ::alloc::string::String; #[cfg(feature = "ServiceWorkerState")] # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorker" , js_name = state)] #[doc = "Getter for the `state` field of this object."] diff --git a/crates/web-sys/src/features/gen_ServiceWorkerContainer.rs b/crates/web-sys/src/features/gen_ServiceWorkerContainer.rs index d2be819c51e..ba2036d5b84 100644 --- a/crates/web-sys/src/features/gen_ServiceWorkerContainer.rs +++ b/crates/web-sys/src/features/gen_ServiceWorkerContainer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -101,7 +102,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getScopeForUrl)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] - pub fn get_scope_for_url(this: &ServiceWorkerContainer, url: &str) -> Result; + pub fn get_scope_for_url( + this: &ServiceWorkerContainer, + url: &str, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = register)] #[doc = "The `register()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_ServiceWorkerGlobalScope.rs b/crates/web-sys/src/features/gen_ServiceWorkerGlobalScope.rs index e25ebbc4459..51c90143068 100644 --- a/crates/web-sys/src/features/gen_ServiceWorkerGlobalScope.rs +++ b/crates/web-sys/src/features/gen_ServiceWorkerGlobalScope.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ServiceWorkerRegistration.rs b/crates/web-sys/src/features/gen_ServiceWorkerRegistration.rs index 06155365c92..12aaee05c68 100644 --- a/crates/web-sys/src/features/gen_ServiceWorkerRegistration.rs +++ b/crates/web-sys/src/features/gen_ServiceWorkerRegistration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -41,7 +42,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/scope)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerRegistration`*"] - pub fn scope(this: &ServiceWorkerRegistration) -> String; + pub fn scope(this: &ServiceWorkerRegistration) -> ::alloc::string::String; #[cfg(feature = "ServiceWorkerUpdateViaCache")] # [wasm_bindgen (structural , catch , method , getter , js_class = "ServiceWorkerRegistration" , js_name = updateViaCache)] #[doc = "Getter for the `updateViaCache` field of this object."] @@ -83,17 +84,6 @@ extern "C" { pub fn get_notifications( this: &ServiceWorkerRegistration, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "GetNotificationOptions")] - # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerRegistration" , js_name = getNotifications)] - #[doc = "The `getNotifications()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/getNotifications)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GetNotificationOptions`, `ServiceWorkerRegistration`*"] - pub fn get_notifications_with_filter( - this: &ServiceWorkerRegistration, - filter: &GetNotificationOptions, - ) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerRegistration" , js_name = showNotification)] #[doc = "The `showNotification()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_ServiceWorkerState.rs b/crates/web-sys/src/features/gen_ServiceWorkerState.rs index 4dfcc6156e4..cf37c476fb8 100644 --- a/crates/web-sys/src/features/gen_ServiceWorkerState.rs +++ b/crates/web-sys/src/features/gen_ServiceWorkerState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ServiceWorkerState` enum."] diff --git a/crates/web-sys/src/features/gen_ServiceWorkerUpdateViaCache.rs b/crates/web-sys/src/features/gen_ServiceWorkerUpdateViaCache.rs index 72de930ae35..d667ab4ea9e 100644 --- a/crates/web-sys/src/features/gen_ServiceWorkerUpdateViaCache.rs +++ b/crates/web-sys/src/features/gen_ServiceWorkerUpdateViaCache.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ServiceWorkerUpdateViaCache` enum."] diff --git a/crates/web-sys/src/features/gen_ShadowRoot.rs b/crates/web-sys/src/features/gen_ShadowRoot.rs index a0186ea2eb4..500db8ef42c 100644 --- a/crates/web-sys/src/features/gen_ShadowRoot.rs +++ b/crates/web-sys/src/features/gen_ShadowRoot.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -33,7 +34,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/innerHTML)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ShadowRoot`*"] - pub fn inner_html(this: &ShadowRoot) -> String; + pub fn inner_html(this: &ShadowRoot) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "ShadowRoot" , js_name = innerHTML)] #[doc = "Setter for the `innerHTML` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_ShadowRootInit.rs b/crates/web-sys/src/features/gen_ShadowRootInit.rs index 762fc9e81dd..9dc8ec93521 100644 --- a/crates/web-sys/src/features/gen_ShadowRootInit.rs +++ b/crates/web-sys/src/features/gen_ShadowRootInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`*"] pub type ShadowRootInit; + #[cfg(feature = "ShadowRootMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`, `ShadowRootMode`*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &ShadowRootInit) -> ShadowRootMode; + #[cfg(feature = "ShadowRootMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`, `ShadowRootMode`*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &ShadowRootInit, val: ShadowRootMode); } impl ShadowRootInit { #[cfg(feature = "ShadowRootMode")] @@ -18,21 +31,13 @@ impl ShadowRootInit { pub fn new(mode: ShadowRootMode) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.mode(mode); + ret.set_mode(mode); ret } #[cfg(feature = "ShadowRootMode")] - #[doc = "Change the `mode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`, `ShadowRootMode`*"] + #[deprecated = "Use `set_mode()` instead."] pub fn mode(&mut self, val: ShadowRootMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("mode"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_mode(val); self } } diff --git a/crates/web-sys/src/features/gen_ShadowRootMode.rs b/crates/web-sys/src/features/gen_ShadowRootMode.rs index baddd9fe96b..c6cfca62a0c 100644 --- a/crates/web-sys/src/features/gen_ShadowRootMode.rs +++ b/crates/web-sys/src/features/gen_ShadowRootMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `ShadowRootMode` enum."] diff --git a/crates/web-sys/src/features/gen_ShareData.rs b/crates/web-sys/src/features/gen_ShareData.rs index 982cbd480d9..dfd1d3591bf 100644 --- a/crates/web-sys/src/features/gen_ShareData.rs +++ b/crates/web-sys/src/features/gen_ShareData.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ShareData)] @@ -9,94 +9,78 @@ extern "C" { #[doc = "The `ShareData` dictionary."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ShareData; + #[doc = "Get the `files` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] + #[wasm_bindgen(method, getter = "files")] + pub fn get_files(this: &ShareData) -> Option<::js_sys::Array>; + #[doc = "Change the `files` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] + #[wasm_bindgen(method, setter = "files")] + pub fn set_files(this: &ShareData, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `text` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] + #[wasm_bindgen(method, getter = "text")] + pub fn get_text(this: &ShareData) -> Option<::alloc::string::String>; + #[doc = "Change the `text` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] + #[wasm_bindgen(method, setter = "text")] + pub fn set_text(this: &ShareData, val: &str); + #[doc = "Get the `title` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] + #[wasm_bindgen(method, getter = "title")] + pub fn get_title(this: &ShareData) -> Option<::alloc::string::String>; + #[doc = "Change the `title` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] + #[wasm_bindgen(method, setter = "title")] + pub fn set_title(this: &ShareData, val: &str); + #[doc = "Get the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] + #[wasm_bindgen(method, getter = "url")] + pub fn get_url(this: &ShareData) -> Option<::alloc::string::String>; + #[doc = "Change the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] + #[wasm_bindgen(method, setter = "url")] + pub fn set_url(this: &ShareData, val: &str); } -#[cfg(web_sys_unstable_apis)] impl ShareData { #[doc = "Construct a new `ShareData`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `files` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_files()` instead."] pub fn files(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("files"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_files(val); self } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `text` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_text()` instead."] pub fn text(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("text"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_text(val); self } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `title` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_title()` instead."] pub fn title(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("title"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_title(val); self } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `url` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ShareData`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_url()` instead."] pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_url(val); self } } -#[cfg(web_sys_unstable_apis)] impl Default for ShareData { fn default() -> Self { Self::new() diff --git a/crates/web-sys/src/features/gen_SharedWorker.rs b/crates/web-sys/src/features/gen_SharedWorker.rs index 28c93e7700c..3ced2d82961 100644 --- a/crates/web-sys/src/features/gen_SharedWorker.rs +++ b/crates/web-sys/src/features/gen_SharedWorker.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SharedWorkerGlobalScope.rs b/crates/web-sys/src/features/gen_SharedWorkerGlobalScope.rs index b77b9f89245..fe6938b61d8 100644 --- a/crates/web-sys/src/features/gen_SharedWorkerGlobalScope.rs +++ b/crates/web-sys/src/features/gen_SharedWorkerGlobalScope.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorkerGlobalScope/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SharedWorkerGlobalScope`*"] - pub fn name(this: &SharedWorkerGlobalScope) -> String; + pub fn name(this: &SharedWorkerGlobalScope) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SharedWorkerGlobalScope" , js_name = onconnect)] #[doc = "Getter for the `onconnect` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SignResponse.rs b/crates/web-sys/src/features/gen_SignResponse.rs index 5b0680e1d67..7a16596b9f9 100644 --- a/crates/web-sys/src/features/gen_SignResponse.rs +++ b/crates/web-sys/src/features/gen_SignResponse.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] pub type SignResponse; + #[doc = "Get the `clientData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, getter = "clientData")] + pub fn get_client_data(this: &SignResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `clientData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, setter = "clientData")] + pub fn set_client_data(this: &SignResponse, val: &str); + #[doc = "Get the `errorCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, getter = "errorCode")] + pub fn get_error_code(this: &SignResponse) -> Option; + #[doc = "Change the `errorCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, setter = "errorCode")] + pub fn set_error_code(this: &SignResponse, val: Option); + #[doc = "Get the `errorMessage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, getter = "errorMessage")] + pub fn get_error_message(this: &SignResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `errorMessage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, setter = "errorMessage")] + pub fn set_error_message(this: &SignResponse, val: Option<&str>); + #[doc = "Get the `keyHandle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, getter = "keyHandle")] + pub fn get_key_handle(this: &SignResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `keyHandle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, setter = "keyHandle")] + pub fn set_key_handle(this: &SignResponse, val: &str); + #[doc = "Get the `signatureData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, getter = "signatureData")] + pub fn get_signature_data(this: &SignResponse) -> Option<::alloc::string::String>; + #[doc = "Change the `signatureData` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[wasm_bindgen(method, setter = "signatureData")] + pub fn set_signature_data(this: &SignResponse, val: &str); } impl SignResponse { #[doc = "Construct a new `SignResponse`."] @@ -19,89 +70,29 @@ impl SignResponse { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `clientData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[deprecated = "Use `set_client_data()` instead."] pub fn client_data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_data(val); self } - #[doc = "Change the `errorCode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[deprecated = "Use `set_error_code()` instead."] pub fn error_code(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("errorCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error_code(val); self } - #[doc = "Change the `errorMessage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[deprecated = "Use `set_error_message()` instead."] pub fn error_message(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("errorMessage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error_message(val); self } - #[doc = "Change the `keyHandle` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[deprecated = "Use `set_key_handle()` instead."] pub fn key_handle(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyHandle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key_handle(val); self } - #[doc = "Change the `signatureData` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SignResponse`*"] + #[deprecated = "Use `set_signature_data()` instead."] pub fn signature_data(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("signatureData"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_signature_data(val); self } } diff --git a/crates/web-sys/src/features/gen_SocketElement.rs b/crates/web-sys/src/features/gen_SocketElement.rs index 81bc62c7236..083f219d32b 100644 --- a/crates/web-sys/src/features/gen_SocketElement.rs +++ b/crates/web-sys/src/features/gen_SocketElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] pub type SocketElement; + #[doc = "Get the `active` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, getter = "active")] + pub fn get_active(this: &SocketElement) -> Option; + #[doc = "Change the `active` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, setter = "active")] + pub fn set_active(this: &SocketElement, val: bool); + #[doc = "Get the `host` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, getter = "host")] + pub fn get_host(this: &SocketElement) -> Option<::alloc::string::String>; + #[doc = "Change the `host` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, setter = "host")] + pub fn set_host(this: &SocketElement, val: &str); + #[doc = "Get the `port` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, getter = "port")] + pub fn get_port(this: &SocketElement) -> Option; + #[doc = "Change the `port` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, setter = "port")] + pub fn set_port(this: &SocketElement, val: u32); + #[doc = "Get the `received` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, getter = "received")] + pub fn get_received(this: &SocketElement) -> Option; + #[doc = "Change the `received` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, setter = "received")] + pub fn set_received(this: &SocketElement, val: f64); + #[doc = "Get the `sent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, getter = "sent")] + pub fn get_sent(this: &SocketElement) -> Option; + #[doc = "Change the `sent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, setter = "sent")] + pub fn set_sent(this: &SocketElement, val: f64); + #[doc = "Get the `tcp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, getter = "tcp")] + pub fn get_tcp(this: &SocketElement) -> Option; + #[doc = "Change the `tcp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[wasm_bindgen(method, setter = "tcp")] + pub fn set_tcp(this: &SocketElement, val: bool); } impl SocketElement { #[doc = "Construct a new `SocketElement`."] @@ -19,87 +80,34 @@ impl SocketElement { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `active` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[deprecated = "Use `set_active()` instead."] pub fn active(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("active"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_active(val); self } - #[doc = "Change the `host` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[deprecated = "Use `set_host()` instead."] pub fn host(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("host"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_host(val); self } - #[doc = "Change the `port` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[deprecated = "Use `set_port()` instead."] pub fn port(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("port"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_port(val); self } - #[doc = "Change the `received` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[deprecated = "Use `set_received()` instead."] pub fn received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("received"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_received(val); self } - #[doc = "Change the `sent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[deprecated = "Use `set_sent()` instead."] pub fn sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sent"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sent(val); self } - #[doc = "Change the `tcp` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketElement`*"] + #[deprecated = "Use `set_tcp()` instead."] pub fn tcp(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("tcp"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_tcp(val); self } } diff --git a/crates/web-sys/src/features/gen_SocketOptions.rs b/crates/web-sys/src/features/gen_SocketOptions.rs index 103c82e19b5..3d99e6381c8 100644 --- a/crates/web-sys/src/features/gen_SocketOptions.rs +++ b/crates/web-sys/src/features/gen_SocketOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,28 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketOptions`*"] pub type SocketOptions; + #[cfg(feature = "TcpSocketBinaryType")] + #[doc = "Get the `binaryType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketOptions`, `TcpSocketBinaryType`*"] + #[wasm_bindgen(method, getter = "binaryType")] + pub fn get_binary_type(this: &SocketOptions) -> Option; + #[cfg(feature = "TcpSocketBinaryType")] + #[doc = "Change the `binaryType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketOptions`, `TcpSocketBinaryType`*"] + #[wasm_bindgen(method, setter = "binaryType")] + pub fn set_binary_type(this: &SocketOptions, val: TcpSocketBinaryType); + #[doc = "Get the `useSecureTransport` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketOptions`*"] + #[wasm_bindgen(method, getter = "useSecureTransport")] + pub fn get_use_secure_transport(this: &SocketOptions) -> Option; + #[doc = "Change the `useSecureTransport` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketOptions`*"] + #[wasm_bindgen(method, setter = "useSecureTransport")] + pub fn set_use_secure_transport(this: &SocketOptions, val: bool); } impl SocketOptions { #[doc = "Construct a new `SocketOptions`."] @@ -20,38 +43,14 @@ impl SocketOptions { ret } #[cfg(feature = "TcpSocketBinaryType")] - #[doc = "Change the `binaryType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketOptions`, `TcpSocketBinaryType`*"] + #[deprecated = "Use `set_binary_type()` instead."] pub fn binary_type(&mut self, val: TcpSocketBinaryType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("binaryType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_binary_type(val); self } - #[doc = "Change the `useSecureTransport` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketOptions`*"] + #[deprecated = "Use `set_use_secure_transport()` instead."] pub fn use_secure_transport(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("useSecureTransport"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_use_secure_transport(val); self } } diff --git a/crates/web-sys/src/features/gen_SocketReadyState.rs b/crates/web-sys/src/features/gen_SocketReadyState.rs index 5c359de2ab6..00092b00a70 100644 --- a/crates/web-sys/src/features/gen_SocketReadyState.rs +++ b/crates/web-sys/src/features/gen_SocketReadyState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `SocketReadyState` enum."] diff --git a/crates/web-sys/src/features/gen_SocketsDict.rs b/crates/web-sys/src/features/gen_SocketsDict.rs index 15e87f1184d..6a892687cae 100644 --- a/crates/web-sys/src/features/gen_SocketsDict.rs +++ b/crates/web-sys/src/features/gen_SocketsDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] pub type SocketsDict; + #[doc = "Get the `received` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[wasm_bindgen(method, getter = "received")] + pub fn get_received(this: &SocketsDict) -> Option; + #[doc = "Change the `received` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[wasm_bindgen(method, setter = "received")] + pub fn set_received(this: &SocketsDict, val: f64); + #[doc = "Get the `sent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[wasm_bindgen(method, getter = "sent")] + pub fn get_sent(this: &SocketsDict) -> Option; + #[doc = "Change the `sent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[wasm_bindgen(method, setter = "sent")] + pub fn set_sent(this: &SocketsDict, val: f64); + #[doc = "Get the `sockets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[wasm_bindgen(method, getter = "sockets")] + pub fn get_sockets(this: &SocketsDict) -> Option<::js_sys::Array>; + #[doc = "Change the `sockets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[wasm_bindgen(method, setter = "sockets")] + pub fn set_sockets(this: &SocketsDict, val: &::wasm_bindgen::JsValue); } impl SocketsDict { #[doc = "Construct a new `SocketsDict`."] @@ -19,51 +50,19 @@ impl SocketsDict { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `received` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[deprecated = "Use `set_received()` instead."] pub fn received(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("received"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_received(val); self } - #[doc = "Change the `sent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[deprecated = "Use `set_sent()` instead."] pub fn sent(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("sent"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sent(val); self } - #[doc = "Change the `sockets` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SocketsDict`*"] + #[deprecated = "Use `set_sockets()` instead."] pub fn sockets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sockets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sockets(val); self } } diff --git a/crates/web-sys/src/features/gen_SourceBuffer.rs b/crates/web-sys/src/features/gen_SourceBuffer.rs index 8405987e393..a205b4827ac 100644 --- a/crates/web-sys/src/features/gen_SourceBuffer.rs +++ b/crates/web-sys/src/features/gen_SourceBuffer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -213,6 +214,16 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"] pub fn append_buffer_with_u8_array(this: &SourceBuffer, data: &mut [u8]) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "SourceBuffer" , js_name = appendBuffer)] + #[doc = "The `appendBuffer()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"] + pub fn append_buffer_with_js_u8_array( + this: &SourceBuffer, + data: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "SourceBuffer" , js_name = appendBufferAsync)] #[doc = "The `appendBufferAsync()` method."] #[doc = ""] @@ -243,6 +254,16 @@ extern "C" { this: &SourceBuffer, data: &mut [u8], ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "SourceBuffer" , js_name = appendBufferAsync)] + #[doc = "The `appendBufferAsync()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBufferAsync)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"] + pub fn append_buffer_async_with_js_u8_array( + this: &SourceBuffer, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "SourceBuffer" , js_name = changeType)] #[doc = "The `changeType()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SourceBufferAppendMode.rs b/crates/web-sys/src/features/gen_SourceBufferAppendMode.rs index 21eb0db9a2a..cdd97c94d55 100644 --- a/crates/web-sys/src/features/gen_SourceBufferAppendMode.rs +++ b/crates/web-sys/src/features/gen_SourceBufferAppendMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `SourceBufferAppendMode` enum."] diff --git a/crates/web-sys/src/features/gen_SourceBufferList.rs b/crates/web-sys/src/features/gen_SourceBufferList.rs index 37e0e23075b..6c9feca51a3 100644 --- a/crates/web-sys/src/features/gen_SourceBufferList.rs +++ b/crates/web-sys/src/features/gen_SourceBufferList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -48,7 +49,7 @@ extern "C" { pub fn set_onremovesourcebuffer(this: &SourceBufferList, value: Option<&::js_sys::Function>); #[cfg(feature = "SourceBuffer")] #[wasm_bindgen(method, structural, js_class = "SourceBufferList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechGrammar.rs b/crates/web-sys/src/features/gen_SpeechGrammar.rs index f9a24accc5f..c50b179daee 100644 --- a/crates/web-sys/src/features/gen_SpeechGrammar.rs +++ b/crates/web-sys/src/features/gen_SpeechGrammar.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechGrammar/src)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechGrammar`*"] - pub fn src(this: &SpeechGrammar) -> Result; + pub fn src(this: &SpeechGrammar) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "SpeechGrammar" , js_name = src)] #[doc = "Setter for the `src` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechGrammarList.rs b/crates/web-sys/src/features/gen_SpeechGrammarList.rs index 1f9e7a72160..62fb935900e 100644 --- a/crates/web-sys/src/features/gen_SpeechGrammarList.rs +++ b/crates/web-sys/src/features/gen_SpeechGrammarList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -77,7 +78,7 @@ extern "C" { js_class = "SpeechGrammarList", indexing_getter )] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechRecognition.rs b/crates/web-sys/src/features/gen_SpeechRecognition.rs index 10bb4a75e95..f446bd30fb9 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognition.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognition.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -33,7 +34,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/lang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"] - pub fn lang(this: &SpeechRecognition) -> String; + pub fn lang(this: &SpeechRecognition) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SpeechRecognition" , js_name = lang)] #[doc = "Setter for the `lang` field of this object."] #[doc = ""] @@ -89,7 +90,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/serviceURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognition`*"] - pub fn service_uri(this: &SpeechRecognition) -> Result; + pub fn service_uri(this: &SpeechRecognition) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "SpeechRecognition" , js_name = serviceURI)] #[doc = "Setter for the `serviceURI` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionAlternative.rs b/crates/web-sys/src/features/gen_SpeechRecognitionAlternative.rs index 5aced7fb38d..037beaf8133 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionAlternative.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionAlternative.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionAlternative/transcript)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionAlternative`*"] - pub fn transcript(this: &SpeechRecognitionAlternative) -> String; + pub fn transcript(this: &SpeechRecognitionAlternative) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SpeechRecognitionAlternative" , js_name = confidence)] #[doc = "Getter for the `confidence` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionError.rs b/crates/web-sys/src/features/gen_SpeechRecognitionError.rs index 37111271203..c6dbea27575 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionError.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionError.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionError/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionError`*"] - pub fn message(this: &SpeechRecognitionError) -> Option; + pub fn message(this: &SpeechRecognitionError) -> Option<::alloc::string::String>; #[wasm_bindgen(catch, constructor, js_class = "SpeechRecognitionError")] #[doc = "The `new SpeechRecognitionError(..)` constructor, creating a new instance of `SpeechRecognitionError`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionErrorCode.rs b/crates/web-sys/src/features/gen_SpeechRecognitionErrorCode.rs index 4f728469068..4bbf99e600c 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionErrorCode.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionErrorCode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `SpeechRecognitionErrorCode` enum."] diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionErrorInit.rs b/crates/web-sys/src/features/gen_SpeechRecognitionErrorInit.rs index 1a7d578ac51..cb7e52d934c 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionErrorInit.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionErrorInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] pub type SpeechRecognitionErrorInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &SpeechRecognitionErrorInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &SpeechRecognitionErrorInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &SpeechRecognitionErrorInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &SpeechRecognitionErrorInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &SpeechRecognitionErrorInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &SpeechRecognitionErrorInit, val: bool); + #[cfg(feature = "SpeechRecognitionErrorCode")] + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorCode`, `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &SpeechRecognitionErrorInit) -> Option; + #[cfg(feature = "SpeechRecognitionErrorCode")] + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorCode`, `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &SpeechRecognitionErrorInit, val: SpeechRecognitionErrorCode); + #[doc = "Get the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, getter = "message")] + pub fn get_message(this: &SpeechRecognitionErrorInit) -> Option<::alloc::string::String>; + #[doc = "Change the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[wasm_bindgen(method, setter = "message")] + pub fn set_message(this: &SpeechRecognitionErrorInit, val: &str); } impl SpeechRecognitionErrorInit { #[doc = "Construct a new `SpeechRecognitionErrorInit`."] @@ -19,86 +72,30 @@ impl SpeechRecognitionErrorInit { 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: `SpeechRecognitionErrorInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "SpeechRecognitionErrorCode")] - #[doc = "Change the `error` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorCode`, `SpeechRecognitionErrorInit`*"] + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: SpeechRecognitionErrorCode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } - #[doc = "Change the `message` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"] + #[deprecated = "Use `set_message()` instead."] pub fn message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_message(val); self } } diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionEvent.rs b/crates/web-sys/src/features/gen_SpeechRecognitionEvent.rs index 1e37c86ab59..4b316dbad64 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionEvent.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionEventInit.rs b/crates/web-sys/src/features/gen_SpeechRecognitionEventInit.rs index 7ac78ecf219..dcd41c8616f 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionEventInit.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,83 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] pub type SpeechRecognitionEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &SpeechRecognitionEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &SpeechRecognitionEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &SpeechRecognitionEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &SpeechRecognitionEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &SpeechRecognitionEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &SpeechRecognitionEventInit, val: bool); + #[cfg(feature = "Document")] + #[doc = "Get the `emma` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`, `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, getter = "emma")] + pub fn get_emma(this: &SpeechRecognitionEventInit) -> Option; + #[cfg(feature = "Document")] + #[doc = "Change the `emma` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Document`, `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, setter = "emma")] + pub fn set_emma(this: &SpeechRecognitionEventInit, val: Option<&Document>); + #[doc = "Get the `interpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, getter = "interpretation")] + pub fn get_interpretation(this: &SpeechRecognitionEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `interpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, setter = "interpretation")] + pub fn set_interpretation(this: &SpeechRecognitionEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `resultIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, getter = "resultIndex")] + pub fn get_result_index(this: &SpeechRecognitionEventInit) -> Option; + #[doc = "Change the `resultIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[wasm_bindgen(method, setter = "resultIndex")] + pub fn set_result_index(this: &SpeechRecognitionEventInit, val: u32); + #[cfg(feature = "SpeechRecognitionResultList")] + #[doc = "Get the `results` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`, `SpeechRecognitionResultList`*"] + #[wasm_bindgen(method, getter = "results")] + pub fn get_results(this: &SpeechRecognitionEventInit) -> Option; + #[cfg(feature = "SpeechRecognitionResultList")] + #[doc = "Change the `results` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`, `SpeechRecognitionResultList`*"] + #[wasm_bindgen(method, setter = "results")] + pub fn set_results( + this: &SpeechRecognitionEventInit, + val: Option<&SpeechRecognitionResultList>, + ); } impl SpeechRecognitionEventInit { #[doc = "Construct a new `SpeechRecognitionEventInit`."] @@ -19,121 +97,41 @@ impl SpeechRecognitionEventInit { 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: `SpeechRecognitionEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "Document")] - #[doc = "Change the `emma` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Document`, `SpeechRecognitionEventInit`*"] + #[deprecated = "Use `set_emma()` instead."] pub fn emma(&mut self, val: Option<&Document>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("emma"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_emma(val); self } - #[doc = "Change the `interpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[deprecated = "Use `set_interpretation()` instead."] pub fn interpretation(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("interpretation"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_interpretation(val); self } - #[doc = "Change the `resultIndex` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`*"] + #[deprecated = "Use `set_result_index()` instead."] pub fn result_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("resultIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_result_index(val); self } #[cfg(feature = "SpeechRecognitionResultList")] - #[doc = "Change the `results` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionEventInit`, `SpeechRecognitionResultList`*"] + #[deprecated = "Use `set_results()` instead."] pub fn results(&mut self, val: Option<&SpeechRecognitionResultList>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("results"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_results(val); self } } diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionResult.rs b/crates/web-sys/src/features/gen_SpeechRecognitionResult.rs index 15075334d81..feced968f02 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionResult.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -40,7 +41,7 @@ extern "C" { js_class = "SpeechRecognitionResult", indexing_getter )] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechRecognitionResultList.rs b/crates/web-sys/src/features/gen_SpeechRecognitionResultList.rs index 9201f8e5312..4ed74d6e2b0 100644 --- a/crates/web-sys/src/features/gen_SpeechRecognitionResultList.rs +++ b/crates/web-sys/src/features/gen_SpeechRecognitionResultList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -33,7 +34,7 @@ extern "C" { js_class = "SpeechRecognitionResultList", indexing_getter )] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechSynthesis.rs b/crates/web-sys/src/features/gen_SpeechSynthesis.rs index 729f47d0022..ff364971498 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesis.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesis.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisErrorCode.rs b/crates/web-sys/src/features/gen_SpeechSynthesisErrorCode.rs index f6cf1bcba74..f024bf0695b 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisErrorCode.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisErrorCode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `SpeechSynthesisErrorCode` enum."] diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisErrorEvent.rs b/crates/web-sys/src/features/gen_SpeechSynthesisErrorEvent.rs index 9d6354531ab..04ab04bfad2 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisErrorEvent.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisErrorEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisErrorEventInit.rs b/crates/web-sys/src/features/gen_SpeechSynthesisErrorEventInit.rs index 8bb2801a3ab..32df173a5cf 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisErrorEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,100 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] pub type SpeechSynthesisErrorEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &SpeechSynthesisErrorEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &SpeechSynthesisErrorEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &SpeechSynthesisErrorEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &SpeechSynthesisErrorEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &SpeechSynthesisErrorEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &SpeechSynthesisErrorEventInit, val: bool); + #[doc = "Get the `charIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, getter = "charIndex")] + pub fn get_char_index(this: &SpeechSynthesisErrorEventInit) -> Option; + #[doc = "Change the `charIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, setter = "charIndex")] + pub fn set_char_index(this: &SpeechSynthesisErrorEventInit, val: u32); + #[doc = "Get the `charLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, getter = "charLength")] + pub fn get_char_length(this: &SpeechSynthesisErrorEventInit) -> Option; + #[doc = "Change the `charLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, setter = "charLength")] + pub fn set_char_length(this: &SpeechSynthesisErrorEventInit, val: Option); + #[doc = "Get the `elapsedTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, getter = "elapsedTime")] + pub fn get_elapsed_time(this: &SpeechSynthesisErrorEventInit) -> Option; + #[doc = "Change the `elapsedTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, setter = "elapsedTime")] + pub fn set_elapsed_time(this: &SpeechSynthesisErrorEventInit, val: f32); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &SpeechSynthesisErrorEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &SpeechSynthesisErrorEventInit, val: &str); + #[cfg(feature = "SpeechSynthesisUtterance")] + #[doc = "Get the `utterance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"] + #[wasm_bindgen(method, getter = "utterance")] + pub fn get_utterance(this: &SpeechSynthesisErrorEventInit) -> SpeechSynthesisUtterance; + #[cfg(feature = "SpeechSynthesisUtterance")] + #[doc = "Change the `utterance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"] + #[wasm_bindgen(method, setter = "utterance")] + pub fn set_utterance(this: &SpeechSynthesisErrorEventInit, val: &SpeechSynthesisUtterance); + #[cfg(feature = "SpeechSynthesisErrorCode")] + #[doc = "Get the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &SpeechSynthesisErrorEventInit) -> SpeechSynthesisErrorCode; + #[cfg(feature = "SpeechSynthesisErrorCode")] + #[doc = "Change the `error` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`*"] + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &SpeechSynthesisErrorEventInit, val: SpeechSynthesisErrorCode); } impl SpeechSynthesisErrorEventInit { #[cfg(all( @@ -21,155 +116,55 @@ impl SpeechSynthesisErrorEventInit { pub fn new(utterance: &SpeechSynthesisUtterance, error: SpeechSynthesisErrorCode) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.utterance(utterance); - ret.error(error); + ret.set_utterance(utterance); + ret.set_error(error); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `charIndex` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[deprecated = "Use `set_char_index()` instead."] pub fn char_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_char_index(val); self } - #[doc = "Change the `charLength` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[deprecated = "Use `set_char_length()` instead."] pub fn char_length(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_char_length(val); self } - #[doc = "Change the `elapsedTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[deprecated = "Use `set_elapsed_time()` instead."] 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.set_elapsed_time(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } #[cfg(feature = "SpeechSynthesisUtterance")] - #[doc = "Change the `utterance` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorEventInit`, `SpeechSynthesisUtterance`*"] + #[deprecated = "Use `set_utterance()` instead."] pub fn utterance(&mut self, val: &SpeechSynthesisUtterance) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("utterance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_utterance(val); self } #[cfg(feature = "SpeechSynthesisErrorCode")] - #[doc = "Change the `error` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisErrorCode`, `SpeechSynthesisErrorEventInit`*"] + #[deprecated = "Use `set_error()` instead."] pub fn error(&mut self, val: SpeechSynthesisErrorCode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_error(val); self } } diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisEvent.rs b/crates/web-sys/src/features/gen_SpeechSynthesisEvent.rs index 361fb54c98f..8979ba26f8f 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisEvent.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -46,7 +47,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisEvent/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEvent`*"] - pub fn name(this: &SpeechSynthesisEvent) -> Option; + pub fn name(this: &SpeechSynthesisEvent) -> Option<::alloc::string::String>; #[cfg(feature = "SpeechSynthesisEventInit")] #[wasm_bindgen(catch, constructor, js_class = "SpeechSynthesisEvent")] #[doc = "The `new SpeechSynthesisEvent(..)` constructor, creating a new instance of `SpeechSynthesisEvent`."] diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisEventInit.rs b/crates/web-sys/src/features/gen_SpeechSynthesisEventInit.rs index 83ddf5e9715..9f9058a9614 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisEventInit.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,88 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] pub type SpeechSynthesisEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &SpeechSynthesisEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &SpeechSynthesisEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &SpeechSynthesisEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &SpeechSynthesisEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &SpeechSynthesisEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &SpeechSynthesisEventInit, val: bool); + #[doc = "Get the `charIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, getter = "charIndex")] + pub fn get_char_index(this: &SpeechSynthesisEventInit) -> Option; + #[doc = "Change the `charIndex` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, setter = "charIndex")] + pub fn set_char_index(this: &SpeechSynthesisEventInit, val: u32); + #[doc = "Get the `charLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, getter = "charLength")] + pub fn get_char_length(this: &SpeechSynthesisEventInit) -> Option; + #[doc = "Change the `charLength` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, setter = "charLength")] + pub fn set_char_length(this: &SpeechSynthesisEventInit, val: Option); + #[doc = "Get the `elapsedTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, getter = "elapsedTime")] + pub fn get_elapsed_time(this: &SpeechSynthesisEventInit) -> Option; + #[doc = "Change the `elapsedTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, setter = "elapsedTime")] + pub fn set_elapsed_time(this: &SpeechSynthesisEventInit, val: f32); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &SpeechSynthesisEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &SpeechSynthesisEventInit, val: &str); + #[cfg(feature = "SpeechSynthesisUtterance")] + #[doc = "Get the `utterance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`, `SpeechSynthesisUtterance`*"] + #[wasm_bindgen(method, getter = "utterance")] + pub fn get_utterance(this: &SpeechSynthesisEventInit) -> SpeechSynthesisUtterance; + #[cfg(feature = "SpeechSynthesisUtterance")] + #[doc = "Change the `utterance` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`, `SpeechSynthesisUtterance`*"] + #[wasm_bindgen(method, setter = "utterance")] + pub fn set_utterance(this: &SpeechSynthesisEventInit, val: &SpeechSynthesisUtterance); } impl SpeechSynthesisEventInit { #[cfg(feature = "SpeechSynthesisUtterance")] @@ -18,140 +101,48 @@ impl SpeechSynthesisEventInit { pub fn new(utterance: &SpeechSynthesisUtterance) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.utterance(utterance); + ret.set_utterance(utterance); ret } - #[doc = "Change the `bubbles` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `charIndex` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[deprecated = "Use `set_char_index()` instead."] pub fn char_index(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charIndex"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_char_index(val); self } - #[doc = "Change the `charLength` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[deprecated = "Use `set_char_length()` instead."] pub fn char_length(&mut self, val: Option) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("charLength"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_char_length(val); self } - #[doc = "Change the `elapsedTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[deprecated = "Use `set_elapsed_time()` instead."] 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.set_elapsed_time(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } #[cfg(feature = "SpeechSynthesisUtterance")] - #[doc = "Change the `utterance` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisEventInit`, `SpeechSynthesisUtterance`*"] + #[deprecated = "Use `set_utterance()` instead."] pub fn utterance(&mut self, val: &SpeechSynthesisUtterance) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("utterance"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_utterance(val); self } } diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisUtterance.rs b/crates/web-sys/src/features/gen_SpeechSynthesisUtterance.rs index aa7eaacf3a9..a6005cf5461 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisUtterance.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisUtterance.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisUtterance`*"] - pub fn text(this: &SpeechSynthesisUtterance) -> String; + pub fn text(this: &SpeechSynthesisUtterance) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SpeechSynthesisUtterance" , js_name = text)] #[doc = "Setter for the `text` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/lang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisUtterance`*"] - pub fn lang(this: &SpeechSynthesisUtterance) -> String; + pub fn lang(this: &SpeechSynthesisUtterance) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SpeechSynthesisUtterance" , js_name = lang)] #[doc = "Setter for the `lang` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SpeechSynthesisVoice.rs b/crates/web-sys/src/features/gen_SpeechSynthesisVoice.rs index 26012757927..3d4d97dc7a4 100644 --- a/crates/web-sys/src/features/gen_SpeechSynthesisVoice.rs +++ b/crates/web-sys/src/features/gen_SpeechSynthesisVoice.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,21 +18,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisVoice/voiceURI)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisVoice`*"] - pub fn voice_uri(this: &SpeechSynthesisVoice) -> String; + pub fn voice_uri(this: &SpeechSynthesisVoice) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SpeechSynthesisVoice" , 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/SpeechSynthesisVoice/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisVoice`*"] - pub fn name(this: &SpeechSynthesisVoice) -> String; + pub fn name(this: &SpeechSynthesisVoice) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SpeechSynthesisVoice" , js_name = lang)] #[doc = "Getter for the `lang` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisVoice/lang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SpeechSynthesisVoice`*"] - pub fn lang(this: &SpeechSynthesisVoice) -> String; + pub fn lang(this: &SpeechSynthesisVoice) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "SpeechSynthesisVoice" , js_name = localService)] #[doc = "Getter for the `localService` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_StereoPannerNode.rs b/crates/web-sys/src/features/gen_StereoPannerNode.rs index 8accee506f1..c72bd5f98f9 100644 --- a/crates/web-sys/src/features/gen_StereoPannerNode.rs +++ b/crates/web-sys/src/features/gen_StereoPannerNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_StereoPannerOptions.rs b/crates/web-sys/src/features/gen_StereoPannerOptions.rs index f1996c603bf..3a56b27f013 100644 --- a/crates/web-sys/src/features/gen_StereoPannerOptions.rs +++ b/crates/web-sys/src/features/gen_StereoPannerOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,50 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] pub type StereoPannerOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &StereoPannerOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &StereoPannerOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `StereoPannerOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &StereoPannerOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `StereoPannerOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &StereoPannerOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `StereoPannerOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &StereoPannerOptions) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `StereoPannerOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &StereoPannerOptions, val: ChannelInterpretation); + #[doc = "Get the `pan` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] + #[wasm_bindgen(method, getter = "pan")] + pub fn get_pan(this: &StereoPannerOptions) -> Option; + #[doc = "Change the `pan` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] + #[wasm_bindgen(method, setter = "pan")] + pub fn set_pan(this: &StereoPannerOptions, val: f32); } impl StereoPannerOptions { #[doc = "Construct a new `StereoPannerOptions`."] @@ -19,70 +64,26 @@ impl StereoPannerOptions { 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: `StereoPannerOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `StereoPannerOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `StereoPannerOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `pan` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StereoPannerOptions`*"] + #[deprecated = "Use `set_pan()` instead."] pub fn pan(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pan"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_pan(val); self } } diff --git a/crates/web-sys/src/features/gen_Storage.rs b/crates/web-sys/src/features/gen_Storage.rs index 2a287b7d928..e31ffc87a1f 100644 --- a/crates/web-sys/src/features/gen_Storage.rs +++ b/crates/web-sys/src/features/gen_Storage.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,14 +32,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Storage`*"] - pub fn get_item(this: &Storage, key: &str) -> Result, JsValue>; + pub fn get_item(this: &Storage, key: &str) -> Result, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Storage" , js_name = key)] #[doc = "The `key()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage/key)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Storage`*"] - pub fn key(this: &Storage, index: u32) -> Result, JsValue>; + pub fn key(this: &Storage, index: u32) -> Result, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Storage" , js_name = removeItem)] #[doc = "The `removeItem()` method."] #[doc = ""] @@ -54,21 +55,21 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `Storage`*"] pub fn set_item(this: &Storage, key: &str, value: &str) -> Result<(), JsValue>; #[wasm_bindgen(catch, method, structural, js_class = "Storage", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Storage`*"] - pub fn get(this: &Storage, key: &str) -> Result, JsValue>; + pub fn get(this: &Storage, key: &str) -> Result, JsValue>; #[wasm_bindgen(catch, method, structural, js_class = "Storage", indexing_setter)] - #[doc = "Indexing setter."] + #[doc = "Indexing setter. As in the literal Javascript `this[key] = value`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Storage`*"] pub fn set(this: &Storage, key: &str, value: &str) -> Result<(), JsValue>; #[wasm_bindgen(catch, method, structural, js_class = "Storage", indexing_deleter)] - #[doc = "Indexing deleter."] + #[doc = "Indexing deleter. As in the literal Javascript `delete this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_StorageEstimate.rs b/crates/web-sys/src/features/gen_StorageEstimate.rs index 20cebe9a154..bd360574641 100644 --- a/crates/web-sys/src/features/gen_StorageEstimate.rs +++ b/crates/web-sys/src/features/gen_StorageEstimate.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] pub type StorageEstimate; + #[doc = "Get the `quota` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] + #[wasm_bindgen(method, getter = "quota")] + pub fn get_quota(this: &StorageEstimate) -> Option; + #[doc = "Change the `quota` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] + #[wasm_bindgen(method, setter = "quota")] + pub fn set_quota(this: &StorageEstimate, val: f64); + #[doc = "Get the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] + #[wasm_bindgen(method, getter = "usage")] + pub fn get_usage(this: &StorageEstimate) -> Option; + #[doc = "Change the `usage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] + #[wasm_bindgen(method, setter = "usage")] + pub fn set_usage(this: &StorageEstimate, val: f64); } impl StorageEstimate { #[doc = "Construct a new `StorageEstimate`."] @@ -19,30 +40,14 @@ impl StorageEstimate { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `quota` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] + #[deprecated = "Use `set_quota()` instead."] pub fn quota(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("quota"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_quota(val); self } - #[doc = "Change the `usage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"] + #[deprecated = "Use `set_usage()` instead."] pub fn usage(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("usage"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_usage(val); self } } diff --git a/crates/web-sys/src/features/gen_StorageEvent.rs b/crates/web-sys/src/features/gen_StorageEvent.rs index 8030d407dcf..782000997b6 100644 --- a/crates/web-sys/src/features/gen_StorageEvent.rs +++ b/crates/web-sys/src/features/gen_StorageEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,28 +18,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent/key)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEvent`*"] - pub fn key(this: &StorageEvent) -> Option; + pub fn key(this: &StorageEvent) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "StorageEvent" , js_name = oldValue)] #[doc = "Getter for the `oldValue` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent/oldValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEvent`*"] - pub fn old_value(this: &StorageEvent) -> Option; + pub fn old_value(this: &StorageEvent) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "StorageEvent" , js_name = newValue)] #[doc = "Getter for the `newValue` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent/newValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEvent`*"] - pub fn new_value(this: &StorageEvent) -> Option; + pub fn new_value(this: &StorageEvent) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "StorageEvent" , js_name = url)] #[doc = "Getter for the `url` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent/url)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEvent`*"] - pub fn url(this: &StorageEvent) -> Option; + pub fn url(this: &StorageEvent) -> Option<::alloc::string::String>; #[cfg(feature = "Storage")] # [wasm_bindgen (structural , method , getter , js_class = "StorageEvent" , js_name = storageArea)] #[doc = "Getter for the `storageArea` field of this object."] diff --git a/crates/web-sys/src/features/gen_StorageEventInit.rs b/crates/web-sys/src/features/gen_StorageEventInit.rs index d3509e51359..63da9d1abe4 100644 --- a/crates/web-sys/src/features/gen_StorageEventInit.rs +++ b/crates/web-sys/src/features/gen_StorageEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,88 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] pub type StorageEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &StorageEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &StorageEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &StorageEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &StorageEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &StorageEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &StorageEventInit, val: bool); + #[doc = "Get the `key` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, getter = "key")] + pub fn get_key(this: &StorageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `key` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, setter = "key")] + pub fn set_key(this: &StorageEventInit, val: Option<&str>); + #[doc = "Get the `newValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, getter = "newValue")] + pub fn get_new_value(this: &StorageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `newValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, setter = "newValue")] + pub fn set_new_value(this: &StorageEventInit, val: Option<&str>); + #[doc = "Get the `oldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, getter = "oldValue")] + pub fn get_old_value(this: &StorageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `oldValue` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, setter = "oldValue")] + pub fn set_old_value(this: &StorageEventInit, val: Option<&str>); + #[cfg(feature = "Storage")] + #[doc = "Get the `storageArea` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Storage`, `StorageEventInit`*"] + #[wasm_bindgen(method, getter = "storageArea")] + pub fn get_storage_area(this: &StorageEventInit) -> Option; + #[cfg(feature = "Storage")] + #[doc = "Change the `storageArea` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Storage`, `StorageEventInit`*"] + #[wasm_bindgen(method, setter = "storageArea")] + pub fn set_storage_area(this: &StorageEventInit, val: Option<&Storage>); + #[doc = "Get the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, getter = "url")] + pub fn get_url(this: &StorageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `url` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[wasm_bindgen(method, setter = "url")] + pub fn set_url(this: &StorageEventInit, val: &str); } impl StorageEventInit { #[doc = "Construct a new `StorageEventInit`."] @@ -19,133 +102,45 @@ impl StorageEventInit { 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: `StorageEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `key` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[deprecated = "Use `set_key()` instead."] pub fn key(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("key"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key(val); self } - #[doc = "Change the `newValue` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[deprecated = "Use `set_new_value()` instead."] pub fn new_value(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("newValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_new_value(val); self } - #[doc = "Change the `oldValue` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[deprecated = "Use `set_old_value()` instead."] pub fn old_value(&mut self, val: Option<&str>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("oldValue"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_old_value(val); self } #[cfg(feature = "Storage")] - #[doc = "Change the `storageArea` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Storage`, `StorageEventInit`*"] + #[deprecated = "Use `set_storage_area()` instead."] pub fn storage_area(&mut self, val: Option<&Storage>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("storageArea"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_storage_area(val); self } - #[doc = "Change the `url` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StorageEventInit`*"] + #[deprecated = "Use `set_url()` instead."] pub fn url(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_url(val); self } } diff --git a/crates/web-sys/src/features/gen_StorageManager.rs b/crates/web-sys/src/features/gen_StorageManager.rs index 9901c79509c..2bb5782ebf0 100644 --- a/crates/web-sys/src/features/gen_StorageManager.rs +++ b/crates/web-sys/src/features/gen_StorageManager.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -18,6 +19,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageManager`*"] pub fn estimate(this: &StorageManager) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (method , structural , js_class = "StorageManager" , js_name = getDirectory)] + #[doc = "The `getDirectory()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/getDirectory)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StorageManager`*"] + pub fn get_directory(this: &StorageManager) -> ::js_sys::Promise; # [wasm_bindgen (catch , method , structural , js_class = "StorageManager" , js_name = persist)] #[doc = "The `persist()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_StorageType.rs b/crates/web-sys/src/features/gen_StorageType.rs index 46eea4c2f05..beb27040502 100644 --- a/crates/web-sys/src/features/gen_StorageType.rs +++ b/crates/web-sys/src/features/gen_StorageType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `StorageType` enum."] diff --git a/crates/web-sys/src/features/gen_StreamPipeOptions.rs b/crates/web-sys/src/features/gen_StreamPipeOptions.rs index b58cee2a2e6..a23579d144b 100644 --- a/crates/web-sys/src/features/gen_StreamPipeOptions.rs +++ b/crates/web-sys/src/features/gen_StreamPipeOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] pub type StreamPipeOptions; + #[doc = "Get the `preventAbort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[wasm_bindgen(method, getter = "preventAbort")] + pub fn get_prevent_abort(this: &StreamPipeOptions) -> Option; + #[doc = "Change the `preventAbort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[wasm_bindgen(method, setter = "preventAbort")] + pub fn set_prevent_abort(this: &StreamPipeOptions, val: bool); + #[doc = "Get the `preventCancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[wasm_bindgen(method, getter = "preventCancel")] + pub fn get_prevent_cancel(this: &StreamPipeOptions) -> Option; + #[doc = "Change the `preventCancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[wasm_bindgen(method, setter = "preventCancel")] + pub fn set_prevent_cancel(this: &StreamPipeOptions, val: bool); + #[doc = "Get the `preventClose` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[wasm_bindgen(method, getter = "preventClose")] + pub fn get_prevent_close(this: &StreamPipeOptions) -> Option; + #[doc = "Change the `preventClose` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[wasm_bindgen(method, setter = "preventClose")] + pub fn set_prevent_close(this: &StreamPipeOptions, val: bool); + #[cfg(feature = "AbortSignal")] + #[doc = "Get the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `StreamPipeOptions`*"] + #[wasm_bindgen(method, getter = "signal")] + pub fn get_signal(this: &StreamPipeOptions) -> Option; + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `StreamPipeOptions`*"] + #[wasm_bindgen(method, setter = "signal")] + pub fn set_signal(this: &StreamPipeOptions, val: &AbortSignal); } impl StreamPipeOptions { #[doc = "Construct a new `StreamPipeOptions`."] @@ -19,70 +62,25 @@ impl StreamPipeOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `preventAbort` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[deprecated = "Use `set_prevent_abort()` instead."] pub fn prevent_abort(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preventAbort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prevent_abort(val); self } - #[doc = "Change the `preventCancel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[deprecated = "Use `set_prevent_cancel()` instead."] pub fn prevent_cancel(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preventCancel"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prevent_cancel(val); self } - #[doc = "Change the `preventClose` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*"] + #[deprecated = "Use `set_prevent_close()` instead."] pub fn prevent_close(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preventClose"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_prevent_close(val); self } #[cfg(feature = "AbortSignal")] - #[doc = "Change the `signal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `StreamPipeOptions`*"] + #[deprecated = "Use `set_signal()` instead."] pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_signal(val); self } } diff --git a/crates/web-sys/src/features/gen_StyleRuleChangeEventInit.rs b/crates/web-sys/src/features/gen_StyleRuleChangeEventInit.rs index 7a9d3033c2d..9366e1e7345 100644 --- a/crates/web-sys/src/features/gen_StyleRuleChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_StyleRuleChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,60 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] pub type StyleRuleChangeEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &StyleRuleChangeEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &StyleRuleChangeEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &StyleRuleChangeEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &StyleRuleChangeEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &StyleRuleChangeEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &StyleRuleChangeEventInit, val: bool); + #[cfg(feature = "CssRule")] + #[doc = "Get the `rule` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssRule`, `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, getter = "rule")] + pub fn get_rule(this: &StyleRuleChangeEventInit) -> Option; + #[cfg(feature = "CssRule")] + #[doc = "Change the `rule` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssRule`, `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, setter = "rule")] + pub fn set_rule(this: &StyleRuleChangeEventInit, val: Option<&CssRule>); + #[cfg(feature = "CssStyleSheet")] + #[doc = "Get the `stylesheet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, getter = "stylesheet")] + pub fn get_stylesheet(this: &StyleRuleChangeEventInit) -> Option; + #[cfg(feature = "CssStyleSheet")] + #[doc = "Change the `stylesheet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleRuleChangeEventInit`*"] + #[wasm_bindgen(method, setter = "stylesheet")] + pub fn set_stylesheet(this: &StyleRuleChangeEventInit, val: Option<&CssStyleSheet>); } impl StyleRuleChangeEventInit { #[doc = "Construct a new `StyleRuleChangeEventInit`."] @@ -19,87 +74,31 @@ impl StyleRuleChangeEventInit { 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: `StyleRuleChangeEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StyleRuleChangeEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "CssRule")] - #[doc = "Change the `rule` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CssRule`, `StyleRuleChangeEventInit`*"] + #[deprecated = "Use `set_rule()` instead."] pub fn rule(&mut self, val: Option<&CssRule>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rule"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rule(val); self } #[cfg(feature = "CssStyleSheet")] - #[doc = "Change the `stylesheet` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleRuleChangeEventInit`*"] + #[deprecated = "Use `set_stylesheet()` instead."] pub fn stylesheet(&mut self, val: Option<&CssStyleSheet>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stylesheet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stylesheet(val); self } } diff --git a/crates/web-sys/src/features/gen_StyleSheet.rs b/crates/web-sys/src/features/gen_StyleSheet.rs index b539c60e30c..6455da9a2f9 100644 --- a/crates/web-sys/src/features/gen_StyleSheet.rs +++ b/crates/web-sys/src/features/gen_StyleSheet.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheet`*"] - pub fn type_(this: &StyleSheet) -> String; + pub fn type_(this: &StyleSheet) -> ::alloc::string::String; # [wasm_bindgen (structural , catch , method , getter , js_class = "StyleSheet" , js_name = href)] #[doc = "Getter for the `href` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheet`*"] - pub fn href(this: &StyleSheet) -> Result, JsValue>; + pub fn href(this: &StyleSheet) -> Result, JsValue>; #[cfg(feature = "Node")] # [wasm_bindgen (structural , method , getter , js_class = "StyleSheet" , js_name = ownerNode)] #[doc = "Getter for the `ownerNode` field of this object."] @@ -46,7 +47,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/title)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheet`*"] - pub fn title(this: &StyleSheet) -> Option; + pub fn title(this: &StyleSheet) -> Option<::alloc::string::String>; #[cfg(feature = "MediaList")] # [wasm_bindgen (structural , method , getter , js_class = "StyleSheet" , js_name = media)] #[doc = "Getter for the `media` field of this object."] diff --git a/crates/web-sys/src/features/gen_StyleSheetApplicableStateChangeEventInit.rs b/crates/web-sys/src/features/gen_StyleSheetApplicableStateChangeEventInit.rs index b4ff3d124c1..70aecd5ed6f 100644 --- a/crates/web-sys/src/features/gen_StyleSheetApplicableStateChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_StyleSheetApplicableStateChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,62 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] pub type StyleSheetApplicableStateChangeEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &StyleSheetApplicableStateChangeEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &StyleSheetApplicableStateChangeEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &StyleSheetApplicableStateChangeEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &StyleSheetApplicableStateChangeEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &StyleSheetApplicableStateChangeEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &StyleSheetApplicableStateChangeEventInit, val: bool); + #[doc = "Get the `applicable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, getter = "applicable")] + pub fn get_applicable(this: &StyleSheetApplicableStateChangeEventInit) -> Option; + #[doc = "Change the `applicable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, setter = "applicable")] + pub fn set_applicable(this: &StyleSheetApplicableStateChangeEventInit, val: bool); + #[cfg(feature = "CssStyleSheet")] + #[doc = "Get the `stylesheet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, getter = "stylesheet")] + pub fn get_stylesheet(this: &StyleSheetApplicableStateChangeEventInit) + -> Option; + #[cfg(feature = "CssStyleSheet")] + #[doc = "Change the `stylesheet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleSheetApplicableStateChangeEventInit`*"] + #[wasm_bindgen(method, setter = "stylesheet")] + pub fn set_stylesheet( + this: &StyleSheetApplicableStateChangeEventInit, + val: Option<&CssStyleSheet>, + ); } impl StyleSheetApplicableStateChangeEventInit { #[doc = "Construct a new `StyleSheetApplicableStateChangeEventInit`."] @@ -19,90 +76,30 @@ impl StyleSheetApplicableStateChangeEventInit { 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: `StyleSheetApplicableStateChangeEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `applicable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StyleSheetApplicableStateChangeEventInit`*"] + #[deprecated = "Use `set_applicable()` instead."] pub fn applicable(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("applicable"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_applicable(val); self } #[cfg(feature = "CssStyleSheet")] - #[doc = "Change the `stylesheet` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleSheetApplicableStateChangeEventInit`*"] + #[deprecated = "Use `set_stylesheet()` instead."] pub fn stylesheet(&mut self, val: Option<&CssStyleSheet>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stylesheet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stylesheet(val); self } } diff --git a/crates/web-sys/src/features/gen_StyleSheetChangeEventInit.rs b/crates/web-sys/src/features/gen_StyleSheetChangeEventInit.rs index 75b3235d9ea..a0d658a71fd 100644 --- a/crates/web-sys/src/features/gen_StyleSheetChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_StyleSheetChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] pub type StyleSheetChangeEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &StyleSheetChangeEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &StyleSheetChangeEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &StyleSheetChangeEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &StyleSheetChangeEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &StyleSheetChangeEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &StyleSheetChangeEventInit, val: bool); + #[doc = "Get the `documentSheet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, getter = "documentSheet")] + pub fn get_document_sheet(this: &StyleSheetChangeEventInit) -> Option; + #[doc = "Change the `documentSheet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, setter = "documentSheet")] + pub fn set_document_sheet(this: &StyleSheetChangeEventInit, val: bool); + #[cfg(feature = "CssStyleSheet")] + #[doc = "Get the `stylesheet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, getter = "stylesheet")] + pub fn get_stylesheet(this: &StyleSheetChangeEventInit) -> Option; + #[cfg(feature = "CssStyleSheet")] + #[doc = "Change the `stylesheet` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleSheetChangeEventInit`*"] + #[wasm_bindgen(method, setter = "stylesheet")] + pub fn set_stylesheet(this: &StyleSheetChangeEventInit, val: Option<&CssStyleSheet>); } impl StyleSheetChangeEventInit { #[doc = "Construct a new `StyleSheetChangeEventInit`."] @@ -19,90 +72,30 @@ impl StyleSheetChangeEventInit { 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: `StyleSheetChangeEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `documentSheet` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `StyleSheetChangeEventInit`*"] + #[deprecated = "Use `set_document_sheet()` instead."] pub fn document_sheet(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("documentSheet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_document_sheet(val); self } #[cfg(feature = "CssStyleSheet")] - #[doc = "Change the `stylesheet` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CssStyleSheet`, `StyleSheetChangeEventInit`*"] + #[deprecated = "Use `set_stylesheet()` instead."] pub fn stylesheet(&mut self, val: Option<&CssStyleSheet>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stylesheet"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stylesheet(val); self } } diff --git a/crates/web-sys/src/features/gen_StyleSheetList.rs b/crates/web-sys/src/features/gen_StyleSheetList.rs index ce7c706e881..186015dc6e5 100644 --- a/crates/web-sys/src/features/gen_StyleSheetList.rs +++ b/crates/web-sys/src/features/gen_StyleSheetList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -28,7 +29,7 @@ extern "C" { pub fn item(this: &StyleSheetList, index: u32) -> Option; #[cfg(feature = "StyleSheet")] #[wasm_bindgen(method, structural, js_class = "StyleSheetList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SubmitEvent.rs b/crates/web-sys/src/features/gen_SubmitEvent.rs new file mode 100644 index 00000000000..3b5f1b1cedb --- /dev/null +++ b/crates/web-sys/src/features/gen_SubmitEvent.rs @@ -0,0 +1,41 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = SubmitEvent , typescript_type = "SubmitEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SubmitEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubmitEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEvent`*"] + pub type SubmitEvent; + #[cfg(feature = "HtmlElement")] + # [wasm_bindgen (structural , method , getter , js_class = "SubmitEvent" , js_name = submitter)] + #[doc = "Getter for the `submitter` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubmitEvent/submitter)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`, `SubmitEvent`*"] + pub fn submitter(this: &SubmitEvent) -> Option; + #[wasm_bindgen(catch, constructor, js_class = "SubmitEvent")] + #[doc = "The `new SubmitEvent(..)` constructor, creating a new instance of `SubmitEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubmitEvent/SubmitEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEvent`*"] + pub fn new(type_: &str) -> Result; + #[cfg(feature = "SubmitEventInit")] + #[wasm_bindgen(catch, constructor, js_class = "SubmitEvent")] + #[doc = "The `new SubmitEvent(..)` constructor, creating a new instance of `SubmitEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubmitEvent/SubmitEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEvent`, `SubmitEventInit`*"] + pub fn new_with_event_init_dict( + type_: &str, + event_init_dict: &SubmitEventInit, + ) -> Result; +} diff --git a/crates/web-sys/src/features/gen_SubmitEventInit.rs b/crates/web-sys/src/features/gen_SubmitEventInit.rs new file mode 100644 index 00000000000..4d954d50e3f --- /dev/null +++ b/crates/web-sys/src/features/gen_SubmitEventInit.rs @@ -0,0 +1,91 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SubmitEventInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `SubmitEventInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] + pub type SubmitEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &SubmitEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &SubmitEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &SubmitEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &SubmitEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &SubmitEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &SubmitEventInit, val: bool); + #[cfg(feature = "HtmlElement")] + #[doc = "Get the `submitter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`, `SubmitEventInit`*"] + #[wasm_bindgen(method, getter = "submitter")] + pub fn get_submitter(this: &SubmitEventInit) -> Option; + #[cfg(feature = "HtmlElement")] + #[doc = "Change the `submitter` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlElement`, `SubmitEventInit`*"] + #[wasm_bindgen(method, setter = "submitter")] + pub fn set_submitter(this: &SubmitEventInit, val: Option<&HtmlElement>); +} +impl SubmitEventInit { + #[doc = "Construct a new `SubmitEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubmitEventInit`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(feature = "HtmlElement")] + #[deprecated = "Use `set_submitter()` instead."] + pub fn submitter(&mut self, val: Option<&HtmlElement>) -> &mut Self { + self.set_submitter(val); + self + } +} +impl Default for SubmitEventInit { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_SubtleCrypto.rs b/crates/web-sys/src/features/gen_SubtleCrypto.rs index 516e819bacb..3a9cdbf5b95 100644 --- a/crates/web-sys/src/features/gen_SubtleCrypto.rs +++ b/crates/web-sys/src/features/gen_SubtleCrypto.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -48,7 +49,7 @@ extern "C" { this: &SubtleCrypto, algorithm: &::js_sys::Object, key: &CryptoKey, - data: &mut [u8], + data: &[u8], ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = decrypt)] @@ -61,7 +62,33 @@ extern "C" { this: &SubtleCrypto, algorithm: &str, key: &CryptoKey, - data: &mut [u8], + data: &[u8], + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = decrypt)] + #[doc = "The `decrypt()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/decrypt)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn decrypt_with_object_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + key: &CryptoKey, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = decrypt)] + #[doc = "The `decrypt()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/decrypt)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn decrypt_with_str_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &str, + key: &CryptoKey, + data: &::js_sys::Uint8Array, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = deriveBits)] @@ -180,7 +207,7 @@ extern "C" { pub fn digest_with_object_and_u8_array( this: &SubtleCrypto, algorithm: &::js_sys::Object, - data: &mut [u8], + data: &[u8], ) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = digest)] #[doc = "The `digest()` method."] @@ -191,7 +218,29 @@ extern "C" { pub fn digest_with_str_and_u8_array( this: &SubtleCrypto, algorithm: &str, - data: &mut [u8], + data: &[u8], + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = digest)] + #[doc = "The `digest()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubtleCrypto`*"] + pub fn digest_with_object_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = digest)] + #[doc = "The `digest()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SubtleCrypto`*"] + pub fn digest_with_str_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &str, + data: &::js_sys::Uint8Array, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = encrypt)] @@ -230,7 +279,7 @@ extern "C" { this: &SubtleCrypto, algorithm: &::js_sys::Object, key: &CryptoKey, - data: &mut [u8], + data: &[u8], ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = encrypt)] @@ -243,7 +292,33 @@ extern "C" { this: &SubtleCrypto, algorithm: &str, key: &CryptoKey, - data: &mut [u8], + data: &[u8], + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = encrypt)] + #[doc = "The `encrypt()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn encrypt_with_object_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + key: &CryptoKey, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = encrypt)] + #[doc = "The `encrypt()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn encrypt_with_str_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &str, + key: &CryptoKey, + data: &::js_sys::Uint8Array, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = exportKey)] @@ -346,7 +421,7 @@ extern "C" { this: &SubtleCrypto, algorithm: &::js_sys::Object, key: &CryptoKey, - data: &mut [u8], + data: &[u8], ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = sign)] @@ -359,7 +434,33 @@ extern "C" { this: &SubtleCrypto, algorithm: &str, key: &CryptoKey, - data: &mut [u8], + data: &[u8], + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = sign)] + #[doc = "The `sign()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/sign)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn sign_with_object_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + key: &CryptoKey, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = sign)] + #[doc = "The `sign()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/sign)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn sign_with_str_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &str, + key: &CryptoKey, + data: &::js_sys::Uint8Array, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = unwrapKey)] @@ -388,7 +489,24 @@ extern "C" { pub fn unwrap_key_with_u8_array_and_object_and_object( this: &SubtleCrypto, format: &str, - wrapped_key: &mut [u8], + wrapped_key: &[u8], + unwrapping_key: &CryptoKey, + unwrap_algorithm: &::js_sys::Object, + unwrapped_key_algorithm: &::js_sys::Object, + extractable: bool, + key_usages: &::wasm_bindgen::JsValue, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = unwrapKey)] + #[doc = "The `unwrapKey()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/unwrapKey)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn unwrap_key_with_js_u8_array_and_object_and_object( + this: &SubtleCrypto, + format: &str, + wrapped_key: &::js_sys::Uint8Array, unwrapping_key: &CryptoKey, unwrap_algorithm: &::js_sys::Object, unwrapped_key_algorithm: &::js_sys::Object, @@ -422,7 +540,24 @@ extern "C" { pub fn unwrap_key_with_u8_array_and_str_and_object( this: &SubtleCrypto, format: &str, - wrapped_key: &mut [u8], + wrapped_key: &[u8], + unwrapping_key: &CryptoKey, + unwrap_algorithm: &str, + unwrapped_key_algorithm: &::js_sys::Object, + extractable: bool, + key_usages: &::wasm_bindgen::JsValue, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = unwrapKey)] + #[doc = "The `unwrapKey()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/unwrapKey)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn unwrap_key_with_js_u8_array_and_str_and_object( + this: &SubtleCrypto, + format: &str, + wrapped_key: &::js_sys::Uint8Array, unwrapping_key: &CryptoKey, unwrap_algorithm: &str, unwrapped_key_algorithm: &::js_sys::Object, @@ -456,7 +591,24 @@ extern "C" { pub fn unwrap_key_with_u8_array_and_object_and_str( this: &SubtleCrypto, format: &str, - wrapped_key: &mut [u8], + wrapped_key: &[u8], + unwrapping_key: &CryptoKey, + unwrap_algorithm: &::js_sys::Object, + unwrapped_key_algorithm: &str, + extractable: bool, + key_usages: &::wasm_bindgen::JsValue, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = unwrapKey)] + #[doc = "The `unwrapKey()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/unwrapKey)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn unwrap_key_with_js_u8_array_and_object_and_str( + this: &SubtleCrypto, + format: &str, + wrapped_key: &::js_sys::Uint8Array, unwrapping_key: &CryptoKey, unwrap_algorithm: &::js_sys::Object, unwrapped_key_algorithm: &str, @@ -490,7 +642,24 @@ extern "C" { pub fn unwrap_key_with_u8_array_and_str_and_str( this: &SubtleCrypto, format: &str, - wrapped_key: &mut [u8], + wrapped_key: &[u8], + unwrapping_key: &CryptoKey, + unwrap_algorithm: &str, + unwrapped_key_algorithm: &str, + extractable: bool, + key_usages: &::wasm_bindgen::JsValue, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = unwrapKey)] + #[doc = "The `unwrapKey()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/unwrapKey)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn unwrap_key_with_js_u8_array_and_str_and_str( + this: &SubtleCrypto, + format: &str, + wrapped_key: &::js_sys::Uint8Array, unwrapping_key: &CryptoKey, unwrap_algorithm: &str, unwrapped_key_algorithm: &str, @@ -536,7 +705,7 @@ extern "C" { this: &SubtleCrypto, algorithm: &::js_sys::Object, key: &CryptoKey, - signature: &mut [u8], + signature: &[u8], data: &::js_sys::Object, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] @@ -550,7 +719,35 @@ extern "C" { this: &SubtleCrypto, algorithm: &str, key: &CryptoKey, - signature: &mut [u8], + signature: &[u8], + data: &::js_sys::Object, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_object_and_js_u8_array_and_buffer_source( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + key: &CryptoKey, + signature: &::js_sys::Uint8Array, + data: &::js_sys::Object, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_str_and_js_u8_array_and_buffer_source( + this: &SubtleCrypto, + algorithm: &str, + key: &CryptoKey, + signature: &::js_sys::Uint8Array, data: &::js_sys::Object, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] @@ -565,7 +762,7 @@ extern "C" { algorithm: &::js_sys::Object, key: &CryptoKey, signature: &::js_sys::Object, - data: &mut [u8], + data: &[u8], ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] @@ -579,7 +776,7 @@ extern "C" { algorithm: &str, key: &CryptoKey, signature: &::js_sys::Object, - data: &mut [u8], + data: &[u8], ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] @@ -592,8 +789,8 @@ extern "C" { this: &SubtleCrypto, algorithm: &::js_sys::Object, key: &CryptoKey, - signature: &mut [u8], - data: &mut [u8], + signature: &[u8], + data: &[u8], ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] @@ -606,8 +803,120 @@ extern "C" { this: &SubtleCrypto, algorithm: &str, key: &CryptoKey, - signature: &mut [u8], - data: &mut [u8], + signature: &[u8], + data: &[u8], + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_object_and_u8_array_and_u8_slice( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + key: &CryptoKey, + signature: &::js_sys::Uint8Array, + data: &[u8], + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_str_and_u8_array_and_u8_slice( + this: &SubtleCrypto, + algorithm: &str, + key: &CryptoKey, + signature: &::js_sys::Uint8Array, + data: &[u8], + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_object_and_buffer_source_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + key: &CryptoKey, + signature: &::js_sys::Object, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_str_and_buffer_source_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &str, + key: &CryptoKey, + signature: &::js_sys::Object, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_object_and_u8_slice_and_u8_array( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + key: &CryptoKey, + signature: &[u8], + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_str_and_u8_slice_and_u8_array( + this: &SubtleCrypto, + algorithm: &str, + key: &CryptoKey, + signature: &[u8], + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_object_and_js_u8_array_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &::js_sys::Object, + key: &CryptoKey, + signature: &::js_sys::Uint8Array, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "CryptoKey")] + # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = verify)] + #[doc = "The `verify()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `SubtleCrypto`*"] + pub fn verify_with_str_and_js_u8_array_and_js_u8_array( + this: &SubtleCrypto, + algorithm: &str, + key: &CryptoKey, + signature: &::js_sys::Uint8Array, + data: &::js_sys::Uint8Array, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "CryptoKey")] # [wasm_bindgen (catch , method , structural , js_class = "SubtleCrypto" , js_name = wrapKey)] diff --git a/crates/web-sys/src/features/gen_SupportedType.rs b/crates/web-sys/src/features/gen_SupportedType.rs index dcc3d41bac9..0d384a87aba 100644 --- a/crates/web-sys/src/features/gen_SupportedType.rs +++ b/crates/web-sys/src/features/gen_SupportedType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `SupportedType` enum."] diff --git a/crates/web-sys/src/features/gen_SvcOutputMetadata.rs b/crates/web-sys/src/features/gen_SvcOutputMetadata.rs index aebaa2040f2..84f9d00dd6a 100644 --- a/crates/web-sys/src/features/gen_SvcOutputMetadata.rs +++ b/crates/web-sys/src/features/gen_SvcOutputMetadata.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type SvcOutputMetadata; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `temporalLayerId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvcOutputMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "temporalLayerId")] + pub fn get_temporal_layer_id(this: &SvcOutputMetadata) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `temporalLayerId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvcOutputMetadata`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "temporalLayerId")] + pub fn set_temporal_layer_id(this: &SvcOutputMetadata, val: u32); } #[cfg(web_sys_unstable_apis)] impl SvcOutputMetadata { @@ -28,24 +47,9 @@ impl SvcOutputMetadata { ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `temporalLayerId` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SvcOutputMetadata`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_temporal_layer_id()` instead."] pub fn temporal_layer_id(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("temporalLayerId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_temporal_layer_id(val); self } } diff --git a/crates/web-sys/src/features/gen_SvgAngle.rs b/crates/web-sys/src/features/gen_SvgAngle.rs index 3406dfdfe8c..ba774cec3ce 100644 --- a/crates/web-sys/src/features/gen_SvgAngle.rs +++ b/crates/web-sys/src/features/gen_SvgAngle.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -52,7 +53,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAngle/valueAsString)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgAngle`*"] - pub fn value_as_string(this: &SvgAngle) -> String; + pub fn value_as_string(this: &SvgAngle) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGAngle" , js_name = valueAsString)] #[doc = "Setter for the `valueAsString` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgAnimateElement.rs b/crates/web-sys/src/features/gen_SvgAnimateElement.rs index 273f132de67..a4ba8ecf164 100644 --- a/crates/web-sys/src/features/gen_SvgAnimateElement.rs +++ b/crates/web-sys/src/features/gen_SvgAnimateElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimateMotionElement.rs b/crates/web-sys/src/features/gen_SvgAnimateMotionElement.rs index 2d29f194876..567b3ab0b20 100644 --- a/crates/web-sys/src/features/gen_SvgAnimateMotionElement.rs +++ b/crates/web-sys/src/features/gen_SvgAnimateMotionElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimateTransformElement.rs b/crates/web-sys/src/features/gen_SvgAnimateTransformElement.rs index c1d437c228a..2d9fb541bf1 100644 --- a/crates/web-sys/src/features/gen_SvgAnimateTransformElement.rs +++ b/crates/web-sys/src/features/gen_SvgAnimateTransformElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedAngle.rs b/crates/web-sys/src/features/gen_SvgAnimatedAngle.rs index ffcfd63e42d..ac9d4b5ff37 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedAngle.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedAngle.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedBoolean.rs b/crates/web-sys/src/features/gen_SvgAnimatedBoolean.rs index 99b3d98a05d..4031198c46e 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedBoolean.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedBoolean.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedEnumeration.rs b/crates/web-sys/src/features/gen_SvgAnimatedEnumeration.rs index 2d9172db7e6..f3613b802b9 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedEnumeration.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedEnumeration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedInteger.rs b/crates/web-sys/src/features/gen_SvgAnimatedInteger.rs index 89690a26105..14c8f40044f 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedInteger.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedInteger.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedLength.rs b/crates/web-sys/src/features/gen_SvgAnimatedLength.rs index 8348f7d0259..0820e201f5c 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedLength.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedLength.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedLengthList.rs b/crates/web-sys/src/features/gen_SvgAnimatedLengthList.rs index 9e5032f1688..335505f9256 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedLengthList.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedLengthList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedNumber.rs b/crates/web-sys/src/features/gen_SvgAnimatedNumber.rs index c38e204b89c..0edaf1c8c9c 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedNumber.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedNumber.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedNumberList.rs b/crates/web-sys/src/features/gen_SvgAnimatedNumberList.rs index ec5ab3718dd..7d46243e282 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedNumberList.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedNumberList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedPreserveAspectRatio.rs b/crates/web-sys/src/features/gen_SvgAnimatedPreserveAspectRatio.rs index 4dee971d759..543668c5fa4 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedPreserveAspectRatio.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedPreserveAspectRatio.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedRect.rs b/crates/web-sys/src/features/gen_SvgAnimatedRect.rs index 45daf5d4f56..a9776c1f873 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedRect.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedRect.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimatedString.rs b/crates/web-sys/src/features/gen_SvgAnimatedString.rs index b02669aaa6b..28db97f2e89 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedString.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedString.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedString/baseVal)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgAnimatedString`*"] - pub fn base_val(this: &SvgAnimatedString) -> String; + pub fn base_val(this: &SvgAnimatedString) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGAnimatedString" , js_name = baseVal)] #[doc = "Setter for the `baseVal` field of this object."] #[doc = ""] @@ -31,5 +32,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedString/animVal)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgAnimatedString`*"] - pub fn anim_val(this: &SvgAnimatedString) -> String; + pub fn anim_val(this: &SvgAnimatedString) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_SvgAnimatedTransformList.rs b/crates/web-sys/src/features/gen_SvgAnimatedTransformList.rs index 08e923b00af..930cc90a7a3 100644 --- a/crates/web-sys/src/features/gen_SvgAnimatedTransformList.rs +++ b/crates/web-sys/src/features/gen_SvgAnimatedTransformList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgAnimationElement.rs b/crates/web-sys/src/features/gen_SvgAnimationElement.rs index 6135908286f..b2a51990fa3 100644 --- a/crates/web-sys/src/features/gen_SvgAnimationElement.rs +++ b/crates/web-sys/src/features/gen_SvgAnimationElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgBoundingBoxOptions.rs b/crates/web-sys/src/features/gen_SvgBoundingBoxOptions.rs index 81a1e4365cc..fc9141bf2fc 100644 --- a/crates/web-sys/src/features/gen_SvgBoundingBoxOptions.rs +++ b/crates/web-sys/src/features/gen_SvgBoundingBoxOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] pub type SvgBoundingBoxOptions; + #[doc = "Get the `clipped` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[wasm_bindgen(method, getter = "clipped")] + pub fn get_clipped(this: &SvgBoundingBoxOptions) -> Option; + #[doc = "Change the `clipped` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[wasm_bindgen(method, setter = "clipped")] + pub fn set_clipped(this: &SvgBoundingBoxOptions, val: bool); + #[doc = "Get the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[wasm_bindgen(method, getter = "fill")] + pub fn get_fill(this: &SvgBoundingBoxOptions) -> Option; + #[doc = "Change the `fill` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[wasm_bindgen(method, setter = "fill")] + pub fn set_fill(this: &SvgBoundingBoxOptions, val: bool); + #[doc = "Get the `markers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[wasm_bindgen(method, getter = "markers")] + pub fn get_markers(this: &SvgBoundingBoxOptions) -> Option; + #[doc = "Change the `markers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[wasm_bindgen(method, setter = "markers")] + pub fn set_markers(this: &SvgBoundingBoxOptions, val: bool); + #[doc = "Get the `stroke` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[wasm_bindgen(method, getter = "stroke")] + pub fn get_stroke(this: &SvgBoundingBoxOptions) -> Option; + #[doc = "Change the `stroke` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[wasm_bindgen(method, setter = "stroke")] + pub fn set_stroke(this: &SvgBoundingBoxOptions, val: bool); } impl SvgBoundingBoxOptions { #[doc = "Construct a new `SvgBoundingBoxOptions`."] @@ -19,65 +60,24 @@ impl SvgBoundingBoxOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `clipped` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[deprecated = "Use `set_clipped()` instead."] pub fn clipped(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clipped"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_clipped(val); self } - #[doc = "Change the `fill` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[deprecated = "Use `set_fill()` instead."] pub fn fill(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fill"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fill(val); self } - #[doc = "Change the `markers` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[deprecated = "Use `set_markers()` instead."] pub fn markers(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("markers"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_markers(val); self } - #[doc = "Change the `stroke` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SvgBoundingBoxOptions`*"] + #[deprecated = "Use `set_stroke()` instead."] pub fn stroke(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stroke"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stroke(val); self } } diff --git a/crates/web-sys/src/features/gen_SvgCircleElement.rs b/crates/web-sys/src/features/gen_SvgCircleElement.rs index c3a6e9297b6..a4772a685a2 100644 --- a/crates/web-sys/src/features/gen_SvgCircleElement.rs +++ b/crates/web-sys/src/features/gen_SvgCircleElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgClipPathElement.rs b/crates/web-sys/src/features/gen_SvgClipPathElement.rs index 3d11d34226f..907e2a11a7c 100644 --- a/crates/web-sys/src/features/gen_SvgClipPathElement.rs +++ b/crates/web-sys/src/features/gen_SvgClipPathElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgComponentTransferFunctionElement.rs b/crates/web-sys/src/features/gen_SvgComponentTransferFunctionElement.rs index 9703e6f9cf8..a7863e051e4 100644 --- a/crates/web-sys/src/features/gen_SvgComponentTransferFunctionElement.rs +++ b/crates/web-sys/src/features/gen_SvgComponentTransferFunctionElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgDefsElement.rs b/crates/web-sys/src/features/gen_SvgDefsElement.rs index 49a1359f5c8..d7dceaa9f11 100644 --- a/crates/web-sys/src/features/gen_SvgDefsElement.rs +++ b/crates/web-sys/src/features/gen_SvgDefsElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgDescElement.rs b/crates/web-sys/src/features/gen_SvgDescElement.rs index 5327c00431b..1a06691c2f8 100644 --- a/crates/web-sys/src/features/gen_SvgDescElement.rs +++ b/crates/web-sys/src/features/gen_SvgDescElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgElement.rs b/crates/web-sys/src/features/gen_SvgElement.rs index 2f1e1ab42e7..443755ebbc4 100644 --- a/crates/web-sys/src/features/gen_SvgElement.rs +++ b/crates/web-sys/src/features/gen_SvgElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] - pub fn id(this: &SvgElement) -> String; + pub fn id(this: &SvgElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGElement" , js_name = id)] #[doc = "Setter for the `id` field of this object."] #[doc = ""] @@ -33,22 +34,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgAnimatedString`, `SvgElement`*"] pub fn class_name(this: &SvgElement) -> SvgAnimatedString; - #[cfg(feature = "DomStringMap")] - # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = dataset)] - #[doc = "Getter for the `dataset` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/dataset)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `DomStringMap`, `SvgElement`*"] - pub fn dataset(this: &SvgElement) -> DomStringMap; - #[cfg(feature = "CssStyleDeclaration")] - # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = style)] - #[doc = "Getter for the `style` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/style)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`, `SvgElement`*"] - pub fn style(this: &SvgElement) -> CssStyleDeclaration; #[cfg(feature = "SvgsvgElement")] # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = ownerSVGElement)] #[doc = "Getter for the `ownerSVGElement` field of this object."] @@ -64,20 +49,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] pub fn viewport_element(this: &SvgElement) -> Option; - # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = tabIndex)] - #[doc = "Getter for the `tabIndex` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/tabIndex)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] - pub fn tab_index(this: &SvgElement) -> i32; - # [wasm_bindgen (structural , method , setter , js_class = "SVGElement" , js_name = tabIndex)] - #[doc = "Setter for the `tabIndex` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/tabIndex)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] - pub fn set_tab_index(this: &SvgElement, value: i32); # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = oncopy)] #[doc = "Getter for the `oncopy` field of this object."] #[doc = ""] @@ -120,6 +91,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] pub fn set_onpaste(this: &SvgElement, value: Option<&::js_sys::Function>); + #[cfg(feature = "CssStyleDeclaration")] + # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = style)] + #[doc = "Getter for the `style` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/style)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CssStyleDeclaration`, `SvgElement`*"] + pub fn style(this: &SvgElement) -> CssStyleDeclaration; # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = onabort)] #[doc = "Getter for the `onabort` field of this object."] #[doc = ""] @@ -176,6 +155,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] pub fn set_onauxclick(this: &SvgElement, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = onbeforetoggle)] + #[doc = "Getter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] + pub fn onbeforetoggle(this: &SvgElement) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "SVGElement" , js_name = onbeforetoggle)] + #[doc = "Setter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] + pub fn set_onbeforetoggle(this: &SvgElement, value: Option<&::js_sys::Function>); # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = oncanplay)] #[doc = "Getter for the `oncanplay` field of this object."] #[doc = ""] @@ -1268,6 +1261,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] pub fn set_onwebkittransitionend(this: &SvgElement, value: Option<&::js_sys::Function>); + #[cfg(feature = "DomStringMap")] + # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = dataset)] + #[doc = "Getter for the `dataset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/dataset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomStringMap`, `SvgElement`*"] + pub fn dataset(this: &SvgElement) -> DomStringMap; + # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = nonce)] + #[doc = "Getter for the `nonce` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/nonce)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] + pub fn nonce(this: &SvgElement) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , setter , js_class = "SVGElement" , js_name = nonce)] + #[doc = "Setter for the `nonce` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/nonce)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] + pub fn set_nonce(this: &SvgElement, value: &str); + # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = autofocus)] + #[doc = "Getter for the `autofocus` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/autofocus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] + pub fn autofocus(this: &SvgElement) -> bool; + # [wasm_bindgen (structural , catch , method , setter , js_class = "SVGElement" , js_name = autofocus)] + #[doc = "Setter for the `autofocus` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/autofocus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] + pub fn set_autofocus(this: &SvgElement, value: bool) -> Result<(), JsValue>; + # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = tabIndex)] + #[doc = "Getter for the `tabIndex` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/tabIndex)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] + pub fn tab_index(this: &SvgElement) -> i32; + # [wasm_bindgen (structural , method , setter , js_class = "SVGElement" , js_name = tabIndex)] + #[doc = "Setter for the `tabIndex` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/tabIndex)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] + pub fn set_tab_index(this: &SvgElement, value: i32); # [wasm_bindgen (structural , method , getter , js_class = "SVGElement" , js_name = onerror)] #[doc = "Getter for the `onerror` field of this object."] #[doc = ""] @@ -1352,4 +1395,12 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgElement`*"] pub fn focus(this: &SvgElement) -> Result<(), JsValue>; + #[cfg(feature = "FocusOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "SVGElement" , js_name = focus)] + #[doc = "The `focus()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/focus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `FocusOptions`, `SvgElement`*"] + pub fn focus_with_options(this: &SvgElement, options: &FocusOptions) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_SvgEllipseElement.rs b/crates/web-sys/src/features/gen_SvgEllipseElement.rs index 9b053815648..faba1ba37ec 100644 --- a/crates/web-sys/src/features/gen_SvgEllipseElement.rs +++ b/crates/web-sys/src/features/gen_SvgEllipseElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgFilterElement.rs b/crates/web-sys/src/features/gen_SvgFilterElement.rs index 1f178eafb0a..7fb25f9b70c 100644 --- a/crates/web-sys/src/features/gen_SvgFilterElement.rs +++ b/crates/web-sys/src/features/gen_SvgFilterElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgForeignObjectElement.rs b/crates/web-sys/src/features/gen_SvgForeignObjectElement.rs index be0ba8829d6..897e22a4c36 100644 --- a/crates/web-sys/src/features/gen_SvgForeignObjectElement.rs +++ b/crates/web-sys/src/features/gen_SvgForeignObjectElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgGeometryElement.rs b/crates/web-sys/src/features/gen_SvgGeometryElement.rs index fe6116b88f5..b31cba8f7de 100644 --- a/crates/web-sys/src/features/gen_SvgGeometryElement.rs +++ b/crates/web-sys/src/features/gen_SvgGeometryElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgGradientElement.rs b/crates/web-sys/src/features/gen_SvgGradientElement.rs index 7a46835d0eb..8000070a249 100644 --- a/crates/web-sys/src/features/gen_SvgGradientElement.rs +++ b/crates/web-sys/src/features/gen_SvgGradientElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgGraphicsElement.rs b/crates/web-sys/src/features/gen_SvgGraphicsElement.rs index 96de914f303..d9b5cf21219 100644 --- a/crates/web-sys/src/features/gen_SvgGraphicsElement.rs +++ b/crates/web-sys/src/features/gen_SvgGraphicsElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgImageElement.rs b/crates/web-sys/src/features/gen_SvgImageElement.rs index 99134788b0c..dd909e02478 100644 --- a/crates/web-sys/src/features/gen_SvgImageElement.rs +++ b/crates/web-sys/src/features/gen_SvgImageElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgLength.rs b/crates/web-sys/src/features/gen_SvgLength.rs index 63a3d360775..e365d98e858 100644 --- a/crates/web-sys/src/features/gen_SvgLength.rs +++ b/crates/web-sys/src/features/gen_SvgLength.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -52,7 +53,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/valueAsString)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"] - pub fn value_as_string(this: &SvgLength) -> String; + pub fn value_as_string(this: &SvgLength) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGLength" , js_name = valueAsString)] #[doc = "Setter for the `valueAsString` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgLengthList.rs b/crates/web-sys/src/features/gen_SvgLengthList.rs index 2672c007f09..2a30f7001ed 100644 --- a/crates/web-sys/src/features/gen_SvgLengthList.rs +++ b/crates/web-sys/src/features/gen_SvgLengthList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -83,7 +84,7 @@ extern "C" { ) -> Result; #[cfg(feature = "SvgLength")] #[wasm_bindgen(catch, method, structural, js_class = "SVGLengthList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgLineElement.rs b/crates/web-sys/src/features/gen_SvgLineElement.rs index ab2ce69e4f7..f6a09697605 100644 --- a/crates/web-sys/src/features/gen_SvgLineElement.rs +++ b/crates/web-sys/src/features/gen_SvgLineElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgLinearGradientElement.rs b/crates/web-sys/src/features/gen_SvgLinearGradientElement.rs index e589daa0a1b..04014b3e2f0 100644 --- a/crates/web-sys/src/features/gen_SvgLinearGradientElement.rs +++ b/crates/web-sys/src/features/gen_SvgLinearGradientElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgMarkerElement.rs b/crates/web-sys/src/features/gen_SvgMarkerElement.rs index 0921bcaf7d0..445dce2ba16 100644 --- a/crates/web-sys/src/features/gen_SvgMarkerElement.rs +++ b/crates/web-sys/src/features/gen_SvgMarkerElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgMaskElement.rs b/crates/web-sys/src/features/gen_SvgMaskElement.rs index 9c507c5af60..05f4d883ba8 100644 --- a/crates/web-sys/src/features/gen_SvgMaskElement.rs +++ b/crates/web-sys/src/features/gen_SvgMaskElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgMatrix.rs b/crates/web-sys/src/features/gen_SvgMatrix.rs index ca82392b2f5..cc6ffcb373e 100644 --- a/crates/web-sys/src/features/gen_SvgMatrix.rs +++ b/crates/web-sys/src/features/gen_SvgMatrix.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgMetadataElement.rs b/crates/web-sys/src/features/gen_SvgMetadataElement.rs index d5f4c5c8d81..ec242c0b6d5 100644 --- a/crates/web-sys/src/features/gen_SvgMetadataElement.rs +++ b/crates/web-sys/src/features/gen_SvgMetadataElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgNumber.rs b/crates/web-sys/src/features/gen_SvgNumber.rs index 2cb9ffa51b4..8ac54522d59 100644 --- a/crates/web-sys/src/features/gen_SvgNumber.rs +++ b/crates/web-sys/src/features/gen_SvgNumber.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgNumberList.rs b/crates/web-sys/src/features/gen_SvgNumberList.rs index cda161a35e2..bfe4bd9f083 100644 --- a/crates/web-sys/src/features/gen_SvgNumberList.rs +++ b/crates/web-sys/src/features/gen_SvgNumberList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -83,7 +84,7 @@ extern "C" { ) -> Result; #[cfg(feature = "SvgNumber")] #[wasm_bindgen(catch, method, structural, js_class = "SVGNumberList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgPathElement.rs b/crates/web-sys/src/features/gen_SvgPathElement.rs index 7cd150fcea2..63f1898e73a 100644 --- a/crates/web-sys/src/features/gen_SvgPathElement.rs +++ b/crates/web-sys/src/features/gen_SvgPathElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSeg.rs b/crates/web-sys/src/features/gen_SvgPathSeg.rs index 2c9dc633ef5..de9a214492a 100644 --- a/crates/web-sys/src/features/gen_SvgPathSeg.rs +++ b/crates/web-sys/src/features/gen_SvgPathSeg.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSeg/pathSegTypeAsLetter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgPathSeg`*"] - pub fn path_seg_type_as_letter(this: &SvgPathSeg) -> String; + pub fn path_seg_type_as_letter(this: &SvgPathSeg) -> ::alloc::string::String; } impl SvgPathSeg { #[doc = "The `SVGPathSeg.PATHSEG_UNKNOWN` const."] diff --git a/crates/web-sys/src/features/gen_SvgPathSegArcAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegArcAbs.rs index 36b440f5e40..1a438d4f5a2 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegArcAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegArcAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegArcRel.rs b/crates/web-sys/src/features/gen_SvgPathSegArcRel.rs index a93b871afe4..725e6410a8f 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegArcRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegArcRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegClosePath.rs b/crates/web-sys/src/features/gen_SvgPathSegClosePath.rs index b9892c32723..93730953931 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegClosePath.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegClosePath.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicAbs.rs index fbeb6886d65..b79861eb257 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicRel.rs b/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicRel.rs index f3ee149fa55..7839843d679 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicSmoothAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicSmoothAbs.rs index 07896918b09..d71e6a44d67 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicSmoothAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicSmoothAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicSmoothRel.rs b/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicSmoothRel.rs index d2b03a26542..685e35f24a5 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicSmoothRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegCurvetoCubicSmoothRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticAbs.rs index 4770f97c814..e881cb7dfcb 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticRel.rs b/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticRel.rs index 6a3457d747e..968f2b467ad 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticSmoothAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticSmoothAbs.rs index 9f19b4f5327..a9ca9301176 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticSmoothAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticSmoothAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticSmoothRel.rs b/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticSmoothRel.rs index eadff9849cf..b6e2817c9a7 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticSmoothRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegCurvetoQuadraticSmoothRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegLinetoAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegLinetoAbs.rs index 6f6b930f8a5..aa933fd0db7 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegLinetoAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegLinetoAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegLinetoHorizontalAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegLinetoHorizontalAbs.rs index fb6bba694e2..7c674e635f2 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegLinetoHorizontalAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegLinetoHorizontalAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegLinetoHorizontalRel.rs b/crates/web-sys/src/features/gen_SvgPathSegLinetoHorizontalRel.rs index 461458dba21..d95770ef77e 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegLinetoHorizontalRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegLinetoHorizontalRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegLinetoRel.rs b/crates/web-sys/src/features/gen_SvgPathSegLinetoRel.rs index 64daaf4fa04..be628f8658e 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegLinetoRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegLinetoRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegLinetoVerticalAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegLinetoVerticalAbs.rs index 39a50d6ac89..d02f005d069 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegLinetoVerticalAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegLinetoVerticalAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegLinetoVerticalRel.rs b/crates/web-sys/src/features/gen_SvgPathSegLinetoVerticalRel.rs index 98c9d076b08..cbe51e28158 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegLinetoVerticalRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegLinetoVerticalRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegList.rs b/crates/web-sys/src/features/gen_SvgPathSegList.rs index 76ae0db675f..9fc77b573e2 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegList.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -34,7 +35,7 @@ extern "C" { js_class = "SVGPathSegList", indexing_getter )] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgPathSegMovetoAbs.rs b/crates/web-sys/src/features/gen_SvgPathSegMovetoAbs.rs index ae2f75afbb9..147747d5d48 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegMovetoAbs.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegMovetoAbs.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPathSegMovetoRel.rs b/crates/web-sys/src/features/gen_SvgPathSegMovetoRel.rs index d65c052f96b..ba8d2e39740 100644 --- a/crates/web-sys/src/features/gen_SvgPathSegMovetoRel.rs +++ b/crates/web-sys/src/features/gen_SvgPathSegMovetoRel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPatternElement.rs b/crates/web-sys/src/features/gen_SvgPatternElement.rs index 2e8575bee58..878d8934a39 100644 --- a/crates/web-sys/src/features/gen_SvgPatternElement.rs +++ b/crates/web-sys/src/features/gen_SvgPatternElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPoint.rs b/crates/web-sys/src/features/gen_SvgPoint.rs index 8a328ff23a7..52a6ed2c6a8 100644 --- a/crates/web-sys/src/features/gen_SvgPoint.rs +++ b/crates/web-sys/src/features/gen_SvgPoint.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPointList.rs b/crates/web-sys/src/features/gen_SvgPointList.rs index fde144f5edb..af13249ac1c 100644 --- a/crates/web-sys/src/features/gen_SvgPointList.rs +++ b/crates/web-sys/src/features/gen_SvgPointList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -83,7 +84,7 @@ extern "C" { ) -> Result; #[cfg(feature = "SvgPoint")] #[wasm_bindgen(catch, method, structural, js_class = "SVGPointList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgPolygonElement.rs b/crates/web-sys/src/features/gen_SvgPolygonElement.rs index 1a1140cee51..4b51bf5a70f 100644 --- a/crates/web-sys/src/features/gen_SvgPolygonElement.rs +++ b/crates/web-sys/src/features/gen_SvgPolygonElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPolylineElement.rs b/crates/web-sys/src/features/gen_SvgPolylineElement.rs index ff3abdc50e1..97507fce095 100644 --- a/crates/web-sys/src/features/gen_SvgPolylineElement.rs +++ b/crates/web-sys/src/features/gen_SvgPolylineElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgPreserveAspectRatio.rs b/crates/web-sys/src/features/gen_SvgPreserveAspectRatio.rs index 57fef2ba243..4ab92d43630 100644 --- a/crates/web-sys/src/features/gen_SvgPreserveAspectRatio.rs +++ b/crates/web-sys/src/features/gen_SvgPreserveAspectRatio.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgRadialGradientElement.rs b/crates/web-sys/src/features/gen_SvgRadialGradientElement.rs index 79627e0223e..7cdd98eabb2 100644 --- a/crates/web-sys/src/features/gen_SvgRadialGradientElement.rs +++ b/crates/web-sys/src/features/gen_SvgRadialGradientElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgRect.rs b/crates/web-sys/src/features/gen_SvgRect.rs index 3ee979817c5..7d89500f957 100644 --- a/crates/web-sys/src/features/gen_SvgRect.rs +++ b/crates/web-sys/src/features/gen_SvgRect.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgRectElement.rs b/crates/web-sys/src/features/gen_SvgRectElement.rs index c019621fcaf..9be592c814c 100644 --- a/crates/web-sys/src/features/gen_SvgRectElement.rs +++ b/crates/web-sys/src/features/gen_SvgRectElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgScriptElement.rs b/crates/web-sys/src/features/gen_SvgScriptElement.rs index 0892cbc609d..14d016bda1c 100644 --- a/crates/web-sys/src/features/gen_SvgScriptElement.rs +++ b/crates/web-sys/src/features/gen_SvgScriptElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGScriptElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgScriptElement`*"] - pub fn type_(this: &SvgScriptElement) -> String; + pub fn type_(this: &SvgScriptElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGScriptElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGScriptElement/crossOrigin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgScriptElement`*"] - pub fn cross_origin(this: &SvgScriptElement) -> Option; + pub fn cross_origin(this: &SvgScriptElement) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , setter , js_class = "SVGScriptElement" , js_name = crossOrigin)] #[doc = "Setter for the `crossOrigin` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgSetElement.rs b/crates/web-sys/src/features/gen_SvgSetElement.rs index 3fe789ecff8..b067247bdcd 100644 --- a/crates/web-sys/src/features/gen_SvgSetElement.rs +++ b/crates/web-sys/src/features/gen_SvgSetElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgStopElement.rs b/crates/web-sys/src/features/gen_SvgStopElement.rs index 3bbd4523b22..e44635629ab 100644 --- a/crates/web-sys/src/features/gen_SvgStopElement.rs +++ b/crates/web-sys/src/features/gen_SvgStopElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgStringList.rs b/crates/web-sys/src/features/gen_SvgStringList.rs index 57362b9b245..9344ea162dc 100644 --- a/crates/web-sys/src/features/gen_SvgStringList.rs +++ b/crates/web-sys/src/features/gen_SvgStringList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGStringList/appendItem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStringList`*"] - pub fn append_item(this: &SvgStringList, new_item: &str) -> Result; + pub fn append_item( + this: &SvgStringList, + new_item: &str, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (method , structural , js_class = "SVGStringList" , js_name = clear)] #[doc = "The `clear()` method."] #[doc = ""] @@ -45,14 +49,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGStringList/getItem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStringList`*"] - pub fn get_item(this: &SvgStringList, index: u32) -> Result; + pub fn get_item(this: &SvgStringList, index: u32) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "SVGStringList" , js_name = initialize)] #[doc = "The `initialize()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGStringList/initialize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStringList`*"] - pub fn initialize(this: &SvgStringList, new_item: &str) -> Result; + pub fn initialize( + this: &SvgStringList, + new_item: &str, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "SVGStringList" , js_name = insertItemBefore)] #[doc = "The `insertItemBefore()` method."] #[doc = ""] @@ -63,14 +70,17 @@ extern "C" { this: &SvgStringList, new_item: &str, index: u32, - ) -> Result; + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "SVGStringList" , js_name = removeItem)] #[doc = "The `removeItem()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGStringList/removeItem)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStringList`*"] - pub fn remove_item(this: &SvgStringList, index: u32) -> Result; + pub fn remove_item( + this: &SvgStringList, + index: u32, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "SVGStringList" , js_name = replaceItem)] #[doc = "The `replaceItem()` method."] #[doc = ""] @@ -81,12 +91,12 @@ extern "C" { this: &SvgStringList, new_item: &str, index: u32, - ) -> Result; + ) -> Result<::alloc::string::String, JsValue>; #[wasm_bindgen(method, structural, js_class = "SVGStringList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStringList`*"] - pub fn get(this: &SvgStringList, index: u32) -> Option; + pub fn get(this: &SvgStringList, index: u32) -> Option<::alloc::string::String>; } diff --git a/crates/web-sys/src/features/gen_SvgStyleElement.rs b/crates/web-sys/src/features/gen_SvgStyleElement.rs index 2c36d5969a0..7ee045abfbe 100644 --- a/crates/web-sys/src/features/gen_SvgStyleElement.rs +++ b/crates/web-sys/src/features/gen_SvgStyleElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGStyleElement/xmlspace)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStyleElement`*"] - pub fn xmlspace(this: &SvgStyleElement) -> String; + pub fn xmlspace(this: &SvgStyleElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGStyleElement" , js_name = xmlspace)] #[doc = "Setter for the `xmlspace` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGStyleElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStyleElement`*"] - pub fn type_(this: &SvgStyleElement) -> String; + pub fn type_(this: &SvgStyleElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGStyleElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -45,7 +46,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGStyleElement/media)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStyleElement`*"] - pub fn media(this: &SvgStyleElement) -> String; + pub fn media(this: &SvgStyleElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGStyleElement" , js_name = media)] #[doc = "Setter for the `media` field of this object."] #[doc = ""] @@ -59,7 +60,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGStyleElement/title)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgStyleElement`*"] - pub fn title(this: &SvgStyleElement) -> String; + pub fn title(this: &SvgStyleElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGStyleElement" , js_name = title)] #[doc = "Setter for the `title` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgSwitchElement.rs b/crates/web-sys/src/features/gen_SvgSwitchElement.rs index 62ba99363fc..925d668262d 100644 --- a/crates/web-sys/src/features/gen_SvgSwitchElement.rs +++ b/crates/web-sys/src/features/gen_SvgSwitchElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgSymbolElement.rs b/crates/web-sys/src/features/gen_SvgSymbolElement.rs index 2fd29f06000..e9a4874aa16 100644 --- a/crates/web-sys/src/features/gen_SvgSymbolElement.rs +++ b/crates/web-sys/src/features/gen_SvgSymbolElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgTextContentElement.rs b/crates/web-sys/src/features/gen_SvgTextContentElement.rs index ac2abf5dcb5..2aa8553c37d 100644 --- a/crates/web-sys/src/features/gen_SvgTextContentElement.rs +++ b/crates/web-sys/src/features/gen_SvgTextContentElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgTextElement.rs b/crates/web-sys/src/features/gen_SvgTextElement.rs index 5b046b017a8..2a937a5bdc5 100644 --- a/crates/web-sys/src/features/gen_SvgTextElement.rs +++ b/crates/web-sys/src/features/gen_SvgTextElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgTextPathElement.rs b/crates/web-sys/src/features/gen_SvgTextPathElement.rs index 9e274b3c30c..1e7ce1d56ee 100644 --- a/crates/web-sys/src/features/gen_SvgTextPathElement.rs +++ b/crates/web-sys/src/features/gen_SvgTextPathElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgTextPositioningElement.rs b/crates/web-sys/src/features/gen_SvgTextPositioningElement.rs index ee5d40db854..42a810235b9 100644 --- a/crates/web-sys/src/features/gen_SvgTextPositioningElement.rs +++ b/crates/web-sys/src/features/gen_SvgTextPositioningElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgTitleElement.rs b/crates/web-sys/src/features/gen_SvgTitleElement.rs index 4f15b6ee4f5..34c3a7df40d 100644 --- a/crates/web-sys/src/features/gen_SvgTitleElement.rs +++ b/crates/web-sys/src/features/gen_SvgTitleElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgTransform.rs b/crates/web-sys/src/features/gen_SvgTransform.rs index 00615597b48..1fcc2fc7e60 100644 --- a/crates/web-sys/src/features/gen_SvgTransform.rs +++ b/crates/web-sys/src/features/gen_SvgTransform.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgTransformList.rs b/crates/web-sys/src/features/gen_SvgTransformList.rs index 66cfac09af4..1f5957aaed6 100644 --- a/crates/web-sys/src/features/gen_SvgTransformList.rs +++ b/crates/web-sys/src/features/gen_SvgTransformList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -114,7 +115,7 @@ extern "C" { js_class = "SVGTransformList", indexing_getter )] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgUnitTypes.rs b/crates/web-sys/src/features/gen_SvgUnitTypes.rs index d5d1bf3c021..fa9160a21c7 100644 --- a/crates/web-sys/src/features/gen_SvgUnitTypes.rs +++ b/crates/web-sys/src/features/gen_SvgUnitTypes.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgUseElement.rs b/crates/web-sys/src/features/gen_SvgUseElement.rs index 4410c45b918..73600c083b1 100644 --- a/crates/web-sys/src/features/gen_SvgUseElement.rs +++ b/crates/web-sys/src/features/gen_SvgUseElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgViewElement.rs b/crates/web-sys/src/features/gen_SvgViewElement.rs index 64baf02dae5..a80d9bf0c8e 100644 --- a/crates/web-sys/src/features/gen_SvgViewElement.rs +++ b/crates/web-sys/src/features/gen_SvgViewElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgZoomAndPan.rs b/crates/web-sys/src/features/gen_SvgZoomAndPan.rs index 187d2f00a24..a0794d7eba6 100644 --- a/crates/web-sys/src/features/gen_SvgZoomAndPan.rs +++ b/crates/web-sys/src/features/gen_SvgZoomAndPan.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgaElement.rs b/crates/web-sys/src/features/gen_SvgaElement.rs index e866e2ff235..f4bc67cad3f 100644 --- a/crates/web-sys/src/features/gen_SvgaElement.rs +++ b/crates/web-sys/src/features/gen_SvgaElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAElement/download)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgaElement`*"] - pub fn download(this: &SvgaElement) -> String; + pub fn download(this: &SvgaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGAElement" , js_name = download)] #[doc = "Setter for the `download` field of this object."] #[doc = ""] @@ -39,7 +40,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAElement/ping)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgaElement`*"] - pub fn ping(this: &SvgaElement) -> String; + pub fn ping(this: &SvgaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGAElement" , js_name = ping)] #[doc = "Setter for the `ping` field of this object."] #[doc = ""] @@ -53,7 +54,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAElement/rel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgaElement`*"] - pub fn rel(this: &SvgaElement) -> String; + pub fn rel(this: &SvgaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGAElement" , js_name = rel)] #[doc = "Setter for the `rel` field of this object."] #[doc = ""] @@ -67,7 +68,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAElement/referrerPolicy)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgaElement`*"] - pub fn referrer_policy(this: &SvgaElement) -> String; + pub fn referrer_policy(this: &SvgaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGAElement" , js_name = referrerPolicy)] #[doc = "Setter for the `referrerPolicy` field of this object."] #[doc = ""] @@ -89,7 +90,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAElement/hreflang)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgaElement`*"] - pub fn hreflang(this: &SvgaElement) -> String; + pub fn hreflang(this: &SvgaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGAElement" , js_name = hreflang)] #[doc = "Setter for the `hreflang` field of this object."] #[doc = ""] @@ -103,7 +104,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAElement/type)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgaElement`*"] - pub fn type_(this: &SvgaElement) -> String; + pub fn type_(this: &SvgaElement) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "SVGAElement" , js_name = type)] #[doc = "Setter for the `type` field of this object."] #[doc = ""] @@ -117,7 +118,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGAElement/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `SvgaElement`*"] - pub fn text(this: &SvgaElement) -> Result; + pub fn text(this: &SvgaElement) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "SVGAElement" , js_name = text)] #[doc = "Setter for the `text` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_SvgfeBlendElement.rs b/crates/web-sys/src/features/gen_SvgfeBlendElement.rs index 97ce3978d3f..36d2eec9c3e 100644 --- a/crates/web-sys/src/features/gen_SvgfeBlendElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeBlendElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeColorMatrixElement.rs b/crates/web-sys/src/features/gen_SvgfeColorMatrixElement.rs index c951981f805..4c07492096d 100644 --- a/crates/web-sys/src/features/gen_SvgfeColorMatrixElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeColorMatrixElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeComponentTransferElement.rs b/crates/web-sys/src/features/gen_SvgfeComponentTransferElement.rs index dda9bff7abc..b78b3fd8ff1 100644 --- a/crates/web-sys/src/features/gen_SvgfeComponentTransferElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeComponentTransferElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeCompositeElement.rs b/crates/web-sys/src/features/gen_SvgfeCompositeElement.rs index 23f4db08813..a6e3bf4f941 100644 --- a/crates/web-sys/src/features/gen_SvgfeCompositeElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeCompositeElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeConvolveMatrixElement.rs b/crates/web-sys/src/features/gen_SvgfeConvolveMatrixElement.rs index 605a9ac66c0..ab6d46b0584 100644 --- a/crates/web-sys/src/features/gen_SvgfeConvolveMatrixElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeConvolveMatrixElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeDiffuseLightingElement.rs b/crates/web-sys/src/features/gen_SvgfeDiffuseLightingElement.rs index 6ac26b3fa0a..3429d6027f8 100644 --- a/crates/web-sys/src/features/gen_SvgfeDiffuseLightingElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeDiffuseLightingElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeDisplacementMapElement.rs b/crates/web-sys/src/features/gen_SvgfeDisplacementMapElement.rs index f533134b626..8eff0b71f86 100644 --- a/crates/web-sys/src/features/gen_SvgfeDisplacementMapElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeDisplacementMapElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeDistantLightElement.rs b/crates/web-sys/src/features/gen_SvgfeDistantLightElement.rs index 424df95f628..52dbdf60a46 100644 --- a/crates/web-sys/src/features/gen_SvgfeDistantLightElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeDistantLightElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeDropShadowElement.rs b/crates/web-sys/src/features/gen_SvgfeDropShadowElement.rs index d48d5d6b2f3..77d96fecaaa 100644 --- a/crates/web-sys/src/features/gen_SvgfeDropShadowElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeDropShadowElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeFloodElement.rs b/crates/web-sys/src/features/gen_SvgfeFloodElement.rs index 392ebacf390..77047a40c55 100644 --- a/crates/web-sys/src/features/gen_SvgfeFloodElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeFloodElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeFuncAElement.rs b/crates/web-sys/src/features/gen_SvgfeFuncAElement.rs index 688c97d0a77..57c2e0bc9f1 100644 --- a/crates/web-sys/src/features/gen_SvgfeFuncAElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeFuncAElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeFuncBElement.rs b/crates/web-sys/src/features/gen_SvgfeFuncBElement.rs index d0ebf847499..322663f82b1 100644 --- a/crates/web-sys/src/features/gen_SvgfeFuncBElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeFuncBElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeFuncGElement.rs b/crates/web-sys/src/features/gen_SvgfeFuncGElement.rs index dc61bf560b5..2332e71c83d 100644 --- a/crates/web-sys/src/features/gen_SvgfeFuncGElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeFuncGElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeFuncRElement.rs b/crates/web-sys/src/features/gen_SvgfeFuncRElement.rs index de260ac38c6..a87e383934c 100644 --- a/crates/web-sys/src/features/gen_SvgfeFuncRElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeFuncRElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeGaussianBlurElement.rs b/crates/web-sys/src/features/gen_SvgfeGaussianBlurElement.rs index 88cb074d10a..7e4d094197b 100644 --- a/crates/web-sys/src/features/gen_SvgfeGaussianBlurElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeGaussianBlurElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeImageElement.rs b/crates/web-sys/src/features/gen_SvgfeImageElement.rs index efb101bbce7..613b41bc496 100644 --- a/crates/web-sys/src/features/gen_SvgfeImageElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeImageElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeMergeElement.rs b/crates/web-sys/src/features/gen_SvgfeMergeElement.rs index 7ff05f3df60..7669d64e3a2 100644 --- a/crates/web-sys/src/features/gen_SvgfeMergeElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeMergeElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeMergeNodeElement.rs b/crates/web-sys/src/features/gen_SvgfeMergeNodeElement.rs index ed556e18fdb..8aa4c4acf60 100644 --- a/crates/web-sys/src/features/gen_SvgfeMergeNodeElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeMergeNodeElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeMorphologyElement.rs b/crates/web-sys/src/features/gen_SvgfeMorphologyElement.rs index 5170c0471b3..2ccab08b362 100644 --- a/crates/web-sys/src/features/gen_SvgfeMorphologyElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeMorphologyElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeOffsetElement.rs b/crates/web-sys/src/features/gen_SvgfeOffsetElement.rs index 3baf9001551..7c5b017b803 100644 --- a/crates/web-sys/src/features/gen_SvgfeOffsetElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeOffsetElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfePointLightElement.rs b/crates/web-sys/src/features/gen_SvgfePointLightElement.rs index 2c417c93ebe..d3b3e90b42f 100644 --- a/crates/web-sys/src/features/gen_SvgfePointLightElement.rs +++ b/crates/web-sys/src/features/gen_SvgfePointLightElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeSpecularLightingElement.rs b/crates/web-sys/src/features/gen_SvgfeSpecularLightingElement.rs index 56bc66036c3..5a658bec0d4 100644 --- a/crates/web-sys/src/features/gen_SvgfeSpecularLightingElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeSpecularLightingElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeSpotLightElement.rs b/crates/web-sys/src/features/gen_SvgfeSpotLightElement.rs index 28da387678e..e7d5b0f8bd6 100644 --- a/crates/web-sys/src/features/gen_SvgfeSpotLightElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeSpotLightElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeTileElement.rs b/crates/web-sys/src/features/gen_SvgfeTileElement.rs index cad40bd16cb..041990f0fe2 100644 --- a/crates/web-sys/src/features/gen_SvgfeTileElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeTileElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgfeTurbulenceElement.rs b/crates/web-sys/src/features/gen_SvgfeTurbulenceElement.rs index 6e91ac5a62e..47961537334 100644 --- a/crates/web-sys/src/features/gen_SvgfeTurbulenceElement.rs +++ b/crates/web-sys/src/features/gen_SvgfeTurbulenceElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvggElement.rs b/crates/web-sys/src/features/gen_SvggElement.rs index d7d35dca98a..0668e102b7a 100644 --- a/crates/web-sys/src/features/gen_SvggElement.rs +++ b/crates/web-sys/src/features/gen_SvggElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgmPathElement.rs b/crates/web-sys/src/features/gen_SvgmPathElement.rs index adacfbabe01..007ea796e94 100644 --- a/crates/web-sys/src/features/gen_SvgmPathElement.rs +++ b/crates/web-sys/src/features/gen_SvgmPathElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgsvgElement.rs b/crates/web-sys/src/features/gen_SvgsvgElement.rs index b7978354d3e..b62f2f641ee 100644 --- a/crates/web-sys/src/features/gen_SvgsvgElement.rs +++ b/crates/web-sys/src/features/gen_SvgsvgElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_SvgtSpanElement.rs b/crates/web-sys/src/features/gen_SvgtSpanElement.rs index fc943015da5..5a8cf8cbabd 100644 --- a/crates/web-sys/src/features/gen_SvgtSpanElement.rs +++ b/crates/web-sys/src/features/gen_SvgtSpanElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TaskController.rs b/crates/web-sys/src/features/gen_TaskController.rs new file mode 100644 index 00000000000..3dcb523db71 --- /dev/null +++ b/crates/web-sys/src/features/gen_TaskController.rs @@ -0,0 +1,54 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = AbortController , extends = :: js_sys :: Object , js_name = TaskController , typescript_type = "TaskController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TaskController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskController`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type TaskController; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "TaskController")] + #[doc = "The `new TaskController(..)` constructor, creating a new instance of `TaskController`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskController/TaskController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskController`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskControllerInit")] + #[wasm_bindgen(catch, constructor, js_class = "TaskController")] + #[doc = "The `new TaskController(..)` constructor, creating a new instance of `TaskController`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskController/TaskController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskController`, `TaskControllerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_init(init: &TaskControllerInit) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + # [wasm_bindgen (catch , method , structural , js_class = "TaskController" , js_name = setPriority)] + #[doc = "The `setPriority()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskController/setPriority)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskController`, `TaskPriority`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_priority(this: &TaskController, priority: TaskPriority) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_TaskControllerInit.rs b/crates/web-sys/src/features/gen_TaskControllerInit.rs new file mode 100644 index 00000000000..71b2c5a0e46 --- /dev/null +++ b/crates/web-sys/src/features/gen_TaskControllerInit.rs @@ -0,0 +1,64 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TaskControllerInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TaskControllerInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskControllerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type TaskControllerInit; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[doc = "Get the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskControllerInit`, `TaskPriority`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "priority")] + pub fn get_priority(this: &TaskControllerInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[doc = "Change the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskControllerInit`, `TaskPriority`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "priority")] + pub fn set_priority(this: &TaskControllerInit, val: TaskPriority); +} +#[cfg(web_sys_unstable_apis)] +impl TaskControllerInit { + #[doc = "Construct a new `TaskControllerInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskControllerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[deprecated = "Use `set_priority()` instead."] + pub fn priority(&mut self, val: TaskPriority) -> &mut Self { + self.set_priority(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for TaskControllerInit { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_TaskPriority.rs b/crates/web-sys/src/features/gen_TaskPriority.rs new file mode 100644 index 00000000000..4d04fe23c15 --- /dev/null +++ b/crates/web-sys/src/features/gen_TaskPriority.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `TaskPriority` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `TaskPriority`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum TaskPriority { + UserBlocking = "user-blocking", + UserVisible = "user-visible", + Background = "background", +} diff --git a/crates/web-sys/src/features/gen_TaskPriorityChangeEvent.rs b/crates/web-sys/src/features/gen_TaskPriorityChangeEvent.rs new file mode 100644 index 00000000000..618696a7bde --- /dev/null +++ b/crates/web-sys/src/features/gen_TaskPriorityChangeEvent.rs @@ -0,0 +1,46 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = TaskPriorityChangeEvent , typescript_type = "TaskPriorityChangeEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TaskPriorityChangeEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskPriorityChangeEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type TaskPriorityChangeEvent; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + # [wasm_bindgen (structural , method , getter , js_class = "TaskPriorityChangeEvent" , js_name = previousPriority)] + #[doc = "Getter for the `previousPriority` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskPriorityChangeEvent/previousPriority)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriority`, `TaskPriorityChangeEvent`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn previous_priority(this: &TaskPriorityChangeEvent) -> TaskPriority; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriorityChangeEventInit")] + #[wasm_bindgen(catch, constructor, js_class = "TaskPriorityChangeEvent")] + #[doc = "The `new TaskPriorityChangeEvent(..)` constructor, creating a new instance of `TaskPriorityChangeEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskPriorityChangeEvent/TaskPriorityChangeEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEvent`, `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + type_: &str, + priority_change_event_init_dict: &TaskPriorityChangeEventInit, + ) -> Result; +} diff --git a/crates/web-sys/src/features/gen_TaskPriorityChangeEventInit.rs b/crates/web-sys/src/features/gen_TaskPriorityChangeEventInit.rs new file mode 100644 index 00000000000..caf66dc02e6 --- /dev/null +++ b/crates/web-sys/src/features/gen_TaskPriorityChangeEventInit.rs @@ -0,0 +1,132 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TaskPriorityChangeEventInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TaskPriorityChangeEventInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type TaskPriorityChangeEventInit; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &TaskPriorityChangeEventInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &TaskPriorityChangeEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &TaskPriorityChangeEventInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &TaskPriorityChangeEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &TaskPriorityChangeEventInit) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &TaskPriorityChangeEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[doc = "Get the `previousPriority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriority`, `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "previousPriority")] + pub fn get_previous_priority(this: &TaskPriorityChangeEventInit) -> TaskPriority; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[doc = "Change the `previousPriority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriority`, `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "previousPriority")] + pub fn set_previous_priority(this: &TaskPriorityChangeEventInit, val: TaskPriority); +} +#[cfg(web_sys_unstable_apis)] +impl TaskPriorityChangeEventInit { + #[cfg(feature = "TaskPriority")] + #[doc = "Construct a new `TaskPriorityChangeEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriority`, `TaskPriorityChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(previous_priority: TaskPriority) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_previous_priority(previous_priority); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + #[deprecated = "Use `set_previous_priority()` instead."] + pub fn previous_priority(&mut self, val: TaskPriority) -> &mut Self { + self.set_previous_priority(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_TaskSignal.rs b/crates/web-sys/src/features/gen_TaskSignal.rs new file mode 100644 index 00000000000..62044bcf932 --- /dev/null +++ b/crates/web-sys/src/features/gen_TaskSignal.rs @@ -0,0 +1,77 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = AbortSignal , extends = EventTarget , extends = :: js_sys :: Object , js_name = TaskSignal , typescript_type = "TaskSignal")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TaskSignal` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskSignal)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignal`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type TaskSignal; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskPriority")] + # [wasm_bindgen (structural , method , getter , js_class = "TaskSignal" , js_name = priority)] + #[doc = "Getter for the `priority` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskSignal/priority)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskPriority`, `TaskSignal`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn priority(this: &TaskSignal) -> TaskPriority; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "TaskSignal" , js_name = onprioritychange)] + #[doc = "Getter for the `onprioritychange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskSignal/onprioritychange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignal`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onprioritychange(this: &TaskSignal) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "TaskSignal" , js_name = onprioritychange)] + #[doc = "Setter for the `onprioritychange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskSignal/onprioritychange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignal`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onprioritychange(this: &TaskSignal, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (static_method_of = TaskSignal , js_class = "TaskSignal" , js_name = any)] + #[doc = "The `any()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskSignal/any_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignal`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn any(signals: &::wasm_bindgen::JsValue) -> TaskSignal; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "TaskSignalAnyInit")] + # [wasm_bindgen (static_method_of = TaskSignal , js_class = "TaskSignal" , js_name = any)] + #[doc = "The `any()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TaskSignal/any_static)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignal`, `TaskSignalAnyInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn any_with_init(signals: &::wasm_bindgen::JsValue, init: &TaskSignalAnyInit) + -> TaskSignal; +} diff --git a/crates/web-sys/src/features/gen_TaskSignalAnyInit.rs b/crates/web-sys/src/features/gen_TaskSignalAnyInit.rs new file mode 100644 index 00000000000..61fc8bc9de0 --- /dev/null +++ b/crates/web-sys/src/features/gen_TaskSignalAnyInit.rs @@ -0,0 +1,61 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TaskSignalAnyInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TaskSignalAnyInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignalAnyInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type TaskSignalAnyInit; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignalAnyInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "priority")] + pub fn get_priority(this: &TaskSignalAnyInit) -> ::wasm_bindgen::JsValue; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `priority` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignalAnyInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "priority")] + pub fn set_priority(this: &TaskSignalAnyInit, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl TaskSignalAnyInit { + #[doc = "Construct a new `TaskSignalAnyInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TaskSignalAnyInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_priority()` instead."] + pub fn priority(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_priority(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for TaskSignalAnyInit { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_TcpReadyState.rs b/crates/web-sys/src/features/gen_TcpReadyState.rs index 7dff83babc2..a4ff84a1047 100644 --- a/crates/web-sys/src/features/gen_TcpReadyState.rs +++ b/crates/web-sys/src/features/gen_TcpReadyState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `TcpReadyState` enum."] diff --git a/crates/web-sys/src/features/gen_TcpServerSocket.rs b/crates/web-sys/src/features/gen_TcpServerSocket.rs index 0904f2ddffe..614fbfa7f43 100644 --- a/crates/web-sys/src/features/gen_TcpServerSocket.rs +++ b/crates/web-sys/src/features/gen_TcpServerSocket.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TcpServerSocketEvent.rs b/crates/web-sys/src/features/gen_TcpServerSocketEvent.rs index 4faa0de7440..fe0493eef0f 100644 --- a/crates/web-sys/src/features/gen_TcpServerSocketEvent.rs +++ b/crates/web-sys/src/features/gen_TcpServerSocketEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TcpServerSocketEventInit.rs b/crates/web-sys/src/features/gen_TcpServerSocketEventInit.rs index f0c7dcdfb9d..1021c266f49 100644 --- a/crates/web-sys/src/features/gen_TcpServerSocketEventInit.rs +++ b/crates/web-sys/src/features/gen_TcpServerSocketEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,48 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] pub type TcpServerSocketEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &TcpServerSocketEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &TcpServerSocketEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &TcpServerSocketEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &TcpServerSocketEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &TcpServerSocketEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &TcpServerSocketEventInit, val: bool); + #[cfg(feature = "TcpSocket")] + #[doc = "Get the `socket` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`, `TcpSocket`*"] + #[wasm_bindgen(method, getter = "socket")] + pub fn get_socket(this: &TcpServerSocketEventInit) -> Option; + #[cfg(feature = "TcpSocket")] + #[doc = "Change the `socket` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`, `TcpSocket`*"] + #[wasm_bindgen(method, setter = "socket")] + pub fn set_socket(this: &TcpServerSocketEventInit, val: Option<&TcpSocket>); } impl TcpServerSocketEventInit { #[doc = "Construct a new `TcpServerSocketEventInit`."] @@ -19,70 +62,25 @@ impl TcpServerSocketEventInit { 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: `TcpServerSocketEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } #[cfg(feature = "TcpSocket")] - #[doc = "Change the `socket` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpServerSocketEventInit`, `TcpSocket`*"] + #[deprecated = "Use `set_socket()` instead."] pub fn socket(&mut self, val: Option<&TcpSocket>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("socket"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_socket(val); self } } diff --git a/crates/web-sys/src/features/gen_TcpSocket.rs b/crates/web-sys/src/features/gen_TcpSocket.rs index 3631e805b75..86fb34450b2 100644 --- a/crates/web-sys/src/features/gen_TcpSocket.rs +++ b/crates/web-sys/src/features/gen_TcpSocket.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPSocket/host)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocket`*"] - pub fn host(this: &TcpSocket) -> String; + pub fn host(this: &TcpSocket) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "TCPSocket" , js_name = port)] #[doc = "Getter for the `port` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TcpSocketBinaryType.rs b/crates/web-sys/src/features/gen_TcpSocketBinaryType.rs index 762dd9a7137..7951276a0d6 100644 --- a/crates/web-sys/src/features/gen_TcpSocketBinaryType.rs +++ b/crates/web-sys/src/features/gen_TcpSocketBinaryType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `TcpSocketBinaryType` enum."] diff --git a/crates/web-sys/src/features/gen_TcpSocketErrorEvent.rs b/crates/web-sys/src/features/gen_TcpSocketErrorEvent.rs index a2d1daf93c8..306efd487f2 100644 --- a/crates/web-sys/src/features/gen_TcpSocketErrorEvent.rs +++ b/crates/web-sys/src/features/gen_TcpSocketErrorEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPSocketErrorEvent/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEvent`*"] - pub fn name(this: &TcpSocketErrorEvent) -> String; + pub fn name(this: &TcpSocketErrorEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "TCPSocketErrorEvent" , js_name = message)] #[doc = "Getter for the `message` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPSocketErrorEvent/message)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEvent`*"] - pub fn message(this: &TcpSocketErrorEvent) -> String; + pub fn message(this: &TcpSocketErrorEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "TCPSocketErrorEvent")] #[doc = "The `new TcpSocketErrorEvent(..)` constructor, creating a new instance of `TcpSocketErrorEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TcpSocketErrorEventInit.rs b/crates/web-sys/src/features/gen_TcpSocketErrorEventInit.rs index cfe92df2e8d..b51f897d895 100644 --- a/crates/web-sys/src/features/gen_TcpSocketErrorEventInit.rs +++ b/crates/web-sys/src/features/gen_TcpSocketErrorEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] pub type TcpSocketErrorEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &TcpSocketErrorEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &TcpSocketErrorEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &TcpSocketErrorEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &TcpSocketErrorEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &TcpSocketErrorEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &TcpSocketErrorEventInit, val: bool); + #[doc = "Get the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, getter = "message")] + pub fn get_message(this: &TcpSocketErrorEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `message` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, setter = "message")] + pub fn set_message(this: &TcpSocketErrorEventInit, val: &str); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &TcpSocketErrorEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &TcpSocketErrorEventInit, val: &str); } impl TcpSocketErrorEventInit { #[doc = "Construct a new `TcpSocketErrorEventInit`."] @@ -19,85 +70,29 @@ impl TcpSocketErrorEventInit { 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: `TcpSocketErrorEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `message` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[deprecated = "Use `set_message()` instead."] pub fn message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("message"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_message(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpSocketErrorEventInit`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } } diff --git a/crates/web-sys/src/features/gen_TcpSocketEvent.rs b/crates/web-sys/src/features/gen_TcpSocketEvent.rs index 37623fb3b0b..e9ade38d70b 100644 --- a/crates/web-sys/src/features/gen_TcpSocketEvent.rs +++ b/crates/web-sys/src/features/gen_TcpSocketEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TcpSocketEventInit.rs b/crates/web-sys/src/features/gen_TcpSocketEventInit.rs index e62fe981b7a..5980130f25a 100644 --- a/crates/web-sys/src/features/gen_TcpSocketEventInit.rs +++ b/crates/web-sys/src/features/gen_TcpSocketEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] pub type TcpSocketEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &TcpSocketEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &TcpSocketEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &TcpSocketEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &TcpSocketEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &TcpSocketEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &TcpSocketEventInit, val: bool); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &TcpSocketEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &TcpSocketEventInit, val: &::wasm_bindgen::JsValue); } impl TcpSocketEventInit { #[doc = "Construct a new `TcpSocketEventInit`."] @@ -19,68 +60,24 @@ impl TcpSocketEventInit { 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: `TcpSocketEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `data` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TcpSocketEventInit`*"] + #[deprecated = "Use `set_data()` instead."] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_data(val); self } } diff --git a/crates/web-sys/src/features/gen_Text.rs b/crates/web-sys/src/features/gen_Text.rs index 12d84e1fdd5..e629e597189 100644 --- a/crates/web-sys/src/features/gen_Text.rs +++ b/crates/web-sys/src/features/gen_Text.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Text/wholeText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Text`*"] - pub fn whole_text(this: &Text) -> Result; + pub fn whole_text(this: &Text) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "HtmlSlotElement")] # [wasm_bindgen (structural , method , getter , js_class = "Text" , js_name = assignedSlot)] #[doc = "Getter for the `assignedSlot` field of this object."] diff --git a/crates/web-sys/src/features/gen_TextDecodeOptions.rs b/crates/web-sys/src/features/gen_TextDecodeOptions.rs index 65277eeba99..e9176c5d9e8 100644 --- a/crates/web-sys/src/features/gen_TextDecodeOptions.rs +++ b/crates/web-sys/src/features/gen_TextDecodeOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`*"] pub type TextDecodeOptions; + #[doc = "Get the `stream` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`*"] + #[wasm_bindgen(method, getter = "stream")] + pub fn get_stream(this: &TextDecodeOptions) -> Option; + #[doc = "Change the `stream` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`*"] + #[wasm_bindgen(method, setter = "stream")] + pub fn set_stream(this: &TextDecodeOptions, val: bool); } impl TextDecodeOptions { #[doc = "Construct a new `TextDecodeOptions`."] @@ -19,18 +30,9 @@ impl TextDecodeOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `stream` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`*"] + #[deprecated = "Use `set_stream()` instead."] pub fn stream(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("stream"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stream(val); self } } diff --git a/crates/web-sys/src/features/gen_TextDecoder.rs b/crates/web-sys/src/features/gen_TextDecoder.rs index 7eb50d27746..12bbf6f87cd 100644 --- a/crates/web-sys/src/features/gen_TextDecoder.rs +++ b/crates/web-sys/src/features/gen_TextDecoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/encoding)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"] - pub fn encoding(this: &TextDecoder) -> String; + pub fn encoding(this: &TextDecoder) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "TextDecoder" , js_name = fatal)] #[doc = "Getter for the `fatal` field of this object."] #[doc = ""] @@ -56,7 +57,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"] - pub fn decode(this: &TextDecoder) -> Result; + pub fn decode(this: &TextDecoder) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "TextDecoder" , js_name = decode)] #[doc = "The `decode()` method."] #[doc = ""] @@ -66,14 +67,27 @@ extern "C" { pub fn decode_with_buffer_source( this: &TextDecoder, input: &::js_sys::Object, - ) -> Result; + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "TextDecoder" , js_name = decode)] #[doc = "The `decode()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"] - pub fn decode_with_u8_array(this: &TextDecoder, input: &mut [u8]) -> Result; + pub fn decode_with_u8_array( + this: &TextDecoder, + input: &[u8], + ) -> Result<::alloc::string::String, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "TextDecoder" , js_name = decode)] + #[doc = "The `decode()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TextDecoder`*"] + pub fn decode_with_js_u8_array( + this: &TextDecoder, + input: &::js_sys::Uint8Array, + ) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "TextDecodeOptions")] # [wasm_bindgen (catch , method , structural , js_class = "TextDecoder" , js_name = decode)] #[doc = "The `decode()` method."] @@ -85,7 +99,7 @@ extern "C" { this: &TextDecoder, input: &::js_sys::Object, options: &TextDecodeOptions, - ) -> Result; + ) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "TextDecodeOptions")] # [wasm_bindgen (catch , method , structural , js_class = "TextDecoder" , js_name = decode)] #[doc = "The `decode()` method."] @@ -95,7 +109,19 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`, `TextDecoder`*"] pub fn decode_with_u8_array_and_options( this: &TextDecoder, - input: &mut [u8], + input: &[u8], + options: &TextDecodeOptions, + ) -> Result<::alloc::string::String, JsValue>; + #[cfg(feature = "TextDecodeOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "TextDecoder" , js_name = decode)] + #[doc = "The `decode()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TextDecodeOptions`, `TextDecoder`*"] + pub fn decode_with_js_u8_array_and_options( + this: &TextDecoder, + input: &::js_sys::Uint8Array, options: &TextDecodeOptions, - ) -> Result; + ) -> Result<::alloc::string::String, JsValue>; } diff --git a/crates/web-sys/src/features/gen_TextDecoderOptions.rs b/crates/web-sys/src/features/gen_TextDecoderOptions.rs index 7a89d6b0466..1ca8079c0cd 100644 --- a/crates/web-sys/src/features/gen_TextDecoderOptions.rs +++ b/crates/web-sys/src/features/gen_TextDecoderOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextDecoderOptions`*"] pub type TextDecoderOptions; + #[doc = "Get the `fatal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TextDecoderOptions`*"] + #[wasm_bindgen(method, getter = "fatal")] + pub fn get_fatal(this: &TextDecoderOptions) -> Option; + #[doc = "Change the `fatal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TextDecoderOptions`*"] + #[wasm_bindgen(method, setter = "fatal")] + pub fn set_fatal(this: &TextDecoderOptions, val: bool); } impl TextDecoderOptions { #[doc = "Construct a new `TextDecoderOptions`."] @@ -19,17 +30,9 @@ impl TextDecoderOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `fatal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TextDecoderOptions`*"] + #[deprecated = "Use `set_fatal()` instead."] pub fn fatal(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fatal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fatal(val); self } } diff --git a/crates/web-sys/src/features/gen_TextEncoder.rs b/crates/web-sys/src/features/gen_TextEncoder.rs index efaea87bd8b..4d49b845b39 100644 --- a/crates/web-sys/src/features/gen_TextEncoder.rs +++ b/crates/web-sys/src/features/gen_TextEncoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encoding)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"] - pub fn encoding(this: &TextEncoder) -> String; + pub fn encoding(this: &TextEncoder) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "TextEncoder")] #[doc = "The `new TextEncoder(..)` constructor, creating a new instance of `TextEncoder`."] #[doc = ""] @@ -31,12 +32,12 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"] - pub fn encode(this: &TextEncoder) -> Vec; + pub fn encode(this: &TextEncoder) -> ::alloc::vec::Vec; # [wasm_bindgen (method , structural , js_class = "TextEncoder" , js_name = encode)] #[doc = "The `encode()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encode)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"] - pub fn encode_with_input(this: &TextEncoder, input: &str) -> Vec; + pub fn encode_with_input(this: &TextEncoder, input: &str) -> ::alloc::vec::Vec; } diff --git a/crates/web-sys/src/features/gen_TextMetrics.rs b/crates/web-sys/src/features/gen_TextMetrics.rs index fe71817e63f..24aa5ccf3a2 100644 --- a/crates/web-sys/src/features/gen_TextMetrics.rs +++ b/crates/web-sys/src/features/gen_TextMetrics.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TextTrack.rs b/crates/web-sys/src/features/gen_TextTrack.rs index 9e3f5be748f..578de269c91 100644 --- a/crates/web-sys/src/features/gen_TextTrack.rs +++ b/crates/web-sys/src/features/gen_TextTrack.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,28 +26,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"] - pub fn label(this: &TextTrack) -> String; + pub fn label(this: &TextTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "TextTrack" , 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/TextTrack/language)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"] - pub fn language(this: &TextTrack) -> String; + pub fn language(this: &TextTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "TextTrack" , 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/TextTrack/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"] - pub fn id(this: &TextTrack) -> String; + pub fn id(this: &TextTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "TextTrack" , js_name = inBandMetadataTrackDispatchType)] #[doc = "Getter for the `inBandMetadataTrackDispatchType` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/inBandMetadataTrackDispatchType)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextTrack`*"] - pub fn in_band_metadata_track_dispatch_type(this: &TextTrack) -> String; + pub fn in_band_metadata_track_dispatch_type(this: &TextTrack) -> ::alloc::string::String; #[cfg(feature = "TextTrackMode")] # [wasm_bindgen (structural , method , getter , js_class = "TextTrack" , js_name = mode)] #[doc = "Getter for the `mode` field of this object."] diff --git a/crates/web-sys/src/features/gen_TextTrackCue.rs b/crates/web-sys/src/features/gen_TextTrackCue.rs index c73dfaaf16b..08983047b7c 100644 --- a/crates/web-sys/src/features/gen_TextTrackCue.rs +++ b/crates/web-sys/src/features/gen_TextTrackCue.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,7 +26,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TextTrackCue`*"] - pub fn id(this: &TextTrackCue) -> String; + pub fn id(this: &TextTrackCue) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "TextTrackCue" , js_name = id)] #[doc = "Setter for the `id` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TextTrackCueList.rs b/crates/web-sys/src/features/gen_TextTrackCueList.rs index 82e46863ad6..c2aa432b43a 100644 --- a/crates/web-sys/src/features/gen_TextTrackCueList.rs +++ b/crates/web-sys/src/features/gen_TextTrackCueList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -28,7 +29,7 @@ extern "C" { pub fn get_cue_by_id(this: &TextTrackCueList, id: &str) -> Option; #[cfg(feature = "VttCue")] #[wasm_bindgen(method, structural, js_class = "TextTrackCueList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TextTrackKind.rs b/crates/web-sys/src/features/gen_TextTrackKind.rs index ce933e65ca0..5f81e64e533 100644 --- a/crates/web-sys/src/features/gen_TextTrackKind.rs +++ b/crates/web-sys/src/features/gen_TextTrackKind.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `TextTrackKind` enum."] diff --git a/crates/web-sys/src/features/gen_TextTrackList.rs b/crates/web-sys/src/features/gen_TextTrackList.rs index d3f55a1ed39..a71e51630cc 100644 --- a/crates/web-sys/src/features/gen_TextTrackList.rs +++ b/crates/web-sys/src/features/gen_TextTrackList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -70,7 +71,7 @@ extern "C" { pub fn get_track_by_id(this: &TextTrackList, id: &str) -> Option; #[cfg(feature = "TextTrack")] #[wasm_bindgen(method, structural, js_class = "TextTrackList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TextTrackMode.rs b/crates/web-sys/src/features/gen_TextTrackMode.rs index f71fc0812e2..95b9455b1e9 100644 --- a/crates/web-sys/src/features/gen_TextTrackMode.rs +++ b/crates/web-sys/src/features/gen_TextTrackMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `TextTrackMode` enum."] diff --git a/crates/web-sys/src/features/gen_TimeEvent.rs b/crates/web-sys/src/features/gen_TimeEvent.rs index bf89b71aafa..5a26c029eb9 100644 --- a/crates/web-sys/src/features/gen_TimeEvent.rs +++ b/crates/web-sys/src/features/gen_TimeEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TimeRanges.rs b/crates/web-sys/src/features/gen_TimeRanges.rs index 96e3077e919..c7f04c47de3 100644 --- a/crates/web-sys/src/features/gen_TimeRanges.rs +++ b/crates/web-sys/src/features/gen_TimeRanges.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ToggleEvent.rs b/crates/web-sys/src/features/gen_ToggleEvent.rs new file mode 100644 index 00000000000..34fa012e458 --- /dev/null +++ b/crates/web-sys/src/features/gen_ToggleEvent.rs @@ -0,0 +1,47 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = Event , extends = :: js_sys :: Object , js_name = ToggleEvent , typescript_type = "ToggleEvent")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ToggleEvent` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ToggleEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEvent`*"] + pub type ToggleEvent; + # [wasm_bindgen (structural , method , getter , js_class = "ToggleEvent" , js_name = oldState)] + #[doc = "Getter for the `oldState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ToggleEvent/oldState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEvent`*"] + pub fn old_state(this: &ToggleEvent) -> ::alloc::string::String; + # [wasm_bindgen (structural , method , getter , js_class = "ToggleEvent" , js_name = newState)] + #[doc = "Getter for the `newState` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ToggleEvent/newState)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEvent`*"] + pub fn new_state(this: &ToggleEvent) -> ::alloc::string::String; + #[wasm_bindgen(catch, constructor, js_class = "ToggleEvent")] + #[doc = "The `new ToggleEvent(..)` constructor, creating a new instance of `ToggleEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ToggleEvent/ToggleEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEvent`*"] + pub fn new(type_: &str) -> Result; + #[cfg(feature = "ToggleEventInit")] + #[wasm_bindgen(catch, constructor, js_class = "ToggleEvent")] + #[doc = "The `new ToggleEvent(..)` constructor, creating a new instance of `ToggleEvent`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ToggleEvent/ToggleEvent)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEvent`, `ToggleEventInit`*"] + pub fn new_with_event_init_dict( + type_: &str, + event_init_dict: &ToggleEventInit, + ) -> Result; +} diff --git a/crates/web-sys/src/features/gen_ToggleEventInit.rs b/crates/web-sys/src/features/gen_ToggleEventInit.rs new file mode 100644 index 00000000000..e9028eb05d9 --- /dev/null +++ b/crates/web-sys/src/features/gen_ToggleEventInit.rs @@ -0,0 +1,103 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ToggleEventInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ToggleEventInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + pub type ToggleEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ToggleEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ToggleEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ToggleEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ToggleEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ToggleEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ToggleEventInit, val: bool); + #[doc = "Get the `newState` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, getter = "newState")] + pub fn get_new_state(this: &ToggleEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `newState` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, setter = "newState")] + pub fn set_new_state(this: &ToggleEventInit, val: &str); + #[doc = "Get the `oldState` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, getter = "oldState")] + pub fn get_old_state(this: &ToggleEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `oldState` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + #[wasm_bindgen(method, setter = "oldState")] + pub fn set_old_state(this: &ToggleEventInit, val: &str); +} +impl ToggleEventInit { + #[doc = "Construct a new `ToggleEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ToggleEventInit`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[deprecated = "Use `set_new_state()` instead."] + pub fn new_state(&mut self, val: &str) -> &mut Self { + self.set_new_state(val); + self + } + #[deprecated = "Use `set_old_state()` instead."] + pub fn old_state(&mut self, val: &str) -> &mut Self { + self.set_old_state(val); + self + } +} +impl Default for ToggleEventInit { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_TokenBinding.rs b/crates/web-sys/src/features/gen_TokenBinding.rs new file mode 100644 index 00000000000..8066eb2216d --- /dev/null +++ b/crates/web-sys/src/features/gen_TokenBinding.rs @@ -0,0 +1,54 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TokenBinding)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TokenBinding` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TokenBinding`*"] + pub type TokenBinding; + #[doc = "Get the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TokenBinding`*"] + #[wasm_bindgen(method, getter = "id")] + pub fn get_id(this: &TokenBinding) -> Option<::alloc::string::String>; + #[doc = "Change the `id` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TokenBinding`*"] + #[wasm_bindgen(method, setter = "id")] + pub fn set_id(this: &TokenBinding, val: &str); + #[doc = "Get the `status` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TokenBinding`*"] + #[wasm_bindgen(method, getter = "status")] + pub fn get_status(this: &TokenBinding) -> ::alloc::string::String; + #[doc = "Change the `status` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TokenBinding`*"] + #[wasm_bindgen(method, setter = "status")] + pub fn set_status(this: &TokenBinding, val: &str); +} +impl TokenBinding { + #[doc = "Construct a new `TokenBinding`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TokenBinding`*"] + pub fn new(status: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_status(status); + ret + } + #[deprecated = "Use `set_id()` instead."] + pub fn id(&mut self, val: &str) -> &mut Self { + self.set_id(val); + self + } + #[deprecated = "Use `set_status()` instead."] + pub fn status(&mut self, val: &str) -> &mut Self { + self.set_status(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_TokenBindingStatus.rs b/crates/web-sys/src/features/gen_TokenBindingStatus.rs new file mode 100644 index 00000000000..a9afc68ae1f --- /dev/null +++ b/crates/web-sys/src/features/gen_TokenBindingStatus.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `TokenBindingStatus` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `TokenBindingStatus`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum TokenBindingStatus { + Present = "present", + Supported = "supported", +} diff --git a/crates/web-sys/src/features/gen_Touch.rs b/crates/web-sys/src/features/gen_Touch.rs index 2f364edc0a5..ca946be5839 100644 --- a/crates/web-sys/src/features/gen_Touch.rs +++ b/crates/web-sys/src/features/gen_Touch.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TouchEvent.rs b/crates/web-sys/src/features/gen_TouchEvent.rs index 55f2174aab5..5f11ef2067e 100644 --- a/crates/web-sys/src/features/gen_TouchEvent.rs +++ b/crates/web-sys/src/features/gen_TouchEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TouchEventInit.rs b/crates/web-sys/src/features/gen_TouchEventInit.rs index 4923124ecff..18c280b631f 100644 --- a/crates/web-sys/src/features/gen_TouchEventInit.rs +++ b/crates/web-sys/src/features/gen_TouchEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,218 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] pub type TouchEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &TouchEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &TouchEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &TouchEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &TouchEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &TouchEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &TouchEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &TouchEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &TouchEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &TouchEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &TouchEventInit, val: Option<&Window>); + #[doc = "Get the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "altKey")] + pub fn get_alt_key(this: &TouchEventInit) -> Option; + #[doc = "Change the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "altKey")] + pub fn set_alt_key(this: &TouchEventInit, val: bool); + #[doc = "Get the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "ctrlKey")] + pub fn get_ctrl_key(this: &TouchEventInit) -> Option; + #[doc = "Change the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "ctrlKey")] + pub fn set_ctrl_key(this: &TouchEventInit, val: bool); + #[doc = "Get the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "metaKey")] + pub fn get_meta_key(this: &TouchEventInit) -> Option; + #[doc = "Change the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "metaKey")] + pub fn set_meta_key(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierAltGraph")] + pub fn get_modifier_alt_graph(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierAltGraph")] + pub fn set_modifier_alt_graph(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierCapsLock")] + pub fn get_modifier_caps_lock(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierCapsLock")] + pub fn set_modifier_caps_lock(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFn")] + pub fn get_modifier_fn(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFn")] + pub fn set_modifier_fn(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFnLock")] + pub fn get_modifier_fn_lock(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFnLock")] + pub fn set_modifier_fn_lock(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierNumLock")] + pub fn get_modifier_num_lock(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierNumLock")] + pub fn set_modifier_num_lock(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierOS")] + pub fn get_modifier_os(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierOS")] + pub fn set_modifier_os(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierScrollLock")] + pub fn get_modifier_scroll_lock(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierScrollLock")] + pub fn set_modifier_scroll_lock(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbol")] + pub fn get_modifier_symbol(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbol")] + pub fn set_modifier_symbol(this: &TouchEventInit, val: bool); + #[doc = "Get the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbolLock")] + pub fn get_modifier_symbol_lock(this: &TouchEventInit) -> Option; + #[doc = "Change the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + pub fn set_modifier_symbol_lock(this: &TouchEventInit, val: bool); + #[doc = "Get the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "shiftKey")] + pub fn get_shift_key(this: &TouchEventInit) -> Option; + #[doc = "Change the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "shiftKey")] + pub fn set_shift_key(this: &TouchEventInit, val: bool); + #[doc = "Get the `changedTouches` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "changedTouches")] + pub fn get_changed_touches(this: &TouchEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `changedTouches` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "changedTouches")] + pub fn set_changed_touches(this: &TouchEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `targetTouches` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "targetTouches")] + pub fn get_target_touches(this: &TouchEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `targetTouches` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "targetTouches")] + pub fn set_target_touches(this: &TouchEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `touches` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, getter = "touches")] + pub fn get_touches(this: &TouchEventInit) -> Option<::js_sys::Array>; + #[doc = "Change the `touches` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[wasm_bindgen(method, setter = "touches")] + pub fn set_touches(this: &TouchEventInit, val: &::wasm_bindgen::JsValue); } impl TouchEventInit { #[doc = "Construct a new `TouchEventInit`."] @@ -19,352 +232,110 @@ impl TouchEventInit { 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: `TouchEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `altKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_alt_key()` instead."] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alt_key(val); self } - #[doc = "Change the `ctrlKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_ctrl_key()` instead."] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ctrl_key(val); self } - #[doc = "Change the `metaKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_meta_key()` instead."] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_meta_key(val); self } - #[doc = "Change the `modifierAltGraph` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_alt_graph()` instead."] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_alt_graph(val); self } - #[doc = "Change the `modifierCapsLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_caps_lock()` instead."] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_caps_lock(val); self } - #[doc = "Change the `modifierFn` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_fn()` instead."] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn(val); self } - #[doc = "Change the `modifierFnLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_fn_lock()` instead."] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn_lock(val); self } - #[doc = "Change the `modifierNumLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_num_lock()` instead."] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_num_lock(val); self } - #[doc = "Change the `modifierOS` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_os()` instead."] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_os(val); self } - #[doc = "Change the `modifierScrollLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_scroll_lock()` instead."] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_scroll_lock(val); self } - #[doc = "Change the `modifierSymbol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_symbol()` instead."] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol(val); self } - #[doc = "Change the `modifierSymbolLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_modifier_symbol_lock()` instead."] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol_lock(val); self } - #[doc = "Change the `shiftKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_shift_key()` instead."] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shift_key(val); self } - #[doc = "Change the `changedTouches` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_changed_touches()` instead."] pub fn changed_touches(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("changedTouches"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_changed_touches(val); self } - #[doc = "Change the `targetTouches` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_target_touches()` instead."] pub fn target_touches(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("targetTouches"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_target_touches(val); self } - #[doc = "Change the `touches` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchEventInit`*"] + #[deprecated = "Use `set_touches()` instead."] pub fn touches(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("touches"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_touches(val); self } } diff --git a/crates/web-sys/src/features/gen_TouchInit.rs b/crates/web-sys/src/features/gen_TouchInit.rs index b64ce7a77dc..62687525e0a 100644 --- a/crates/web-sys/src/features/gen_TouchInit.rs +++ b/crates/web-sys/src/features/gen_TouchInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,128 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] pub type TouchInit; + #[doc = "Get the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "clientX")] + pub fn get_client_x(this: &TouchInit) -> Option; + #[doc = "Change the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "clientX")] + pub fn set_client_x(this: &TouchInit, val: i32); + #[doc = "Get the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "clientY")] + pub fn get_client_y(this: &TouchInit) -> Option; + #[doc = "Change the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "clientY")] + pub fn set_client_y(this: &TouchInit, val: i32); + #[doc = "Get the `force` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "force")] + pub fn get_force(this: &TouchInit) -> Option; + #[doc = "Change the `force` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "force")] + pub fn set_force(this: &TouchInit, val: f32); + #[doc = "Get the `identifier` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "identifier")] + pub fn get_identifier(this: &TouchInit) -> i32; + #[doc = "Change the `identifier` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "identifier")] + pub fn set_identifier(this: &TouchInit, val: i32); + #[doc = "Get the `pageX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "pageX")] + pub fn get_page_x(this: &TouchInit) -> Option; + #[doc = "Change the `pageX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "pageX")] + pub fn set_page_x(this: &TouchInit, val: i32); + #[doc = "Get the `pageY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "pageY")] + pub fn get_page_y(this: &TouchInit) -> Option; + #[doc = "Change the `pageY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "pageY")] + pub fn set_page_y(this: &TouchInit, val: i32); + #[doc = "Get the `radiusX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "radiusX")] + pub fn get_radius_x(this: &TouchInit) -> Option; + #[doc = "Change the `radiusX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "radiusX")] + pub fn set_radius_x(this: &TouchInit, val: f32); + #[doc = "Get the `radiusY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "radiusY")] + pub fn get_radius_y(this: &TouchInit) -> Option; + #[doc = "Change the `radiusY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "radiusY")] + pub fn set_radius_y(this: &TouchInit, val: f32); + #[doc = "Get the `rotationAngle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "rotationAngle")] + pub fn get_rotation_angle(this: &TouchInit) -> Option; + #[doc = "Change the `rotationAngle` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "rotationAngle")] + pub fn set_rotation_angle(this: &TouchInit, val: f32); + #[doc = "Get the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "screenX")] + pub fn get_screen_x(this: &TouchInit) -> Option; + #[doc = "Change the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "screenX")] + pub fn set_screen_x(this: &TouchInit, val: i32); + #[doc = "Get the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, getter = "screenY")] + pub fn get_screen_y(this: &TouchInit) -> Option; + #[doc = "Change the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[wasm_bindgen(method, setter = "screenY")] + pub fn set_screen_y(this: &TouchInit, val: i32); + #[cfg(feature = "EventTarget")] + #[doc = "Get the `target` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `TouchInit`*"] + #[wasm_bindgen(method, getter = "target")] + pub fn get_target(this: &TouchInit) -> EventTarget; + #[cfg(feature = "EventTarget")] + #[doc = "Change the `target` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `TouchInit`*"] + #[wasm_bindgen(method, setter = "target")] + pub fn set_target(this: &TouchInit, val: &EventTarget); } impl TouchInit { #[cfg(feature = "EventTarget")] @@ -18,198 +141,69 @@ impl TouchInit { pub fn new(identifier: i32, target: &EventTarget) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.identifier(identifier); - ret.target(target); + ret.set_identifier(identifier); + ret.set_target(target); ret } - #[doc = "Change the `clientX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_client_x()` instead."] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_x(val); self } - #[doc = "Change the `clientY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_client_y()` instead."] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_y(val); self } - #[doc = "Change the `force` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_force()` instead."] pub fn force(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("force"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_force(val); self } - #[doc = "Change the `identifier` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_identifier()` instead."] pub fn identifier(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("identifier"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_identifier(val); self } - #[doc = "Change the `pageX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_page_x()` instead."] pub fn page_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pageX"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_page_x(val); self } - #[doc = "Change the `pageY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_page_y()` instead."] pub fn page_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pageY"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_page_y(val); self } - #[doc = "Change the `radiusX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_radius_x()` instead."] pub fn radius_x(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("radiusX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_radius_x(val); self } - #[doc = "Change the `radiusY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_radius_y()` instead."] pub fn radius_y(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("radiusY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_radius_y(val); self } - #[doc = "Change the `rotationAngle` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_rotation_angle()` instead."] pub fn rotation_angle(&mut self, val: f32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rotationAngle"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rotation_angle(val); self } - #[doc = "Change the `screenX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_screen_x()` instead."] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_x(val); self } - #[doc = "Change the `screenY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TouchInit`*"] + #[deprecated = "Use `set_screen_y()` instead."] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_y(val); self } #[cfg(feature = "EventTarget")] - #[doc = "Change the `target` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `TouchInit`*"] + #[deprecated = "Use `set_target()` instead."] pub fn target(&mut self, val: &EventTarget) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("target"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_target(val); self } } diff --git a/crates/web-sys/src/features/gen_TouchList.rs b/crates/web-sys/src/features/gen_TouchList.rs index a4415d9eb0f..e50608917e5 100644 --- a/crates/web-sys/src/features/gen_TouchList.rs +++ b/crates/web-sys/src/features/gen_TouchList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -28,7 +29,7 @@ extern "C" { pub fn item(this: &TouchList, index: u32) -> Option; #[cfg(feature = "Touch")] #[wasm_bindgen(method, structural, js_class = "TouchList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TrackEvent.rs b/crates/web-sys/src/features/gen_TrackEvent.rs index 2325cb3dfcf..9b01abecff0 100644 --- a/crates/web-sys/src/features/gen_TrackEvent.rs +++ b/crates/web-sys/src/features/gen_TrackEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TrackEventInit.rs b/crates/web-sys/src/features/gen_TrackEventInit.rs index 48a91359b62..8097517d952 100644 --- a/crates/web-sys/src/features/gen_TrackEventInit.rs +++ b/crates/web-sys/src/features/gen_TrackEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] pub type TrackEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &TrackEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &TrackEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &TrackEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &TrackEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &TrackEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &TrackEventInit, val: bool); + #[doc = "Get the `track` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[wasm_bindgen(method, getter = "track")] + pub fn get_track(this: &TrackEventInit) -> Option<::js_sys::Object>; + #[doc = "Change the `track` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[wasm_bindgen(method, setter = "track")] + pub fn set_track(this: &TrackEventInit, val: Option<&::js_sys::Object>); } impl TrackEventInit { #[doc = "Construct a new `TrackEventInit`."] @@ -19,68 +60,24 @@ impl TrackEventInit { 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: `TrackEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `track` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TrackEventInit`*"] + #[deprecated = "Use `set_track()` instead."] pub fn track(&mut self, val: Option<&::js_sys::Object>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("track"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_track(val); self } } diff --git a/crates/web-sys/src/features/gen_TransformStream.rs b/crates/web-sys/src/features/gen_TransformStream.rs index d2a041a700c..8fd7aff7c8b 100644 --- a/crates/web-sys/src/features/gen_TransformStream.rs +++ b/crates/web-sys/src/features/gen_TransformStream.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStream , typescript_type = "TransformStream")] @@ -11,11 +11,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type TransformStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = readable)] #[doc = "Getter for the `readable` field of this object."] @@ -23,11 +19,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/readable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn readable(this: &TransformStream) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = writable)] #[doc = "Getter for the `writable` field of this object."] @@ -35,34 +27,22 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/writable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(this: &TransformStream) -> WritableStream; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Result; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_transformer(transformer: &::js_sys::Object) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "QueuingStrategy")] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] @@ -70,14 +50,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_transformer_and_writable_strategy( transformer: &::js_sys::Object, writable_strategy: &QueuingStrategy, ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "QueuingStrategy")] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] #[doc = "The `new TransformStream(..)` constructor, creating a new instance of `TransformStream`."] @@ -85,9 +61,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_transformer_and_writable_strategy_and_readable_strategy( transformer: &::js_sys::Object, writable_strategy: &QueuingStrategy, diff --git a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs new file mode 100644 index 00000000000..1d7ec87c6c0 --- /dev/null +++ b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs @@ -0,0 +1,63 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStreamDefaultController , typescript_type = "TransformStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TransformStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub type TransformStreamDefaultController; + # [wasm_bindgen (structural , method , getter , js_class = "TransformStreamDefaultController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn desired_size(this: &TransformStreamDefaultController) -> Option; + # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn enqueue(this: &TransformStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn enqueue_with_chunk( + this: &TransformStreamDefaultController, + chunk: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn error(this: &TransformStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn error_with_reason( + this: &TransformStreamDefaultController, + reason: &::wasm_bindgen::JsValue, + ); + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = terminate)] + #[doc = "The `terminate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/terminate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn terminate(this: &TransformStreamDefaultController); +} diff --git a/crates/web-sys/src/features/gen_Transformer.rs b/crates/web-sys/src/features/gen_Transformer.rs new file mode 100644 index 00000000000..77d6965fa3f --- /dev/null +++ b/crates/web-sys/src/features/gen_Transformer.rs @@ -0,0 +1,103 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Transformer)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Transformer` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub type Transformer; + #[doc = "Get the `flush` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, getter = "flush")] + pub fn get_flush(this: &Transformer) -> Option<::js_sys::Function>; + #[doc = "Change the `flush` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, setter = "flush")] + pub fn set_flush(this: &Transformer, val: &::js_sys::Function); + #[doc = "Get the `readableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, getter = "readableType")] + pub fn get_readable_type(this: &Transformer) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `readableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, setter = "readableType")] + pub fn set_readable_type(this: &Transformer, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, getter = "start")] + pub fn get_start(this: &Transformer) -> Option<::js_sys::Function>; + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, setter = "start")] + pub fn set_start(this: &Transformer, val: &::js_sys::Function); + #[doc = "Get the `transform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, getter = "transform")] + pub fn get_transform(this: &Transformer) -> Option<::js_sys::Function>; + #[doc = "Change the `transform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, setter = "transform")] + pub fn set_transform(this: &Transformer, val: &::js_sys::Function); + #[doc = "Get the `writableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, getter = "writableType")] + pub fn get_writable_type(this: &Transformer) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `writableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + #[wasm_bindgen(method, setter = "writableType")] + pub fn set_writable_type(this: &Transformer, val: &::wasm_bindgen::JsValue); +} +impl Transformer { + #[doc = "Construct a new `Transformer`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_flush()` instead."] + pub fn flush(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_flush(val); + self + } + #[deprecated = "Use `set_readable_type()` instead."] + pub fn readable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_readable_type(val); + self + } + #[deprecated = "Use `set_start()` instead."] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_start(val); + self + } + #[deprecated = "Use `set_transform()` instead."] + pub fn transform(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_transform(val); + self + } + #[deprecated = "Use `set_writable_type()` instead."] + pub fn writable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_writable_type(val); + self + } +} +impl Default for Transformer { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_TransitionEvent.rs b/crates/web-sys/src/features/gen_TransitionEvent.rs index c6c98bb93f2..39ea99fda00 100644 --- a/crates/web-sys/src/features/gen_TransitionEvent.rs +++ b/crates/web-sys/src/features/gen_TransitionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent/propertyName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEvent`*"] - pub fn property_name(this: &TransitionEvent) -> String; + pub fn property_name(this: &TransitionEvent) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "TransitionEvent" , js_name = elapsedTime)] #[doc = "Getter for the `elapsedTime` field of this object."] #[doc = ""] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent/pseudoElement)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEvent`*"] - pub fn pseudo_element(this: &TransitionEvent) -> String; + pub fn pseudo_element(this: &TransitionEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "TransitionEvent")] #[doc = "The `new TransitionEvent(..)` constructor, creating a new instance of `TransitionEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TransitionEventInit.rs b/crates/web-sys/src/features/gen_TransitionEventInit.rs index 1681b9c1b74..f94c28261cd 100644 --- a/crates/web-sys/src/features/gen_TransitionEventInit.rs +++ b/crates/web-sys/src/features/gen_TransitionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] pub type TransitionEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &TransitionEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &TransitionEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &TransitionEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &TransitionEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &TransitionEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &TransitionEventInit, val: bool); + #[doc = "Get the `elapsedTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, getter = "elapsedTime")] + pub fn get_elapsed_time(this: &TransitionEventInit) -> Option; + #[doc = "Change the `elapsedTime` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, setter = "elapsedTime")] + pub fn set_elapsed_time(this: &TransitionEventInit, val: f32); + #[doc = "Get the `propertyName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, getter = "propertyName")] + pub fn get_property_name(this: &TransitionEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `propertyName` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, setter = "propertyName")] + pub fn set_property_name(this: &TransitionEventInit, val: &str); + #[doc = "Get the `pseudoElement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, getter = "pseudoElement")] + pub fn get_pseudo_element(this: &TransitionEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `pseudoElement` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[wasm_bindgen(method, setter = "pseudoElement")] + pub fn set_pseudo_element(this: &TransitionEventInit, val: &str); } impl TransitionEventInit { #[doc = "Construct a new `TransitionEventInit`."] @@ -19,106 +80,34 @@ impl TransitionEventInit { 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: `TransitionEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `elapsedTime` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[deprecated = "Use `set_elapsed_time()` instead."] 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.set_elapsed_time(val); self } - #[doc = "Change the `propertyName` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[deprecated = "Use `set_property_name()` instead."] pub fn property_name(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("propertyName"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_property_name(val); self } - #[doc = "Change the `pseudoElement` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransitionEventInit`*"] + #[deprecated = "Use `set_pseudo_element()` instead."] 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.set_pseudo_element(val); self } } diff --git a/crates/web-sys/src/features/gen_Transport.rs b/crates/web-sys/src/features/gen_Transport.rs index 9b9389c2502..ae35abf5230 100644 --- a/crates/web-sys/src/features/gen_Transport.rs +++ b/crates/web-sys/src/features/gen_Transport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `Transport` enum."] diff --git a/crates/web-sys/src/features/gen_TreeBoxObject.rs b/crates/web-sys/src/features/gen_TreeBoxObject.rs index 74e6b3e6fce..4f562599590 100644 --- a/crates/web-sys/src/features/gen_TreeBoxObject.rs +++ b/crates/web-sys/src/features/gen_TreeBoxObject.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_TreeCellInfo.rs b/crates/web-sys/src/features/gen_TreeCellInfo.rs index 9d0794449db..b87771c1392 100644 --- a/crates/web-sys/src/features/gen_TreeCellInfo.rs +++ b/crates/web-sys/src/features/gen_TreeCellInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,26 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] pub type TreeCellInfo; + #[doc = "Get the `childElt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] + #[wasm_bindgen(method, getter = "childElt")] + pub fn get_child_elt(this: &TreeCellInfo) -> Option<::alloc::string::String>; + #[doc = "Change the `childElt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] + #[wasm_bindgen(method, setter = "childElt")] + pub fn set_child_elt(this: &TreeCellInfo, val: &str); + #[doc = "Get the `row` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] + #[wasm_bindgen(method, getter = "row")] + pub fn get_row(this: &TreeCellInfo) -> Option; + #[doc = "Change the `row` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] + #[wasm_bindgen(method, setter = "row")] + pub fn set_row(this: &TreeCellInfo, val: i32); } impl TreeCellInfo { #[doc = "Construct a new `TreeCellInfo`."] @@ -19,34 +40,14 @@ impl TreeCellInfo { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `childElt` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] + #[deprecated = "Use `set_child_elt()` instead."] pub fn child_elt(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("childElt"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_child_elt(val); self } - #[doc = "Change the `row` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TreeCellInfo`*"] + #[deprecated = "Use `set_row()` instead."] pub fn row(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("row"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_row(val); self } } diff --git a/crates/web-sys/src/features/gen_TreeView.rs b/crates/web-sys/src/features/gen_TreeView.rs index 50b334a6bce..b5145edf2ac 100644 --- a/crates/web-sys/src/features/gen_TreeView.rs +++ b/crates/web-sys/src/features/gen_TreeView.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -64,7 +65,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TreeView/getRowProperties)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TreeView`*"] - pub fn get_row_properties(this: &TreeView, row: i32) -> Result; + pub fn get_row_properties( + this: &TreeView, + row: i32, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "TreeView" , js_name = hasNextSibling)] #[doc = "The `hasNextSibling()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TreeWalker.rs b/crates/web-sys/src/features/gen_TreeWalker.rs index 3838270c655..7a3f4cde94b 100644 --- a/crates/web-sys/src/features/gen_TreeWalker.rs +++ b/crates/web-sys/src/features/gen_TreeWalker.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_U2f.rs b/crates/web-sys/src/features/gen_U2f.rs index 775377d12c2..2c56e101ac3 100644 --- a/crates/web-sys/src/features/gen_U2f.rs +++ b/crates/web-sys/src/features/gen_U2f.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_U2fClientData.rs b/crates/web-sys/src/features/gen_U2fClientData.rs index 2a4de187780..8dd7051e06e 100644 --- a/crates/web-sys/src/features/gen_U2fClientData.rs +++ b/crates/web-sys/src/features/gen_U2fClientData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,36 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] pub type U2fClientData; + #[doc = "Get the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[wasm_bindgen(method, getter = "challenge")] + pub fn get_challenge(this: &U2fClientData) -> Option<::alloc::string::String>; + #[doc = "Change the `challenge` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[wasm_bindgen(method, setter = "challenge")] + pub fn set_challenge(this: &U2fClientData, val: &str); + #[doc = "Get the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[wasm_bindgen(method, getter = "origin")] + pub fn get_origin(this: &U2fClientData) -> Option<::alloc::string::String>; + #[doc = "Change the `origin` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[wasm_bindgen(method, setter = "origin")] + pub fn set_origin(this: &U2fClientData, val: &str); + #[doc = "Get the `typ` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[wasm_bindgen(method, getter = "typ")] + pub fn get_typ(this: &U2fClientData) -> Option<::alloc::string::String>; + #[doc = "Change the `typ` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[wasm_bindgen(method, setter = "typ")] + pub fn set_typ(this: &U2fClientData, val: &str); } impl U2fClientData { #[doc = "Construct a new `U2fClientData`."] @@ -19,48 +50,19 @@ impl U2fClientData { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `challenge` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[deprecated = "Use `set_challenge()` instead."] pub fn challenge(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("challenge"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_challenge(val); self } - #[doc = "Change the `origin` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[deprecated = "Use `set_origin()` instead."] pub fn origin(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_origin(val); self } - #[doc = "Change the `typ` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `U2fClientData`*"] + #[deprecated = "Use `set_typ()` instead."] pub fn typ(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("typ"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_typ(val); self } } diff --git a/crates/web-sys/src/features/gen_ULongRange.rs b/crates/web-sys/src/features/gen_ULongRange.rs new file mode 100644 index 00000000000..acf295622ee --- /dev/null +++ b/crates/web-sys/src/features/gen_ULongRange.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ULongRange)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ULongRange` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type ULongRange; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `max` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "max")] + pub fn get_max(this: &ULongRange) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `max` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "max")] + pub fn set_max(this: &ULongRange, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `min` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "min")] + pub fn get_min(this: &ULongRange) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `min` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "min")] + pub fn set_min(this: &ULongRange, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl ULongRange { + #[doc = "Construct a new `ULongRange`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ULongRange`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_max()` instead."] + pub fn max(&mut self, val: u32) -> &mut Self { + self.set_max(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_min()` instead."] + pub fn min(&mut self, val: u32) -> &mut Self { + self.set_min(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for ULongRange { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UaDataValues.rs b/crates/web-sys/src/features/gen_UaDataValues.rs new file mode 100644 index 00000000000..40057b752da --- /dev/null +++ b/crates/web-sys/src/features/gen_UaDataValues.rs @@ -0,0 +1,277 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UADataValues)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UaDataValues` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type UaDataValues; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `architecture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "architecture")] + pub fn get_architecture(this: &UaDataValues) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `architecture` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "architecture")] + pub fn set_architecture(this: &UaDataValues, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bitness` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bitness")] + pub fn get_bitness(this: &UaDataValues) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bitness` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bitness")] + pub fn set_bitness(this: &UaDataValues, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `brands` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "brands")] + pub fn get_brands(this: &UaDataValues) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `brands` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "brands")] + pub fn set_brands(this: &UaDataValues, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `formFactors` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "formFactors")] + pub fn get_form_factors(this: &UaDataValues) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `formFactors` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "formFactors")] + pub fn set_form_factors(this: &UaDataValues, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `fullVersionList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "fullVersionList")] + pub fn get_full_version_list(this: &UaDataValues) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `fullVersionList` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "fullVersionList")] + pub fn set_full_version_list(this: &UaDataValues, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mobile` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mobile")] + pub fn get_mobile(this: &UaDataValues) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mobile` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mobile")] + pub fn set_mobile(this: &UaDataValues, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `model` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "model")] + pub fn get_model(this: &UaDataValues) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `model` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "model")] + pub fn set_model(this: &UaDataValues, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `platform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "platform")] + pub fn get_platform(this: &UaDataValues) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `platform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "platform")] + pub fn set_platform(this: &UaDataValues, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `platformVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "platformVersion")] + pub fn get_platform_version(this: &UaDataValues) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `platformVersion` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "platformVersion")] + pub fn set_platform_version(this: &UaDataValues, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `wow64` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "wow64")] + pub fn get_wow64(this: &UaDataValues) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `wow64` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "wow64")] + pub fn set_wow64(this: &UaDataValues, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl UaDataValues { + #[doc = "Construct a new `UaDataValues`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaDataValues`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_architecture()` instead."] + pub fn architecture(&mut self, val: &str) -> &mut Self { + self.set_architecture(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bitness()` instead."] + pub fn bitness(&mut self, val: &str) -> &mut Self { + self.set_bitness(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_brands()` instead."] + pub fn brands(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_brands(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_form_factors()` instead."] + pub fn form_factors(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_form_factors(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_full_version_list()` instead."] + pub fn full_version_list(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_full_version_list(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mobile()` instead."] + pub fn mobile(&mut self, val: bool) -> &mut Self { + self.set_mobile(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_model()` instead."] + pub fn model(&mut self, val: &str) -> &mut Self { + self.set_model(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_platform()` instead."] + pub fn platform(&mut self, val: &str) -> &mut Self { + self.set_platform(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_platform_version()` instead."] + pub fn platform_version(&mut self, val: &str) -> &mut Self { + self.set_platform_version(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_wow64()` instead."] + pub fn wow64(&mut self, val: bool) -> &mut Self { + self.set_wow64(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for UaDataValues { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UaLowEntropyJson.rs b/crates/web-sys/src/features/gen_UaLowEntropyJson.rs new file mode 100644 index 00000000000..b41243775bb --- /dev/null +++ b/crates/web-sys/src/features/gen_UaLowEntropyJson.rs @@ -0,0 +1,109 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UALowEntropyJSON)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UaLowEntropyJson` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type UaLowEntropyJson; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `brands` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "brands")] + pub fn get_brands(this: &UaLowEntropyJson) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `brands` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "brands")] + pub fn set_brands(this: &UaLowEntropyJson, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `mobile` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mobile")] + pub fn get_mobile(this: &UaLowEntropyJson) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `mobile` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mobile")] + pub fn set_mobile(this: &UaLowEntropyJson, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `platform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "platform")] + pub fn get_platform(this: &UaLowEntropyJson) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `platform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "platform")] + pub fn set_platform(this: &UaLowEntropyJson, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl UaLowEntropyJson { + #[doc = "Construct a new `UaLowEntropyJson`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UaLowEntropyJson`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_brands()` instead."] + pub fn brands(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_brands(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_mobile()` instead."] + pub fn mobile(&mut self, val: bool) -> &mut Self { + self.set_mobile(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_platform()` instead."] + pub fn platform(&mut self, val: &str) -> &mut Self { + self.set_platform(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for UaLowEntropyJson { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UdpMessageEventInit.rs b/crates/web-sys/src/features/gen_UdpMessageEventInit.rs index 7ba192b349b..1a3d8596fcd 100644 --- a/crates/web-sys/src/features/gen_UdpMessageEventInit.rs +++ b/crates/web-sys/src/features/gen_UdpMessageEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] pub type UdpMessageEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &UdpMessageEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &UdpMessageEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &UdpMessageEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &UdpMessageEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &UdpMessageEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &UdpMessageEventInit, val: bool); + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &UdpMessageEventInit) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &UdpMessageEventInit, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `remoteAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, getter = "remoteAddress")] + pub fn get_remote_address(this: &UdpMessageEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `remoteAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, setter = "remoteAddress")] + pub fn set_remote_address(this: &UdpMessageEventInit, val: &str); + #[doc = "Get the `remotePort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, getter = "remotePort")] + pub fn get_remote_port(this: &UdpMessageEventInit) -> Option; + #[doc = "Change the `remotePort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[wasm_bindgen(method, setter = "remotePort")] + pub fn set_remote_port(this: &UdpMessageEventInit, val: u16); } impl UdpMessageEventInit { #[doc = "Construct a new `UdpMessageEventInit`."] @@ -19,102 +80,34 @@ impl UdpMessageEventInit { 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: `UdpMessageEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `data` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[deprecated = "Use `set_data()` instead."] pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_data(val); self } - #[doc = "Change the `remoteAddress` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[deprecated = "Use `set_remote_address()` instead."] pub fn remote_address(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_address(val); self } - #[doc = "Change the `remotePort` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpMessageEventInit`*"] + #[deprecated = "Use `set_remote_port()` instead."] pub fn remote_port(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remotePort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_port(val); self } } diff --git a/crates/web-sys/src/features/gen_UdpOptions.rs b/crates/web-sys/src/features/gen_UdpOptions.rs index 4ba727c4a9c..71af774a39b 100644 --- a/crates/web-sys/src/features/gen_UdpOptions.rs +++ b/crates/web-sys/src/features/gen_UdpOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] pub type UdpOptions; + #[doc = "Get the `addressReuse` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, getter = "addressReuse")] + pub fn get_address_reuse(this: &UdpOptions) -> Option; + #[doc = "Change the `addressReuse` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, setter = "addressReuse")] + pub fn set_address_reuse(this: &UdpOptions, val: bool); + #[doc = "Get the `localAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, getter = "localAddress")] + pub fn get_local_address(this: &UdpOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `localAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, setter = "localAddress")] + pub fn set_local_address(this: &UdpOptions, val: &str); + #[doc = "Get the `localPort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, getter = "localPort")] + pub fn get_local_port(this: &UdpOptions) -> Option; + #[doc = "Change the `localPort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, setter = "localPort")] + pub fn set_local_port(this: &UdpOptions, val: u16); + #[doc = "Get the `loopback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, getter = "loopback")] + pub fn get_loopback(this: &UdpOptions) -> Option; + #[doc = "Change the `loopback` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, setter = "loopback")] + pub fn set_loopback(this: &UdpOptions, val: bool); + #[doc = "Get the `remoteAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, getter = "remoteAddress")] + pub fn get_remote_address(this: &UdpOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `remoteAddress` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, setter = "remoteAddress")] + pub fn set_remote_address(this: &UdpOptions, val: &str); + #[doc = "Get the `remotePort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, getter = "remotePort")] + pub fn get_remote_port(this: &UdpOptions) -> Option; + #[doc = "Change the `remotePort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[wasm_bindgen(method, setter = "remotePort")] + pub fn set_remote_port(this: &UdpOptions, val: u16); } impl UdpOptions { #[doc = "Construct a new `UdpOptions`."] @@ -19,106 +80,34 @@ impl UdpOptions { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `addressReuse` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[deprecated = "Use `set_address_reuse()` instead."] pub fn address_reuse(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("addressReuse"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_address_reuse(val); self } - #[doc = "Change the `localAddress` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[deprecated = "Use `set_local_address()` instead."] pub fn local_address(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_local_address(val); self } - #[doc = "Change the `localPort` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[deprecated = "Use `set_local_port()` instead."] pub fn local_port(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("localPort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_local_port(val); self } - #[doc = "Change the `loopback` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[deprecated = "Use `set_loopback()` instead."] pub fn loopback(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("loopback"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_loopback(val); self } - #[doc = "Change the `remoteAddress` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[deprecated = "Use `set_remote_address()` instead."] pub fn remote_address(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remoteAddress"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_address(val); self } - #[doc = "Change the `remotePort` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UdpOptions`*"] + #[deprecated = "Use `set_remote_port()` instead."] pub fn remote_port(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("remotePort"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_remote_port(val); self } } diff --git a/crates/web-sys/src/features/gen_UiEvent.rs b/crates/web-sys/src/features/gen_UiEvent.rs index 5c2120b6c75..66e1b84f092 100644 --- a/crates/web-sys/src/features/gen_UiEvent.rs +++ b/crates/web-sys/src/features/gen_UiEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_UiEventInit.rs b/crates/web-sys/src/features/gen_UiEventInit.rs index d1449c34e97..75bdfc8b260 100644 --- a/crates/web-sys/src/features/gen_UiEventInit.rs +++ b/crates/web-sys/src/features/gen_UiEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,58 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] pub type UiEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &UiEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &UiEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &UiEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &UiEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &UiEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &UiEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &UiEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &UiEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &UiEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UiEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &UiEventInit, val: Option<&Window>); } impl UiEventInit { #[doc = "Construct a new `UiEventInit`."] @@ -19,83 +72,30 @@ impl UiEventInit { 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: `UiEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UiEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } } diff --git a/crates/web-sys/src/features/gen_UnderlyingSink.rs b/crates/web-sys/src/features/gen_UnderlyingSink.rs new file mode 100644 index 00000000000..c01268facf9 --- /dev/null +++ b/crates/web-sys/src/features/gen_UnderlyingSink.rs @@ -0,0 +1,103 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSink)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UnderlyingSink` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub type UnderlyingSink; + #[doc = "Get the `abort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, getter = "abort")] + pub fn get_abort(this: &UnderlyingSink) -> Option<::js_sys::Function>; + #[doc = "Change the `abort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, setter = "abort")] + pub fn set_abort(this: &UnderlyingSink, val: &::js_sys::Function); + #[doc = "Get the `close` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, getter = "close")] + pub fn get_close(this: &UnderlyingSink) -> Option<::js_sys::Function>; + #[doc = "Change the `close` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, setter = "close")] + pub fn set_close(this: &UnderlyingSink, val: &::js_sys::Function); + #[doc = "Get the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, getter = "start")] + pub fn get_start(this: &UnderlyingSink) -> Option<::js_sys::Function>; + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, setter = "start")] + pub fn set_start(this: &UnderlyingSink, val: &::js_sys::Function); + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &UnderlyingSink) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &UnderlyingSink, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `write` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, getter = "write")] + pub fn get_write(this: &UnderlyingSink) -> Option<::js_sys::Function>; + #[doc = "Change the `write` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + #[wasm_bindgen(method, setter = "write")] + pub fn set_write(this: &UnderlyingSink, val: &::js_sys::Function); +} +impl UnderlyingSink { + #[doc = "Construct a new `UnderlyingSink`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_abort()` instead."] + pub fn abort(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_abort(val); + self + } + #[deprecated = "Use `set_close()` instead."] + pub fn close(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_close(val); + self + } + #[deprecated = "Use `set_start()` instead."] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_start(val); + self + } + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_type(val); + self + } + #[deprecated = "Use `set_write()` instead."] + pub fn write(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_write(val); + self + } +} +impl Default for UnderlyingSink { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UnderlyingSource.rs b/crates/web-sys/src/features/gen_UnderlyingSource.rs new file mode 100644 index 00000000000..c1da8cc9c1d --- /dev/null +++ b/crates/web-sys/src/features/gen_UnderlyingSource.rs @@ -0,0 +1,106 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSource)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UnderlyingSource` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub type UnderlyingSource; + #[doc = "Get the `autoAllocateChunkSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + #[wasm_bindgen(method, getter = "autoAllocateChunkSize")] + pub fn get_auto_allocate_chunk_size(this: &UnderlyingSource) -> Option; + #[doc = "Change the `autoAllocateChunkSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + #[wasm_bindgen(method, setter = "autoAllocateChunkSize")] + pub fn set_auto_allocate_chunk_size(this: &UnderlyingSource, val: f64); + #[doc = "Get the `cancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + #[wasm_bindgen(method, getter = "cancel")] + pub fn get_cancel(this: &UnderlyingSource) -> Option<::js_sys::Function>; + #[doc = "Change the `cancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + #[wasm_bindgen(method, setter = "cancel")] + pub fn set_cancel(this: &UnderlyingSource, val: &::js_sys::Function); + #[doc = "Get the `pull` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + #[wasm_bindgen(method, getter = "pull")] + pub fn get_pull(this: &UnderlyingSource) -> Option<::js_sys::Function>; + #[doc = "Change the `pull` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + #[wasm_bindgen(method, setter = "pull")] + pub fn set_pull(this: &UnderlyingSource, val: &::js_sys::Function); + #[doc = "Get the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + #[wasm_bindgen(method, getter = "start")] + pub fn get_start(this: &UnderlyingSource) -> Option<::js_sys::Function>; + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + #[wasm_bindgen(method, setter = "start")] + pub fn set_start(this: &UnderlyingSource, val: &::js_sys::Function); + #[cfg(feature = "ReadableStreamType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &UnderlyingSource) -> Option; + #[cfg(feature = "ReadableStreamType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &UnderlyingSource, val: ReadableStreamType); +} +impl UnderlyingSource { + #[doc = "Construct a new `UnderlyingSource`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[deprecated = "Use `set_auto_allocate_chunk_size()` instead."] + pub fn auto_allocate_chunk_size(&mut self, val: f64) -> &mut Self { + self.set_auto_allocate_chunk_size(val); + self + } + #[deprecated = "Use `set_cancel()` instead."] + pub fn cancel(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_cancel(val); + self + } + #[deprecated = "Use `set_pull()` instead."] + pub fn pull(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_pull(val); + self + } + #[deprecated = "Use `set_start()` instead."] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_start(val); + self + } + #[cfg(feature = "ReadableStreamType")] + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: ReadableStreamType) -> &mut Self { + self.set_type(val); + self + } +} +impl Default for UnderlyingSource { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_Url.rs b/crates/web-sys/src/features/gen_Url.rs index b4ad91dbc24..e229dc5628c 100644 --- a/crates/web-sys/src/features/gen_Url.rs +++ b/crates/web-sys/src/features/gen_Url.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn href(this: &Url) -> String; + pub fn href(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = href)] #[doc = "Setter for the `href` field of this object."] #[doc = ""] @@ -31,14 +32,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn origin(this: &Url) -> String; + pub fn origin(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "URL" , js_name = protocol)] #[doc = "Getter for the `protocol` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn protocol(this: &Url) -> String; + pub fn protocol(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = protocol)] #[doc = "Setter for the `protocol` field of this object."] #[doc = ""] @@ -52,7 +53,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/username)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn username(this: &Url) -> String; + pub fn username(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = username)] #[doc = "Setter for the `username` field of this object."] #[doc = ""] @@ -66,7 +67,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/password)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn password(this: &Url) -> String; + pub fn password(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = password)] #[doc = "Setter for the `password` field of this object."] #[doc = ""] @@ -80,7 +81,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/host)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn host(this: &Url) -> String; + pub fn host(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = host)] #[doc = "Setter for the `host` field of this object."] #[doc = ""] @@ -94,7 +95,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/hostname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn hostname(this: &Url) -> String; + pub fn hostname(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = hostname)] #[doc = "Setter for the `hostname` field of this object."] #[doc = ""] @@ -108,7 +109,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/port)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn port(this: &Url) -> String; + pub fn port(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = port)] #[doc = "Setter for the `port` field of this object."] #[doc = ""] @@ -122,7 +123,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn pathname(this: &Url) -> String; + pub fn pathname(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = pathname)] #[doc = "Setter for the `pathname` field of this object."] #[doc = ""] @@ -136,7 +137,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/search)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn search(this: &Url) -> String; + pub fn search(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = search)] #[doc = "Setter for the `search` field of this object."] #[doc = ""] @@ -158,7 +159,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn hash(this: &Url) -> String; + pub fn hash(this: &Url) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "URL" , js_name = hash)] #[doc = "Setter for the `hash` field of this object."] #[doc = ""] @@ -184,22 +185,24 @@ extern "C" { # [wasm_bindgen (catch , static_method_of = Url , js_class = "URL" , js_name = createObjectURL)] #[doc = "The `createObjectURL()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Blob`, `Url`*"] - pub fn create_object_url_with_blob(blob: &Blob) -> Result; + pub fn create_object_url_with_blob(blob: &Blob) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "MediaSource")] # [wasm_bindgen (catch , static_method_of = Url , js_class = "URL" , js_name = createObjectURL)] #[doc = "The `createObjectURL()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `Url`*"] - pub fn create_object_url_with_source(source: &MediaSource) -> Result; + pub fn create_object_url_with_source( + source: &MediaSource, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , static_method_of = Url , js_class = "URL" , js_name = revokeObjectURL)] #[doc = "The `revokeObjectURL()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] pub fn revoke_object_url(url: &str) -> Result<(), JsValue>; @@ -209,5 +212,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL/toJSON)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Url`*"] - pub fn to_json(this: &Url) -> String; + pub fn to_json(this: &Url) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_UrlSearchParams.rs b/crates/web-sys/src/features/gen_UrlSearchParams.rs index 4c4f1e3518e..db83392f4d5 100644 --- a/crates/web-sys/src/features/gen_UrlSearchParams.rs +++ b/crates/web-sys/src/features/gen_UrlSearchParams.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -33,6 +34,15 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] + pub fn new_with_record_from_str_to_str( + init: &::js_sys::Object, + ) -> Result; + #[wasm_bindgen(catch, constructor, js_class = "URLSearchParams")] + #[doc = "The `new UrlSearchParams(..)` constructor, creating a new instance of `UrlSearchParams`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] pub fn new_with_str(init: &str) -> Result; # [wasm_bindgen (method , structural , js_class = "URLSearchParams" , js_name = append)] #[doc = "The `append()` method."] @@ -48,13 +58,27 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] pub fn delete(this: &UrlSearchParams, name: &str); + # [wasm_bindgen (method , structural , js_class = "URLSearchParams" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] + pub fn entries(this: &UrlSearchParams) -> ::js_sys::Iterator; + # [wasm_bindgen (catch , method , structural , js_class = "URLSearchParams" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] + pub fn for_each(this: &UrlSearchParams, callback: &::js_sys::Function) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "URLSearchParams" , js_name = get)] #[doc = "The `get()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/get)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] - pub fn get(this: &UrlSearchParams, name: &str) -> Option; + pub fn get(this: &UrlSearchParams, name: &str) -> Option<::alloc::string::String>; # [wasm_bindgen (method , structural , js_class = "URLSearchParams" , js_name = getAll)] #[doc = "The `getAll()` method."] #[doc = ""] @@ -69,6 +93,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] pub fn has(this: &UrlSearchParams, name: &str) -> bool; + # [wasm_bindgen (method , structural , js_class = "URLSearchParams" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] + pub fn keys(this: &UrlSearchParams) -> ::js_sys::Iterator; # [wasm_bindgen (method , structural , js_class = "URLSearchParams" , js_name = set)] #[doc = "The `set()` method."] #[doc = ""] @@ -83,4 +114,11 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] pub fn sort(this: &UrlSearchParams) -> Result<(), JsValue>; + # [wasm_bindgen (method , structural , js_class = "URLSearchParams" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UrlSearchParams`*"] + pub fn values(this: &UrlSearchParams) -> ::js_sys::Iterator; } diff --git a/crates/web-sys/src/features/gen_Usb.rs b/crates/web-sys/src/features/gen_Usb.rs index 3b10babdcbe..4139afc8004 100644 --- a/crates/web-sys/src/features/gen_Usb.rs +++ b/crates/web-sys/src/features/gen_Usb.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbAlternateInterface.rs b/crates/web-sys/src/features/gen_UsbAlternateInterface.rs index 97d7704f1f5..1d9b17a2894 100644 --- a/crates/web-sys/src/features/gen_UsbAlternateInterface.rs +++ b/crates/web-sys/src/features/gen_UsbAlternateInterface.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -69,7 +70,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn interface_name(this: &UsbAlternateInterface) -> Option; + pub fn interface_name(this: &UsbAlternateInterface) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "USBAlternateInterface" , js_name = endpoints)] #[doc = "Getter for the `endpoints` field of this object."] diff --git a/crates/web-sys/src/features/gen_UsbConfiguration.rs b/crates/web-sys/src/features/gen_UsbConfiguration.rs index 4f2da9e0b77..b7fe74c40a7 100644 --- a/crates/web-sys/src/features/gen_UsbConfiguration.rs +++ b/crates/web-sys/src/features/gen_UsbConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -36,7 +37,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn configuration_name(this: &UsbConfiguration) -> Option; + pub fn configuration_name(this: &UsbConfiguration) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "USBConfiguration" , js_name = interfaces)] #[doc = "Getter for the `interfaces` field of this object."] diff --git a/crates/web-sys/src/features/gen_UsbConnectionEvent.rs b/crates/web-sys/src/features/gen_UsbConnectionEvent.rs index 0881347ce6a..1a1a9f2f011 100644 --- a/crates/web-sys/src/features/gen_UsbConnectionEvent.rs +++ b/crates/web-sys/src/features/gen_UsbConnectionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbConnectionEventInit.rs b/crates/web-sys/src/features/gen_UsbConnectionEventInit.rs index d0ed6bf52b6..a39d26e5708 100644 --- a/crates/web-sys/src/features/gen_UsbConnectionEventInit.rs +++ b/crates/web-sys/src/features/gen_UsbConnectionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type UsbConnectionEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl UsbConnectionEventInit { - #[cfg(feature = "UsbDevice")] - #[doc = "Construct a new `UsbConnectionEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UsbConnectionEventInit`, `UsbDevice`*"] + #[doc = "*This API requires the following crate features to be activated: `UsbConnectionEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(device: &UsbDevice) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.device(device); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &UsbConnectionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl UsbConnectionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &UsbConnectionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbConnectionEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &UsbConnectionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -57,20 +48,17 @@ impl UsbConnectionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &UsbConnectionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbConnectionEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &UsbConnectionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -78,20 +66,18 @@ impl UsbConnectionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &UsbConnectionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "UsbDevice")] + #[doc = "Get the `device` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbConnectionEventInit`, `UsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "device")] + pub fn get_device(this: &UsbConnectionEventInit) -> UsbDevice; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "UsbDevice")] #[doc = "Change the `device` field of this object."] @@ -100,15 +86,47 @@ impl UsbConnectionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "device")] + pub fn set_device(this: &UsbConnectionEventInit, val: &UsbDevice); +} +#[cfg(web_sys_unstable_apis)] +impl UsbConnectionEventInit { + #[cfg(feature = "UsbDevice")] + #[doc = "Construct a new `UsbConnectionEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbConnectionEventInit`, `UsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(device: &UsbDevice) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_device(device); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "UsbDevice")] + #[deprecated = "Use `set_device()` instead."] pub fn device(&mut self, val: &UsbDevice) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("device"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_device(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbControlTransferParameters.rs b/crates/web-sys/src/features/gen_UsbControlTransferParameters.rs index 51c820634c5..7dee38d02ad 100644 --- a/crates/web-sys/src/features/gen_UsbControlTransferParameters.rs +++ b/crates/web-sys/src/features/gen_UsbControlTransferParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,32 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type UsbControlTransferParameters; -} -#[cfg(web_sys_unstable_apis)] -impl UsbControlTransferParameters { - #[cfg(all(feature = "UsbRecipient", feature = "UsbRequestType",))] - #[doc = "Construct a new `UsbControlTransferParameters`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `index` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRecipient`, `UsbRequestType`*"] + #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new( - index: u16, - recipient: UsbRecipient, - request: u8, - request_type: UsbRequestType, - value: u16, - ) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.index(index); - ret.recipient(recipient); - ret.request(request); - ret.request_type(request_type); - ret.value(value); - ret - } + #[wasm_bindgen(method, getter = "index")] + pub fn get_index(this: &UsbControlTransferParameters) -> u16; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `index` field of this object."] #[doc = ""] @@ -46,16 +30,18 @@ impl UsbControlTransferParameters { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn index(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("index"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "index")] + pub fn set_index(this: &UsbControlTransferParameters, val: u16); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "UsbRecipient")] + #[doc = "Get the `recipient` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRecipient`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "recipient")] + pub fn get_recipient(this: &UsbControlTransferParameters) -> UsbRecipient; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "UsbRecipient")] #[doc = "Change the `recipient` field of this object."] @@ -64,20 +50,17 @@ impl UsbControlTransferParameters { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn recipient(&mut self, val: UsbRecipient) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("recipient"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "recipient")] + pub fn set_recipient(this: &UsbControlTransferParameters, val: UsbRecipient); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `request` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "request")] + pub fn get_request(this: &UsbControlTransferParameters) -> u8; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `request` field of this object."] #[doc = ""] @@ -85,20 +68,18 @@ impl UsbControlTransferParameters { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn request(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("request"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "request")] + pub fn set_request(this: &UsbControlTransferParameters, val: u8); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "UsbRequestType")] + #[doc = "Get the `requestType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRequestType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requestType")] + pub fn get_request_type(this: &UsbControlTransferParameters) -> UsbRequestType; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "UsbRequestType")] #[doc = "Change the `requestType` field of this object."] @@ -107,20 +88,17 @@ impl UsbControlTransferParameters { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn request_type(&mut self, val: UsbRequestType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requestType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "requestType")] + pub fn set_request_type(this: &UsbControlTransferParameters, val: UsbRequestType); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &UsbControlTransferParameters) -> u16; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `value` field of this object."] #[doc = ""] @@ -128,14 +106,64 @@ impl UsbControlTransferParameters { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &UsbControlTransferParameters, val: u16); +} +#[cfg(web_sys_unstable_apis)] +impl UsbControlTransferParameters { + #[cfg(all(feature = "UsbRecipient", feature = "UsbRequestType",))] + #[doc = "Construct a new `UsbControlTransferParameters`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRecipient`, `UsbRequestType`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + index: u16, + recipient: UsbRecipient, + request: u8, + request_type: UsbRequestType, + value: u16, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_index(index); + ret.set_recipient(recipient); + ret.set_request(request); + ret.set_request_type(request_type); + ret.set_value(value); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_index()` instead."] + pub fn index(&mut self, val: u16) -> &mut Self { + self.set_index(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "UsbRecipient")] + #[deprecated = "Use `set_recipient()` instead."] + pub fn recipient(&mut self, val: UsbRecipient) -> &mut Self { + self.set_recipient(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_request()` instead."] + pub fn request(&mut self, val: u8) -> &mut Self { + self.set_request(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "UsbRequestType")] + #[deprecated = "Use `set_request_type()` instead."] + pub fn request_type(&mut self, val: UsbRequestType) -> &mut Self { + self.set_request_type(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_value()` instead."] pub fn value(&mut self, val: u16) -> &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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbDevice.rs b/crates/web-sys/src/features/gen_UsbDevice.rs index 67806114dfb..4cc4104e9fa 100644 --- a/crates/web-sys/src/features/gen_UsbDevice.rs +++ b/crates/web-sys/src/features/gen_UsbDevice.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -146,7 +147,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn manufacturer_name(this: &UsbDevice) -> Option; + pub fn manufacturer_name(this: &UsbDevice) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "USBDevice" , js_name = productName)] #[doc = "Getter for the `productName` field of this object."] @@ -157,7 +158,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn product_name(this: &UsbDevice) -> Option; + pub fn product_name(this: &UsbDevice) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "USBDevice" , js_name = serialNumber)] #[doc = "Getter for the `serialNumber` field of this object."] @@ -168,7 +169,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn serial_number(this: &UsbDevice) -> Option; + pub fn serial_number(this: &UsbDevice) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "UsbConfiguration")] # [wasm_bindgen (structural , method , getter , js_class = "USBDevice" , js_name = configuration)] @@ -274,7 +275,7 @@ extern "C" { ) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "UsbControlTransferParameters")] - # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = controlTransferOut)] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = controlTransferOut)] #[doc = "The `controlTransferOut()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferOut)"] @@ -287,10 +288,10 @@ extern "C" { this: &UsbDevice, setup: &UsbControlTransferParameters, data: &::js_sys::Object, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "UsbControlTransferParameters")] - # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = controlTransferOut)] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = controlTransferOut)] #[doc = "The `controlTransferOut()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferOut)"] @@ -299,11 +300,38 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn control_transfer_out_with_u8_array( + pub fn control_transfer_out_with_u8_slice( this: &UsbDevice, setup: &UsbControlTransferParameters, data: &mut [u8], - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "UsbControlTransferParameters")] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = controlTransferOut)] + #[doc = "The `controlTransferOut()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/controlTransferOut)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn control_transfer_out_with_u8_array( + this: &UsbDevice, + setup: &UsbControlTransferParameters, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = forget)] + #[doc = "The `forget()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/forget)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn forget(this: &UsbDevice) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = isochronousTransferIn)] #[doc = "The `isochronousTransferIn()` method."] @@ -320,7 +348,7 @@ extern "C" { packet_lengths: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = isochronousTransferOut)] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = isochronousTransferOut)] #[doc = "The `isochronousTransferOut()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/isochronousTransferOut)"] @@ -334,9 +362,9 @@ extern "C" { endpoint_number: u8, data: &::js_sys::Object, packet_lengths: &::wasm_bindgen::JsValue, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = isochronousTransferOut)] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = isochronousTransferOut)] #[doc = "The `isochronousTransferOut()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/isochronousTransferOut)"] @@ -345,12 +373,28 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn isochronous_transfer_out_with_u8_array( + pub fn isochronous_transfer_out_with_u8_slice( this: &UsbDevice, endpoint_number: u8, data: &mut [u8], packet_lengths: &::wasm_bindgen::JsValue, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = isochronousTransferOut)] + #[doc = "The `isochronousTransferOut()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/isochronousTransferOut)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn isochronous_transfer_out_with_u8_array( + this: &UsbDevice, + endpoint_number: u8, + data: &::js_sys::Uint8Array, + packet_lengths: &::wasm_bindgen::JsValue, + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = open)] #[doc = "The `open()` method."] @@ -422,7 +466,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn transfer_in(this: &UsbDevice, endpoint_number: u8, length: u32) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = transferOut)] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = transferOut)] #[doc = "The `transferOut()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/transferOut)"] @@ -435,9 +479,9 @@ extern "C" { this: &UsbDevice, endpoint_number: u8, data: &::js_sys::Object, - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "USBDevice" , js_name = transferOut)] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = transferOut)] #[doc = "The `transferOut()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/transferOut)"] @@ -446,9 +490,24 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn transfer_out_with_u8_array( + pub fn transfer_out_with_u8_slice( this: &UsbDevice, endpoint_number: u8, data: &mut [u8], - ) -> ::js_sys::Promise; + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "USBDevice" , js_name = transferOut)] + #[doc = "The `transferOut()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBDevice/transferOut)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDevice`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn transfer_out_with_u8_array( + this: &UsbDevice, + endpoint_number: u8, + data: &::js_sys::Uint8Array, + ) -> Result<::js_sys::Promise, JsValue>; } diff --git a/crates/web-sys/src/features/gen_UsbDeviceFilter.rs b/crates/web-sys/src/features/gen_UsbDeviceFilter.rs index 132b25637af..e25da163b83 100644 --- a/crates/web-sys/src/features/gen_UsbDeviceFilter.rs +++ b/crates/web-sys/src/features/gen_UsbDeviceFilter.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type UsbDeviceFilter; -} -#[cfg(web_sys_unstable_apis)] -impl UsbDeviceFilter { - #[doc = "Construct a new `UsbDeviceFilter`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `classCode` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UsbDeviceFilter`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "classCode")] + pub fn get_class_code(this: &UsbDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `classCode` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl UsbDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn class_code(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("classCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "classCode")] + pub fn set_class_code(this: &UsbDeviceFilter, val: u8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `productId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "productId")] + pub fn get_product_id(this: &UsbDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `productId` field of this object."] #[doc = ""] @@ -55,20 +48,17 @@ impl UsbDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn product_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("productId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "productId")] + pub fn set_product_id(this: &UsbDeviceFilter, val: u16); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `protocolCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "protocolCode")] + pub fn get_protocol_code(this: &UsbDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `protocolCode` field of this object."] #[doc = ""] @@ -76,20 +66,17 @@ impl UsbDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn protocol_code(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("protocolCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "protocolCode")] + pub fn set_protocol_code(this: &UsbDeviceFilter, val: u8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `serialNumber` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "serialNumber")] + pub fn get_serial_number(this: &UsbDeviceFilter) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `serialNumber` field of this object."] #[doc = ""] @@ -97,20 +84,17 @@ impl UsbDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn serial_number(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("serialNumber"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "serialNumber")] + pub fn set_serial_number(this: &UsbDeviceFilter, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `subclassCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "subclassCode")] + pub fn get_subclass_code(this: &UsbDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `subclassCode` field of this object."] #[doc = ""] @@ -118,20 +102,17 @@ impl UsbDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn subclass_code(&mut self, val: u8) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("subclassCode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "subclassCode")] + pub fn set_subclass_code(this: &UsbDeviceFilter, val: u8); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `vendorId` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "vendorId")] + pub fn get_vendor_id(this: &UsbDeviceFilter) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `vendorId` field of this object."] #[doc = ""] @@ -139,18 +120,56 @@ impl UsbDeviceFilter { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "vendorId")] + pub fn set_vendor_id(this: &UsbDeviceFilter, val: u16); +} +#[cfg(web_sys_unstable_apis)] +impl UsbDeviceFilter { + #[doc = "Construct a new `UsbDeviceFilter`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDeviceFilter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_class_code()` instead."] + pub fn class_code(&mut self, val: u8) -> &mut Self { + self.set_class_code(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_product_id()` instead."] + pub fn product_id(&mut self, val: u16) -> &mut Self { + self.set_product_id(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_protocol_code()` instead."] + pub fn protocol_code(&mut self, val: u8) -> &mut Self { + self.set_protocol_code(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_serial_number()` instead."] + pub fn serial_number(&mut self, val: &str) -> &mut Self { + self.set_serial_number(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_subclass_code()` instead."] + pub fn subclass_code(&mut self, val: u8) -> &mut Self { + self.set_subclass_code(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_vendor_id()` instead."] pub fn vendor_id(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("vendorId"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_vendor_id(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbDeviceRequestOptions.rs b/crates/web-sys/src/features/gen_UsbDeviceRequestOptions.rs index 10f3f70e496..545cc8b66bb 100644 --- a/crates/web-sys/src/features/gen_UsbDeviceRequestOptions.rs +++ b/crates/web-sys/src/features/gen_UsbDeviceRequestOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type UsbDeviceRequestOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDeviceRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "filters")] + pub fn get_filters(this: &UsbDeviceRequestOptions) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbDeviceRequestOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "filters")] + pub fn set_filters(this: &UsbDeviceRequestOptions, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl UsbDeviceRequestOptions { @@ -25,28 +44,13 @@ impl UsbDeviceRequestOptions { pub fn new(filters: &::wasm_bindgen::JsValue) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.filters(filters); + ret.set_filters(filters); ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `filters` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UsbDeviceRequestOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_filters()` instead."] pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_filters(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbDirection.rs b/crates/web-sys/src/features/gen_UsbDirection.rs index 93583f25888..f2abfbd1c6f 100644 --- a/crates/web-sys/src/features/gen_UsbDirection.rs +++ b/crates/web-sys/src/features/gen_UsbDirection.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_UsbEndpoint.rs b/crates/web-sys/src/features/gen_UsbEndpoint.rs index 6a829de5d9e..27741fe344e 100644 --- a/crates/web-sys/src/features/gen_UsbEndpoint.rs +++ b/crates/web-sys/src/features/gen_UsbEndpoint.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbEndpointType.rs b/crates/web-sys/src/features/gen_UsbEndpointType.rs index 26c5fa8bcb0..73a52f710e4 100644 --- a/crates/web-sys/src/features/gen_UsbEndpointType.rs +++ b/crates/web-sys/src/features/gen_UsbEndpointType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_UsbInTransferResult.rs b/crates/web-sys/src/features/gen_UsbInTransferResult.rs index 4640a25dad3..08a3e18584c 100644 --- a/crates/web-sys/src/features/gen_UsbInTransferResult.rs +++ b/crates/web-sys/src/features/gen_UsbInTransferResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbInterface.rs b/crates/web-sys/src/features/gen_UsbInterface.rs index 3eab4137b88..f15831ca1bc 100644 --- a/crates/web-sys/src/features/gen_UsbInterface.rs +++ b/crates/web-sys/src/features/gen_UsbInterface.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbIsochronousInTransferPacket.rs b/crates/web-sys/src/features/gen_UsbIsochronousInTransferPacket.rs index c169ad7ecde..986bdf7b786 100644 --- a/crates/web-sys/src/features/gen_UsbIsochronousInTransferPacket.rs +++ b/crates/web-sys/src/features/gen_UsbIsochronousInTransferPacket.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbIsochronousInTransferResult.rs b/crates/web-sys/src/features/gen_UsbIsochronousInTransferResult.rs index 6330d44ac6f..2c3a43910b4 100644 --- a/crates/web-sys/src/features/gen_UsbIsochronousInTransferResult.rs +++ b/crates/web-sys/src/features/gen_UsbIsochronousInTransferResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbIsochronousOutTransferPacket.rs b/crates/web-sys/src/features/gen_UsbIsochronousOutTransferPacket.rs index 74a87c54b31..bc0fb12e8b3 100644 --- a/crates/web-sys/src/features/gen_UsbIsochronousOutTransferPacket.rs +++ b/crates/web-sys/src/features/gen_UsbIsochronousOutTransferPacket.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbIsochronousOutTransferResult.rs b/crates/web-sys/src/features/gen_UsbIsochronousOutTransferResult.rs index 5d1c7abf7fd..2a569b0c8bb 100644 --- a/crates/web-sys/src/features/gen_UsbIsochronousOutTransferResult.rs +++ b/crates/web-sys/src/features/gen_UsbIsochronousOutTransferResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbOutTransferResult.rs b/crates/web-sys/src/features/gen_UsbOutTransferResult.rs index 3f9fbc68a55..b0d67ab3986 100644 --- a/crates/web-sys/src/features/gen_UsbOutTransferResult.rs +++ b/crates/web-sys/src/features/gen_UsbOutTransferResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbPermissionDescriptor.rs b/crates/web-sys/src/features/gen_UsbPermissionDescriptor.rs index 1d2341838f8..212e844c66b 100644 --- a/crates/web-sys/src/features/gen_UsbPermissionDescriptor.rs +++ b/crates/web-sys/src/features/gen_UsbPermissionDescriptor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type UsbPermissionDescriptor; -} -#[cfg(web_sys_unstable_apis)] -impl UsbPermissionDescriptor { + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "PermissionName")] - #[doc = "Construct a new `UsbPermissionDescriptor`."] + #[doc = "Get the `name` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `UsbPermissionDescriptor`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(name: PermissionName) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.name(name); - ret - } + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &UsbPermissionDescriptor) -> PermissionName; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "PermissionName")] #[doc = "Change the `name` field of this object."] @@ -37,16 +32,17 @@ impl UsbPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn name(&mut self, val: PermissionName) -> &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 - } + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &UsbPermissionDescriptor, val: PermissionName); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `filters` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "filters")] + pub fn get_filters(this: &UsbPermissionDescriptor) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `filters` field of this object."] #[doc = ""] @@ -54,18 +50,35 @@ impl UsbPermissionDescriptor { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "filters")] + pub fn set_filters(this: &UsbPermissionDescriptor, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl UsbPermissionDescriptor { + #[cfg(feature = "PermissionName")] + #[doc = "Construct a new `UsbPermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `UsbPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(name: PermissionName) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_name(name); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: PermissionName) -> &mut Self { + self.set_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_filters()` instead."] pub fn filters(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("filters"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_filters(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbPermissionResult.rs b/crates/web-sys/src/features/gen_UsbPermissionResult.rs index 2dc7d854b4a..96a5e975f15 100644 --- a/crates/web-sys/src/features/gen_UsbPermissionResult.rs +++ b/crates/web-sys/src/features/gen_UsbPermissionResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_UsbPermissionStorage.rs b/crates/web-sys/src/features/gen_UsbPermissionStorage.rs index 75b8350e793..7c99dd15666 100644 --- a/crates/web-sys/src/features/gen_UsbPermissionStorage.rs +++ b/crates/web-sys/src/features/gen_UsbPermissionStorage.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type UsbPermissionStorage; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `allowedDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbPermissionStorage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "allowedDevices")] + pub fn get_allowed_devices(this: &UsbPermissionStorage) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `allowedDevices` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UsbPermissionStorage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "allowedDevices")] + pub fn set_allowed_devices(this: &UsbPermissionStorage, val: &::wasm_bindgen::JsValue); } #[cfg(web_sys_unstable_apis)] impl UsbPermissionStorage { @@ -28,24 +47,9 @@ impl UsbPermissionStorage { ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `allowedDevices` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UsbPermissionStorage`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_allowed_devices()` instead."] pub fn allowed_devices(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("allowedDevices"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_allowed_devices(val); self } } diff --git a/crates/web-sys/src/features/gen_UsbRecipient.rs b/crates/web-sys/src/features/gen_UsbRecipient.rs index 413c2f04d0a..fb486f9531d 100644 --- a/crates/web-sys/src/features/gen_UsbRecipient.rs +++ b/crates/web-sys/src/features/gen_UsbRecipient.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_UsbRequestType.rs b/crates/web-sys/src/features/gen_UsbRequestType.rs index a3984a59939..e47b7b4af41 100644 --- a/crates/web-sys/src/features/gen_UsbRequestType.rs +++ b/crates/web-sys/src/features/gen_UsbRequestType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_UsbTransferStatus.rs b/crates/web-sys/src/features/gen_UsbTransferStatus.rs index 2f80dee8418..3a23a5156d2 100644 --- a/crates/web-sys/src/features/gen_UsbTransferStatus.rs +++ b/crates/web-sys/src/features/gen_UsbTransferStatus.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_UserActivation.rs b/crates/web-sys/src/features/gen_UserActivation.rs new file mode 100644 index 00000000000..deef4a5ce43 --- /dev/null +++ b/crates/web-sys/src/features/gen_UserActivation.rs @@ -0,0 +1,29 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UserActivation , typescript_type = "UserActivation")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UserActivation` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/UserActivation)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserActivation`*"] + pub type UserActivation; + # [wasm_bindgen (structural , method , getter , js_class = "UserActivation" , js_name = hasBeenActive)] + #[doc = "Getter for the `hasBeenActive` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/UserActivation/hasBeenActive)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserActivation`*"] + pub fn has_been_active(this: &UserActivation) -> bool; + # [wasm_bindgen (structural , method , getter , js_class = "UserActivation" , js_name = isActive)] + #[doc = "Getter for the `isActive` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/UserActivation/isActive)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserActivation`*"] + pub fn is_active(this: &UserActivation) -> bool; +} diff --git a/crates/web-sys/src/features/gen_UserProximityEvent.rs b/crates/web-sys/src/features/gen_UserProximityEvent.rs index 5b949247604..f982be1e155 100644 --- a/crates/web-sys/src/features/gen_UserProximityEvent.rs +++ b/crates/web-sys/src/features/gen_UserProximityEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_UserProximityEventInit.rs b/crates/web-sys/src/features/gen_UserProximityEventInit.rs index 63c45c228e7..717e8354c82 100644 --- a/crates/web-sys/src/features/gen_UserProximityEventInit.rs +++ b/crates/web-sys/src/features/gen_UserProximityEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] pub type UserProximityEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &UserProximityEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &UserProximityEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &UserProximityEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &UserProximityEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &UserProximityEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &UserProximityEventInit, val: bool); + #[doc = "Get the `near` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[wasm_bindgen(method, getter = "near")] + pub fn get_near(this: &UserProximityEventInit) -> Option; + #[doc = "Change the `near` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[wasm_bindgen(method, setter = "near")] + pub fn set_near(this: &UserProximityEventInit, val: bool); } impl UserProximityEventInit { #[doc = "Construct a new `UserProximityEventInit`."] @@ -19,68 +60,24 @@ impl UserProximityEventInit { 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: `UserProximityEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `near` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UserProximityEventInit`*"] + #[deprecated = "Use `set_near()` instead."] pub fn near(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("near"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_near(val); self } } diff --git a/crates/web-sys/src/features/gen_UserVerificationRequirement.rs b/crates/web-sys/src/features/gen_UserVerificationRequirement.rs index f683e955474..674372b5bf4 100644 --- a/crates/web-sys/src/features/gen_UserVerificationRequirement.rs +++ b/crates/web-sys/src/features/gen_UserVerificationRequirement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `UserVerificationRequirement` enum."] diff --git a/crates/web-sys/src/features/gen_ValidityState.rs b/crates/web-sys/src/features/gen_ValidityState.rs index 4550a3de489..6dffe86e750 100644 --- a/crates/web-sys/src/features/gen_ValidityState.rs +++ b/crates/web-sys/src/features/gen_ValidityState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ValueEvent.rs b/crates/web-sys/src/features/gen_ValueEvent.rs index dad1661210f..4956b1d9de5 100644 --- a/crates/web-sys/src/features/gen_ValueEvent.rs +++ b/crates/web-sys/src/features/gen_ValueEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_ValueEventInit.rs b/crates/web-sys/src/features/gen_ValueEventInit.rs index 7e6980e597f..493a9f39cb0 100644 --- a/crates/web-sys/src/features/gen_ValueEventInit.rs +++ b/crates/web-sys/src/features/gen_ValueEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ValueEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl ValueEventInit { - #[doc = "Construct a new `ValueEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &ValueEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl ValueEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &ValueEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &ValueEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -55,20 +48,17 @@ impl ValueEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &ValueEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &ValueEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -76,20 +66,17 @@ impl ValueEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &ValueEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &ValueEventInit) -> ::wasm_bindgen::JsValue; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `value` field of this object."] #[doc = ""] @@ -97,14 +84,44 @@ impl ValueEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &ValueEventInit, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl ValueEventInit { + #[doc = "Construct a new `ValueEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ValueEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_value()` instead."] pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &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.set_value(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoColorPrimaries.rs b/crates/web-sys/src/features/gen_VideoColorPrimaries.rs index 944e60128d3..31c6f0e739e 100644 --- a/crates/web-sys/src/features/gen_VideoColorPrimaries.rs +++ b/crates/web-sys/src/features/gen_VideoColorPrimaries.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_VideoColorSpace.rs b/crates/web-sys/src/features/gen_VideoColorSpace.rs index 11287ec9b23..dbd617dac90 100644 --- a/crates/web-sys/src/features/gen_VideoColorSpace.rs +++ b/crates/web-sys/src/features/gen_VideoColorSpace.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs b/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs index 2343649f9d9..fbf7cd1bc19 100644 --- a/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs +++ b/crates/web-sys/src/features/gen_VideoColorSpaceInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoColorSpaceInit; -} -#[cfg(web_sys_unstable_apis)] -impl VideoColorSpaceInit { - #[doc = "Construct a new `VideoColorSpaceInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `fullRange` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "fullRange")] + pub fn get_full_range(this: &VideoColorSpaceInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `fullRange` field of this object."] #[doc = ""] @@ -34,20 +30,18 @@ impl VideoColorSpaceInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn full_range(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("fullRange"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "fullRange")] + pub fn set_full_range(this: &VideoColorSpaceInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoMatrixCoefficients")] + #[doc = "Get the `matrix` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`, `VideoMatrixCoefficients`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "matrix")] + pub fn get_matrix(this: &VideoColorSpaceInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoMatrixCoefficients")] #[doc = "Change the `matrix` field of this object."] @@ -56,17 +50,18 @@ impl VideoColorSpaceInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn matrix(&mut self, val: VideoMatrixCoefficients) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("matrix"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "matrix")] + pub fn set_matrix(this: &VideoColorSpaceInit, val: VideoMatrixCoefficients); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoColorPrimaries")] + #[doc = "Get the `primaries` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoColorPrimaries`, `VideoColorSpaceInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "primaries")] + pub fn get_primaries(this: &VideoColorSpaceInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoColorPrimaries")] #[doc = "Change the `primaries` field of this object."] @@ -75,20 +70,18 @@ impl VideoColorSpaceInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn primaries(&mut self, val: VideoColorPrimaries) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("primaries"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "primaries")] + pub fn set_primaries(this: &VideoColorSpaceInit, val: VideoColorPrimaries); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoTransferCharacteristics")] + #[doc = "Get the `transfer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`, `VideoTransferCharacteristics`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "transfer")] + pub fn get_transfer(this: &VideoColorSpaceInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoTransferCharacteristics")] #[doc = "Change the `transfer` field of this object."] @@ -97,18 +90,47 @@ impl VideoColorSpaceInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "transfer")] + pub fn set_transfer(this: &VideoColorSpaceInit, val: VideoTransferCharacteristics); +} +#[cfg(web_sys_unstable_apis)] +impl VideoColorSpaceInit { + #[doc = "Construct a new `VideoColorSpaceInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_full_range()` instead."] + pub fn full_range(&mut self, val: bool) -> &mut Self { + self.set_full_range(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoMatrixCoefficients")] + #[deprecated = "Use `set_matrix()` instead."] + pub fn matrix(&mut self, val: VideoMatrixCoefficients) -> &mut Self { + self.set_matrix(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoColorPrimaries")] + #[deprecated = "Use `set_primaries()` instead."] + pub fn primaries(&mut self, val: VideoColorPrimaries) -> &mut Self { + self.set_primaries(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoTransferCharacteristics")] + #[deprecated = "Use `set_transfer()` instead."] pub fn transfer(&mut self, val: VideoTransferCharacteristics) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transfer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_transfer(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoConfiguration.rs b/crates/web-sys/src/features/gen_VideoConfiguration.rs index a69d0039a38..aa6b2a6f3bd 100644 --- a/crates/web-sys/src/features/gen_VideoConfiguration.rs +++ b/crates/web-sys/src/features/gen_VideoConfiguration.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,56 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] pub type VideoConfiguration; + #[doc = "Get the `bitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, getter = "bitrate")] + pub fn get_bitrate(this: &VideoConfiguration) -> Option; + #[doc = "Change the `bitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, setter = "bitrate")] + pub fn set_bitrate(this: &VideoConfiguration, val: f64); + #[doc = "Get the `contentType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, getter = "contentType")] + pub fn get_content_type(this: &VideoConfiguration) -> Option<::alloc::string::String>; + #[doc = "Change the `contentType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, setter = "contentType")] + pub fn set_content_type(this: &VideoConfiguration, val: &str); + #[doc = "Get the `framerate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, getter = "framerate")] + pub fn get_framerate(this: &VideoConfiguration) -> Option<::alloc::string::String>; + #[doc = "Change the `framerate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, setter = "framerate")] + pub fn set_framerate(this: &VideoConfiguration, val: &str); + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &VideoConfiguration) -> Option; + #[doc = "Change the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &VideoConfiguration, val: u32); + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &VideoConfiguration) -> Option; + #[doc = "Change the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &VideoConfiguration, val: u32); } impl VideoConfiguration { #[doc = "Construct a new `VideoConfiguration`."] @@ -19,82 +70,29 @@ impl VideoConfiguration { 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: `VideoConfiguration`*"] + #[deprecated = "Use `set_bitrate()` instead."] 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.set_bitrate(val); self } - #[doc = "Change the `contentType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[deprecated = "Use `set_content_type()` instead."] 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.set_content_type(val); self } - #[doc = "Change the `framerate` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[deprecated = "Use `set_framerate()` instead."] pub fn framerate(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_framerate(val); self } - #[doc = "Change the `height` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[deprecated = "Use `set_height()` instead."] pub fn height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_height(val); self } - #[doc = "Change the `width` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoConfiguration`*"] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoDecoder.rs b/crates/web-sys/src/features/gen_VideoDecoder.rs index 591aad1b908..1002aca6be2 100644 --- a/crates/web-sys/src/features/gen_VideoDecoder.rs +++ b/crates/web-sys/src/features/gen_VideoDecoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -51,7 +52,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(init: &VideoDecoderInit) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = close)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoDecoder" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/close)"] @@ -60,10 +61,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn close(this: &VideoDecoder); + pub fn close(this: &VideoDecoder) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoDecoderConfig")] - # [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = configure)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoDecoder" , js_name = configure)] #[doc = "The `configure()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/configure)"] @@ -72,10 +73,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn configure(this: &VideoDecoder, config: &VideoDecoderConfig); + pub fn configure(this: &VideoDecoder, config: &VideoDecoderConfig) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "EncodedVideoChunk")] - # [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = decode)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoDecoder" , js_name = decode)] #[doc = "The `decode()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/decode)"] @@ -84,7 +85,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn decode(this: &VideoDecoder, chunk: &EncodedVideoChunk); + pub fn decode(this: &VideoDecoder, chunk: &EncodedVideoChunk) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = flush)] #[doc = "The `flush()` method."] @@ -101,7 +102,7 @@ extern "C" { # [wasm_bindgen (static_method_of = VideoDecoder , js_class = "VideoDecoder" , js_name = isConfigSupported)] #[doc = "The `isConfigSupported()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/isConfigSupported)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/isConfigSupported_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`, `VideoDecoderConfig`*"] #[doc = ""] @@ -109,7 +110,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn is_config_supported(config: &VideoDecoderConfig) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "VideoDecoder" , js_name = reset)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoDecoder" , js_name = reset)] #[doc = "The `reset()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/reset)"] @@ -118,5 +119,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn reset(this: &VideoDecoder); + pub fn reset(this: &VideoDecoder) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_VideoDecoderConfig.rs b/crates/web-sys/src/features/gen_VideoDecoderConfig.rs index 073b8b4a64b..d4e4b427ce6 100644 --- a/crates/web-sys/src/features/gen_VideoDecoderConfig.rs +++ b/crates/web-sys/src/features/gen_VideoDecoderConfig.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,21 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoDecoderConfig; -} -#[cfg(web_sys_unstable_apis)] -impl VideoDecoderConfig { - #[doc = "Construct a new `VideoDecoderConfig`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `codec` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(codec: &str) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.codec(codec); - ret - } + #[wasm_bindgen(method, getter = "codec")] + pub fn get_codec(this: &VideoDecoderConfig) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `codec` field of this object."] #[doc = ""] @@ -35,16 +30,17 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "codec")] + pub fn set_codec(this: &VideoDecoderConfig, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `codedHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "codedHeight")] + pub fn get_coded_height(this: &VideoDecoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `codedHeight` field of this object."] #[doc = ""] @@ -52,20 +48,17 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn coded_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codedHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "codedHeight")] + pub fn set_coded_height(this: &VideoDecoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `codedWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "codedWidth")] + pub fn get_coded_width(this: &VideoDecoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `codedWidth` field of this object."] #[doc = ""] @@ -73,20 +66,18 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn coded_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codedWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "codedWidth")] + pub fn set_coded_width(this: &VideoDecoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoColorSpaceInit")] + #[doc = "Get the `colorSpace` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`, `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "colorSpace")] + pub fn get_color_space(this: &VideoDecoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoColorSpaceInit")] #[doc = "Change the `colorSpace` field of this object."] @@ -95,20 +86,17 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "colorSpace")] + pub fn set_color_space(this: &VideoDecoderConfig, val: &VideoColorSpaceInit); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "description")] + pub fn get_description(this: &VideoDecoderConfig) -> Option<::js_sys::Object>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `description` field of this object."] #[doc = ""] @@ -116,20 +104,17 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn description(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "description")] + pub fn set_description(this: &VideoDecoderConfig, val: &::js_sys::Object); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayAspectHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayAspectHeight")] + pub fn get_display_aspect_height(this: &VideoDecoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `displayAspectHeight` field of this object."] #[doc = ""] @@ -137,20 +122,17 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn display_aspect_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayAspectHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "displayAspectHeight")] + pub fn set_display_aspect_height(this: &VideoDecoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayAspectWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayAspectWidth")] + pub fn get_display_aspect_width(this: &VideoDecoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `displayAspectWidth` field of this object."] #[doc = ""] @@ -158,20 +140,18 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn display_aspect_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayAspectWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "displayAspectWidth")] + pub fn set_display_aspect_width(this: &VideoDecoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HardwareAcceleration")] + #[doc = "Get the `hardwareAcceleration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HardwareAcceleration`, `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "hardwareAcceleration")] + pub fn get_hardware_acceleration(this: &VideoDecoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "HardwareAcceleration")] #[doc = "Change the `hardwareAcceleration` field of this object."] @@ -180,20 +160,17 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hardwareAcceleration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "hardwareAcceleration")] + pub fn set_hardware_acceleration(this: &VideoDecoderConfig, val: HardwareAcceleration); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `optimizeForLatency` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "optimizeForLatency")] + pub fn get_optimize_for_latency(this: &VideoDecoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `optimizeForLatency` field of this object."] #[doc = ""] @@ -201,18 +178,77 @@ impl VideoDecoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "optimizeForLatency")] + pub fn set_optimize_for_latency(this: &VideoDecoderConfig, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl VideoDecoderConfig { + #[doc = "Construct a new `VideoDecoderConfig`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(codec: &str) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_codec(codec); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_codec()` instead."] + pub fn codec(&mut self, val: &str) -> &mut Self { + self.set_codec(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_coded_height()` instead."] + pub fn coded_height(&mut self, val: u32) -> &mut Self { + self.set_coded_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_coded_width()` instead."] + pub fn coded_width(&mut self, val: u32) -> &mut Self { + self.set_coded_width(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoColorSpaceInit")] + #[deprecated = "Use `set_color_space()` instead."] + pub fn color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self { + self.set_color_space(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_description()` instead."] + pub fn description(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_description(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_aspect_height()` instead."] + pub fn display_aspect_height(&mut self, val: u32) -> &mut Self { + self.set_display_aspect_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_aspect_width()` instead."] + pub fn display_aspect_width(&mut self, val: u32) -> &mut Self { + self.set_display_aspect_width(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HardwareAcceleration")] + #[deprecated = "Use `set_hardware_acceleration()` instead."] + pub fn hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self { + self.set_hardware_acceleration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_optimize_for_latency()` instead."] pub fn optimize_for_latency(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optimizeForLatency"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_optimize_for_latency(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoDecoderInit.rs b/crates/web-sys/src/features/gen_VideoDecoderInit.rs index b1dd38bcc20..abd00678abe 100644 --- a/crates/web-sys/src/features/gen_VideoDecoderInit.rs +++ b/crates/web-sys/src/features/gen_VideoDecoderInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoDecoderInit; -} -#[cfg(web_sys_unstable_apis)] -impl VideoDecoderInit { - #[doc = "Construct a new `VideoDecoderInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `error` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoDecoderInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(error: &::js_sys::Function, output: &::js_sys::Function) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.error(error); - ret.output(output); - ret - } + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &VideoDecoderInit) -> ::js_sys::Function; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `error` field of this object."] #[doc = ""] @@ -36,16 +30,17 @@ impl VideoDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn error(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &VideoDecoderInit, val: &::js_sys::Function); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `output` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "output")] + pub fn get_output(this: &VideoDecoderInit) -> ::js_sys::Function; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `output` field of this object."] #[doc = ""] @@ -53,15 +48,34 @@ impl VideoDecoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "output")] + pub fn set_output(this: &VideoDecoderInit, val: &::js_sys::Function); +} +#[cfg(web_sys_unstable_apis)] +impl VideoDecoderInit { + #[doc = "Construct a new `VideoDecoderInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(error: &::js_sys::Function, output: &::js_sys::Function) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_error(error); + ret.set_output(output); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_error()` instead."] + pub fn error(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_error(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_output()` instead."] pub fn output(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("output"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_output(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoDecoderSupport.rs b/crates/web-sys/src/features/gen_VideoDecoderSupport.rs index 44efe4037ab..74356620b90 100644 --- a/crates/web-sys/src/features/gen_VideoDecoderSupport.rs +++ b/crates/web-sys/src/features/gen_VideoDecoderSupport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,44 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoDecoderSupport; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoDecoderConfig")] + #[doc = "Get the `config` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`, `VideoDecoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "config")] + pub fn get_config(this: &VideoDecoderSupport) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoDecoderConfig")] + #[doc = "Change the `config` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`, `VideoDecoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "config")] + pub fn set_config(this: &VideoDecoderSupport, val: &VideoDecoderConfig); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "supported")] + pub fn get_supported(this: &VideoDecoderSupport) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoDecoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "supported")] + pub fn set_supported(this: &VideoDecoderSupport, val: bool); } #[cfg(web_sys_unstable_apis)] impl VideoDecoderSupport { @@ -29,42 +68,15 @@ impl VideoDecoderSupport { } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoDecoderConfig")] - #[doc = "Change the `config` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`, `VideoDecoderSupport`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_config()` instead."] pub fn config(&mut self, val: &VideoDecoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("config"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_config(val); self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `supported` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoDecoderSupport`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_supported()` instead."] pub fn supported(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supported"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_supported(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoEncoder.rs b/crates/web-sys/src/features/gen_VideoEncoder.rs index 28a670772a8..84d74ae01a4 100644 --- a/crates/web-sys/src/features/gen_VideoEncoder.rs +++ b/crates/web-sys/src/features/gen_VideoEncoder.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -51,7 +52,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(init: &VideoEncoderInit) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "VideoEncoder" , js_name = close)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoEncoder" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/close)"] @@ -60,10 +61,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn close(this: &VideoEncoder); + pub fn close(this: &VideoEncoder) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoEncoderConfig")] - # [wasm_bindgen (method , structural , js_class = "VideoEncoder" , js_name = configure)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoEncoder" , js_name = configure)] #[doc = "The `configure()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/configure)"] @@ -72,10 +73,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn configure(this: &VideoEncoder, config: &VideoEncoderConfig); + pub fn configure(this: &VideoEncoder, config: &VideoEncoderConfig) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoFrame")] - # [wasm_bindgen (method , structural , js_class = "VideoEncoder" , js_name = encode)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoEncoder" , js_name = encode)] #[doc = "The `encode()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/encode)"] @@ -84,10 +85,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn encode(this: &VideoEncoder, frame: &VideoFrame); + pub fn encode(this: &VideoEncoder, frame: &VideoFrame) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "VideoEncoderEncodeOptions", feature = "VideoFrame",))] - # [wasm_bindgen (method , structural , js_class = "VideoEncoder" , js_name = encode)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoEncoder" , js_name = encode)] #[doc = "The `encode()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/encode)"] @@ -100,7 +101,7 @@ extern "C" { this: &VideoEncoder, frame: &VideoFrame, options: &VideoEncoderEncodeOptions, - ); + ) -> Result<(), JsValue>; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "VideoEncoder" , js_name = flush)] #[doc = "The `flush()` method."] @@ -117,7 +118,7 @@ extern "C" { # [wasm_bindgen (static_method_of = VideoEncoder , js_class = "VideoEncoder" , js_name = isConfigSupported)] #[doc = "The `isConfigSupported()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/isConfigSupported)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/isConfigSupported_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`, `VideoEncoderConfig`*"] #[doc = ""] @@ -125,7 +126,7 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn is_config_supported(config: &VideoEncoderConfig) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "VideoEncoder" , js_name = reset)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoEncoder" , js_name = reset)] #[doc = "The `reset()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/reset)"] @@ -134,5 +135,5 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn reset(this: &VideoEncoder); + pub fn reset(this: &VideoEncoder) -> Result<(), JsValue>; } diff --git a/crates/web-sys/src/features/gen_VideoEncoderConfig.rs b/crates/web-sys/src/features/gen_VideoEncoderConfig.rs index 4d61f21a74b..4251ddf8eba 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderConfig.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderConfig.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,23 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoEncoderConfig; -} -#[cfg(web_sys_unstable_apis)] -impl VideoEncoderConfig { - #[doc = "Construct a new `VideoEncoderConfig`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AlphaOption")] + #[doc = "Get the `alpha` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = "*This API requires the following crate features to be activated: `AlphaOption`, `VideoEncoderConfig`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(codec: &str, height: u32, width: u32) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.codec(codec); - ret.height(height); - ret.width(width); - ret - } + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &VideoEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AlphaOption")] #[doc = "Change the `alpha` field of this object."] @@ -38,16 +32,17 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha(&mut self, val: AlphaOption) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &VideoEncoderConfig, val: AlphaOption); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bitrate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bitrate")] + pub fn get_bitrate(this: &VideoEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bitrate` field of this object."] #[doc = ""] @@ -55,20 +50,17 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bitrate")] + pub fn set_bitrate(this: &VideoEncoderConfig, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `codec` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "codec")] + pub fn get_codec(this: &VideoEncoderConfig) -> ::alloc::string::String; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `codec` field of this object."] #[doc = ""] @@ -76,16 +68,17 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn codec(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("codec"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "codec")] + pub fn set_codec(this: &VideoEncoderConfig, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayHeight")] + pub fn get_display_height(this: &VideoEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `displayHeight` field of this object."] #[doc = ""] @@ -93,20 +86,17 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn display_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "displayHeight")] + pub fn set_display_height(this: &VideoEncoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayWidth")] + pub fn get_display_width(this: &VideoEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `displayWidth` field of this object."] #[doc = ""] @@ -114,20 +104,17 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn display_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "displayWidth")] + pub fn set_display_width(this: &VideoEncoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `framerate` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "framerate")] + pub fn get_framerate(this: &VideoEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `framerate` field of this object."] #[doc = ""] @@ -135,20 +122,18 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn framerate(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framerate"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "framerate")] + pub fn set_framerate(this: &VideoEncoderConfig, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HardwareAcceleration")] + #[doc = "Get the `hardwareAcceleration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HardwareAcceleration`, `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "hardwareAcceleration")] + pub fn get_hardware_acceleration(this: &VideoEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "HardwareAcceleration")] #[doc = "Change the `hardwareAcceleration` field of this object."] @@ -157,20 +142,17 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hardwareAcceleration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "hardwareAcceleration")] + pub fn set_hardware_acceleration(this: &VideoEncoderConfig, val: HardwareAcceleration); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `height` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "height")] + pub fn get_height(this: &VideoEncoderConfig) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `height` field of this object."] #[doc = ""] @@ -178,17 +160,18 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("height"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "height")] + pub fn set_height(this: &VideoEncoderConfig, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LatencyMode")] + #[doc = "Get the `latencyMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LatencyMode`, `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "latencyMode")] + pub fn get_latency_mode(this: &VideoEncoderConfig) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "LatencyMode")] #[doc = "Change the `latencyMode` field of this object."] @@ -197,20 +180,17 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn latency_mode(&mut self, val: LatencyMode) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("latencyMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "latencyMode")] + pub fn set_latency_mode(this: &VideoEncoderConfig, val: LatencyMode); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `scalabilityMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "scalabilityMode")] + pub fn get_scalability_mode(this: &VideoEncoderConfig) -> Option<::alloc::string::String>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `scalabilityMode` field of this object."] #[doc = ""] @@ -218,20 +198,17 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn scalability_mode(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("scalabilityMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "scalabilityMode")] + pub fn set_scalability_mode(this: &VideoEncoderConfig, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `width` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "width")] + pub fn get_width(this: &VideoEncoderConfig) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `width` field of this object."] #[doc = ""] @@ -239,14 +216,92 @@ impl VideoEncoderConfig { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "width")] + pub fn set_width(this: &VideoEncoderConfig, val: u32); +} +#[cfg(web_sys_unstable_apis)] +impl VideoEncoderConfig { + #[doc = "Construct a new `VideoEncoderConfig`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(codec: &str, height: u32, width: u32) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_codec(codec); + ret.set_height(height); + ret.set_width(width); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AlphaOption")] + #[deprecated = "Use `set_alpha()` instead."] + pub fn alpha(&mut self, val: AlphaOption) -> &mut Self { + self.set_alpha(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bitrate()` instead."] + pub fn bitrate(&mut self, val: f64) -> &mut Self { + self.set_bitrate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_codec()` instead."] + pub fn codec(&mut self, val: &str) -> &mut Self { + self.set_codec(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_height()` instead."] + pub fn display_height(&mut self, val: u32) -> &mut Self { + self.set_display_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_width()` instead."] + pub fn display_width(&mut self, val: u32) -> &mut Self { + self.set_display_width(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_framerate()` instead."] + pub fn framerate(&mut self, val: f64) -> &mut Self { + self.set_framerate(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "HardwareAcceleration")] + #[deprecated = "Use `set_hardware_acceleration()` instead."] + pub fn hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self { + self.set_hardware_acceleration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_height()` instead."] + pub fn height(&mut self, val: u32) -> &mut Self { + self.set_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LatencyMode")] + #[deprecated = "Use `set_latency_mode()` instead."] + pub fn latency_mode(&mut self, val: LatencyMode) -> &mut Self { + self.set_latency_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_scalability_mode()` instead."] + pub fn scalability_mode(&mut self, val: &str) -> &mut Self { + self.set_scalability_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_width()` instead."] pub fn width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("width"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_width(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoEncoderEncodeOptions.rs b/crates/web-sys/src/features/gen_VideoEncoderEncodeOptions.rs index 345363afa30..18c58aac847 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderEncodeOptions.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderEncodeOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,24 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoEncoderEncodeOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `keyFrame` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderEncodeOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "keyFrame")] + pub fn get_key_frame(this: &VideoEncoderEncodeOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `keyFrame` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderEncodeOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "keyFrame")] + pub fn set_key_frame(this: &VideoEncoderEncodeOptions, val: bool); } #[cfg(web_sys_unstable_apis)] impl VideoEncoderEncodeOptions { @@ -28,24 +47,9 @@ impl VideoEncoderEncodeOptions { ret } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `keyFrame` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoEncoderEncodeOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_key_frame()` instead."] pub fn key_frame(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("keyFrame"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_key_frame(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoEncoderInit.rs b/crates/web-sys/src/features/gen_VideoEncoderInit.rs index e2c73e0b4a1..9bf0c7f83de 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderInit.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoEncoderInit; -} -#[cfg(web_sys_unstable_apis)] -impl VideoEncoderInit { - #[doc = "Construct a new `VideoEncoderInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `error` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoEncoderInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(error: &::js_sys::Function, output: &::js_sys::Function) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.error(error); - ret.output(output); - ret - } + #[wasm_bindgen(method, getter = "error")] + pub fn get_error(this: &VideoEncoderInit) -> ::js_sys::Function; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `error` field of this object."] #[doc = ""] @@ -36,16 +30,17 @@ impl VideoEncoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn error(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("error"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "error")] + pub fn set_error(this: &VideoEncoderInit, val: &::js_sys::Function); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `output` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "output")] + pub fn get_output(this: &VideoEncoderInit) -> ::js_sys::Function; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `output` field of this object."] #[doc = ""] @@ -53,15 +48,34 @@ impl VideoEncoderInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "output")] + pub fn set_output(this: &VideoEncoderInit, val: &::js_sys::Function); +} +#[cfg(web_sys_unstable_apis)] +impl VideoEncoderInit { + #[doc = "Construct a new `VideoEncoderInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(error: &::js_sys::Function, output: &::js_sys::Function) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_error(error); + ret.set_output(output); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_error()` instead."] + pub fn error(&mut self, val: &::js_sys::Function) -> &mut Self { + self.set_error(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_output()` instead."] pub fn output(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("output"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_output(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoEncoderSupport.rs b/crates/web-sys/src/features/gen_VideoEncoderSupport.rs index 94dab1e0fa5..8fa25810ba6 100644 --- a/crates/web-sys/src/features/gen_VideoEncoderSupport.rs +++ b/crates/web-sys/src/features/gen_VideoEncoderSupport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,44 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoEncoderSupport; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoEncoderConfig")] + #[doc = "Get the `config` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`, `VideoEncoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "config")] + pub fn get_config(this: &VideoEncoderSupport) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoEncoderConfig")] + #[doc = "Change the `config` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`, `VideoEncoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "config")] + pub fn set_config(this: &VideoEncoderSupport, val: &VideoEncoderConfig); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "supported")] + pub fn get_supported(this: &VideoEncoderSupport) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `supported` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoEncoderSupport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "supported")] + pub fn set_supported(this: &VideoEncoderSupport, val: bool); } #[cfg(web_sys_unstable_apis)] impl VideoEncoderSupport { @@ -29,42 +68,15 @@ impl VideoEncoderSupport { } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoEncoderConfig")] - #[doc = "Change the `config` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`, `VideoEncoderSupport`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_config()` instead."] pub fn config(&mut self, val: &VideoEncoderConfig) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("config"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_config(val); self } #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `supported` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoEncoderSupport`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_supported()` instead."] pub fn supported(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("supported"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_supported(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoFacingModeEnum.rs b/crates/web-sys/src/features/gen_VideoFacingModeEnum.rs index cabca288358..81fd3839ae9 100644 --- a/crates/web-sys/src/features/gen_VideoFacingModeEnum.rs +++ b/crates/web-sys/src/features/gen_VideoFacingModeEnum.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `VideoFacingModeEnum` enum."] diff --git a/crates/web-sys/src/features/gen_VideoFrame.rs b/crates/web-sys/src/features/gen_VideoFrame.rs index b0f29df7644..962c353b1b5 100644 --- a/crates/web-sys/src/features/gen_VideoFrame.rs +++ b/crates/web-sys/src/features/gen_VideoFrame.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -190,6 +191,29 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_image_bitmap(image: &ImageBitmap) -> Result; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "OffscreenCanvas")] + #[wasm_bindgen(catch, constructor, js_class = "VideoFrame")] + #[doc = "The `new VideoFrame(..)` constructor, creating a new instance of `VideoFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/VideoFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_offscreen_canvas(image: &OffscreenCanvas) -> Result; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "VideoFrame")] + #[doc = "The `new VideoFrame(..)` constructor, creating a new instance of `VideoFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/VideoFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_video_frame(image: &VideoFrame) -> Result; + #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "HtmlImageElement", feature = "VideoFrameInit",))] #[wasm_bindgen(catch, constructor, js_class = "VideoFrame")] #[doc = "The `new VideoFrame(..)` constructor, creating a new instance of `VideoFrame`."] @@ -265,6 +289,36 @@ extern "C" { init: &VideoFrameInit, ) -> Result; #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "OffscreenCanvas", feature = "VideoFrameInit",))] + #[wasm_bindgen(catch, constructor, js_class = "VideoFrame")] + #[doc = "The `new VideoFrame(..)` constructor, creating a new instance of `VideoFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/VideoFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `VideoFrame`, `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_offscreen_canvas_and_video_frame_init( + image: &OffscreenCanvas, + init: &VideoFrameInit, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameInit")] + #[wasm_bindgen(catch, constructor, js_class = "VideoFrame")] + #[doc = "The `new VideoFrame(..)` constructor, creating a new instance of `VideoFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/VideoFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_video_frame_and_video_frame_init( + image: &VideoFrame, + init: &VideoFrameInit, + ) -> Result; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoFrameBufferInit")] #[wasm_bindgen(catch, constructor, js_class = "VideoFrame")] #[doc = "The `new VideoFrame(..)` constructor, creating a new instance of `VideoFrame`."] @@ -290,12 +344,27 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new_with_u8_array_and_video_frame_buffer_init( + pub fn new_with_u8_slice_and_video_frame_buffer_init( data: &mut [u8], init: &VideoFrameBufferInit, ) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "VideoFrame" , js_name = allocationSize)] + #[cfg(feature = "VideoFrameBufferInit")] + #[wasm_bindgen(catch, constructor, js_class = "VideoFrame")] + #[doc = "The `new VideoFrame(..)` constructor, creating a new instance of `VideoFrame`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/VideoFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_u8_array_and_video_frame_buffer_init( + data: &::js_sys::Uint8Array, + init: &VideoFrameBufferInit, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoFrame" , js_name = allocationSize)] #[doc = "The `allocationSize()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/allocationSize)"] @@ -304,10 +373,10 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn allocation_size(this: &VideoFrame) -> u32; + pub fn allocation_size(this: &VideoFrame) -> Result; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoFrameCopyToOptions")] - # [wasm_bindgen (method , structural , js_class = "VideoFrame" , js_name = allocationSize)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoFrame" , js_name = allocationSize)] #[doc = "The `allocationSize()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/allocationSize)"] @@ -319,9 +388,9 @@ extern "C" { pub fn allocation_size_with_options( this: &VideoFrame, options: &VideoFrameCopyToOptions, - ) -> u32; + ) -> Result; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "VideoFrame" , js_name = clone)] + # [wasm_bindgen (catch , method , structural , js_class = "VideoFrame" , js_name = clone)] #[doc = "The `clone()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/clone)"] @@ -330,7 +399,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn clone(this: &VideoFrame) -> VideoFrame; + pub fn clone(this: &VideoFrame) -> Result; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "VideoFrame" , js_name = close)] #[doc = "The `close()` method."] @@ -366,7 +435,21 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn copy_to_with_u8_array(this: &VideoFrame, destination: &mut [u8]) -> ::js_sys::Promise; + pub fn copy_to_with_u8_slice(this: &VideoFrame, destination: &mut [u8]) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "VideoFrame" , js_name = copyTo)] + #[doc = "The `copyTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/copyTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_to_with_u8_array( + this: &VideoFrame, + destination: &::js_sys::Uint8Array, + ) -> ::js_sys::Promise; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoFrameCopyToOptions")] # [wasm_bindgen (method , structural , js_class = "VideoFrame" , js_name = copyTo)] @@ -394,9 +477,25 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn copy_to_with_u8_array_and_options( + pub fn copy_to_with_u8_slice_and_options( this: &VideoFrame, destination: &mut [u8], options: &VideoFrameCopyToOptions, ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrameCopyToOptions")] + # [wasm_bindgen (method , structural , js_class = "VideoFrame" , js_name = copyTo)] + #[doc = "The `copyTo()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/copyTo)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `VideoFrameCopyToOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn copy_to_with_u8_array_and_options( + this: &VideoFrame, + destination: &::js_sys::Uint8Array, + options: &VideoFrameCopyToOptions, + ) -> ::js_sys::Promise; } diff --git a/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs b/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs index 30607a75dd1..20c3aa7e845 100644 --- a/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs +++ b/crates/web-sys/src/features/gen_VideoFrameBufferInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,30 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoFrameBufferInit; -} -#[cfg(web_sys_unstable_apis)] -impl VideoFrameBufferInit { - #[cfg(feature = "VideoPixelFormat")] - #[doc = "Construct a new `VideoFrameBufferInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `codedHeight` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoPixelFormat`*"] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new( - coded_height: u32, - coded_width: u32, - format: VideoPixelFormat, - timestamp: f64, - ) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.coded_height(coded_height); - ret.coded_width(coded_width); - ret.format(format); - ret.timestamp(timestamp); - ret - } + #[wasm_bindgen(method, getter = "codedHeight")] + pub fn get_coded_height(this: &VideoFrameBufferInit) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `codedHeight` field of this object."] #[doc = ""] @@ -44,20 +30,17 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn coded_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codedHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "codedHeight")] + pub fn set_coded_height(this: &VideoFrameBufferInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `codedWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "codedWidth")] + pub fn get_coded_width(this: &VideoFrameBufferInit) -> u32; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `codedWidth` field of this object."] #[doc = ""] @@ -65,20 +48,18 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn coded_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("codedWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "codedWidth")] + pub fn set_coded_width(this: &VideoFrameBufferInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoColorSpaceInit")] + #[doc = "Get the `colorSpace` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`, `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "colorSpace")] + pub fn get_color_space(this: &VideoFrameBufferInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoColorSpaceInit")] #[doc = "Change the `colorSpace` field of this object."] @@ -87,20 +68,17 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("colorSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "colorSpace")] + pub fn set_color_space(this: &VideoFrameBufferInit, val: &VideoColorSpaceInit); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayHeight")] + pub fn get_display_height(this: &VideoFrameBufferInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `displayHeight` field of this object."] #[doc = ""] @@ -108,20 +86,17 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn display_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "displayHeight")] + pub fn set_display_height(this: &VideoFrameBufferInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayWidth")] + pub fn get_display_width(this: &VideoFrameBufferInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `displayWidth` field of this object."] #[doc = ""] @@ -129,20 +104,17 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn display_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "displayWidth")] + pub fn set_display_width(this: &VideoFrameBufferInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &VideoFrameBufferInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `duration` field of this object."] #[doc = ""] @@ -150,20 +122,18 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &VideoFrameBufferInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoPixelFormat")] + #[doc = "Get the `format` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoPixelFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "format")] + pub fn get_format(this: &VideoFrameBufferInit) -> VideoPixelFormat; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "VideoPixelFormat")] #[doc = "Change the `format` field of this object."] @@ -172,17 +142,17 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn format(&mut self, val: VideoPixelFormat) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "format")] + pub fn set_format(this: &VideoFrameBufferInit, val: VideoPixelFormat); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `layout` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &VideoFrameBufferInit) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `layout` field of this object."] #[doc = ""] @@ -190,17 +160,17 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &VideoFrameBufferInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &VideoFrameBufferInit) -> f64; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `timestamp` field of this object."] #[doc = ""] @@ -208,20 +178,18 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &VideoFrameBufferInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DomRectInit")] + #[doc = "Get the `visibleRect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameBufferInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "visibleRect")] + pub fn get_visible_rect(this: &VideoFrameBufferInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DomRectInit")] #[doc = "Change the `visibleRect` field of this object."] @@ -230,18 +198,93 @@ impl VideoFrameBufferInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "visibleRect")] + pub fn set_visible_rect(this: &VideoFrameBufferInit, val: &DomRectInit); +} +#[cfg(web_sys_unstable_apis)] +impl VideoFrameBufferInit { + #[cfg(feature = "VideoPixelFormat")] + #[doc = "Construct a new `VideoFrameBufferInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoPixelFormat`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + coded_height: u32, + coded_width: u32, + format: VideoPixelFormat, + timestamp: f64, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_coded_height(coded_height); + ret.set_coded_width(coded_width); + ret.set_format(format); + ret.set_timestamp(timestamp); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_coded_height()` instead."] + pub fn coded_height(&mut self, val: u32) -> &mut Self { + self.set_coded_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_coded_width()` instead."] + pub fn coded_width(&mut self, val: u32) -> &mut Self { + self.set_coded_width(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoColorSpaceInit")] + #[deprecated = "Use `set_color_space()` instead."] + pub fn color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self { + self.set_color_space(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_height()` instead."] + pub fn display_height(&mut self, val: u32) -> &mut Self { + self.set_display_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_width()` instead."] + pub fn display_width(&mut self, val: u32) -> &mut Self { + self.set_display_width(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_duration()` instead."] + pub fn duration(&mut self, val: f64) -> &mut Self { + self.set_duration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoPixelFormat")] + #[deprecated = "Use `set_format()` instead."] + pub fn format(&mut self, val: VideoPixelFormat) -> &mut Self { + self.set_format(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_layout()` instead."] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_layout(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DomRectInit")] + #[deprecated = "Use `set_visible_rect()` instead."] pub fn visible_rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("visibleRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_visible_rect(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs b/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs index 9ba37f78971..686a12cbd92 100644 --- a/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs +++ b/crates/web-sys/src/features/gen_VideoFrameCopyToOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoFrameCopyToOptions; -} -#[cfg(web_sys_unstable_apis)] -impl VideoFrameCopyToOptions { - #[doc = "Construct a new `VideoFrameCopyToOptions`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `layout` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoFrameCopyToOptions`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "layout")] + pub fn get_layout(this: &VideoFrameCopyToOptions) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `layout` field of this object."] #[doc = ""] @@ -34,17 +30,18 @@ impl VideoFrameCopyToOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "layout")] + pub fn set_layout(this: &VideoFrameCopyToOptions, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DomRectInit")] + #[doc = "Get the `rect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameCopyToOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rect")] + pub fn get_rect(this: &VideoFrameCopyToOptions) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DomRectInit")] #[doc = "Change the `rect` field of this object."] @@ -53,14 +50,33 @@ impl VideoFrameCopyToOptions { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rect")] + pub fn set_rect(this: &VideoFrameCopyToOptions, val: &DomRectInit); +} +#[cfg(web_sys_unstable_apis)] +impl VideoFrameCopyToOptions { + #[doc = "Construct a new `VideoFrameCopyToOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameCopyToOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_layout()` instead."] + pub fn layout(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_layout(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DomRectInit")] + #[deprecated = "Use `set_rect()` instead."] pub fn rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rect"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_rect(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoFrameInit.rs b/crates/web-sys/src/features/gen_VideoFrameInit.rs index bf91f0fb757..2180804556f 100644 --- a/crates/web-sys/src/features/gen_VideoFrameInit.rs +++ b/crates/web-sys/src/features/gen_VideoFrameInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type VideoFrameInit; -} -#[cfg(web_sys_unstable_apis)] -impl VideoFrameInit { - #[doc = "Construct a new `VideoFrameInit`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AlphaOption")] + #[doc = "Get the `alpha` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = "*This API requires the following crate features to be activated: `AlphaOption`, `VideoFrameInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &VideoFrameInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AlphaOption")] #[doc = "Change the `alpha` field of this object."] @@ -35,16 +32,17 @@ impl VideoFrameInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha(&mut self, val: AlphaOption) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &VideoFrameInit, val: AlphaOption); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayHeight` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayHeight")] + pub fn get_display_height(this: &VideoFrameInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `displayHeight` field of this object."] #[doc = ""] @@ -52,20 +50,17 @@ impl VideoFrameInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn display_height(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayHeight"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "displayHeight")] + pub fn set_display_height(this: &VideoFrameInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `displayWidth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "displayWidth")] + pub fn get_display_width(this: &VideoFrameInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `displayWidth` field of this object."] #[doc = ""] @@ -73,20 +68,17 @@ impl VideoFrameInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn display_width(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("displayWidth"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "displayWidth")] + pub fn set_display_width(this: &VideoFrameInit, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `duration` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "duration")] + pub fn get_duration(this: &VideoFrameInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `duration` field of this object."] #[doc = ""] @@ -94,20 +86,17 @@ impl VideoFrameInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn duration(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("duration"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "duration")] + pub fn set_duration(this: &VideoFrameInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &VideoFrameInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `timestamp` field of this object."] #[doc = ""] @@ -115,20 +104,18 @@ impl VideoFrameInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn timestamp(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("timestamp"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &VideoFrameInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DomRectInit")] + #[doc = "Get the `visibleRect` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "visibleRect")] + pub fn get_visible_rect(this: &VideoFrameInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "DomRectInit")] #[doc = "Change the `visibleRect` field of this object."] @@ -137,18 +124,58 @@ impl VideoFrameInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "visibleRect")] + pub fn set_visible_rect(this: &VideoFrameInit, val: &DomRectInit); +} +#[cfg(web_sys_unstable_apis)] +impl VideoFrameInit { + #[doc = "Construct a new `VideoFrameInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AlphaOption")] + #[deprecated = "Use `set_alpha()` instead."] + pub fn alpha(&mut self, val: AlphaOption) -> &mut Self { + self.set_alpha(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_height()` instead."] + pub fn display_height(&mut self, val: u32) -> &mut Self { + self.set_display_height(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_display_width()` instead."] + pub fn display_width(&mut self, val: u32) -> &mut Self { + self.set_display_width(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_duration()` instead."] + pub fn duration(&mut self, val: f64) -> &mut Self { + self.set_duration(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DomRectInit")] + #[deprecated = "Use `set_visible_rect()` instead."] pub fn visible_rect(&mut self, val: &DomRectInit) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("visibleRect"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_visible_rect(val); self } } diff --git a/crates/web-sys/src/features/gen_VideoMatrixCoefficients.rs b/crates/web-sys/src/features/gen_VideoMatrixCoefficients.rs index 5520fae08a3..196688d6add 100644 --- a/crates/web-sys/src/features/gen_VideoMatrixCoefficients.rs +++ b/crates/web-sys/src/features/gen_VideoMatrixCoefficients.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_VideoPixelFormat.rs b/crates/web-sys/src/features/gen_VideoPixelFormat.rs index 6b465da51eb..e2348ed9495 100644 --- a/crates/web-sys/src/features/gen_VideoPixelFormat.rs +++ b/crates/web-sys/src/features/gen_VideoPixelFormat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_VideoPlaybackQuality.rs b/crates/web-sys/src/features/gen_VideoPlaybackQuality.rs index 6556f12225a..f22b259872c 100644 --- a/crates/web-sys/src/features/gen_VideoPlaybackQuality.rs +++ b/crates/web-sys/src/features/gen_VideoPlaybackQuality.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_VideoStreamTrack.rs b/crates/web-sys/src/features/gen_VideoStreamTrack.rs index de248ce5f83..8d33779a760 100644 --- a/crates/web-sys/src/features/gen_VideoStreamTrack.rs +++ b/crates/web-sys/src/features/gen_VideoStreamTrack.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_VideoTrack.rs b/crates/web-sys/src/features/gen_VideoTrack.rs index 08f6e0b0221..6af0862f1ef 100644 --- a/crates/web-sys/src/features/gen_VideoTrack.rs +++ b/crates/web-sys/src/features/gen_VideoTrack.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,28 +18,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoTrack/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoTrack`*"] - pub fn id(this: &VideoTrack) -> String; + pub fn id(this: &VideoTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "VideoTrack" , 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/VideoTrack/kind)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoTrack`*"] - pub fn kind(this: &VideoTrack) -> String; + pub fn kind(this: &VideoTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "VideoTrack" , 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/VideoTrack/label)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoTrack`*"] - pub fn label(this: &VideoTrack) -> String; + pub fn label(this: &VideoTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "VideoTrack" , 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/VideoTrack/language)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VideoTrack`*"] - pub fn language(this: &VideoTrack) -> String; + pub fn language(this: &VideoTrack) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "VideoTrack" , js_name = selected)] #[doc = "Getter for the `selected` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_VideoTrackList.rs b/crates/web-sys/src/features/gen_VideoTrackList.rs index 8a743d5e7b9..3502df03f5c 100644 --- a/crates/web-sys/src/features/gen_VideoTrackList.rs +++ b/crates/web-sys/src/features/gen_VideoTrackList.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -77,7 +78,7 @@ extern "C" { pub fn get_track_by_id(this: &VideoTrackList, id: &str) -> Option; #[cfg(feature = "VideoTrack")] #[wasm_bindgen(method, structural, js_class = "VideoTrackList", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_VideoTransferCharacteristics.rs b/crates/web-sys/src/features/gen_VideoTransferCharacteristics.rs index 7eed7abc9b1..dbb6684f5a5 100644 --- a/crates/web-sys/src/features/gen_VideoTransferCharacteristics.rs +++ b/crates/web-sys/src/features/gen_VideoTransferCharacteristics.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_ViewTransition.rs b/crates/web-sys/src/features/gen_ViewTransition.rs new file mode 100644 index 00000000000..aa8f5ae1ef4 --- /dev/null +++ b/crates/web-sys/src/features/gen_ViewTransition.rs @@ -0,0 +1,63 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ViewTransition , typescript_type = "ViewTransition")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ViewTransition` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ViewTransition`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type ViewTransition; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "ViewTransition" , js_name = updateCallbackDone)] + #[doc = "Getter for the `updateCallbackDone` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition/updateCallbackDone)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ViewTransition`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn update_callback_done(this: &ViewTransition) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "ViewTransition" , 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/ViewTransition/ready)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ViewTransition`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ready(this: &ViewTransition) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "ViewTransition" , 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/ViewTransition/finished)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ViewTransition`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn finished(this: &ViewTransition) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "ViewTransition" , js_name = skipTransition)] + #[doc = "The `skipTransition()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition/skipTransition)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ViewTransition`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn skip_transition(this: &ViewTransition) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_VisibilityState.rs b/crates/web-sys/src/features/gen_VisibilityState.rs index a528680cfed..7e4dd56b15f 100644 --- a/crates/web-sys/src/features/gen_VisibilityState.rs +++ b/crates/web-sys/src/features/gen_VisibilityState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `VisibilityState` enum."] diff --git a/crates/web-sys/src/features/gen_VisualViewport.rs b/crates/web-sys/src/features/gen_VisualViewport.rs new file mode 100644 index 00000000000..946ee459368 --- /dev/null +++ b/crates/web-sys/src/features/gen_VisualViewport.rs @@ -0,0 +1,106 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = VisualViewport , typescript_type = "VisualViewport")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `VisualViewport` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub type VisualViewport; + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = offsetLeft)] + #[doc = "Getter for the `offsetLeft` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/offsetLeft)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn offset_left(this: &VisualViewport) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = offsetTop)] + #[doc = "Getter for the `offsetTop` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/offsetTop)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn offset_top(this: &VisualViewport) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = pageLeft)] + #[doc = "Getter for the `pageLeft` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/pageLeft)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn page_left(this: &VisualViewport) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = pageTop)] + #[doc = "Getter for the `pageTop` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/pageTop)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn page_top(this: &VisualViewport) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = width)] + #[doc = "Getter for the `width` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/width)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn width(this: &VisualViewport) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = height)] + #[doc = "Getter for the `height` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/height)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn height(this: &VisualViewport) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = scale)] + #[doc = "Getter for the `scale` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/scale)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn scale(this: &VisualViewport) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = onresize)] + #[doc = "Getter for the `onresize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/onresize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn onresize(this: &VisualViewport) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "VisualViewport" , js_name = onresize)] + #[doc = "Setter for the `onresize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/onresize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn set_onresize(this: &VisualViewport, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = onscroll)] + #[doc = "Getter for the `onscroll` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/onscroll)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn onscroll(this: &VisualViewport) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "VisualViewport" , js_name = onscroll)] + #[doc = "Setter for the `onscroll` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/onscroll)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn set_onscroll(this: &VisualViewport, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "VisualViewport" , js_name = onscrollend)] + #[doc = "Getter for the `onscrollend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/onscrollend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn onscrollend(this: &VisualViewport) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "VisualViewport" , js_name = onscrollend)] + #[doc = "Setter for the `onscrollend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport/onscrollend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`*"] + pub fn set_onscrollend(this: &VisualViewport, value: Option<&::js_sys::Function>); +} diff --git a/crates/web-sys/src/features/gen_VoidCallback.rs b/crates/web-sys/src/features/gen_VoidCallback.rs index c76cadcb0a8..46b21e4a6e5 100644 --- a/crates/web-sys/src/features/gen_VoidCallback.rs +++ b/crates/web-sys/src/features/gen_VoidCallback.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VoidCallback`*"] pub type VoidCallback; + #[doc = "Get the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VoidCallback`*"] + #[wasm_bindgen(method, getter = "handleEvent")] + pub fn get_handle_event(this: &VoidCallback) -> Option<::js_sys::Function>; + #[doc = "Change the `handleEvent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VoidCallback`*"] + #[wasm_bindgen(method, setter = "handleEvent")] + pub fn set_handle_event(this: &VoidCallback, val: &::js_sys::Function); } impl VoidCallback { #[doc = "Construct a new `VoidCallback`."] @@ -19,21 +30,9 @@ impl VoidCallback { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `handleEvent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VoidCallback`*"] + #[deprecated = "Use `set_handle_event()` instead."] pub fn handle_event(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("handleEvent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_handle_event(val); self } } diff --git a/crates/web-sys/src/features/gen_VrDisplay.rs b/crates/web-sys/src/features/gen_VrDisplay.rs index f4f100e869d..99c27ee51ae 100644 --- a/crates/web-sys/src/features/gen_VrDisplay.rs +++ b/crates/web-sys/src/features/gen_VrDisplay.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -54,7 +55,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/displayName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrDisplay`*"] - pub fn display_name(this: &VrDisplay) -> String; + pub fn display_name(this: &VrDisplay) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "VRDisplay" , js_name = depthNear)] #[doc = "Getter for the `depthNear` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_VrDisplayCapabilities.rs b/crates/web-sys/src/features/gen_VrDisplayCapabilities.rs index 1f02ad81f44..69db0bf1081 100644 --- a/crates/web-sys/src/features/gen_VrDisplayCapabilities.rs +++ b/crates/web-sys/src/features/gen_VrDisplayCapabilities.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_VrEye.rs b/crates/web-sys/src/features/gen_VrEye.rs index ee860299f73..690ae13d9f4 100644 --- a/crates/web-sys/src/features/gen_VrEye.rs +++ b/crates/web-sys/src/features/gen_VrEye.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `VrEye` enum."] diff --git a/crates/web-sys/src/features/gen_VrEyeParameters.rs b/crates/web-sys/src/features/gen_VrEyeParameters.rs index 6a351c26a31..c68f02bafd5 100644 --- a/crates/web-sys/src/features/gen_VrEyeParameters.rs +++ b/crates/web-sys/src/features/gen_VrEyeParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VREyeParameters/offset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrEyeParameters`*"] - pub fn offset(this: &VrEyeParameters) -> Result, JsValue>; + pub fn offset(this: &VrEyeParameters) -> Result<::alloc::vec::Vec, JsValue>; #[cfg(feature = "VrFieldOfView")] # [wasm_bindgen (structural , method , getter , js_class = "VREyeParameters" , js_name = fieldOfView)] #[doc = "Getter for the `fieldOfView` field of this object."] diff --git a/crates/web-sys/src/features/gen_VrFieldOfView.rs b/crates/web-sys/src/features/gen_VrFieldOfView.rs index 45621b219f3..9f9c30a1943 100644 --- a/crates/web-sys/src/features/gen_VrFieldOfView.rs +++ b/crates/web-sys/src/features/gen_VrFieldOfView.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_VrFrameData.rs b/crates/web-sys/src/features/gen_VrFrameData.rs index 697997dbdce..8fbe18f9a8a 100644 --- a/crates/web-sys/src/features/gen_VrFrameData.rs +++ b/crates/web-sys/src/features/gen_VrFrameData.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,28 +25,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRFrameData/leftProjectionMatrix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrFrameData`*"] - pub fn left_projection_matrix(this: &VrFrameData) -> Result, JsValue>; + pub fn left_projection_matrix(this: &VrFrameData) -> Result<::alloc::vec::Vec, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "VRFrameData" , js_name = leftViewMatrix)] #[doc = "Getter for the `leftViewMatrix` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRFrameData/leftViewMatrix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrFrameData`*"] - pub fn left_view_matrix(this: &VrFrameData) -> Result, JsValue>; + pub fn left_view_matrix(this: &VrFrameData) -> Result<::alloc::vec::Vec, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "VRFrameData" , js_name = rightProjectionMatrix)] #[doc = "Getter for the `rightProjectionMatrix` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRFrameData/rightProjectionMatrix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrFrameData`*"] - pub fn right_projection_matrix(this: &VrFrameData) -> Result, JsValue>; + pub fn right_projection_matrix(this: &VrFrameData) -> Result<::alloc::vec::Vec, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "VRFrameData" , js_name = rightViewMatrix)] #[doc = "Getter for the `rightViewMatrix` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRFrameData/rightViewMatrix)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrFrameData`*"] - pub fn right_view_matrix(this: &VrFrameData) -> Result, JsValue>; + pub fn right_view_matrix(this: &VrFrameData) -> Result<::alloc::vec::Vec, JsValue>; #[cfg(feature = "VrPose")] # [wasm_bindgen (structural , method , getter , js_class = "VRFrameData" , js_name = pose)] #[doc = "Getter for the `pose` field of this object."] diff --git a/crates/web-sys/src/features/gen_VrLayer.rs b/crates/web-sys/src/features/gen_VrLayer.rs index 6d0adae943e..7fd282af462 100644 --- a/crates/web-sys/src/features/gen_VrLayer.rs +++ b/crates/web-sys/src/features/gen_VrLayer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,38 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] pub type VrLayer; + #[doc = "Get the `leftBounds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] + #[wasm_bindgen(method, getter = "leftBounds")] + pub fn get_left_bounds(this: &VrLayer) -> Option<::js_sys::Array>; + #[doc = "Change the `leftBounds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] + #[wasm_bindgen(method, setter = "leftBounds")] + pub fn set_left_bounds(this: &VrLayer, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `rightBounds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] + #[wasm_bindgen(method, getter = "rightBounds")] + pub fn get_right_bounds(this: &VrLayer) -> Option<::js_sys::Array>; + #[doc = "Change the `rightBounds` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] + #[wasm_bindgen(method, setter = "rightBounds")] + pub fn set_right_bounds(this: &VrLayer, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "HtmlCanvasElement")] + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `VrLayer`*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &VrLayer) -> Option; + #[cfg(feature = "HtmlCanvasElement")] + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `VrLayer`*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &VrLayer, val: Option<&HtmlCanvasElement>); } impl VrLayer { #[doc = "Construct a new `VrLayer`."] @@ -19,53 +52,20 @@ impl VrLayer { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `leftBounds` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] + #[deprecated = "Use `set_left_bounds()` instead."] pub fn left_bounds(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("leftBounds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_left_bounds(val); self } - #[doc = "Change the `rightBounds` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `VrLayer`*"] + #[deprecated = "Use `set_right_bounds()` instead."] pub fn right_bounds(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("rightBounds"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_right_bounds(val); self } #[cfg(feature = "HtmlCanvasElement")] - #[doc = "Change the `source` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `VrLayer`*"] + #[deprecated = "Use `set_source()` instead."] pub fn source(&mut self, val: Option<&HtmlCanvasElement>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_source(val); self } } diff --git a/crates/web-sys/src/features/gen_VrMockController.rs b/crates/web-sys/src/features/gen_VrMockController.rs index 23676c7ef8f..dfc048210fd 100644 --- a/crates/web-sys/src/features/gen_VrMockController.rs +++ b/crates/web-sys/src/features/gen_VrMockController.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -40,4 +41,949 @@ extern "C" { angular_velocity: Option<&mut [f32]>, angular_acceleration: Option<&mut [f32]>, ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockController" , js_name = newPoseMove)] + #[doc = "The `newPoseMove()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockController/newPoseMove)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockController`*"] + pub fn new_pose_move_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockController, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); } diff --git a/crates/web-sys/src/features/gen_VrMockDisplay.rs b/crates/web-sys/src/features/gen_VrMockDisplay.rs index 5f503ba12fe..d5ad55d899d 100644 --- a/crates/web-sys/src/features/gen_VrMockDisplay.rs +++ b/crates/web-sys/src/features/gen_VrMockDisplay.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -58,6 +59,951 @@ extern "C" { angular_velocity: Option<&mut [f32]>, angular_acceleration: Option<&mut [f32]>, ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&mut [f32]>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&mut [f32]>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&mut [f32]>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&mut [f32]>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&mut [f32]>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_slice_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&mut [f32]>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); + # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = setPose)] + #[doc = "The `setPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRMockDisplay/setPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VrMockDisplay`*"] + pub fn set_pose_with_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array_and_opt_f32_array( + this: &VrMockDisplay, + position: Option<&::js_sys::Float32Array>, + linear_velocity: Option<&::js_sys::Float32Array>, + linear_acceleration: Option<&::js_sys::Float32Array>, + orientation: Option<&::js_sys::Float32Array>, + angular_velocity: Option<&::js_sys::Float32Array>, + angular_acceleration: Option<&::js_sys::Float32Array>, + ); # [wasm_bindgen (method , structural , js_class = "VRMockDisplay" , js_name = update)] #[doc = "The `update()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_VrPose.rs b/crates/web-sys/src/features/gen_VrPose.rs index c7e03eea5e4..076ea694c2c 100644 --- a/crates/web-sys/src/features/gen_VrPose.rs +++ b/crates/web-sys/src/features/gen_VrPose.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,40 +18,40 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/position)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrPose`*"] - pub fn position(this: &VrPose) -> Result>, JsValue>; + pub fn position(this: &VrPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = linearVelocity)] #[doc = "Getter for the `linearVelocity` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/linearVelocity)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrPose`*"] - pub fn linear_velocity(this: &VrPose) -> Result>, JsValue>; + pub fn linear_velocity(this: &VrPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = linearAcceleration)] #[doc = "Getter for the `linearAcceleration` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/linearAcceleration)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrPose`*"] - pub fn linear_acceleration(this: &VrPose) -> Result>, JsValue>; + pub fn linear_acceleration(this: &VrPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = orientation)] #[doc = "Getter for the `orientation` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/orientation)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrPose`*"] - pub fn orientation(this: &VrPose) -> Result>, JsValue>; + pub fn orientation(this: &VrPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = angularVelocity)] #[doc = "Getter for the `angularVelocity` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/angularVelocity)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrPose`*"] - pub fn angular_velocity(this: &VrPose) -> Result>, JsValue>; + pub fn angular_velocity(this: &VrPose) -> Result>, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = angularAcceleration)] #[doc = "Getter for the `angularAcceleration` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/angularAcceleration)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrPose`*"] - pub fn angular_acceleration(this: &VrPose) -> Result>, JsValue>; + pub fn angular_acceleration(this: &VrPose) -> Result>, JsValue>; } diff --git a/crates/web-sys/src/features/gen_VrServiceTest.rs b/crates/web-sys/src/features/gen_VrServiceTest.rs index 7becadb161a..46cd2b268ac 100644 --- a/crates/web-sys/src/features/gen_VrServiceTest.rs +++ b/crates/web-sys/src/features/gen_VrServiceTest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_VrStageParameters.rs b/crates/web-sys/src/features/gen_VrStageParameters.rs index 081ff053557..3ae11ff57fd 100644 --- a/crates/web-sys/src/features/gen_VrStageParameters.rs +++ b/crates/web-sys/src/features/gen_VrStageParameters.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRStageParameters/sittingToStandingTransform)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrStageParameters`*"] - pub fn sitting_to_standing_transform(this: &VrStageParameters) -> Result, JsValue>; + pub fn sitting_to_standing_transform( + this: &VrStageParameters, + ) -> Result<::alloc::vec::Vec, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "VRStageParameters" , js_name = sizeX)] #[doc = "Getter for the `sizeX` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_VrSubmitFrameResult.rs b/crates/web-sys/src/features/gen_VrSubmitFrameResult.rs index b0dd1aebedd..4779638a56a 100644 --- a/crates/web-sys/src/features/gen_VrSubmitFrameResult.rs +++ b/crates/web-sys/src/features/gen_VrSubmitFrameResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -24,7 +25,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRSubmitFrameResult/base64Image)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VrSubmitFrameResult`*"] - pub fn base64_image(this: &VrSubmitFrameResult) -> Option; + pub fn base64_image(this: &VrSubmitFrameResult) -> Option<::alloc::string::String>; #[wasm_bindgen(catch, constructor, js_class = "VRSubmitFrameResult")] #[doc = "The `new VrSubmitFrameResult(..)` constructor, creating a new instance of `VrSubmitFrameResult`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_VttCue.rs b/crates/web-sys/src/features/gen_VttCue.rs index a232704b0d1..6598a915ef6 100644 --- a/crates/web-sys/src/features/gen_VttCue.rs +++ b/crates/web-sys/src/features/gen_VttCue.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -70,7 +71,23 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/line)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VttCue`*"] + #[deprecated] pub fn set_line(this: &VttCue, value: &::wasm_bindgen::JsValue); + # [wasm_bindgen (structural , method , setter , js_class = "VTTCue" , js_name = line)] + #[doc = "Setter for the `line` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/line)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VttCue`*"] + pub fn set_line_f64(this: &VttCue, value: f64); + #[cfg(feature = "AutoKeyword")] + # [wasm_bindgen (structural , method , setter , js_class = "VTTCue" , js_name = line)] + #[doc = "Setter for the `line` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/line)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutoKeyword`, `VttCue`*"] + pub fn set_line_auto_keyword(this: &VttCue, value: AutoKeyword); #[cfg(feature = "LineAlignSetting")] # [wasm_bindgen (structural , method , getter , js_class = "VTTCue" , js_name = lineAlign)] #[doc = "Getter for the `lineAlign` field of this object."] @@ -100,7 +117,23 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/position)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VttCue`*"] + #[deprecated] pub fn set_position(this: &VttCue, value: &::wasm_bindgen::JsValue); + # [wasm_bindgen (structural , method , setter , js_class = "VTTCue" , js_name = position)] + #[doc = "Setter for the `position` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/position)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VttCue`*"] + pub fn set_position_f64(this: &VttCue, value: f64); + #[cfg(feature = "AutoKeyword")] + # [wasm_bindgen (structural , method , setter , js_class = "VTTCue" , js_name = position)] + #[doc = "Setter for the `position` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/position)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AutoKeyword`, `VttCue`*"] + pub fn set_position_auto_keyword(this: &VttCue, value: AutoKeyword); #[cfg(feature = "PositionAlignSetting")] # [wasm_bindgen (structural , method , getter , js_class = "VTTCue" , js_name = positionAlign)] #[doc = "Getter for the `positionAlign` field of this object."] @@ -153,7 +186,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/text)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VttCue`*"] - pub fn text(this: &VttCue) -> String; + pub fn text(this: &VttCue) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "VTTCue" , js_name = text)] #[doc = "Setter for the `text` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_VttRegion.rs b/crates/web-sys/src/features/gen_VttRegion.rs index 71e3fb3d06d..c5c85a514cb 100644 --- a/crates/web-sys/src/features/gen_VttRegion.rs +++ b/crates/web-sys/src/features/gen_VttRegion.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VTTRegion/id)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `VttRegion`*"] - pub fn id(this: &VttRegion) -> String; + pub fn id(this: &VttRegion) -> ::alloc::string::String; # [wasm_bindgen (structural , method , setter , js_class = "VTTRegion" , js_name = id)] #[doc = "Setter for the `id` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_WakeLock.rs b/crates/web-sys/src/features/gen_WakeLock.rs index ecdad001894..715647b4ca2 100644 --- a/crates/web-sys/src/features/gen_WakeLock.rs +++ b/crates/web-sys/src/features/gen_WakeLock.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_WakeLockSentinel.rs b/crates/web-sys/src/features/gen_WakeLockSentinel.rs index 3cd67d7f153..253b8a8e82d 100644 --- a/crates/web-sys/src/features/gen_WakeLockSentinel.rs +++ b/crates/web-sys/src/features/gen_WakeLockSentinel.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_WakeLockType.rs b/crates/web-sys/src/features/gen_WakeLockType.rs index b09491890c9..280eda4a122 100644 --- a/crates/web-sys/src/features/gen_WakeLockType.rs +++ b/crates/web-sys/src/features/gen_WakeLockType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs b/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs index 175bbfaedb8..74a95c2f42e 100644 --- a/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs +++ b/crates/web-sys/src/features/gen_WatchAdvertisementsOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,6 +14,26 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WatchAdvertisementsOptions; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[doc = "Get the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WatchAdvertisementsOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "signal")] + pub fn get_signal(this: &WatchAdvertisementsOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "AbortSignal")] + #[doc = "Change the `signal` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WatchAdvertisementsOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "signal")] + pub fn set_signal(this: &WatchAdvertisementsOptions, val: &AbortSignal); } #[cfg(web_sys_unstable_apis)] impl WatchAdvertisementsOptions { @@ -29,21 +50,9 @@ impl WatchAdvertisementsOptions { } #[cfg(web_sys_unstable_apis)] #[cfg(feature = "AbortSignal")] - #[doc = "Change the `signal` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WatchAdvertisementsOptions`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[deprecated = "Use `set_signal()` instead."] pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_signal(val); self } } diff --git a/crates/web-sys/src/features/gen_WaveShaperNode.rs b/crates/web-sys/src/features/gen_WaveShaperNode.rs index 4c3b8c31ce5..8d0315c4590 100644 --- a/crates/web-sys/src/features/gen_WaveShaperNode.rs +++ b/crates/web-sys/src/features/gen_WaveShaperNode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,14 +18,29 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode/curve)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WaveShaperNode`*"] - pub fn curve(this: &WaveShaperNode) -> Option>; + pub fn curve(this: &WaveShaperNode) -> Option<::alloc::vec::Vec>; # [wasm_bindgen (structural , method , setter , js_class = "WaveShaperNode" , js_name = curve)] #[doc = "Setter for the `curve` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode/curve)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WaveShaperNode`*"] + #[deprecated] pub fn set_curve(this: &WaveShaperNode, value: Option<&mut [f32]>); + # [wasm_bindgen (structural , method , setter , js_class = "WaveShaperNode" , js_name = curve)] + #[doc = "Setter for the `curve` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode/curve)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WaveShaperNode`*"] + pub fn set_curve_opt_f32_slice(this: &WaveShaperNode, value: Option<&mut [f32]>); + # [wasm_bindgen (structural , method , setter , js_class = "WaveShaperNode" , js_name = curve)] + #[doc = "Setter for the `curve` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode/curve)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WaveShaperNode`*"] + pub fn set_curve_opt_f32_array(this: &WaveShaperNode, value: Option<&::js_sys::Float32Array>); #[cfg(feature = "OverSampleType")] # [wasm_bindgen (structural , method , getter , js_class = "WaveShaperNode" , js_name = oversample)] #[doc = "Getter for the `oversample` field of this object."] diff --git a/crates/web-sys/src/features/gen_WaveShaperOptions.rs b/crates/web-sys/src/features/gen_WaveShaperOptions.rs index c3581bc61d4..181269e5fa7 100644 --- a/crates/web-sys/src/features/gen_WaveShaperOptions.rs +++ b/crates/web-sys/src/features/gen_WaveShaperOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,62 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] pub type WaveShaperOptions; + #[doc = "Get the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] + #[wasm_bindgen(method, getter = "channelCount")] + pub fn get_channel_count(this: &WaveShaperOptions) -> Option; + #[doc = "Change the `channelCount` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] + #[wasm_bindgen(method, setter = "channelCount")] + pub fn set_channel_count(this: &WaveShaperOptions, val: u32); + #[cfg(feature = "ChannelCountMode")] + #[doc = "Get the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `WaveShaperOptions`*"] + #[wasm_bindgen(method, getter = "channelCountMode")] + pub fn get_channel_count_mode(this: &WaveShaperOptions) -> Option; + #[cfg(feature = "ChannelCountMode")] + #[doc = "Change the `channelCountMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `WaveShaperOptions`*"] + #[wasm_bindgen(method, setter = "channelCountMode")] + pub fn set_channel_count_mode(this: &WaveShaperOptions, val: ChannelCountMode); + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Get the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `WaveShaperOptions`*"] + #[wasm_bindgen(method, getter = "channelInterpretation")] + pub fn get_channel_interpretation(this: &WaveShaperOptions) -> Option; + #[cfg(feature = "ChannelInterpretation")] + #[doc = "Change the `channelInterpretation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `WaveShaperOptions`*"] + #[wasm_bindgen(method, setter = "channelInterpretation")] + pub fn set_channel_interpretation(this: &WaveShaperOptions, val: ChannelInterpretation); + #[doc = "Get the `curve` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] + #[wasm_bindgen(method, getter = "curve")] + pub fn get_curve(this: &WaveShaperOptions) -> Option<::js_sys::Array>; + #[doc = "Change the `curve` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] + #[wasm_bindgen(method, setter = "curve")] + pub fn set_curve(this: &WaveShaperOptions, val: &::wasm_bindgen::JsValue); + #[cfg(feature = "OverSampleType")] + #[doc = "Get the `oversample` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OverSampleType`, `WaveShaperOptions`*"] + #[wasm_bindgen(method, getter = "oversample")] + pub fn get_oversample(this: &WaveShaperOptions) -> Option; + #[cfg(feature = "OverSampleType")] + #[doc = "Change the `oversample` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OverSampleType`, `WaveShaperOptions`*"] + #[wasm_bindgen(method, setter = "oversample")] + pub fn set_oversample(this: &WaveShaperOptions, val: OverSampleType); } impl WaveShaperOptions { #[doc = "Construct a new `WaveShaperOptions`."] @@ -19,88 +76,32 @@ impl WaveShaperOptions { 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: `WaveShaperOptions`*"] + #[deprecated = "Use `set_channel_count()` instead."] 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.set_channel_count(val); self } #[cfg(feature = "ChannelCountMode")] - #[doc = "Change the `channelCountMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `WaveShaperOptions`*"] + #[deprecated = "Use `set_channel_count_mode()` instead."] 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.set_channel_count_mode(val); self } #[cfg(feature = "ChannelInterpretation")] - #[doc = "Change the `channelInterpretation` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `WaveShaperOptions`*"] + #[deprecated = "Use `set_channel_interpretation()` instead."] 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.set_channel_interpretation(val); self } - #[doc = "Change the `curve` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WaveShaperOptions`*"] + #[deprecated = "Use `set_curve()` instead."] pub fn curve(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("curve"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_curve(val); self } #[cfg(feature = "OverSampleType")] - #[doc = "Change the `oversample` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `OverSampleType`, `WaveShaperOptions`*"] + #[deprecated = "Use `set_oversample()` instead."] pub fn oversample(&mut self, val: OverSampleType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("oversample"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_oversample(val); self } } diff --git a/crates/web-sys/src/features/gen_WebGl2RenderingContext.rs b/crates/web-sys/src/features/gen_WebGl2RenderingContext.rs index ddaa46f2c68..0c854aed654 100644 --- a/crates/web-sys/src/features/gen_WebGl2RenderingContext.rs +++ b/crates/web-sys/src/features/gen_WebGl2RenderingContext.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -223,6 +224,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_data_with_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + src_data: &::js_sys::Uint8Array, + usage: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferData)] + #[doc = "The `bufferData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn buffer_data_with_array_buffer_view_and_src_offset( this: &WebGl2RenderingContext, target: u32, @@ -249,6 +262,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_data_with_js_u8_array_and_src_offset( + this: &WebGl2RenderingContext, + target: u32, + src_data: &::js_sys::Uint8Array, + usage: u32, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferData)] + #[doc = "The `bufferData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn buffer_data_with_array_buffer_view_and_src_offset_and_length( this: &WebGl2RenderingContext, target: u32, @@ -271,6 +297,20 @@ extern "C" { src_offset: u32, length: u32, ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferData)] + #[doc = "The `bufferData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_data_with_js_u8_array_and_src_offset_and_length( + this: &WebGl2RenderingContext, + target: u32, + src_data: &::js_sys::Uint8Array, + usage: u32, + src_offset: u32, + length: u32, + ); # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferSubData)] #[doc = "The `bufferSubData()` method."] #[doc = ""] @@ -349,6 +389,30 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferSubData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_sub_data_with_i32_and_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + offset: i32, + src_data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferSubData)] + #[doc = "The `bufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_sub_data_with_f64_and_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + offset: f64, + src_data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferSubData)] + #[doc = "The `bufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn buffer_sub_data_with_i32_and_array_buffer_view_and_src_offset( this: &WebGl2RenderingContext, target: u32, @@ -401,6 +465,32 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferSubData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_sub_data_with_i32_and_js_u8_array_and_src_offset( + this: &WebGl2RenderingContext, + target: u32, + dst_byte_offset: i32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferSubData)] + #[doc = "The `bufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_sub_data_with_f64_and_js_u8_array_and_src_offset( + this: &WebGl2RenderingContext, + target: u32, + dst_byte_offset: f64, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferSubData)] + #[doc = "The `bufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn buffer_sub_data_with_i32_and_array_buffer_view_and_src_offset_and_length( this: &WebGl2RenderingContext, target: u32, @@ -451,6 +541,34 @@ extern "C" { src_offset: u32, length: u32, ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferSubData)] + #[doc = "The `bufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_sub_data_with_i32_and_js_u8_array_and_src_offset_and_length( + this: &WebGl2RenderingContext, + target: u32, + dst_byte_offset: i32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + length: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = bufferSubData)] + #[doc = "The `bufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/bufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn buffer_sub_data_with_f64_and_js_u8_array_and_src_offset_and_length( + this: &WebGl2RenderingContext, + target: u32, + dst_byte_offset: f64, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + length: u32, + ); # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = clearBufferfi)] #[doc = "The `clearBufferfi()` method."] #[doc = ""] @@ -482,6 +600,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferfv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn clear_bufferfv_with_js_f32_array( + this: &WebGl2RenderingContext, + buffer: u32, + drawbuffer: i32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = clearBufferfv)] + #[doc = "The `clearBufferfv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferfv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn clear_bufferfv_with_f32_sequence( this: &WebGl2RenderingContext, buffer: u32, @@ -507,6 +637,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferfv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn clear_bufferfv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + buffer: u32, + drawbuffer: i32, + values: &::js_sys::Float32Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = clearBufferfv)] + #[doc = "The `clearBufferfv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferfv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn clear_bufferfv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, buffer: u32, @@ -532,6 +675,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn clear_bufferiv_with_js_i32_array( + this: &WebGl2RenderingContext, + buffer: u32, + drawbuffer: i32, + values: &::js_sys::Int32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = clearBufferiv)] + #[doc = "The `clearBufferiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn clear_bufferiv_with_i32_sequence( this: &WebGl2RenderingContext, buffer: u32, @@ -557,6 +712,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn clear_bufferiv_with_js_i32_array_and_src_offset( + this: &WebGl2RenderingContext, + buffer: u32, + drawbuffer: i32, + values: &::js_sys::Int32Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = clearBufferiv)] + #[doc = "The `clearBufferiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn clear_bufferiv_with_i32_sequence_and_src_offset( this: &WebGl2RenderingContext, buffer: u32, @@ -582,6 +750,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferuiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn clear_bufferuiv_with_js_u32_array( + this: &WebGl2RenderingContext, + buffer: u32, + drawbuffer: i32, + values: &::js_sys::Uint32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = clearBufferuiv)] + #[doc = "The `clearBufferuiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferuiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn clear_bufferuiv_with_u32_sequence( this: &WebGl2RenderingContext, buffer: u32, @@ -607,6 +787,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferuiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn clear_bufferuiv_with_js_u32_array_and_src_offset( + this: &WebGl2RenderingContext, + buffer: u32, + drawbuffer: i32, + values: &::js_sys::Uint32Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = clearBufferuiv)] + #[doc = "The `clearBufferuiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBufferuiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn clear_bufferuiv_with_u32_sequence_and_src_offset( this: &WebGl2RenderingContext, buffer: u32, @@ -712,6 +905,22 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage2D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_image_2d_with_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: u32, + width: i32, + height: i32, + border: i32, + src_data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexImage2D)] + #[doc = "The `compressedTexImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn compressed_tex_image_2d_with_array_buffer_view_and_u32( this: &WebGl2RenderingContext, target: u32, @@ -746,6 +955,23 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage2D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_image_2d_with_js_u8_array_and_u32( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: u32, + width: i32, + height: i32, + border: i32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexImage2D)] + #[doc = "The `compressedTexImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn compressed_tex_image_2d_with_array_buffer_view_and_u32_and_src_length_override( this: &WebGl2RenderingContext, target: u32, @@ -776,6 +1002,24 @@ extern "C" { src_offset: u32, src_length_override: u32, ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexImage2D)] + #[doc = "The `compressedTexImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_image_2d_with_js_u8_array_and_u32_and_src_length_override( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: u32, + width: i32, + height: i32, + border: i32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + src_length_override: u32, + ); # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexImage3D)] #[doc = "The `compressedTexImage3D()` method."] #[doc = ""] @@ -852,6 +1096,23 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage3D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_image_3d_with_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: u32, + width: i32, + height: i32, + depth: i32, + border: i32, + src_data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexImage3D)] + #[doc = "The `compressedTexImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn compressed_tex_image_3d_with_array_buffer_view_and_u32( this: &WebGl2RenderingContext, target: u32, @@ -888,6 +1149,24 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage3D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_image_3d_with_js_u8_array_and_u32( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: u32, + width: i32, + height: i32, + depth: i32, + border: i32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexImage3D)] + #[doc = "The `compressedTexImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn compressed_tex_image_3d_with_array_buffer_view_and_u32_and_src_length_override( this: &WebGl2RenderingContext, target: u32, @@ -920,6 +1199,25 @@ extern "C" { src_offset: u32, src_length_override: u32, ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexImage3D)] + #[doc = "The `compressedTexImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_image_3d_with_js_u8_array_and_u32_and_src_length_override( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: u32, + width: i32, + height: i32, + depth: i32, + border: i32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + src_length_override: u32, + ); # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexSubImage2D)] #[doc = "The `compressedTexSubImage2D()` method."] #[doc = ""] @@ -996,7 +1294,24 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage2D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] - pub fn compressed_tex_sub_image_2d_with_array_buffer_view_and_u32( + pub fn compressed_tex_sub_image_2d_with_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + width: i32, + height: i32, + format: u32, + src_data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexSubImage2D)] + #[doc = "The `compressedTexSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_sub_image_2d_with_array_buffer_view_and_u32( this: &WebGl2RenderingContext, target: u32, level: i32, @@ -1032,6 +1347,24 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage2D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_sub_image_2d_with_js_u8_array_and_u32( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + width: i32, + height: i32, + format: u32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexSubImage2D)] + #[doc = "The `compressedTexSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn compressed_tex_sub_image_2d_with_array_buffer_view_and_u32_and_src_length_override( this: &WebGl2RenderingContext, target: u32, @@ -1064,6 +1397,25 @@ extern "C" { src_offset: u32, src_length_override: u32, ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexSubImage2D)] + #[doc = "The `compressedTexSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_sub_image_2d_with_js_u8_array_and_u32_and_src_length_override( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + width: i32, + height: i32, + format: u32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + src_length_override: u32, + ); # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexSubImage3D)] #[doc = "The `compressedTexSubImage3D()` method."] #[doc = ""] @@ -1148,6 +1500,25 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage3D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_sub_image_3d_with_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + zoffset: i32, + width: i32, + height: i32, + depth: i32, + format: u32, + src_data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexSubImage3D)] + #[doc = "The `compressedTexSubImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn compressed_tex_sub_image_3d_with_array_buffer_view_and_u32( this: &WebGl2RenderingContext, target: u32, @@ -1188,6 +1559,26 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage3D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_sub_image_3d_with_js_u8_array_and_u32( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + zoffset: i32, + width: i32, + height: i32, + depth: i32, + format: u32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexSubImage3D)] + #[doc = "The `compressedTexSubImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn compressed_tex_sub_image_3d_with_array_buffer_view_and_u32_and_src_length_override( this: &WebGl2RenderingContext, target: u32, @@ -1224,6 +1615,27 @@ extern "C" { src_offset: u32, src_length_override: u32, ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = compressedTexSubImage3D)] + #[doc = "The `compressedTexSubImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn compressed_tex_sub_image_3d_with_js_u8_array_and_u32_and_src_length_override( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + zoffset: i32, + width: i32, + height: i32, + depth: i32, + format: u32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + src_length_override: u32, + ); # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = copyBufferSubData)] #[doc = "The `copyBufferSubData()` method."] #[doc = ""] @@ -1564,7 +1976,7 @@ extern "C" { this: &WebGl2RenderingContext, program: &WebGlProgram, uniform_block_index: u32, - ) -> Option; + ) -> Option<::alloc::string::String>; #[cfg(feature = "WebGlProgram")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = getActiveUniformBlockParameter)] #[doc = "The `getActiveUniformBlockParameter()` method."] @@ -1645,6 +2057,30 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getBufferSubData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn get_buffer_sub_data_with_i32_and_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + src_byte_offset: i32, + dst_data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getBufferSubData)] + #[doc = "The `getBufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getBufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn get_buffer_sub_data_with_f64_and_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + src_byte_offset: f64, + dst_data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getBufferSubData)] + #[doc = "The `getBufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getBufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn get_buffer_sub_data_with_i32_and_array_buffer_view_and_dst_offset( this: &WebGl2RenderingContext, target: u32, @@ -1697,6 +2133,32 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getBufferSubData)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn get_buffer_sub_data_with_i32_and_js_u8_array_and_dst_offset( + this: &WebGl2RenderingContext, + target: u32, + src_byte_offset: i32, + dst_data: &::js_sys::Uint8Array, + dst_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getBufferSubData)] + #[doc = "The `getBufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getBufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn get_buffer_sub_data_with_f64_and_js_u8_array_and_dst_offset( + this: &WebGl2RenderingContext, + target: u32, + src_byte_offset: f64, + dst_data: &::js_sys::Uint8Array, + dst_offset: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getBufferSubData)] + #[doc = "The `getBufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getBufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn get_buffer_sub_data_with_i32_and_array_buffer_view_and_dst_offset_and_length( this: &WebGl2RenderingContext, target: u32, @@ -1747,6 +2209,34 @@ extern "C" { dst_offset: u32, length: u32, ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getBufferSubData)] + #[doc = "The `getBufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getBufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn get_buffer_sub_data_with_i32_and_js_u8_array_and_dst_offset_and_length( + this: &WebGl2RenderingContext, + target: u32, + src_byte_offset: i32, + dst_data: &::js_sys::Uint8Array, + dst_offset: u32, + length: u32, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getBufferSubData)] + #[doc = "The `getBufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getBufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn get_buffer_sub_data_with_f64_and_js_u8_array_and_dst_offset_and_length( + this: &WebGl2RenderingContext, + target: u32, + src_byte_offset: f64, + dst_data: &::js_sys::Uint8Array, + dst_offset: u32, + length: u32, + ); #[cfg(feature = "WebGlProgram")] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getFragDataLocation)] #[doc = "The `getFragDataLocation()` method."] @@ -1989,6 +2479,22 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/readPixels)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn read_pixels_with_opt_js_u8_array( + this: &WebGl2RenderingContext, + x: i32, + y: i32, + width: i32, + height: i32, + format: u32, + type_: u32, + dst_data: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = readPixels)] + #[doc = "The `readPixels()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/readPixels)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn read_pixels_with_i32( this: &WebGl2RenderingContext, x: i32, @@ -2049,6 +2555,23 @@ extern "C" { dst_data: &mut [u8], dst_offset: u32, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = readPixels)] + #[doc = "The `readPixels()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/readPixels)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn read_pixels_with_js_u8_array_and_dst_offset( + this: &WebGl2RenderingContext, + x: i32, + y: i32, + width: i32, + height: i32, + format: u32, + type_: u32, + dst_data: &::js_sys::Uint8Array, + dst_offset: u32, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = renderbufferStorageMultisample)] #[doc = "The `renderbufferStorageMultisample()` method."] #[doc = ""] @@ -2132,6 +2655,24 @@ extern "C" { type_: u32, pixels: Option<&[u8]>, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage2D)] + #[doc = "The `texImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: i32, + width: i32, + height: i32, + border: i32, + format: u32, + type_: u32, + pixels: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; #[cfg(feature = "HtmlCanvasElement")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage2D)] #[doc = "The `texImage2D()` method."] @@ -2180,6 +2721,26 @@ extern "C" { type_: u32, source: &HtmlVideoElement, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage2D)] + #[doc = "The `texImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WebGl2RenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tex_image_2d_with_u32_and_u32_and_video_frame( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: i32, + format: u32, + type_: u32, + source: &VideoFrame, + ) -> Result<(), JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage2D)] #[doc = "The `texImage2D()` method."] @@ -2305,6 +2866,29 @@ extern "C" { type_: u32, source: &HtmlVideoElement, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage2D)] + #[doc = "The `texImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WebGl2RenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_video_frame( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: i32, + width: i32, + height: i32, + border: i32, + format: u32, + type_: u32, + source: &VideoFrame, + ) -> Result<(), JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage2D)] #[doc = "The `texImage2D()` method."] @@ -2381,24 +2965,24 @@ extern "C" { src_data: &[u8], src_offset: u32, ) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage3D)] - #[doc = "The `texImage3D()` method."] + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage2D)] + #[doc = "The `texImage2D()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage2D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] - pub fn tex_image_3d_with_i32( + pub fn tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_js_u8_array_and_src_offset( this: &WebGl2RenderingContext, target: u32, level: i32, internalformat: i32, width: i32, height: i32, - depth: i32, border: i32, format: u32, type_: u32, - pbo_offset: i32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage3D)] #[doc = "The `texImage3D()` method."] @@ -2406,7 +2990,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] - pub fn tex_image_3d_with_f64( + pub fn tex_image_3d_with_i32( this: &WebGl2RenderingContext, target: u32, level: i32, @@ -2417,7 +3001,26 @@ extern "C" { border: i32, format: u32, type_: u32, - pbo_offset: f64, + pbo_offset: i32, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage3D)] + #[doc = "The `texImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn tex_image_3d_with_f64( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: i32, + width: i32, + height: i32, + depth: i32, + border: i32, + format: u32, + type_: u32, + pbo_offset: f64, ) -> Result<(), JsValue>; #[cfg(feature = "HtmlCanvasElement")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage3D)] @@ -2479,6 +3082,30 @@ extern "C" { type_: u32, source: &HtmlVideoElement, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage3D)] + #[doc = "The `texImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WebGl2RenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tex_image_3d_with_video_frame( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: i32, + width: i32, + height: i32, + depth: i32, + border: i32, + format: u32, + type_: u32, + source: &VideoFrame, + ) -> Result<(), JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage3D)] #[doc = "The `texImage3D()` method."] @@ -2563,6 +3190,25 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn tex_image_3d_with_opt_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: i32, + width: i32, + height: i32, + depth: i32, + border: i32, + format: u32, + type_: u32, + src_data: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage3D)] + #[doc = "The `texImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn tex_image_3d_with_array_buffer_view_and_src_offset( this: &WebGl2RenderingContext, target: u32, @@ -2597,6 +3243,26 @@ extern "C" { src_data: &[u8], src_offset: u32, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texImage3D)] + #[doc = "The `texImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn tex_image_3d_with_js_u8_array_and_src_offset( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + internalformat: i32, + width: i32, + height: i32, + depth: i32, + border: i32, + format: u32, + type_: u32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = texStorage2D)] #[doc = "The `texStorage2D()` method."] #[doc = ""] @@ -2662,6 +3328,24 @@ extern "C" { type_: u32, pixels: Option<&[u8]>, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage2D)] + #[doc = "The `texSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + width: i32, + height: i32, + format: u32, + type_: u32, + pixels: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; #[cfg(feature = "HtmlCanvasElement")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage2D)] #[doc = "The `texSubImage2D()` method."] @@ -2713,6 +3397,27 @@ extern "C" { type_: u32, source: &HtmlVideoElement, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage2D)] + #[doc = "The `texSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WebGl2RenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tex_sub_image_2d_with_u32_and_u32_and_video_frame( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + format: u32, + type_: u32, + source: &VideoFrame, + ) -> Result<(), JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage2D)] #[doc = "The `texSubImage2D()` method."] @@ -2840,6 +3545,29 @@ extern "C" { type_: u32, source: &HtmlVideoElement, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage2D)] + #[doc = "The `texSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WebGl2RenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_video_frame( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + width: i32, + height: i32, + format: u32, + type_: u32, + source: &VideoFrame, + ) -> Result<(), JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage2D)] #[doc = "The `texSubImage2D()` method."] @@ -2916,6 +3644,25 @@ extern "C" { src_data: &[u8], src_offset: u32, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage2D)] + #[doc = "The `texSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_js_u8_array_and_src_offset( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + width: i32, + height: i32, + format: u32, + type_: u32, + src_data: &::js_sys::Uint8Array, + src_offset: u32, + ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage3D)] #[doc = "The `texSubImage3D()` method."] #[doc = ""] @@ -3019,6 +3766,31 @@ extern "C" { type_: u32, source: &HtmlVideoElement, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage3D)] + #[doc = "The `texSubImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WebGl2RenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tex_sub_image_3d_with_video_frame( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + zoffset: i32, + width: i32, + height: i32, + depth: i32, + format: u32, + type_: u32, + source: &VideoFrame, + ) -> Result<(), JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage3D)] #[doc = "The `texSubImage3D()` method."] @@ -3107,6 +3879,26 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn tex_sub_image_3d_with_opt_js_u8_array( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + zoffset: i32, + width: i32, + height: i32, + depth: i32, + format: u32, + type_: u32, + src_data: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage3D)] + #[doc = "The `texSubImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn tex_sub_image_3d_with_opt_array_buffer_view_and_src_offset( this: &WebGl2RenderingContext, target: u32, @@ -3143,6 +3935,27 @@ extern "C" { src_data: Option<&[u8]>, src_offset: u32, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGL2RenderingContext" , js_name = texSubImage3D)] + #[doc = "The `texSubImage3D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn tex_sub_image_3d_with_opt_js_u8_array_and_src_offset( + this: &WebGl2RenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + zoffset: i32, + width: i32, + height: i32, + depth: i32, + format: u32, + type_: u32, + src_data: Option<&::js_sys::Uint8Array>, + src_offset: u32, + ) -> Result<(), JsValue>; #[cfg(feature = "WebGlProgram")] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = transformFeedbackVaryings)] #[doc = "The `transformFeedbackVaryings()` method."] @@ -3175,6 +3988,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1fv)] + #[doc = "The `uniform1fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3200,6 +4025,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1fv)] + #[doc = "The `uniform1fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3227,6 +4065,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1fv)] + #[doc = "The `uniform1fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3253,6 +4105,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1iv_with_js_i32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1iv)] + #[doc = "The `uniform1iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1iv_with_i32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3278,6 +4142,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1iv_with_js_i32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1iv)] + #[doc = "The `uniform1iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1iv_with_i32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3305,6 +4182,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1iv_with_js_i32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1iv)] + #[doc = "The `uniform1iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1iv_with_i32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3343,6 +4234,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1uiv_with_js_u32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1uiv)] + #[doc = "The `uniform1uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1uiv_with_u32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3368,6 +4271,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1uiv_with_js_u32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1uiv)] + #[doc = "The `uniform1uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1uiv_with_u32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3395,6 +4311,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1uiv_with_js_u32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform1uiv)] + #[doc = "The `uniform1uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform1uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1uiv_with_u32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3421,6 +4351,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2fv)] + #[doc = "The `uniform2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3446,6 +4388,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2fv)] + #[doc = "The `uniform2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3473,6 +4428,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2fv)] + #[doc = "The `uniform2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3499,6 +4468,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2iv_with_js_i32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2iv)] + #[doc = "The `uniform2iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2iv_with_i32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3524,6 +4505,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2iv_with_js_i32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2iv)] + #[doc = "The `uniform2iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2iv_with_i32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3551,6 +4545,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2iv_with_js_i32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2iv)] + #[doc = "The `uniform2iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2iv_with_i32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3590,6 +4598,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2uiv_with_js_u32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2uiv)] + #[doc = "The `uniform2uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2uiv_with_u32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3615,6 +4635,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2uiv_with_js_u32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2uiv)] + #[doc = "The `uniform2uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2uiv_with_u32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3642,6 +4675,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2uiv_with_js_u32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform2uiv)] + #[doc = "The `uniform2uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform2uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2uiv_with_u32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3668,6 +4715,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3fv)] + #[doc = "The `uniform3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3693,6 +4752,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3fv)] + #[doc = "The `uniform3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3720,6 +4792,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3fv)] + #[doc = "The `uniform3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3746,6 +4832,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3iv_with_js_i32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3iv)] + #[doc = "The `uniform3iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3iv_with_i32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3771,6 +4869,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3iv_with_js_i32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3iv)] + #[doc = "The `uniform3iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3iv_with_i32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3798,6 +4909,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3iv_with_js_i32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3iv)] + #[doc = "The `uniform3iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3iv_with_i32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3838,6 +4963,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3uiv_with_js_u32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3uiv)] + #[doc = "The `uniform3uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3uiv_with_u32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3863,6 +5000,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3uiv_with_js_u32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3uiv)] + #[doc = "The `uniform3uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3uiv_with_u32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3890,6 +5040,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3uiv_with_js_u32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform3uiv)] + #[doc = "The `uniform3uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform3uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3uiv_with_u32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3916,6 +5080,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4fv)] + #[doc = "The `uniform4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3941,6 +5117,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4fv)] + #[doc = "The `uniform4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3968,6 +5157,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4fv)] + #[doc = "The `uniform4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -3994,6 +5197,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4iv_with_js_i32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4iv)] + #[doc = "The `uniform4iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4iv_with_i32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4019,6 +5234,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4iv_with_js_i32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4iv)] + #[doc = "The `uniform4iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4iv_with_i32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4046,6 +5274,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4iv_with_js_i32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4iv)] + #[doc = "The `uniform4iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4iv_with_i32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4087,6 +5329,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4uiv_with_js_u32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4uiv)] + #[doc = "The `uniform4uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4uiv_with_u32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4112,6 +5366,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4uiv_with_js_u32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4uiv)] + #[doc = "The `uniform4uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4uiv_with_u32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4139,6 +5406,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4uiv_with_js_u32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Uint32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniform4uiv)] + #[doc = "The `uniform4uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniform4uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4uiv_with_u32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4179,6 +5460,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2fv)] + #[doc = "The `uniformMatrix2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4206,6 +5500,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2fv)] + #[doc = "The `uniformMatrix2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4235,6 +5543,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2fv)] + #[doc = "The `uniformMatrix2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4263,6 +5586,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2x3fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2x3fv)] + #[doc = "The `uniformMatrix2x3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2x3fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4290,6 +5626,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2x3fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2x3fv)] + #[doc = "The `uniformMatrix2x3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2x3fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4319,6 +5669,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2x3fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2x3fv)] + #[doc = "The `uniformMatrix2x3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2x3fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4347,6 +5712,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2x4fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2x4fv)] + #[doc = "The `uniformMatrix2x4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2x4fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4374,6 +5752,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2x4fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2x4fv)] + #[doc = "The `uniformMatrix2x4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2x4fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4403,13 +5795,67 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2x4fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix2x4fv)] + #[doc = "The `uniformMatrix2x4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix2x4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2x4fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, transpose: bool, data: &::wasm_bindgen::JsValue, - src_offset: u32, - src_length: u32, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3fv)] + #[doc = "The `uniformMatrix3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3fv_with_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &[f32], + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3fv)] + #[doc = "The `uniformMatrix3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3fv)] + #[doc = "The `uniformMatrix3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3fv_with_f32_sequence( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::wasm_bindgen::JsValue, ); #[cfg(feature = "WebGlUniformLocation")] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3fv)] @@ -4418,11 +5864,12 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] - pub fn uniform_matrix3fv_with_f32_array( + pub fn uniform_matrix3fv_with_f32_array_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, transpose: bool, data: &[f32], + src_offset: u32, ); #[cfg(feature = "WebGlUniformLocation")] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3fv)] @@ -4431,11 +5878,12 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] - pub fn uniform_matrix3fv_with_f32_sequence( + pub fn uniform_matrix3fv_with_js_f32_array_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, transpose: bool, - data: &::wasm_bindgen::JsValue, + data: &::js_sys::Float32Array, + src_offset: u32, ); #[cfg(feature = "WebGlUniformLocation")] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3fv)] @@ -4444,11 +5892,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] - pub fn uniform_matrix3fv_with_f32_array_and_src_offset( + pub fn uniform_matrix3fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, transpose: bool, - data: &[f32], + data: &::wasm_bindgen::JsValue, src_offset: u32, ); #[cfg(feature = "WebGlUniformLocation")] @@ -4458,12 +5906,13 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] - pub fn uniform_matrix3fv_with_f32_sequence_and_src_offset( + pub fn uniform_matrix3fv_with_f32_array_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, transpose: bool, - data: &::wasm_bindgen::JsValue, + data: &[f32], src_offset: u32, + src_length: u32, ); #[cfg(feature = "WebGlUniformLocation")] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3fv)] @@ -4472,11 +5921,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] - pub fn uniform_matrix3fv_with_f32_array_and_src_offset_and_src_length( + pub fn uniform_matrix3fv_with_js_f32_array_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, transpose: bool, - data: &[f32], + data: &::js_sys::Float32Array, src_offset: u32, src_length: u32, ); @@ -4515,6 +5964,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3x2fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3x2fv)] + #[doc = "The `uniformMatrix3x2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix3x2fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4542,6 +6004,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3x2fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3x2fv)] + #[doc = "The `uniformMatrix3x2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix3x2fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4571,6 +6047,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3x2fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3x2fv)] + #[doc = "The `uniformMatrix3x2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix3x2fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4599,6 +6090,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3x4fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3x4fv)] + #[doc = "The `uniformMatrix3x4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix3x4fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4626,6 +6130,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3x4fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3x4fv)] + #[doc = "The `uniformMatrix3x4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix3x4fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4655,6 +6173,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3x4fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix3x4fv)] + #[doc = "The `uniformMatrix3x4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix3x4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix3x4fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4683,6 +6216,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4fv)] + #[doc = "The `uniformMatrix4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4710,6 +6256,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4fv)] + #[doc = "The `uniformMatrix4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4739,6 +6299,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4fv)] + #[doc = "The `uniformMatrix4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4767,6 +6342,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4x2fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4x2fv)] + #[doc = "The `uniformMatrix4x2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4x2fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4794,6 +6382,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4x2fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4x2fv)] + #[doc = "The `uniformMatrix4x2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4x2fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4823,6 +6425,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4x2fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4x2fv)] + #[doc = "The `uniformMatrix4x2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4x2fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4851,6 +6468,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4x3fv_with_js_f32_array( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4x3fv)] + #[doc = "The `uniformMatrix4x3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4x3fv_with_f32_sequence( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4878,6 +6508,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4x3fv_with_js_f32_array_and_src_offset( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4x3fv)] + #[doc = "The `uniformMatrix4x3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4x3fv_with_f32_sequence_and_src_offset( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4907,6 +6551,21 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4x3fv_with_js_f32_array_and_src_offset_and_src_length( + this: &WebGl2RenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + src_offset: u32, + src_length: u32, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = uniformMatrix4x3fv)] + #[doc = "The `uniformMatrix4x3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/uniformMatrix4x3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4x3fv_with_f32_sequence_and_src_offset_and_src_length( this: &WebGl2RenderingContext, location: Option<&WebGlUniformLocation>, @@ -4953,6 +6612,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttribI4iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn vertex_attrib_i4iv_with_js_i32_array( + this: &WebGl2RenderingContext, + index: u32, + values: &::js_sys::Int32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = vertexAttribI4iv)] + #[doc = "The `vertexAttribI4iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttribI4iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn vertex_attrib_i4iv_with_i32_sequence( this: &WebGl2RenderingContext, index: u32, @@ -4989,6 +6659,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttribI4uiv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn vertex_attrib_i4uiv_with_js_u32_array( + this: &WebGl2RenderingContext, + index: u32, + values: &::js_sys::Uint32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = vertexAttribI4uiv)] + #[doc = "The `vertexAttribI4uiv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttribI4uiv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn vertex_attrib_i4uiv_with_u32_sequence( this: &WebGl2RenderingContext, index: u32, @@ -5626,7 +7307,7 @@ extern "C" { pub fn get_program_info_log( this: &WebGl2RenderingContext, program: &WebGlProgram, - ) -> Option; + ) -> Option<::alloc::string::String>; #[cfg(feature = "WebGlProgram")] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getProgramParameter)] #[doc = "The `getProgramParameter()` method."] @@ -5660,7 +7341,7 @@ extern "C" { pub fn get_shader_info_log( this: &WebGl2RenderingContext, shader: &WebGlShader, - ) -> Option; + ) -> Option<::alloc::string::String>; #[cfg(feature = "WebGlShader")] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getShaderParameter)] #[doc = "The `getShaderParameter()` method."] @@ -5692,8 +7373,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getShaderSource)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlShader`*"] - pub fn get_shader_source(this: &WebGl2RenderingContext, shader: &WebGlShader) - -> Option; + pub fn get_shader_source( + this: &WebGl2RenderingContext, + shader: &WebGlShader, + ) -> Option<::alloc::string::String>; # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = getSupportedExtensions)] #[doc = "The `getSupportedExtensions()` method."] #[doc = ""] @@ -5844,12 +7527,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `WebGlProgram`*"] pub fn link_program(this: &WebGl2RenderingContext, program: &WebGlProgram); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = makeXRCompatible)] #[doc = "The `makeXRCompatible()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/makeXRCompatible)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn make_xr_compatible(this: &WebGl2RenderingContext) -> ::js_sys::Promise; # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = pixelStorei)] #[doc = "The `pixelStorei()` method."] @@ -6116,6 +7803,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttrib1fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn vertex_attrib1fv_with_js_f32_array( + this: &WebGl2RenderingContext, + indx: u32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = vertexAttrib1fv)] + #[doc = "The `vertexAttrib1fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttrib1fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn vertex_attrib1fv_with_f32_sequence( this: &WebGl2RenderingContext, indx: u32, @@ -6145,6 +7843,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttrib2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn vertex_attrib2fv_with_js_f32_array( + this: &WebGl2RenderingContext, + indx: u32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = vertexAttrib2fv)] + #[doc = "The `vertexAttrib2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttrib2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn vertex_attrib2fv_with_f32_sequence( this: &WebGl2RenderingContext, indx: u32, @@ -6174,6 +7883,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttrib3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn vertex_attrib3fv_with_js_f32_array( + this: &WebGl2RenderingContext, + indx: u32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = vertexAttrib3fv)] + #[doc = "The `vertexAttrib3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttrib3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn vertex_attrib3fv_with_f32_sequence( this: &WebGl2RenderingContext, indx: u32, @@ -6210,6 +7930,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttrib4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] + pub fn vertex_attrib4fv_with_js_f32_array( + this: &WebGl2RenderingContext, + indx: u32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGL2RenderingContext" , js_name = vertexAttrib4fv)] + #[doc = "The `vertexAttrib4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/vertexAttrib4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub fn vertex_attrib4fv_with_f32_sequence( this: &WebGl2RenderingContext, indx: u32, diff --git a/crates/web-sys/src/features/gen_WebGlActiveInfo.rs b/crates/web-sys/src/features/gen_WebGlActiveInfo.rs index 985a83b7d17..b8572f1a90a 100644 --- a/crates/web-sys/src/features/gen_WebGlActiveInfo.rs +++ b/crates/web-sys/src/features/gen_WebGlActiveInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,5 +32,5 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLActiveInfo/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlActiveInfo`*"] - pub fn name(this: &WebGlActiveInfo) -> String; + pub fn name(this: &WebGlActiveInfo) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_WebGlBuffer.rs b/crates/web-sys/src/features/gen_WebGlBuffer.rs index 43f1dfb296c..525e3cb8593 100644 --- a/crates/web-sys/src/features/gen_WebGlBuffer.rs +++ b/crates/web-sys/src/features/gen_WebGlBuffer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlContextAttributes.rs b/crates/web-sys/src/features/gen_WebGlContextAttributes.rs index 4be2298032d..23109aab97e 100644 --- a/crates/web-sys/src/features/gen_WebGlContextAttributes.rs +++ b/crates/web-sys/src/features/gen_WebGlContextAttributes.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,106 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] pub type WebGlContextAttributes; + #[doc = "Get the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &WebGlContextAttributes) -> Option; + #[doc = "Change the `alpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &WebGlContextAttributes, val: bool); + #[doc = "Get the `antialias` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, getter = "antialias")] + pub fn get_antialias(this: &WebGlContextAttributes) -> Option; + #[doc = "Change the `antialias` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, setter = "antialias")] + pub fn set_antialias(this: &WebGlContextAttributes, val: bool); + #[doc = "Get the `depth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, getter = "depth")] + pub fn get_depth(this: &WebGlContextAttributes) -> Option; + #[doc = "Change the `depth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, setter = "depth")] + pub fn set_depth(this: &WebGlContextAttributes, val: bool); + #[doc = "Get the `failIfMajorPerformanceCaveat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, getter = "failIfMajorPerformanceCaveat")] + pub fn get_fail_if_major_performance_caveat(this: &WebGlContextAttributes) -> Option; + #[doc = "Change the `failIfMajorPerformanceCaveat` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, setter = "failIfMajorPerformanceCaveat")] + pub fn set_fail_if_major_performance_caveat(this: &WebGlContextAttributes, val: bool); + #[cfg(feature = "WebGlPowerPreference")] + #[doc = "Get the `powerPreference` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`, `WebGlPowerPreference`*"] + #[wasm_bindgen(method, getter = "powerPreference")] + pub fn get_power_preference(this: &WebGlContextAttributes) -> Option; + #[cfg(feature = "WebGlPowerPreference")] + #[doc = "Change the `powerPreference` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`, `WebGlPowerPreference`*"] + #[wasm_bindgen(method, setter = "powerPreference")] + pub fn set_power_preference(this: &WebGlContextAttributes, val: WebGlPowerPreference); + #[doc = "Get the `premultipliedAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, getter = "premultipliedAlpha")] + pub fn get_premultiplied_alpha(this: &WebGlContextAttributes) -> Option; + #[doc = "Change the `premultipliedAlpha` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, setter = "premultipliedAlpha")] + pub fn set_premultiplied_alpha(this: &WebGlContextAttributes, val: bool); + #[doc = "Get the `preserveDrawingBuffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, getter = "preserveDrawingBuffer")] + pub fn get_preserve_drawing_buffer(this: &WebGlContextAttributes) -> Option; + #[doc = "Change the `preserveDrawingBuffer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, setter = "preserveDrawingBuffer")] + pub fn set_preserve_drawing_buffer(this: &WebGlContextAttributes, val: bool); + #[doc = "Get the `stencil` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, getter = "stencil")] + pub fn get_stencil(this: &WebGlContextAttributes) -> Option; + #[doc = "Change the `stencil` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[wasm_bindgen(method, setter = "stencil")] + pub fn set_stencil(this: &WebGlContextAttributes, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `xrCompatible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "xrCompatible")] + pub fn get_xr_compatible(this: &WebGlContextAttributes) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `xrCompatible` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "xrCompatible")] + pub fn set_xr_compatible(this: &WebGlContextAttributes, val: bool); } impl WebGlContextAttributes { #[doc = "Construct a new `WebGlContextAttributes`."] @@ -19,150 +120,51 @@ impl WebGlContextAttributes { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `alpha` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[deprecated = "Use `set_alpha()` instead."] pub fn alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alpha(val); self } - #[doc = "Change the `antialias` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[deprecated = "Use `set_antialias()` instead."] pub fn antialias(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("antialias"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_antialias(val); self } - #[doc = "Change the `depth` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[deprecated = "Use `set_depth()` instead."] pub fn depth(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("depth"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_depth(val); self } - #[doc = "Change the `failIfMajorPerformanceCaveat` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[deprecated = "Use `set_fail_if_major_performance_caveat()` instead."] pub fn fail_if_major_performance_caveat(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("failIfMajorPerformanceCaveat"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_fail_if_major_performance_caveat(val); self } #[cfg(feature = "WebGlPowerPreference")] - #[doc = "Change the `powerPreference` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`, `WebGlPowerPreference`*"] + #[deprecated = "Use `set_power_preference()` instead."] pub fn power_preference(&mut self, val: WebGlPowerPreference) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("powerPreference"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_power_preference(val); self } - #[doc = "Change the `premultipliedAlpha` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[deprecated = "Use `set_premultiplied_alpha()` instead."] pub fn premultiplied_alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("premultipliedAlpha"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_premultiplied_alpha(val); self } - #[doc = "Change the `preserveDrawingBuffer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[deprecated = "Use `set_preserve_drawing_buffer()` instead."] pub fn preserve_drawing_buffer(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("preserveDrawingBuffer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_preserve_drawing_buffer(val); self } - #[doc = "Change the `stencil` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[deprecated = "Use `set_stencil()` instead."] pub fn stencil(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencil"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stencil(val); self } - #[doc = "Change the `xrCompatible` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextAttributes`*"] + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_xr_compatible()` instead."] pub fn xr_compatible(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("xrCompatible"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_xr_compatible(val); self } } diff --git a/crates/web-sys/src/features/gen_WebGlContextEvent.rs b/crates/web-sys/src/features/gen_WebGlContextEvent.rs index 0c328adbdd3..c0d20858297 100644 --- a/crates/web-sys/src/features/gen_WebGlContextEvent.rs +++ b/crates/web-sys/src/features/gen_WebGlContextEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLContextEvent/statusMessage)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextEvent`*"] - pub fn status_message(this: &WebGlContextEvent) -> String; + pub fn status_message(this: &WebGlContextEvent) -> ::alloc::string::String; #[wasm_bindgen(catch, constructor, js_class = "WebGLContextEvent")] #[doc = "The `new WebGlContextEvent(..)` constructor, creating a new instance of `WebGlContextEvent`."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_WebGlContextEventInit.rs b/crates/web-sys/src/features/gen_WebGlContextEventInit.rs index 28e1c3fdb88..8afb446b902 100644 --- a/crates/web-sys/src/features/gen_WebGlContextEventInit.rs +++ b/crates/web-sys/src/features/gen_WebGlContextEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,46 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] pub type WebGlContextEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &WebGlContextEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &WebGlContextEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &WebGlContextEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &WebGlContextEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &WebGlContextEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &WebGlContextEventInit, val: bool); + #[doc = "Get the `statusMessage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[wasm_bindgen(method, getter = "statusMessage")] + pub fn get_status_message(this: &WebGlContextEventInit) -> Option<::alloc::string::String>; + #[doc = "Change the `statusMessage` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[wasm_bindgen(method, setter = "statusMessage")] + pub fn set_status_message(this: &WebGlContextEventInit, val: &str); } impl WebGlContextEventInit { #[doc = "Construct a new `WebGlContextEventInit`."] @@ -19,72 +60,24 @@ impl WebGlContextEventInit { 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: `WebGlContextEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `statusMessage` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebGlContextEventInit`*"] + #[deprecated = "Use `set_status_message()` instead."] pub fn status_message(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("statusMessage"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_status_message(val); self } } diff --git a/crates/web-sys/src/features/gen_WebGlFramebuffer.rs b/crates/web-sys/src/features/gen_WebGlFramebuffer.rs index 87c9a60f639..7c4e5181306 100644 --- a/crates/web-sys/src/features/gen_WebGlFramebuffer.rs +++ b/crates/web-sys/src/features/gen_WebGlFramebuffer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlPowerPreference.rs b/crates/web-sys/src/features/gen_WebGlPowerPreference.rs index 538918f199d..d346fe056a1 100644 --- a/crates/web-sys/src/features/gen_WebGlPowerPreference.rs +++ b/crates/web-sys/src/features/gen_WebGlPowerPreference.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `WebGlPowerPreference` enum."] diff --git a/crates/web-sys/src/features/gen_WebGlProgram.rs b/crates/web-sys/src/features/gen_WebGlProgram.rs index 8ed0017872c..5dcbcae227e 100644 --- a/crates/web-sys/src/features/gen_WebGlProgram.rs +++ b/crates/web-sys/src/features/gen_WebGlProgram.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlQuery.rs b/crates/web-sys/src/features/gen_WebGlQuery.rs index 1d2fb0aacb3..887c6840034 100644 --- a/crates/web-sys/src/features/gen_WebGlQuery.rs +++ b/crates/web-sys/src/features/gen_WebGlQuery.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlRenderbuffer.rs b/crates/web-sys/src/features/gen_WebGlRenderbuffer.rs index 3efdd967d89..6c917cf0d3e 100644 --- a/crates/web-sys/src/features/gen_WebGlRenderbuffer.rs +++ b/crates/web-sys/src/features/gen_WebGlRenderbuffer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlRenderingContext.rs b/crates/web-sys/src/features/gen_WebGlRenderingContext.rs index 5239284b63a..dbca228ee67 100644 --- a/crates/web-sys/src/features/gen_WebGlRenderingContext.rs +++ b/crates/web-sys/src/features/gen_WebGlRenderingContext.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -82,6 +83,18 @@ extern "C" { data: &[u8], usage: u32, ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = bufferData)] + #[doc = "The `bufferData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn buffer_data_with_js_u8_array( + this: &WebGlRenderingContext, + target: u32, + data: &::js_sys::Uint8Array, + usage: u32, + ); # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = bufferSubData)] #[doc = "The `bufferSubData()` method."] #[doc = ""] @@ -154,6 +167,30 @@ extern "C" { offset: f64, data: &[u8], ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = bufferSubData)] + #[doc = "The `bufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn buffer_sub_data_with_i32_and_js_u8_array( + this: &WebGlRenderingContext, + target: u32, + offset: i32, + data: &::js_sys::Uint8Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = bufferSubData)] + #[doc = "The `bufferSubData()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferSubData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn buffer_sub_data_with_f64_and_js_u8_array( + this: &WebGlRenderingContext, + target: u32, + offset: f64, + data: &::js_sys::Uint8Array, + ); # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = commit)] #[doc = "The `commit()` method."] #[doc = ""] @@ -193,6 +230,22 @@ extern "C" { border: i32, data: &[u8], ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = compressedTexImage2D)] + #[doc = "The `compressedTexImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/compressedTexImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn compressed_tex_image_2d_with_js_u8_array( + this: &WebGlRenderingContext, + target: u32, + level: i32, + internalformat: u32, + width: i32, + height: i32, + border: i32, + data: &::js_sys::Uint8Array, + ); # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = compressedTexSubImage2D)] #[doc = "The `compressedTexSubImage2D()` method."] #[doc = ""] @@ -227,6 +280,23 @@ extern "C" { format: u32, data: &mut [u8], ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = compressedTexSubImage2D)] + #[doc = "The `compressedTexSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/compressedTexSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn compressed_tex_sub_image_2d_with_js_u8_array( + this: &WebGlRenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + width: i32, + height: i32, + format: u32, + data: &::js_sys::Uint8Array, + ); # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = readPixels)] #[doc = "The `readPixels()` method."] #[doc = ""] @@ -259,6 +329,22 @@ extern "C" { type_: u32, pixels: Option<&mut [u8]>, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = readPixels)] + #[doc = "The `readPixels()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn read_pixels_with_opt_js_u8_array( + this: &WebGlRenderingContext, + x: i32, + y: i32, + width: i32, + height: i32, + format: u32, + type_: u32, + pixels: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = texImage2D)] #[doc = "The `texImage2D()` method."] #[doc = ""] @@ -295,6 +381,24 @@ extern "C" { type_: u32, pixels: Option<&[u8]>, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = texImage2D)] + #[doc = "The `texImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_js_u8_array( + this: &WebGlRenderingContext, + target: u32, + level: i32, + internalformat: i32, + width: i32, + height: i32, + border: i32, + format: u32, + type_: u32, + pixels: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = texImage2D)] #[doc = "The `texImage2D()` method."] @@ -375,6 +479,26 @@ extern "C" { type_: u32, video: &HtmlVideoElement, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = texImage2D)] + #[doc = "The `texImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WebGlRenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tex_image_2d_with_u32_and_u32_and_video_frame( + this: &WebGlRenderingContext, + target: u32, + level: i32, + internalformat: i32, + format: u32, + type_: u32, + video_frame: &VideoFrame, + ) -> Result<(), JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = texSubImage2D)] #[doc = "The `texSubImage2D()` method."] #[doc = ""] @@ -411,6 +535,24 @@ extern "C" { type_: u32, pixels: Option<&[u8]>, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = texSubImage2D)] + #[doc = "The `texSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_js_u8_array( + this: &WebGlRenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + width: i32, + height: i32, + format: u32, + type_: u32, + pixels: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; #[cfg(feature = "ImageBitmap")] # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = texSubImage2D)] #[doc = "The `texSubImage2D()` method."] @@ -496,6 +638,27 @@ extern "C" { type_: u32, video: &HtmlVideoElement, ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WebGLRenderingContext" , js_name = texSubImage2D)] + #[doc = "The `texSubImage2D()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texSubImage2D)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WebGlRenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn tex_sub_image_2d_with_u32_and_u32_and_video_frame( + this: &WebGlRenderingContext, + target: u32, + level: i32, + xoffset: i32, + yoffset: i32, + format: u32, + type_: u32, + video_frame: &VideoFrame, + ) -> Result<(), JsValue>; #[cfg(feature = "WebGlUniformLocation")] # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform1fv)] #[doc = "The `uniform1fv()` method."] @@ -515,6 +678,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform1fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1fv_with_js_f32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform1fv)] + #[doc = "The `uniform1fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform1fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1fv_with_f32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -539,6 +714,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform1iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform1iv_with_js_i32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform1iv)] + #[doc = "The `uniform1iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform1iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform1iv_with_i32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -563,6 +750,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2fv_with_js_f32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform2fv)] + #[doc = "The `uniform2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2fv_with_f32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -587,6 +786,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform2iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform2iv_with_js_i32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform2iv)] + #[doc = "The `uniform2iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform2iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform2iv_with_i32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -611,6 +822,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3fv_with_js_f32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform3fv)] + #[doc = "The `uniform3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3fv_with_f32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -635,6 +858,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform3iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform3iv_with_js_i32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform3iv)] + #[doc = "The `uniform3iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform3iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform3iv_with_i32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -659,6 +894,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4fv_with_js_f32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform4fv)] + #[doc = "The `uniform4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4fv_with_f32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -683,6 +930,18 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform4iv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform4iv_with_js_i32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + data: &::js_sys::Int32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniform4iv)] + #[doc = "The `uniform4iv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform4iv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform4iv_with_i32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -708,6 +967,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniformMatrix2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix2fv_with_js_f32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniformMatrix2fv)] + #[doc = "The `uniformMatrix2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniformMatrix2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix2fv_with_f32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -734,6 +1006,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniformMatrix3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix3fv_with_js_f32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniformMatrix3fv)] + #[doc = "The `uniformMatrix3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniformMatrix3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix3fv_with_f32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -760,6 +1045,19 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniformMatrix4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] + pub fn uniform_matrix4fv_with_js_f32_array( + this: &WebGlRenderingContext, + location: Option<&WebGlUniformLocation>, + transpose: bool, + data: &::js_sys::Float32Array, + ); + #[cfg(feature = "WebGlUniformLocation")] + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = uniformMatrix4fv)] + #[doc = "The `uniformMatrix4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniformMatrix4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlUniformLocation`*"] pub fn uniform_matrix4fv_with_f32_sequence( this: &WebGlRenderingContext, location: Option<&WebGlUniformLocation>, @@ -1341,7 +1639,7 @@ extern "C" { pub fn get_program_info_log( this: &WebGlRenderingContext, program: &WebGlProgram, - ) -> Option; + ) -> Option<::alloc::string::String>; #[cfg(feature = "WebGlProgram")] # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = getProgramParameter)] #[doc = "The `getProgramParameter()` method."] @@ -1375,7 +1673,7 @@ extern "C" { pub fn get_shader_info_log( this: &WebGlRenderingContext, shader: &WebGlShader, - ) -> Option; + ) -> Option<::alloc::string::String>; #[cfg(feature = "WebGlShader")] # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = getShaderParameter)] #[doc = "The `getShaderParameter()` method."] @@ -1407,7 +1705,10 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getShaderSource)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `WebGlShader`*"] - pub fn get_shader_source(this: &WebGlRenderingContext, shader: &WebGlShader) -> Option; + pub fn get_shader_source( + this: &WebGlRenderingContext, + shader: &WebGlShader, + ) -> Option<::alloc::string::String>; # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = getSupportedExtensions)] #[doc = "The `getSupportedExtensions()` method."] #[doc = ""] @@ -1558,12 +1859,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlProgram`, `WebGlRenderingContext`*"] pub fn link_program(this: &WebGlRenderingContext, program: &WebGlProgram); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = makeXRCompatible)] #[doc = "The `makeXRCompatible()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/makeXRCompatible)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn make_xr_compatible(this: &WebGlRenderingContext) -> ::js_sys::Promise; # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = pixelStorei)] #[doc = "The `pixelStorei()` method."] @@ -1818,6 +2123,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttrib1fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn vertex_attrib1fv_with_js_f32_array( + this: &WebGlRenderingContext, + indx: u32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = vertexAttrib1fv)] + #[doc = "The `vertexAttrib1fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttrib1fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] pub fn vertex_attrib1fv_with_f32_sequence( this: &WebGlRenderingContext, indx: u32, @@ -1843,6 +2159,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttrib2fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn vertex_attrib2fv_with_js_f32_array( + this: &WebGlRenderingContext, + indx: u32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = vertexAttrib2fv)] + #[doc = "The `vertexAttrib2fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttrib2fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] pub fn vertex_attrib2fv_with_f32_sequence( this: &WebGlRenderingContext, indx: u32, @@ -1868,6 +2195,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttrib3fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn vertex_attrib3fv_with_js_f32_array( + this: &WebGlRenderingContext, + indx: u32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = vertexAttrib3fv)] + #[doc = "The `vertexAttrib3fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttrib3fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] pub fn vertex_attrib3fv_with_f32_sequence( this: &WebGlRenderingContext, indx: u32, @@ -1893,6 +2231,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttrib4fv)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] + pub fn vertex_attrib4fv_with_js_f32_array( + this: &WebGlRenderingContext, + indx: u32, + values: &::js_sys::Float32Array, + ); + # [wasm_bindgen (method , structural , js_class = "WebGLRenderingContext" , js_name = vertexAttrib4fv)] + #[doc = "The `vertexAttrib4fv()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttrib4fv)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`*"] pub fn vertex_attrib4fv_with_f32_sequence( this: &WebGlRenderingContext, indx: u32, diff --git a/crates/web-sys/src/features/gen_WebGlSampler.rs b/crates/web-sys/src/features/gen_WebGlSampler.rs index 6f28463b179..d2743d20b20 100644 --- a/crates/web-sys/src/features/gen_WebGlSampler.rs +++ b/crates/web-sys/src/features/gen_WebGlSampler.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlShader.rs b/crates/web-sys/src/features/gen_WebGlShader.rs index 1d4aa826847..53f87b5fa6f 100644 --- a/crates/web-sys/src/features/gen_WebGlShader.rs +++ b/crates/web-sys/src/features/gen_WebGlShader.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlShaderPrecisionFormat.rs b/crates/web-sys/src/features/gen_WebGlShaderPrecisionFormat.rs index 16e869914ad..fc486905505 100644 --- a/crates/web-sys/src/features/gen_WebGlShaderPrecisionFormat.rs +++ b/crates/web-sys/src/features/gen_WebGlShaderPrecisionFormat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlSync.rs b/crates/web-sys/src/features/gen_WebGlSync.rs index 6c8b2e356b7..41b3c4adb1c 100644 --- a/crates/web-sys/src/features/gen_WebGlSync.rs +++ b/crates/web-sys/src/features/gen_WebGlSync.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlTexture.rs b/crates/web-sys/src/features/gen_WebGlTexture.rs index 14d7b8e13cf..fb720e5735b 100644 --- a/crates/web-sys/src/features/gen_WebGlTexture.rs +++ b/crates/web-sys/src/features/gen_WebGlTexture.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlTransformFeedback.rs b/crates/web-sys/src/features/gen_WebGlTransformFeedback.rs index edfabfb3ae8..933ce5ceec2 100644 --- a/crates/web-sys/src/features/gen_WebGlTransformFeedback.rs +++ b/crates/web-sys/src/features/gen_WebGlTransformFeedback.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlUniformLocation.rs b/crates/web-sys/src/features/gen_WebGlUniformLocation.rs index 545667f6853..fa1a6a56c51 100644 --- a/crates/web-sys/src/features/gen_WebGlUniformLocation.rs +++ b/crates/web-sys/src/features/gen_WebGlUniformLocation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebGlVertexArrayObject.rs b/crates/web-sys/src/features/gen_WebGlVertexArrayObject.rs index 1929efa7e48..202edd6fce9 100644 --- a/crates/web-sys/src/features/gen_WebGlVertexArrayObject.rs +++ b/crates/web-sys/src/features/gen_WebGlVertexArrayObject.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebKitCssMatrix.rs b/crates/web-sys/src/features/gen_WebKitCssMatrix.rs index a8f024ca690..cf21196eb99 100644 --- a/crates/web-sys/src/features/gen_WebKitCssMatrix.rs +++ b/crates/web-sys/src/features/gen_WebKitCssMatrix.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebSocket.rs b/crates/web-sys/src/features/gen_WebSocket.rs index 03143f17f86..7b9ef40e532 100644 --- a/crates/web-sys/src/features/gen_WebSocket.rs +++ b/crates/web-sys/src/features/gen_WebSocket.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,7 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/url)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocket`*"] - pub fn url(this: &WebSocket) -> String; + pub fn url(this: &WebSocket) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WebSocket" , js_name = readyState)] #[doc = "Getter for the `readyState` field of this object."] #[doc = ""] @@ -80,14 +81,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/extensions)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocket`*"] - pub fn extensions(this: &WebSocket) -> String; + pub fn extensions(this: &WebSocket) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WebSocket" , js_name = protocol)] #[doc = "Getter for the `protocol` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/protocol)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocket`*"] - pub fn protocol(this: &WebSocket) -> String; + pub fn protocol(this: &WebSocket) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WebSocket" , js_name = onmessage)] #[doc = "Getter for the `onmessage` field of this object."] #[doc = ""] @@ -209,6 +210,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocket`*"] pub fn send_with_u8_array(this: &WebSocket, data: &[u8]) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WebSocket" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocket`*"] + pub fn send_with_js_u8_array( + this: &WebSocket, + data: &::js_sys::Uint8Array, + ) -> Result<(), JsValue>; } impl WebSocket { #[doc = "The `WebSocket.CONNECTING` const."] diff --git a/crates/web-sys/src/features/gen_WebSocketDict.rs b/crates/web-sys/src/features/gen_WebSocketDict.rs index 05df3bcf918..752934754b9 100644 --- a/crates/web-sys/src/features/gen_WebSocketDict.rs +++ b/crates/web-sys/src/features/gen_WebSocketDict.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketDict`*"] pub type WebSocketDict; + #[doc = "Get the `websockets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketDict`*"] + #[wasm_bindgen(method, getter = "websockets")] + pub fn get_websockets(this: &WebSocketDict) -> Option<::js_sys::Array>; + #[doc = "Change the `websockets` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketDict`*"] + #[wasm_bindgen(method, setter = "websockets")] + pub fn set_websockets(this: &WebSocketDict, val: &::wasm_bindgen::JsValue); } impl WebSocketDict { #[doc = "Construct a new `WebSocketDict`."] @@ -19,21 +30,9 @@ impl WebSocketDict { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `websockets` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebSocketDict`*"] + #[deprecated = "Use `set_websockets()` instead."] pub fn websockets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("websockets"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_websockets(val); self } } diff --git a/crates/web-sys/src/features/gen_WebSocketElement.rs b/crates/web-sys/src/features/gen_WebSocketElement.rs index 402e05eb432..56de8133975 100644 --- a/crates/web-sys/src/features/gen_WebSocketElement.rs +++ b/crates/web-sys/src/features/gen_WebSocketElement.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,66 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] pub type WebSocketElement; + #[doc = "Get the `encrypted` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, getter = "encrypted")] + pub fn get_encrypted(this: &WebSocketElement) -> Option; + #[doc = "Change the `encrypted` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, setter = "encrypted")] + pub fn set_encrypted(this: &WebSocketElement, val: bool); + #[doc = "Get the `hostport` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, getter = "hostport")] + pub fn get_hostport(this: &WebSocketElement) -> Option<::alloc::string::String>; + #[doc = "Change the `hostport` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, setter = "hostport")] + pub fn set_hostport(this: &WebSocketElement, val: &str); + #[doc = "Get the `msgreceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, getter = "msgreceived")] + pub fn get_msgreceived(this: &WebSocketElement) -> Option; + #[doc = "Change the `msgreceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, setter = "msgreceived")] + pub fn set_msgreceived(this: &WebSocketElement, val: u32); + #[doc = "Get the `msgsent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, getter = "msgsent")] + pub fn get_msgsent(this: &WebSocketElement) -> Option; + #[doc = "Change the `msgsent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, setter = "msgsent")] + pub fn set_msgsent(this: &WebSocketElement, val: u32); + #[doc = "Get the `receivedsize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, getter = "receivedsize")] + pub fn get_receivedsize(this: &WebSocketElement) -> Option; + #[doc = "Change the `receivedsize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, setter = "receivedsize")] + pub fn set_receivedsize(this: &WebSocketElement, val: f64); + #[doc = "Get the `sentsize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, getter = "sentsize")] + pub fn get_sentsize(this: &WebSocketElement) -> Option; + #[doc = "Change the `sentsize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[wasm_bindgen(method, setter = "sentsize")] + pub fn set_sentsize(this: &WebSocketElement, val: f64); } impl WebSocketElement { #[doc = "Construct a new `WebSocketElement`."] @@ -19,106 +80,34 @@ impl WebSocketElement { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `encrypted` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[deprecated = "Use `set_encrypted()` instead."] pub fn encrypted(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("encrypted"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_encrypted(val); self } - #[doc = "Change the `hostport` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[deprecated = "Use `set_hostport()` instead."] pub fn hostport(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("hostport"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_hostport(val); self } - #[doc = "Change the `msgreceived` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[deprecated = "Use `set_msgreceived()` instead."] pub fn msgreceived(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("msgreceived"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_msgreceived(val); self } - #[doc = "Change the `msgsent` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[deprecated = "Use `set_msgsent()` instead."] pub fn msgsent(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("msgsent"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_msgsent(val); self } - #[doc = "Change the `receivedsize` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[deprecated = "Use `set_receivedsize()` instead."] pub fn receivedsize(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("receivedsize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_receivedsize(val); self } - #[doc = "Change the `sentsize` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"] + #[deprecated = "Use `set_sentsize()` instead."] pub fn sentsize(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sentsize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_sentsize(val); self } } diff --git a/crates/web-sys/src/features/gen_WebTransport.rs b/crates/web-sys/src/features/gen_WebTransport.rs new file mode 100644 index 00000000000..350d77608e0 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransport.rs @@ -0,0 +1,224 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransport , typescript_type = "WebTransport")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransport` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransport; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , 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/WebTransport/ready)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ready(this: &WebTransport) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportReliabilityMode")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = reliability)] + #[doc = "Getter for the `reliability` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/reliability)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportReliabilityMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn reliability(this: &WebTransport) -> WebTransportReliabilityMode; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportCongestionControl")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = congestionControl)] + #[doc = "Getter for the `congestionControl` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/congestionControl)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportCongestionControl`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn congestion_control(this: &WebTransport) -> WebTransportCongestionControl; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = closed)] + #[doc = "Getter for the `closed` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/closed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn closed(this: &WebTransport) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = draining)] + #[doc = "Getter for the `draining` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/draining)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn draining(this: &WebTransport) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportDatagramDuplexStream")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = datagrams)] + #[doc = "Getter for the `datagrams` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/datagrams)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn datagrams(this: &WebTransport) -> WebTransportDatagramDuplexStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = incomingBidirectionalStreams)] + #[doc = "Getter for the `incomingBidirectionalStreams` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/incomingBidirectionalStreams)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn incoming_bidirectional_streams(this: &WebTransport) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransport" , js_name = incomingUnidirectionalStreams)] + #[doc = "Getter for the `incomingUnidirectionalStreams` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/incomingUnidirectionalStreams)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn incoming_unidirectional_streams(this: &WebTransport) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "WebTransport")] + #[doc = "The `new WebTransport(..)` constructor, creating a new instance of `WebTransport`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/WebTransport)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(url: &str) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportOptions")] + #[wasm_bindgen(catch, constructor, js_class = "WebTransport")] + #[doc = "The `new WebTransport(..)` constructor, creating a new instance of `WebTransport`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/WebTransport)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_options( + url: &str, + options: &WebTransportOptions, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn close(this: &WebTransport); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportCloseInfo")] + # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportCloseInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn close_with_close_info(this: &WebTransport, close_info: &WebTransportCloseInfo); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createBidirectionalStream)] + #[doc = "The `createBidirectionalStream()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createBidirectionalStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_bidirectional_stream(this: &WebTransport) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportSendStreamOptions")] + # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createBidirectionalStream)] + #[doc = "The `createBidirectionalStream()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createBidirectionalStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportSendStreamOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_bidirectional_stream_with_options( + this: &WebTransport, + options: &WebTransportSendStreamOptions, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createUnidirectionalStream)] + #[doc = "The `createUnidirectionalStream()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createUnidirectionalStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_unidirectional_stream(this: &WebTransport) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportSendStreamOptions")] + # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = createUnidirectionalStream)] + #[doc = "The `createUnidirectionalStream()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/createUnidirectionalStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`, `WebTransportSendStreamOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_unidirectional_stream_with_options( + this: &WebTransport, + options: &WebTransportSendStreamOptions, + ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WebTransport" , js_name = getStats)] + #[doc = "The `getStats()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/getStats)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransport`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_stats(this: &WebTransport) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_WebTransportBidirectionalStream.rs b/crates/web-sys/src/features/gen_WebTransportBidirectionalStream.rs new file mode 100644 index 00000000000..e74314244c8 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportBidirectionalStream.rs @@ -0,0 +1,43 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportBidirectionalStream , typescript_type = "WebTransportBidirectionalStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportBidirectionalStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportBidirectionalStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportBidirectionalStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportBidirectionalStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportReceiveStream")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportBidirectionalStream" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportBidirectionalStream/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportBidirectionalStream`, `WebTransportReceiveStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &WebTransportBidirectionalStream) -> WebTransportReceiveStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportSendStream")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportBidirectionalStream" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportBidirectionalStream/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportBidirectionalStream`, `WebTransportSendStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &WebTransportBidirectionalStream) -> WebTransportSendStream; +} diff --git a/crates/web-sys/src/features/gen_WebTransportCloseInfo.rs b/crates/web-sys/src/features/gen_WebTransportCloseInfo.rs new file mode 100644 index 00000000000..fa1cd6f5c4f --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportCloseInfo.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportCloseInfo)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportCloseInfo` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportCloseInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportCloseInfo; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `closeCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportCloseInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "closeCode")] + pub fn get_close_code(this: &WebTransportCloseInfo) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `closeCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportCloseInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "closeCode")] + pub fn set_close_code(this: &WebTransportCloseInfo, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportCloseInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "reason")] + pub fn get_reason(this: &WebTransportCloseInfo) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `reason` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportCloseInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "reason")] + pub fn set_reason(this: &WebTransportCloseInfo, val: &str); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportCloseInfo { + #[doc = "Construct a new `WebTransportCloseInfo`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportCloseInfo`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_close_code()` instead."] + pub fn close_code(&mut self, val: u32) -> &mut Self { + self.set_close_code(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_reason()` instead."] + pub fn reason(&mut self, val: &str) -> &mut Self { + self.set_reason(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportCloseInfo { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebTransportCongestionControl.rs b/crates/web-sys/src/features/gen_WebTransportCongestionControl.rs new file mode 100644 index 00000000000..5838a3f944e --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportCongestionControl.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `WebTransportCongestionControl` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `WebTransportCongestionControl`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum WebTransportCongestionControl { + Default = "default", + Throughput = "throughput", + LowLatency = "low-latency", +} diff --git a/crates/web-sys/src/features/gen_WebTransportDatagramDuplexStream.rs b/crates/web-sys/src/features/gen_WebTransportDatagramDuplexStream.rs new file mode 100644 index 00000000000..4b5fdb6d0c3 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportDatagramDuplexStream.rs @@ -0,0 +1,142 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportDatagramDuplexStream , typescript_type = "WebTransportDatagramDuplexStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportDatagramDuplexStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportDatagramDuplexStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "ReadableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportDatagramDuplexStream" , js_name = readable)] + #[doc = "Getter for the `readable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/readable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn readable(this: &WebTransportDatagramDuplexStream) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WritableStream")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportDatagramDuplexStream" , js_name = writable)] + #[doc = "Getter for the `writable` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/writable)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn writable(this: &WebTransportDatagramDuplexStream) -> WritableStream; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportDatagramDuplexStream" , js_name = maxDatagramSize)] + #[doc = "Getter for the `maxDatagramSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/maxDatagramSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn max_datagram_size(this: &WebTransportDatagramDuplexStream) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportDatagramDuplexStream" , js_name = incomingMaxAge)] + #[doc = "Getter for the `incomingMaxAge` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/incomingMaxAge)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn incoming_max_age(this: &WebTransportDatagramDuplexStream) -> f64; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "WebTransportDatagramDuplexStream" , js_name = incomingMaxAge)] + #[doc = "Setter for the `incomingMaxAge` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/incomingMaxAge)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_incoming_max_age(this: &WebTransportDatagramDuplexStream, value: f64); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportDatagramDuplexStream" , js_name = outgoingMaxAge)] + #[doc = "Getter for the `outgoingMaxAge` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/outgoingMaxAge)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn outgoing_max_age(this: &WebTransportDatagramDuplexStream) -> f64; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "WebTransportDatagramDuplexStream" , js_name = outgoingMaxAge)] + #[doc = "Setter for the `outgoingMaxAge` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/outgoingMaxAge)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_outgoing_max_age(this: &WebTransportDatagramDuplexStream, value: f64); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportDatagramDuplexStream" , js_name = incomingHighWaterMark)] + #[doc = "Getter for the `incomingHighWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/incomingHighWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn incoming_high_water_mark(this: &WebTransportDatagramDuplexStream) -> f64; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "WebTransportDatagramDuplexStream" , js_name = incomingHighWaterMark)] + #[doc = "Setter for the `incomingHighWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/incomingHighWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_incoming_high_water_mark(this: &WebTransportDatagramDuplexStream, value: f64); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportDatagramDuplexStream" , js_name = outgoingHighWaterMark)] + #[doc = "Getter for the `outgoingHighWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/outgoingHighWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn outgoing_high_water_mark(this: &WebTransportDatagramDuplexStream) -> f64; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "WebTransportDatagramDuplexStream" , js_name = outgoingHighWaterMark)] + #[doc = "Setter for the `outgoingHighWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportDatagramDuplexStream/outgoingHighWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramDuplexStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_outgoing_high_water_mark(this: &WebTransportDatagramDuplexStream, value: f64); +} diff --git a/crates/web-sys/src/features/gen_WebTransportDatagramStats.rs b/crates/web-sys/src/features/gen_WebTransportDatagramStats.rs new file mode 100644 index 00000000000..22cd239a268 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportDatagramStats.rs @@ -0,0 +1,133 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportDatagramStats)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportDatagramStats` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportDatagramStats; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `droppedIncoming` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "droppedIncoming")] + pub fn get_dropped_incoming(this: &WebTransportDatagramStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `droppedIncoming` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "droppedIncoming")] + pub fn set_dropped_incoming(this: &WebTransportDatagramStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `expiredOutgoing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "expiredOutgoing")] + pub fn get_expired_outgoing(this: &WebTransportDatagramStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `expiredOutgoing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "expiredOutgoing")] + pub fn set_expired_outgoing(this: &WebTransportDatagramStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `lostOutgoing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "lostOutgoing")] + pub fn get_lost_outgoing(this: &WebTransportDatagramStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `lostOutgoing` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "lostOutgoing")] + pub fn set_lost_outgoing(this: &WebTransportDatagramStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &WebTransportDatagramStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &WebTransportDatagramStats, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportDatagramStats { + #[doc = "Construct a new `WebTransportDatagramStats`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_dropped_incoming()` instead."] + pub fn dropped_incoming(&mut self, val: f64) -> &mut Self { + self.set_dropped_incoming(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_expired_outgoing()` instead."] + pub fn expired_outgoing(&mut self, val: f64) -> &mut Self { + self.set_expired_outgoing(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_lost_outgoing()` instead."] + pub fn lost_outgoing(&mut self, val: f64) -> &mut Self { + self.set_lost_outgoing(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportDatagramStats { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebTransportError.rs b/crates/web-sys/src/features/gen_WebTransportError.rs new file mode 100644 index 00000000000..5c073b902b1 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportError.rs @@ -0,0 +1,79 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = DomException , extends = :: js_sys :: Object , js_name = WebTransportError , typescript_type = "WebTransportError")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportError` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportError; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportErrorSource")] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportError" , js_name = source)] + #[doc = "Getter for the `source` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportError/source)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportError`, `WebTransportErrorSource`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn source(this: &WebTransportError) -> WebTransportErrorSource; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WebTransportError" , js_name = streamErrorCode)] + #[doc = "Getter for the `streamErrorCode` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportError/streamErrorCode)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn stream_error_code(this: &WebTransportError) -> Option; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "WebTransportError")] + #[doc = "The `new WebTransportError(..)` constructor, creating a new instance of `WebTransportError`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportError/WebTransportError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Result; + #[cfg(web_sys_unstable_apis)] + #[wasm_bindgen(catch, constructor, js_class = "WebTransportError")] + #[doc = "The `new WebTransportError(..)` constructor, creating a new instance of `WebTransportError`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportError/WebTransportError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportError`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_message(message: &str) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportErrorOptions")] + #[wasm_bindgen(catch, constructor, js_class = "WebTransportError")] + #[doc = "The `new WebTransportError(..)` constructor, creating a new instance of `WebTransportError`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportError/WebTransportError)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportError`, `WebTransportErrorOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new_with_message_and_options( + message: &str, + options: &WebTransportErrorOptions, + ) -> Result; +} diff --git a/crates/web-sys/src/features/gen_WebTransportErrorOptions.rs b/crates/web-sys/src/features/gen_WebTransportErrorOptions.rs new file mode 100644 index 00000000000..06a6c9dd632 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportErrorOptions.rs @@ -0,0 +1,88 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportErrorOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportErrorOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportErrorOptions; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportErrorSource")] + #[doc = "Get the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`, `WebTransportErrorSource`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "source")] + pub fn get_source(this: &WebTransportErrorOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportErrorSource")] + #[doc = "Change the `source` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`, `WebTransportErrorSource`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "source")] + pub fn set_source(this: &WebTransportErrorOptions, val: WebTransportErrorSource); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `streamErrorCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "streamErrorCode")] + pub fn get_stream_error_code(this: &WebTransportErrorOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `streamErrorCode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "streamErrorCode")] + pub fn set_stream_error_code(this: &WebTransportErrorOptions, val: Option); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportErrorOptions { + #[doc = "Construct a new `WebTransportErrorOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportErrorOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportErrorSource")] + #[deprecated = "Use `set_source()` instead."] + pub fn source(&mut self, val: WebTransportErrorSource) -> &mut Self { + self.set_source(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stream_error_code()` instead."] + pub fn stream_error_code(&mut self, val: Option) -> &mut Self { + self.set_stream_error_code(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportErrorOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebTransportErrorSource.rs b/crates/web-sys/src/features/gen_WebTransportErrorSource.rs new file mode 100644 index 00000000000..1e49ce89253 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportErrorSource.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `WebTransportErrorSource` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `WebTransportErrorSource`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum WebTransportErrorSource { + Stream = "stream", + Session = "session", +} diff --git a/crates/web-sys/src/features/gen_WebTransportHash.rs b/crates/web-sys/src/features/gen_WebTransportHash.rs new file mode 100644 index 00000000000..cf5d1fbfeda --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportHash.rs @@ -0,0 +1,85 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportHash)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportHash` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportHash`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportHash; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `algorithm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportHash`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "algorithm")] + pub fn get_algorithm(this: &WebTransportHash) -> Option<::alloc::string::String>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `algorithm` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportHash`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "algorithm")] + pub fn set_algorithm(this: &WebTransportHash, val: &str); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportHash`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "value")] + pub fn get_value(this: &WebTransportHash) -> Option<::js_sys::Object>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportHash`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "value")] + pub fn set_value(this: &WebTransportHash, val: &::js_sys::Object); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportHash { + #[doc = "Construct a new `WebTransportHash`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportHash`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_algorithm()` instead."] + pub fn algorithm(&mut self, val: &str) -> &mut Self { + self.set_algorithm(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_value()` instead."] + pub fn value(&mut self, val: &::js_sys::Object) -> &mut Self { + self.set_value(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportHash { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebTransportOptions.rs b/crates/web-sys/src/features/gen_WebTransportOptions.rs new file mode 100644 index 00000000000..bc293195182 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportOptions.rs @@ -0,0 +1,138 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `allowPooling` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "allowPooling")] + pub fn get_allow_pooling(this: &WebTransportOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `allowPooling` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "allowPooling")] + pub fn set_allow_pooling(this: &WebTransportOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportCongestionControl")] + #[doc = "Get the `congestionControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportCongestionControl`, `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "congestionControl")] + pub fn get_congestion_control( + this: &WebTransportOptions, + ) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportCongestionControl")] + #[doc = "Change the `congestionControl` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportCongestionControl`, `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "congestionControl")] + pub fn set_congestion_control(this: &WebTransportOptions, val: WebTransportCongestionControl); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `requireUnreliable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requireUnreliable")] + pub fn get_require_unreliable(this: &WebTransportOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `requireUnreliable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "requireUnreliable")] + pub fn set_require_unreliable(this: &WebTransportOptions, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `serverCertificateHashes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "serverCertificateHashes")] + pub fn get_server_certificate_hashes(this: &WebTransportOptions) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `serverCertificateHashes` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "serverCertificateHashes")] + pub fn set_server_certificate_hashes(this: &WebTransportOptions, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportOptions { + #[doc = "Construct a new `WebTransportOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_allow_pooling()` instead."] + pub fn allow_pooling(&mut self, val: bool) -> &mut Self { + self.set_allow_pooling(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportCongestionControl")] + #[deprecated = "Use `set_congestion_control()` instead."] + pub fn congestion_control(&mut self, val: WebTransportCongestionControl) -> &mut Self { + self.set_congestion_control(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_require_unreliable()` instead."] + pub fn require_unreliable(&mut self, val: bool) -> &mut Self { + self.set_require_unreliable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_server_certificate_hashes()` instead."] + pub fn server_certificate_hashes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_server_certificate_hashes(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebTransportReceiveStream.rs b/crates/web-sys/src/features/gen_WebTransportReceiveStream.rs new file mode 100644 index 00000000000..1686340a136 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportReceiveStream.rs @@ -0,0 +1,30 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = ReadableStream , extends = :: js_sys :: Object , js_name = WebTransportReceiveStream , typescript_type = "WebTransportReceiveStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportReceiveStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportReceiveStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportReceiveStream; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WebTransportReceiveStream" , js_name = getStats)] + #[doc = "The `getStats()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportReceiveStream/getStats)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_stats(this: &WebTransportReceiveStream) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_WebTransportReceiveStreamStats.rs b/crates/web-sys/src/features/gen_WebTransportReceiveStreamStats.rs new file mode 100644 index 00000000000..51efe4f837b --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportReceiveStreamStats.rs @@ -0,0 +1,109 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportReceiveStreamStats)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportReceiveStreamStats` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportReceiveStreamStats; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesRead` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesRead")] + pub fn get_bytes_read(this: &WebTransportReceiveStreamStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesRead` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesRead")] + pub fn set_bytes_read(this: &WebTransportReceiveStreamStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesReceived")] + pub fn get_bytes_received(this: &WebTransportReceiveStreamStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesReceived")] + pub fn set_bytes_received(this: &WebTransportReceiveStreamStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &WebTransportReceiveStreamStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &WebTransportReceiveStreamStats, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportReceiveStreamStats { + #[doc = "Construct a new `WebTransportReceiveStreamStats`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportReceiveStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_read()` instead."] + pub fn bytes_read(&mut self, val: f64) -> &mut Self { + self.set_bytes_read(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_received()` instead."] + pub fn bytes_received(&mut self, val: f64) -> &mut Self { + self.set_bytes_received(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportReceiveStreamStats { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebTransportReliabilityMode.rs b/crates/web-sys/src/features/gen_WebTransportReliabilityMode.rs new file mode 100644 index 00000000000..5bdba27c6eb --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportReliabilityMode.rs @@ -0,0 +1,17 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `WebTransportReliabilityMode` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `WebTransportReliabilityMode`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum WebTransportReliabilityMode { + Pending = "pending", + ReliableOnly = "reliable-only", + SupportsUnreliable = "supports-unreliable", +} diff --git a/crates/web-sys/src/features/gen_WebTransportSendStream.rs b/crates/web-sys/src/features/gen_WebTransportSendStream.rs new file mode 100644 index 00000000000..6377f112521 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportSendStream.rs @@ -0,0 +1,30 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = WritableStream , extends = :: js_sys :: Object , js_name = WebTransportSendStream , typescript_type = "WebTransportSendStream")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportSendStream` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportSendStream)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportSendStream; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WebTransportSendStream" , js_name = getStats)] + #[doc = "The `getStats()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebTransportSendStream/getStats)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_stats(this: &WebTransportSendStream) -> ::js_sys::Promise; +} diff --git a/crates/web-sys/src/features/gen_WebTransportSendStreamOptions.rs b/crates/web-sys/src/features/gen_WebTransportSendStreamOptions.rs new file mode 100644 index 00000000000..8b7b073e0aa --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportSendStreamOptions.rs @@ -0,0 +1,61 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportSendStreamOptions)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportSendStreamOptions` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportSendStreamOptions; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `sendOrder` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "sendOrder")] + pub fn get_send_order(this: &WebTransportSendStreamOptions) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `sendOrder` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "sendOrder")] + pub fn set_send_order(this: &WebTransportSendStreamOptions, val: Option); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportSendStreamOptions { + #[doc = "Construct a new `WebTransportSendStreamOptions`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamOptions`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_send_order()` instead."] + pub fn send_order(&mut self, val: Option) -> &mut Self { + self.set_send_order(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportSendStreamOptions { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebTransportSendStreamStats.rs b/crates/web-sys/src/features/gen_WebTransportSendStreamStats.rs new file mode 100644 index 00000000000..e7f14805c32 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportSendStreamStats.rs @@ -0,0 +1,133 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportSendStreamStats)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportSendStreamStats` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportSendStreamStats; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesAcknowledged` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesAcknowledged")] + pub fn get_bytes_acknowledged(this: &WebTransportSendStreamStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesAcknowledged` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesAcknowledged")] + pub fn set_bytes_acknowledged(this: &WebTransportSendStreamStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesSent")] + pub fn get_bytes_sent(this: &WebTransportSendStreamStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesSent")] + pub fn set_bytes_sent(this: &WebTransportSendStreamStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesWritten` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesWritten")] + pub fn get_bytes_written(this: &WebTransportSendStreamStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesWritten` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesWritten")] + pub fn set_bytes_written(this: &WebTransportSendStreamStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &WebTransportSendStreamStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &WebTransportSendStreamStats, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportSendStreamStats { + #[doc = "Construct a new `WebTransportSendStreamStats`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportSendStreamStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_acknowledged()` instead."] + pub fn bytes_acknowledged(&mut self, val: f64) -> &mut Self { + self.set_bytes_acknowledged(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_sent()` instead."] + pub fn bytes_sent(&mut self, val: f64) -> &mut Self { + self.set_bytes_sent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_written()` instead."] + pub fn bytes_written(&mut self, val: f64) -> &mut Self { + self.set_bytes_written(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportSendStreamStats { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebTransportStats.rs b/crates/web-sys/src/features/gen_WebTransportStats.rs new file mode 100644 index 00000000000..175fc01ee29 --- /dev/null +++ b/crates/web-sys/src/features/gen_WebTransportStats.rs @@ -0,0 +1,328 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebTransportStats)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebTransportStats` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WebTransportStats; + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesReceived")] + pub fn get_bytes_received(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesReceived")] + pub fn set_bytes_received(this: &WebTransportStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "bytesSent")] + pub fn get_bytes_sent(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `bytesSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "bytesSent")] + pub fn set_bytes_sent(this: &WebTransportStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportDatagramStats")] + #[doc = "Get the `datagrams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`, `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "datagrams")] + pub fn get_datagrams(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportDatagramStats")] + #[doc = "Change the `datagrams` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportDatagramStats`, `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "datagrams")] + pub fn set_datagrams(this: &WebTransportStats, val: &WebTransportDatagramStats); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `minRtt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "minRtt")] + pub fn get_min_rtt(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `minRtt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "minRtt")] + pub fn set_min_rtt(this: &WebTransportStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `numIncomingStreamsCreated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "numIncomingStreamsCreated")] + pub fn get_num_incoming_streams_created(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `numIncomingStreamsCreated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "numIncomingStreamsCreated")] + pub fn set_num_incoming_streams_created(this: &WebTransportStats, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `numOutgoingStreamsCreated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "numOutgoingStreamsCreated")] + pub fn get_num_outgoing_streams_created(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `numOutgoingStreamsCreated` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "numOutgoingStreamsCreated")] + pub fn set_num_outgoing_streams_created(this: &WebTransportStats, val: u32); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `packetsLost` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "packetsLost")] + pub fn get_packets_lost(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `packetsLost` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "packetsLost")] + pub fn set_packets_lost(this: &WebTransportStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `packetsReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "packetsReceived")] + pub fn get_packets_received(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `packetsReceived` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "packetsReceived")] + pub fn set_packets_received(this: &WebTransportStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `packetsSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "packetsSent")] + pub fn get_packets_sent(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `packetsSent` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "packetsSent")] + pub fn set_packets_sent(this: &WebTransportStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `rttVariation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "rttVariation")] + pub fn get_rtt_variation(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `rttVariation` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "rttVariation")] + pub fn set_rtt_variation(this: &WebTransportStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `smoothedRtt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "smoothedRtt")] + pub fn get_smoothed_rtt(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `smoothedRtt` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "smoothedRtt")] + pub fn set_smoothed_rtt(this: &WebTransportStats, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "timestamp")] + pub fn get_timestamp(this: &WebTransportStats) -> Option; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `timestamp` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "timestamp")] + pub fn set_timestamp(this: &WebTransportStats, val: f64); +} +#[cfg(web_sys_unstable_apis)] +impl WebTransportStats { + #[doc = "Construct a new `WebTransportStats`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebTransportStats`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_received()` instead."] + pub fn bytes_received(&mut self, val: f64) -> &mut Self { + self.set_bytes_received(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bytes_sent()` instead."] + pub fn bytes_sent(&mut self, val: f64) -> &mut Self { + self.set_bytes_sent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "WebTransportDatagramStats")] + #[deprecated = "Use `set_datagrams()` instead."] + pub fn datagrams(&mut self, val: &WebTransportDatagramStats) -> &mut Self { + self.set_datagrams(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_min_rtt()` instead."] + pub fn min_rtt(&mut self, val: f64) -> &mut Self { + self.set_min_rtt(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_num_incoming_streams_created()` instead."] + pub fn num_incoming_streams_created(&mut self, val: u32) -> &mut Self { + self.set_num_incoming_streams_created(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_num_outgoing_streams_created()` instead."] + pub fn num_outgoing_streams_created(&mut self, val: u32) -> &mut Self { + self.set_num_outgoing_streams_created(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_packets_lost()` instead."] + pub fn packets_lost(&mut self, val: f64) -> &mut Self { + self.set_packets_lost(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_packets_received()` instead."] + pub fn packets_received(&mut self, val: f64) -> &mut Self { + self.set_packets_received(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_packets_sent()` instead."] + pub fn packets_sent(&mut self, val: f64) -> &mut Self { + self.set_packets_sent(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_rtt_variation()` instead."] + pub fn rtt_variation(&mut self, val: f64) -> &mut Self { + self.set_rtt_variation(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_smoothed_rtt()` instead."] + pub fn smoothed_rtt(&mut self, val: f64) -> &mut Self { + self.set_smoothed_rtt(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_timestamp()` instead."] + pub fn timestamp(&mut self, val: f64) -> &mut Self { + self.set_timestamp(val); + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for WebTransportStats { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WebglColorBufferFloat.rs b/crates/web-sys/src/features/gen_WebglColorBufferFloat.rs index d16789ab5de..d8c1949ddf3 100644 --- a/crates/web-sys/src/features/gen_WebglColorBufferFloat.rs +++ b/crates/web-sys/src/features/gen_WebglColorBufferFloat.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglCompressedTextureAstc.rs b/crates/web-sys/src/features/gen_WebglCompressedTextureAstc.rs index fb369c2838c..54ad5141a12 100644 --- a/crates/web-sys/src/features/gen_WebglCompressedTextureAstc.rs +++ b/crates/web-sys/src/features/gen_WebglCompressedTextureAstc.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglCompressedTextureAtc.rs b/crates/web-sys/src/features/gen_WebglCompressedTextureAtc.rs index 403a2329f57..67d64d27246 100644 --- a/crates/web-sys/src/features/gen_WebglCompressedTextureAtc.rs +++ b/crates/web-sys/src/features/gen_WebglCompressedTextureAtc.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglCompressedTextureEtc.rs b/crates/web-sys/src/features/gen_WebglCompressedTextureEtc.rs index 37d7323a834..6d1e0e58d29 100644 --- a/crates/web-sys/src/features/gen_WebglCompressedTextureEtc.rs +++ b/crates/web-sys/src/features/gen_WebglCompressedTextureEtc.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglCompressedTextureEtc1.rs b/crates/web-sys/src/features/gen_WebglCompressedTextureEtc1.rs index 52dc55734d8..896feba4bc6 100644 --- a/crates/web-sys/src/features/gen_WebglCompressedTextureEtc1.rs +++ b/crates/web-sys/src/features/gen_WebglCompressedTextureEtc1.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglCompressedTexturePvrtc.rs b/crates/web-sys/src/features/gen_WebglCompressedTexturePvrtc.rs index ec34d191464..1535eb03d96 100644 --- a/crates/web-sys/src/features/gen_WebglCompressedTexturePvrtc.rs +++ b/crates/web-sys/src/features/gen_WebglCompressedTexturePvrtc.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglCompressedTextureS3tc.rs b/crates/web-sys/src/features/gen_WebglCompressedTextureS3tc.rs index 450b1a73050..78265094796 100644 --- a/crates/web-sys/src/features/gen_WebglCompressedTextureS3tc.rs +++ b/crates/web-sys/src/features/gen_WebglCompressedTextureS3tc.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglCompressedTextureS3tcSrgb.rs b/crates/web-sys/src/features/gen_WebglCompressedTextureS3tcSrgb.rs index 94141e7720a..19aa6447246 100644 --- a/crates/web-sys/src/features/gen_WebglCompressedTextureS3tcSrgb.rs +++ b/crates/web-sys/src/features/gen_WebglCompressedTextureS3tcSrgb.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglDebugRendererInfo.rs b/crates/web-sys/src/features/gen_WebglDebugRendererInfo.rs index 2ef3172d3e5..9087f072ff5 100644 --- a/crates/web-sys/src/features/gen_WebglDebugRendererInfo.rs +++ b/crates/web-sys/src/features/gen_WebglDebugRendererInfo.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglDebugShaders.rs b/crates/web-sys/src/features/gen_WebglDebugShaders.rs index 01f5403a497..01131d0d353 100644 --- a/crates/web-sys/src/features/gen_WebglDebugShaders.rs +++ b/crates/web-sys/src/features/gen_WebglDebugShaders.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -18,5 +19,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_shaders/getTranslatedShaderSource)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGlShader`, `WebglDebugShaders`*"] - pub fn get_translated_shader_source(this: &WebglDebugShaders, shader: &WebGlShader) -> String; + pub fn get_translated_shader_source( + this: &WebglDebugShaders, + shader: &WebGlShader, + ) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_WebglDepthTexture.rs b/crates/web-sys/src/features/gen_WebglDepthTexture.rs index 301f58bb6f4..5b2fe181dd0 100644 --- a/crates/web-sys/src/features/gen_WebglDepthTexture.rs +++ b/crates/web-sys/src/features/gen_WebglDepthTexture.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglDrawBuffers.rs b/crates/web-sys/src/features/gen_WebglDrawBuffers.rs index a12d67b52ff..c6ab986d093 100644 --- a/crates/web-sys/src/features/gen_WebglDrawBuffers.rs +++ b/crates/web-sys/src/features/gen_WebglDrawBuffers.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglLoseContext.rs b/crates/web-sys/src/features/gen_WebglLoseContext.rs index 5bf059b555b..62fd4232e74 100644 --- a/crates/web-sys/src/features/gen_WebglLoseContext.rs +++ b/crates/web-sys/src/features/gen_WebglLoseContext.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WebglMultiDraw.rs b/crates/web-sys/src/features/gen_WebglMultiDraw.rs new file mode 100644 index 00000000000..d2c5c7a4e4d --- /dev/null +++ b/crates/web-sys/src/features/gen_WebglMultiDraw.rs @@ -0,0 +1,1239 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WEBGL_multi_draw , typescript_type = "WEBGL_multi_draw")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WebglMultiDraw` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub type WebglMultiDraw; + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_array_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_slice_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_array_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_array_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_slice_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_slice_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_slice_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_array_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_js_i32_array_and_js_i32_array_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_js_i32_array_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_sequence_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_js_i32_array_and_i32_sequence_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_sequence_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_slice_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_js_i32_array_and_js_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_js_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_js_i32_array_and_i32_sequence_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysInstancedWEBGL)] + #[doc = "The `multiDrawArraysInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_i32_array_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_i32_array_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_i32_sequence_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &mut [i32], + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_i32_slice_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_js_i32_array_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_i32_sequence_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &mut [i32], + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_js_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::js_sys::Int32Array, + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawArraysWEBGL)] + #[doc = "The `multiDrawArraysWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_arrays_webgl_with_i32_sequence_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + firsts_list: &::wasm_bindgen::JsValue, + firsts_offset: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_array_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_slice_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_array_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_array_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &mut [i32], + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_slice_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_slice_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_slice_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_array_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_js_i32_array_and_js_i32_array_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_js_i32_array_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_sequence_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_js_i32_array_and_i32_sequence_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_sequence_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &::js_sys::Int32Array, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_slice_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_js_i32_array_and_js_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_js_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_js_i32_array_and_i32_sequence_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsInstancedWEBGL)] + #[doc = "The `multiDrawElementsInstancedWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + instance_counts_list: &::wasm_bindgen::JsValue, + instance_counts_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_i32_array_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_i32_array_and_i32_slice( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_i32_sequence_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &mut [i32], + offsets_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_i32_slice_and_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_js_i32_array_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_i32_sequence_and_js_i32_array( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &::js_sys::Int32Array, + offsets_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &mut [i32], + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_js_i32_array_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::js_sys::Int32Array, + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + drawcount: i32, + ); + # [wasm_bindgen (method , structural , js_class = "WEBGL_multi_draw" , js_name = multiDrawElementsWEBGL)] + #[doc = "The `multiDrawElementsWEBGL()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WebglMultiDraw`*"] + pub fn multi_draw_elements_webgl_with_i32_sequence_and_i32_sequence( + this: &WebglMultiDraw, + mode: u32, + counts_list: &::wasm_bindgen::JsValue, + counts_offset: u32, + type_: u32, + offsets_list: &::wasm_bindgen::JsValue, + offsets_offset: u32, + drawcount: i32, + ); +} diff --git a/crates/web-sys/src/features/gen_WebrtcGlobalStatisticsReport.rs b/crates/web-sys/src/features/gen_WebrtcGlobalStatisticsReport.rs deleted file mode 100644 index 9a2e1991ff7..00000000000 --- a/crates/web-sys/src/features/gen_WebrtcGlobalStatisticsReport.rs +++ /dev/null @@ -1,44 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WebrtcGlobalStatisticsReport)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `WebrtcGlobalStatisticsReport` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebrtcGlobalStatisticsReport`*"] - pub type WebrtcGlobalStatisticsReport; -} -impl WebrtcGlobalStatisticsReport { - #[doc = "Construct a new `WebrtcGlobalStatisticsReport`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebrtcGlobalStatisticsReport`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `reports` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WebrtcGlobalStatisticsReport`*"] - pub fn reports(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("reports"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for WebrtcGlobalStatisticsReport { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_WellKnownDirectory.rs b/crates/web-sys/src/features/gen_WellKnownDirectory.rs new file mode 100644 index 00000000000..a99a80592e5 --- /dev/null +++ b/crates/web-sys/src/features/gen_WellKnownDirectory.rs @@ -0,0 +1,20 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `WellKnownDirectory` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `WellKnownDirectory`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum WellKnownDirectory { + Desktop = "desktop", + Documents = "documents", + Downloads = "downloads", + Music = "music", + Pictures = "pictures", + Videos = "videos", +} diff --git a/crates/web-sys/src/features/gen_WgslLanguageFeatures.rs b/crates/web-sys/src/features/gen_WgslLanguageFeatures.rs new file mode 100644 index 00000000000..b338aedb74a --- /dev/null +++ b/crates/web-sys/src/features/gen_WgslLanguageFeatures.rs @@ -0,0 +1,88 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WGSLLanguageFeatures , typescript_type = "WGSLLanguageFeatures")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WgslLanguageFeatures` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type WgslLanguageFeatures; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WGSLLanguageFeatures" , 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/WGSLLanguageFeatures/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &WgslLanguageFeatures) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WGSLLanguageFeatures" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(this: &WgslLanguageFeatures) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "WGSLLanguageFeatures" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn for_each( + this: &WgslLanguageFeatures, + callback: &::js_sys::Function, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WGSLLanguageFeatures" , js_name = has)] + #[doc = "The `has()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/has)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn has(this: &WgslLanguageFeatures, value: &str) -> bool; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WGSLLanguageFeatures" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn keys(this: &WgslLanguageFeatures) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "WGSLLanguageFeatures" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WGSLLanguageFeatures/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WgslLanguageFeatures`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn values(this: &WgslLanguageFeatures) -> ::js_sys::Iterator; +} diff --git a/crates/web-sys/src/features/gen_WheelEvent.rs b/crates/web-sys/src/features/gen_WheelEvent.rs index cbf9365d280..885954dd4d7 100644 --- a/crates/web-sys/src/features/gen_WheelEvent.rs +++ b/crates/web-sys/src/features/gen_WheelEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WheelEventInit.rs b/crates/web-sys/src/features/gen_WheelEventInit.rs index 2d65bee2852..f8e734ab832 100644 --- a/crates/web-sys/src/features/gen_WheelEventInit.rs +++ b/crates/web-sys/src/features/gen_WheelEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,320 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] pub type WheelEventInit; + #[doc = "Get the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &WheelEventInit) -> Option; + #[doc = "Change the `bubbles` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &WheelEventInit, val: bool); + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &WheelEventInit) -> Option; + #[doc = "Change the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &WheelEventInit, val: bool); + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &WheelEventInit) -> Option; + #[doc = "Change the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &WheelEventInit, val: bool); + #[doc = "Get the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "detail")] + pub fn get_detail(this: &WheelEventInit) -> Option; + #[doc = "Change the `detail` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "detail")] + pub fn set_detail(this: &WheelEventInit, val: i32); + #[cfg(feature = "Window")] + #[doc = "Get the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`, `Window`*"] + #[wasm_bindgen(method, getter = "view")] + pub fn get_view(this: &WheelEventInit) -> Option; + #[cfg(feature = "Window")] + #[doc = "Change the `view` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`, `Window`*"] + #[wasm_bindgen(method, setter = "view")] + pub fn set_view(this: &WheelEventInit, val: Option<&Window>); + #[doc = "Get the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "altKey")] + pub fn get_alt_key(this: &WheelEventInit) -> Option; + #[doc = "Change the `altKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "altKey")] + pub fn set_alt_key(this: &WheelEventInit, val: bool); + #[doc = "Get the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "ctrlKey")] + pub fn get_ctrl_key(this: &WheelEventInit) -> Option; + #[doc = "Change the `ctrlKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "ctrlKey")] + pub fn set_ctrl_key(this: &WheelEventInit, val: bool); + #[doc = "Get the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "metaKey")] + pub fn get_meta_key(this: &WheelEventInit) -> Option; + #[doc = "Change the `metaKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "metaKey")] + pub fn set_meta_key(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierAltGraph")] + pub fn get_modifier_alt_graph(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierAltGraph` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierAltGraph")] + pub fn set_modifier_alt_graph(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierCapsLock")] + pub fn get_modifier_caps_lock(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierCapsLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierCapsLock")] + pub fn set_modifier_caps_lock(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFn")] + pub fn get_modifier_fn(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierFn` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFn")] + pub fn set_modifier_fn(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierFnLock")] + pub fn get_modifier_fn_lock(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierFnLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierFnLock")] + pub fn set_modifier_fn_lock(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierNumLock")] + pub fn get_modifier_num_lock(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierNumLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierNumLock")] + pub fn set_modifier_num_lock(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierOS")] + pub fn get_modifier_os(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierOS` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierOS")] + pub fn set_modifier_os(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierScrollLock")] + pub fn get_modifier_scroll_lock(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierScrollLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierScrollLock")] + pub fn set_modifier_scroll_lock(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbol")] + pub fn get_modifier_symbol(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierSymbol` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbol")] + pub fn set_modifier_symbol(this: &WheelEventInit, val: bool); + #[doc = "Get the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "modifierSymbolLock")] + pub fn get_modifier_symbol_lock(this: &WheelEventInit) -> Option; + #[doc = "Change the `modifierSymbolLock` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "modifierSymbolLock")] + pub fn set_modifier_symbol_lock(this: &WheelEventInit, val: bool); + #[doc = "Get the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "shiftKey")] + pub fn get_shift_key(this: &WheelEventInit) -> Option; + #[doc = "Change the `shiftKey` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "shiftKey")] + pub fn set_shift_key(this: &WheelEventInit, val: bool); + #[doc = "Get the `button` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "button")] + pub fn get_button(this: &WheelEventInit) -> Option; + #[doc = "Change the `button` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "button")] + pub fn set_button(this: &WheelEventInit, val: i16); + #[doc = "Get the `buttons` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "buttons")] + pub fn get_buttons(this: &WheelEventInit) -> Option; + #[doc = "Change the `buttons` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "buttons")] + pub fn set_buttons(this: &WheelEventInit, val: u16); + #[doc = "Get the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "clientX")] + pub fn get_client_x(this: &WheelEventInit) -> Option; + #[doc = "Change the `clientX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "clientX")] + pub fn set_client_x(this: &WheelEventInit, val: i32); + #[doc = "Get the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "clientY")] + pub fn get_client_y(this: &WheelEventInit) -> Option; + #[doc = "Change the `clientY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "clientY")] + pub fn set_client_y(this: &WheelEventInit, val: i32); + #[doc = "Get the `movementX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "movementX")] + pub fn get_movement_x(this: &WheelEventInit) -> Option; + #[doc = "Change the `movementX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "movementX")] + pub fn set_movement_x(this: &WheelEventInit, val: i32); + #[doc = "Get the `movementY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "movementY")] + pub fn get_movement_y(this: &WheelEventInit) -> Option; + #[doc = "Change the `movementY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "movementY")] + pub fn set_movement_y(this: &WheelEventInit, val: i32); + #[cfg(feature = "EventTarget")] + #[doc = "Get the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "relatedTarget")] + pub fn get_related_target(this: &WheelEventInit) -> Option; + #[cfg(feature = "EventTarget")] + #[doc = "Change the `relatedTarget` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "relatedTarget")] + pub fn set_related_target(this: &WheelEventInit, val: Option<&EventTarget>); + #[doc = "Get the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "screenX")] + pub fn get_screen_x(this: &WheelEventInit) -> Option; + #[doc = "Change the `screenX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "screenX")] + pub fn set_screen_x(this: &WheelEventInit, val: i32); + #[doc = "Get the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "screenY")] + pub fn get_screen_y(this: &WheelEventInit) -> Option; + #[doc = "Change the `screenY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "screenY")] + pub fn set_screen_y(this: &WheelEventInit, val: i32); + #[doc = "Get the `deltaMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "deltaMode")] + pub fn get_delta_mode(this: &WheelEventInit) -> Option; + #[doc = "Change the `deltaMode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "deltaMode")] + pub fn set_delta_mode(this: &WheelEventInit, val: u32); + #[doc = "Get the `deltaX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "deltaX")] + pub fn get_delta_x(this: &WheelEventInit) -> Option; + #[doc = "Change the `deltaX` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "deltaX")] + pub fn set_delta_x(this: &WheelEventInit, val: f64); + #[doc = "Get the `deltaY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "deltaY")] + pub fn get_delta_y(this: &WheelEventInit) -> Option; + #[doc = "Change the `deltaY` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "deltaY")] + pub fn set_delta_y(this: &WheelEventInit, val: f64); + #[doc = "Get the `deltaZ` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, getter = "deltaZ")] + pub fn get_delta_z(this: &WheelEventInit) -> Option; + #[doc = "Change the `deltaZ` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[wasm_bindgen(method, setter = "deltaZ")] + pub fn set_delta_z(this: &WheelEventInit, val: f64); } impl WheelEventInit { #[doc = "Construct a new `WheelEventInit`."] @@ -19,511 +334,161 @@ impl WheelEventInit { 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: `WheelEventInit`*"] + #[deprecated = "Use `set_bubbles()` instead."] 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.set_bubbles(val); self } - #[doc = "Change the `cancelable` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_cancelable()` instead."] 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.set_cancelable(val); self } - #[doc = "Change the `composed` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_composed()` instead."] 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.set_composed(val); self } - #[doc = "Change the `detail` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_detail()` instead."] pub fn detail(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_detail(val); self } #[cfg(feature = "Window")] - #[doc = "Change the `view` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`, `Window`*"] + #[deprecated = "Use `set_view()` instead."] pub fn view(&mut self, val: Option<&Window>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_view(val); self } - #[doc = "Change the `altKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_alt_key()` instead."] pub fn alt_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_alt_key(val); self } - #[doc = "Change the `ctrlKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_ctrl_key()` instead."] pub fn ctrl_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ctrlKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_ctrl_key(val); self } - #[doc = "Change the `metaKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_meta_key()` instead."] pub fn meta_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("metaKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_meta_key(val); self } - #[doc = "Change the `modifierAltGraph` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_alt_graph()` instead."] pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierAltGraph"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_alt_graph(val); self } - #[doc = "Change the `modifierCapsLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_caps_lock()` instead."] pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierCapsLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_caps_lock(val); self } - #[doc = "Change the `modifierFn` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_fn()` instead."] pub fn modifier_fn(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFn"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn(val); self } - #[doc = "Change the `modifierFnLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_fn_lock()` instead."] pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierFnLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_fn_lock(val); self } - #[doc = "Change the `modifierNumLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_num_lock()` instead."] pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierNumLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_num_lock(val); self } - #[doc = "Change the `modifierOS` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_os()` instead."] pub fn modifier_os(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierOS"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_os(val); self } - #[doc = "Change the `modifierScrollLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_scroll_lock()` instead."] pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierScrollLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_scroll_lock(val); self } - #[doc = "Change the `modifierSymbol` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_symbol()` instead."] pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbol"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol(val); self } - #[doc = "Change the `modifierSymbolLock` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_modifier_symbol_lock()` instead."] pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("modifierSymbolLock"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_modifier_symbol_lock(val); self } - #[doc = "Change the `shiftKey` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_shift_key()` instead."] pub fn shift_key(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("shiftKey"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_shift_key(val); self } - #[doc = "Change the `button` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_button()` instead."] pub fn button(&mut self, val: i16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_button(val); self } - #[doc = "Change the `buttons` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_buttons()` instead."] pub fn buttons(&mut self, val: u16) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("buttons"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_buttons(val); self } - #[doc = "Change the `clientX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_client_x()` instead."] pub fn client_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_x(val); self } - #[doc = "Change the `clientY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_client_y()` instead."] pub fn client_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("clientY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_client_y(val); self } - #[doc = "Change the `movementX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_movement_x()` instead."] pub fn movement_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_movement_x(val); self } - #[doc = "Change the `movementY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_movement_y()` instead."] pub fn movement_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("movementY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_movement_y(val); self } #[cfg(feature = "EventTarget")] - #[doc = "Change the `relatedTarget` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `EventTarget`, `WheelEventInit`*"] + #[deprecated = "Use `set_related_target()` instead."] pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("relatedTarget"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_related_target(val); self } - #[doc = "Change the `screenX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_screen_x()` instead."] pub fn screen_x(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenX"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_x(val); self } - #[doc = "Change the `screenY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_screen_y()` instead."] pub fn screen_y(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("screenY"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_screen_y(val); self } - #[doc = "Change the `deltaMode` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_delta_mode()` instead."] pub fn delta_mode(&mut self, val: u32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("deltaMode"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delta_mode(val); self } - #[doc = "Change the `deltaX` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_delta_x()` instead."] pub fn delta_x(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaX"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delta_x(val); self } - #[doc = "Change the `deltaY` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_delta_y()` instead."] pub fn delta_y(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaY"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delta_y(val); self } - #[doc = "Change the `deltaZ` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"] + #[deprecated = "Use `set_delta_z()` instead."] pub fn delta_z(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaZ"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_delta_z(val); self } } diff --git a/crates/web-sys/src/features/gen_WidevineCdmManifest.rs b/crates/web-sys/src/features/gen_WidevineCdmManifest.rs index cd5e0cdafa8..8283f251227 100644 --- a/crates/web-sys/src/features/gen_WidevineCdmManifest.rs +++ b/crates/web-sys/src/features/gen_WidevineCdmManifest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,76 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] pub type WidevineCdmManifest; + #[doc = "Get the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, getter = "description")] + pub fn get_description(this: &WidevineCdmManifest) -> ::alloc::string::String; + #[doc = "Change the `description` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, setter = "description")] + pub fn set_description(this: &WidevineCdmManifest, val: &str); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &WidevineCdmManifest) -> ::alloc::string::String; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &WidevineCdmManifest, val: &str); + #[doc = "Get the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, getter = "version")] + pub fn get_version(this: &WidevineCdmManifest) -> ::alloc::string::String; + #[doc = "Change the `version` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, setter = "version")] + pub fn set_version(this: &WidevineCdmManifest, val: &str); + #[doc = "Get the `x-cdm-codecs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, getter = "x-cdm-codecs")] + pub fn get_x_cdm_codecs(this: &WidevineCdmManifest) -> ::alloc::string::String; + #[doc = "Change the `x-cdm-codecs` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, setter = "x-cdm-codecs")] + pub fn set_x_cdm_codecs(this: &WidevineCdmManifest, val: &str); + #[doc = "Get the `x-cdm-host-versions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, getter = "x-cdm-host-versions")] + pub fn get_x_cdm_host_versions(this: &WidevineCdmManifest) -> ::alloc::string::String; + #[doc = "Change the `x-cdm-host-versions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, setter = "x-cdm-host-versions")] + pub fn set_x_cdm_host_versions(this: &WidevineCdmManifest, val: &str); + #[doc = "Get the `x-cdm-interface-versions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, getter = "x-cdm-interface-versions")] + pub fn get_x_cdm_interface_versions(this: &WidevineCdmManifest) -> ::alloc::string::String; + #[doc = "Change the `x-cdm-interface-versions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, setter = "x-cdm-interface-versions")] + pub fn set_x_cdm_interface_versions(this: &WidevineCdmManifest, val: &str); + #[doc = "Get the `x-cdm-module-versions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, getter = "x-cdm-module-versions")] + pub fn get_x_cdm_module_versions(this: &WidevineCdmManifest) -> ::alloc::string::String; + #[doc = "Change the `x-cdm-module-versions` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[wasm_bindgen(method, setter = "x-cdm-module-versions")] + pub fn set_x_cdm_module_versions(this: &WidevineCdmManifest, val: &str); } impl WidevineCdmManifest { #[doc = "Construct a new `WidevineCdmManifest`."] @@ -25,128 +96,48 @@ impl WidevineCdmManifest { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.description(description); - ret.name(name); - ret.version(version); - ret.x_cdm_codecs(x_cdm_codecs); - ret.x_cdm_host_versions(x_cdm_host_versions); - ret.x_cdm_interface_versions(x_cdm_interface_versions); - ret.x_cdm_module_versions(x_cdm_module_versions); + ret.set_description(description); + ret.set_name(name); + ret.set_version(version); + ret.set_x_cdm_codecs(x_cdm_codecs); + ret.set_x_cdm_host_versions(x_cdm_host_versions); + ret.set_x_cdm_interface_versions(x_cdm_interface_versions); + ret.set_x_cdm_module_versions(x_cdm_module_versions); ret } - #[doc = "Change the `description` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[deprecated = "Use `set_description()` instead."] pub fn description(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("description"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_description(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } - #[doc = "Change the `version` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[deprecated = "Use `set_version()` instead."] pub fn version(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("version"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_version(val); self } - #[doc = "Change the `x-cdm-codecs` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[deprecated = "Use `set_x_cdm_codecs()` instead."] pub fn x_cdm_codecs(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("x-cdm-codecs"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x_cdm_codecs(val); self } - #[doc = "Change the `x-cdm-host-versions` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[deprecated = "Use `set_x_cdm_host_versions()` instead."] pub fn x_cdm_host_versions(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("x-cdm-host-versions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x_cdm_host_versions(val); self } - #[doc = "Change the `x-cdm-interface-versions` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[deprecated = "Use `set_x_cdm_interface_versions()` instead."] pub fn x_cdm_interface_versions(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("x-cdm-interface-versions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x_cdm_interface_versions(val); self } - #[doc = "Change the `x-cdm-module-versions` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WidevineCdmManifest`*"] + #[deprecated = "Use `set_x_cdm_module_versions()` instead."] pub fn x_cdm_module_versions(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("x-cdm-module-versions"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_x_cdm_module_versions(val); self } } diff --git a/crates/web-sys/src/features/gen_Window.rs b/crates/web-sys/src/features/gen_Window.rs index 5b9a7512f2d..cea28074b37 100644 --- a/crates/web-sys/src/features/gen_Window.rs +++ b/crates/web-sys/src/features/gen_Window.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -39,7 +40,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/name)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn name(this: &Window) -> Result; + pub fn name(this: &Window) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Window" , js_name = name)] #[doc = "Setter for the `name` field of this object."] #[doc = ""] @@ -125,7 +126,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/status)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn status(this: &Window) -> Result; + pub fn status(this: &Window) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , setter , js_class = "Window" , js_name = status)] #[doc = "Setter for the `status` field of this object."] #[doc = ""] @@ -235,6 +236,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Screen`, `Window`*"] pub fn screen(this: &Window) -> Result; + #[cfg(feature = "VisualViewport")] + # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = visualViewport)] + #[doc = "Getter for the `visualViewport` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/visualViewport)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VisualViewport`, `Window`*"] + pub fn visual_viewport(this: &Window) -> Option; # [wasm_bindgen (structural , catch , method , getter , js_class = "Window" , js_name = innerWidth)] #[doc = "Getter for the `innerWidth` field of this object."] #[doc = ""] @@ -354,14 +363,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn device_pixel_ratio(this: &Window) -> f64; - #[cfg(feature = "Performance")] - # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = performance)] - #[doc = "Getter for the `performance` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/performance)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Performance`, `Window`*"] - pub fn performance(this: &Window) -> Option; # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = orientation)] #[doc = "Getter for the `orientation` field of this object."] #[doc = ""] @@ -525,6 +526,20 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn set_onauxclick(this: &Window, value: Option<&::js_sys::Function>); + # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = onbeforetoggle)] + #[doc = "Getter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + pub fn onbeforetoggle(this: &Window) -> Option<::js_sys::Function>; + # [wasm_bindgen (structural , method , setter , js_class = "Window" , js_name = onbeforetoggle)] + #[doc = "Setter for the `onbeforetoggle` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/onbeforetoggle)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + pub fn set_onbeforetoggle(this: &Window, value: Option<&::js_sys::Function>); # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = oncanplay)] #[doc = "Getter for the `oncanplay` field of this object."] #[doc = ""] @@ -1899,6 +1914,50 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn set_onunload(this: &Window, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = ongamepadconnected)] + #[doc = "Getter for the `ongamepadconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepadconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ongamepadconnected(this: &Window) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Window" , js_name = ongamepadconnected)] + #[doc = "Setter for the `ongamepadconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepadconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ongamepadconnected(this: &Window, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = ongamepaddisconnected)] + #[doc = "Getter for the `ongamepaddisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepaddisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn ongamepaddisconnected(this: &Window) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "Window" , js_name = ongamepaddisconnected)] + #[doc = "Setter for the `ongamepaddisconnected` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepaddisconnected)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_ongamepaddisconnected(this: &Window, value: Option<&::js_sys::Function>); #[cfg(feature = "Storage")] # [wasm_bindgen (structural , catch , method , getter , js_class = "Window" , js_name = localStorage)] #[doc = "Getter for the `localStorage` field of this object."] @@ -1907,13 +1966,29 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Storage`, `Window`*"] pub fn local_storage(this: &Window) -> Result, JsValue>; + #[cfg(feature = "IdbFactory")] + # [wasm_bindgen (structural , catch , method , getter , js_class = "Window" , js_name = indexedDB)] + #[doc = "Getter for the `indexedDB` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/indexedDB)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `Window`*"] + pub fn indexed_db(this: &Window) -> Result, JsValue>; + #[cfg(feature = "Performance")] + # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = performance)] + #[doc = "Getter for the `performance` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/performance)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Performance`, `Window`*"] + pub fn performance(this: &Window) -> Option; # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = origin)] #[doc = "Getter for the `origin` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn origin(this: &Window) -> String; + pub fn origin(this: &Window) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = isSecureContext)] #[doc = "Getter for the `isSecureContext` field of this object."] #[doc = ""] @@ -1921,14 +1996,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn is_secure_context(this: &Window) -> bool; - #[cfg(feature = "IdbFactory")] - # [wasm_bindgen (structural , catch , method , getter , js_class = "Window" , js_name = indexedDB)] - #[doc = "Getter for the `indexedDB` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/indexedDB)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `Window`*"] - pub fn indexed_db(this: &Window) -> Result, JsValue>; #[cfg(feature = "CacheStorage")] # [wasm_bindgen (structural , catch , method , getter , js_class = "Window" , js_name = caches)] #[doc = "Getter for the `caches` field of this object."] @@ -1937,6 +2004,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheStorage`, `Window`*"] pub fn caches(this: &Window) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Scheduler")] + # [wasm_bindgen (structural , method , getter , js_class = "Window" , js_name = scheduler)] + #[doc = "Getter for the `scheduler` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/scheduler)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Scheduler`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn scheduler(this: &Window) -> Scheduler; #[cfg(feature = "Storage")] # [wasm_bindgen (structural , catch , method , getter , js_class = "Window" , js_name = sessionStorage)] #[doc = "Getter for the `sessionStorage` field of this object."] @@ -1966,13 +2045,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn blur(this: &Window) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = cancelAnimationFrame)] - #[doc = "The `cancelAnimationFrame()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn cancel_animation_frame(this: &Window, handle: i32) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "Window" , js_name = cancelIdleCallback)] #[doc = "The `cancelIdleCallback()` method."] #[doc = ""] @@ -2141,14 +2213,17 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn prompt(this: &Window) -> Result, JsValue>; + pub fn prompt(this: &Window) -> Result, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = prompt)] #[doc = "The `prompt()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn prompt_with_message(this: &Window, message: &str) -> Result, JsValue>; + pub fn prompt_with_message( + this: &Window, + message: &str, + ) -> Result, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = prompt)] #[doc = "The `prompt()` method."] #[doc = ""] @@ -2159,7 +2234,33 @@ extern "C" { this: &Window, message: &str, default: &str, - ) -> Result, JsValue>; + ) -> Result, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = queryLocalFonts)] + #[doc = "The `queryLocalFonts()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/queryLocalFonts)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn query_local_fonts(this: &Window) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "QueryOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = queryLocalFonts)] + #[doc = "The `queryLocalFonts()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/queryLocalFonts)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueryOptions`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn query_local_fonts_with_options( + this: &Window, + options: &QueryOptions, + ) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (method , structural , js_class = "Window" , js_name = releaseEvents)] #[doc = "The `releaseEvents()` method."] #[doc = ""] @@ -2167,16 +2268,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn release_events(this: &Window); - # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = requestAnimationFrame)] - #[doc = "The `requestAnimationFrame()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn request_animation_frame( - this: &Window, - callback: &::js_sys::Function, - ) -> Result; # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = requestIdleCallback)] #[doc = "The `requestIdleCallback()` method."] #[doc = ""] @@ -2279,6 +2370,84 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ScrollToOptions`, `Window`*"] pub fn scroll_to_with_scroll_to_options(this: &Window, options: &ScrollToOptions); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = showDirectoryPicker)] + #[doc = "The `showDirectoryPicker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn show_directory_picker(this: &Window) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DirectoryPickerOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = showDirectoryPicker)] + #[doc = "The `showDirectoryPicker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn show_directory_picker_with_options( + this: &Window, + options: &DirectoryPickerOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = showOpenFilePicker)] + #[doc = "The `showOpenFilePicker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn show_open_file_picker(this: &Window) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "OpenFilePickerOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = showOpenFilePicker)] + #[doc = "The `showOpenFilePicker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OpenFilePickerOptions`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn show_open_file_picker_with_options( + this: &Window, + options: &OpenFilePickerOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = showSaveFilePicker)] + #[doc = "The `showSaveFilePicker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn show_save_file_picker(this: &Window) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "SaveFilePickerOptions")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = showSaveFilePicker)] + #[doc = "The `showSaveFilePicker()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `SaveFilePickerOptions`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn show_save_file_picker_with_options( + this: &Window, + options: &SaveFilePickerOptions, + ) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = stop)] #[doc = "The `stop()` method."] #[doc = ""] @@ -2287,26 +2456,43 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn stop(this: &Window) -> Result<(), JsValue>; #[wasm_bindgen(method, structural, js_class = "Window", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn get(this: &Window, name: &str) -> Option<::js_sys::Object>; + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = cancelAnimationFrame)] + #[doc = "The `cancelAnimationFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + pub fn cancel_animation_frame(this: &Window, handle: i32) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = requestAnimationFrame)] + #[doc = "The `requestAnimationFrame()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + pub fn request_animation_frame( + this: &Window, + callback: &::js_sys::Function, + ) -> Result; # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = atob)] #[doc = "The `atob()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/atob)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn atob(this: &Window, atob: &str) -> Result; + pub fn atob(this: &Window, atob: &str) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = btoa)] #[doc = "The `btoa()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn btoa(this: &Window, btoa: &str) -> Result; + pub fn btoa(this: &Window, btoa: &str) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (method , structural , js_class = "Window" , js_name = clearInterval)] #[doc = "The `clearInterval()` method."] #[doc = ""] @@ -2346,16 +2532,16 @@ extern "C" { this: &Window, a_image: &HtmlImageElement, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "HtmlVideoElement")] + #[cfg(feature = "SvgImageElement")] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `Window`*"] - pub fn create_image_bitmap_with_html_video_element( + #[doc = "*This API requires the following crate features to be activated: `SvgImageElement`, `Window`*"] + pub fn create_image_bitmap_with_svg_image_element( this: &Window, - a_image: &HtmlVideoElement, + a_image: &SvgImageElement, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "HtmlCanvasElement")] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] @@ -2368,6 +2554,54 @@ extern "C" { this: &Window, a_image: &HtmlCanvasElement, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "HtmlVideoElement")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `Window`*"] + pub fn create_image_bitmap_with_html_video_element( + this: &Window, + a_image: &HtmlVideoElement, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "ImageBitmap")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `Window`*"] + pub fn create_image_bitmap_with_image_bitmap( + this: &Window, + a_image: &ImageBitmap, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `Window`*"] + pub fn create_image_bitmap_with_offscreen_canvas( + this: &Window, + a_image: &OffscreenCanvas, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_image_bitmap_with_video_frame( + this: &Window, + a_image: &VideoFrame, + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] @@ -2390,47 +2624,117 @@ extern "C" { this: &Window, a_image: &ImageData, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "CanvasRenderingContext2d")] + #[cfg(all(feature = "HtmlImageElement", feature = "ImageBitmapOptions",))] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Window`*"] - pub fn create_image_bitmap_with_canvas_rendering_context_2d( + #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_html_image_element_and_image_bitmap_options( this: &Window, - a_image: &CanvasRenderingContext2d, + a_image: &HtmlImageElement, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "ImageBitmap")] + #[cfg(all(feature = "ImageBitmapOptions", feature = "SvgImageElement",))] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `Window`*"] - pub fn create_image_bitmap_with_image_bitmap( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `SvgImageElement`, `Window`*"] + pub fn create_image_bitmap_with_svg_image_element_and_image_bitmap_options( + this: &Window, + a_image: &SvgImageElement, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "HtmlCanvasElement", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_html_canvas_element_and_image_bitmap_options( + this: &Window, + a_image: &HtmlCanvasElement, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "HtmlVideoElement", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_html_video_element_and_image_bitmap_options( + this: &Window, + a_image: &HtmlVideoElement, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmap", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_image_bitmap_and_image_bitmap_options( this: &Window, a_image: &ImageBitmap, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmapOptions", feature = "OffscreenCanvas",))] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn create_image_bitmap_with_buffer_source( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `OffscreenCanvas`, `Window`*"] + pub fn create_image_bitmap_with_offscreen_canvas_and_image_bitmap_options( this: &Window, - a_image: &::js_sys::Object, + a_image: &OffscreenCanvas, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "ImageBitmapOptions", feature = "VideoFrame",))] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn create_image_bitmap_with_u8_array( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `VideoFrame`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_image_bitmap_with_video_frame_and_image_bitmap_options( + this: &Window, + a_image: &VideoFrame, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "Blob", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Blob`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_blob_and_image_bitmap_options( + this: &Window, + a_image: &Blob, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmapOptions", feature = "ImageData",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ImageData`, `Window`*"] + pub fn create_image_bitmap_with_image_data_and_image_bitmap_options( this: &Window, - a_image: &mut [u8], + a_image: &ImageData, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "HtmlImageElement")] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] @@ -2447,16 +2751,16 @@ extern "C" { a_sw: i32, a_sh: i32, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "HtmlVideoElement")] + #[cfg(feature = "SvgImageElement")] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `Window`*"] - pub fn create_image_bitmap_with_html_video_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `SvgImageElement`, `Window`*"] + pub fn create_image_bitmap_with_svg_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh( this: &Window, - a_image: &HtmlVideoElement, + a_image: &SvgImageElement, a_sx: i32, a_sy: i32, a_sw: i32, @@ -2477,6 +2781,70 @@ extern "C" { a_sw: i32, a_sh: i32, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "HtmlVideoElement")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `Window`*"] + pub fn create_image_bitmap_with_html_video_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + this: &Window, + a_image: &HtmlVideoElement, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "ImageBitmap")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `Window`*"] + pub fn create_image_bitmap_with_image_bitmap_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + this: &Window, + a_image: &ImageBitmap, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `Window`*"] + pub fn create_image_bitmap_with_offscreen_canvas_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + this: &Window, + a_image: &OffscreenCanvas, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_image_bitmap_with_video_frame_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + this: &Window, + a_image: &VideoFrame, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] @@ -2507,63 +2875,153 @@ extern "C" { a_sw: i32, a_sh: i32, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "CanvasRenderingContext2d")] + #[cfg(all(feature = "HtmlImageElement", feature = "ImageBitmapOptions",))] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Window`*"] - pub fn create_image_bitmap_with_canvas_rendering_context_2d_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_html_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( this: &Window, - a_image: &CanvasRenderingContext2d, + a_image: &HtmlImageElement, a_sx: i32, a_sy: i32, a_sw: i32, a_sh: i32, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "ImageBitmap")] + #[cfg(all(feature = "ImageBitmapOptions", feature = "SvgImageElement",))] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `Window`*"] - pub fn create_image_bitmap_with_image_bitmap_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `SvgImageElement`, `Window`*"] + pub fn create_image_bitmap_with_svg_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &Window, + a_image: &SvgImageElement, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "HtmlCanvasElement", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_html_canvas_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &Window, + a_image: &HtmlCanvasElement, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "HtmlVideoElement", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_html_video_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &Window, + a_image: &HtmlVideoElement, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmap", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_image_bitmap_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( this: &Window, a_image: &ImageBitmap, a_sx: i32, a_sy: i32, a_sw: i32, a_sh: i32, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmapOptions", feature = "OffscreenCanvas",))] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn create_image_bitmap_with_buffer_source_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `OffscreenCanvas`, `Window`*"] + pub fn create_image_bitmap_with_offscreen_canvas_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( this: &Window, - a_image: &::js_sys::Object, + a_image: &OffscreenCanvas, a_sx: i32, a_sy: i32, a_sw: i32, a_sh: i32, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "ImageBitmapOptions", feature = "VideoFrame",))] # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Window`*"] - pub fn create_image_bitmap_with_u8_array_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `VideoFrame`, `Window`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_image_bitmap_with_video_frame_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( this: &Window, - a_image: &mut [u8], + a_image: &VideoFrame, a_sx: i32, a_sy: i32, a_sw: i32, a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "Blob", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Blob`, `ImageBitmapOptions`, `Window`*"] + pub fn create_image_bitmap_with_blob_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &Window, + a_image: &Blob, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmapOptions", feature = "ImageData",))] + # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ImageData`, `Window`*"] + pub fn create_image_bitmap_with_image_data_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &Window, + a_image: &ImageData, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "Request")] # [wasm_bindgen (method , structural , js_class = "Window" , js_name = fetch)] @@ -2604,6 +3062,13 @@ extern "C" { input: &str, init: &RequestInit, ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "Window" , js_name = queueMicrotask)] + #[doc = "The `queueMicrotask()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/queueMicrotask)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Window`*"] + pub fn queue_microtask(this: &Window, callback: &::js_sys::Function); # [wasm_bindgen (catch , method , structural , js_class = "Window" , js_name = setInterval)] #[doc = "The `setInterval()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_WindowClient.rs b/crates/web-sys/src/features/gen_WindowClient.rs index 883de35ed5a..7aa5de8d9a2 100644 --- a/crates/web-sys/src/features/gen_WindowClient.rs +++ b/crates/web-sys/src/features/gen_WindowClient.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_Worker.rs b/crates/web-sys/src/features/gen_Worker.rs index ba9139f7023..70b2266aaae 100644 --- a/crates/web-sys/src/features/gen_Worker.rs +++ b/crates/web-sys/src/features/gen_Worker.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WorkerDebuggerGlobalScope.rs b/crates/web-sys/src/features/gen_WorkerDebuggerGlobalScope.rs index e2bd8ee54dc..8239c904fc6 100644 --- a/crates/web-sys/src/features/gen_WorkerDebuggerGlobalScope.rs +++ b/crates/web-sys/src/features/gen_WorkerDebuggerGlobalScope.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WorkerGlobalScope.rs b/crates/web-sys/src/features/gen_WorkerGlobalScope.rs index 3f51a6d0cf9..27ce448e7f7 100644 --- a/crates/web-sys/src/features/gen_WorkerGlobalScope.rs +++ b/crates/web-sys/src/features/gen_WorkerGlobalScope.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -84,13 +85,29 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Crypto`, `WorkerGlobalScope`*"] pub fn crypto(this: &WorkerGlobalScope) -> Result; + #[cfg(feature = "IdbFactory")] + # [wasm_bindgen (structural , catch , method , getter , js_class = "WorkerGlobalScope" , js_name = indexedDB)] + #[doc = "Getter for the `indexedDB` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/indexedDB)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `WorkerGlobalScope`*"] + pub fn indexed_db(this: &WorkerGlobalScope) -> Result, JsValue>; + #[cfg(feature = "Performance")] + # [wasm_bindgen (structural , method , getter , js_class = "WorkerGlobalScope" , js_name = performance)] + #[doc = "Getter for the `performance` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/performance)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Performance`, `WorkerGlobalScope`*"] + pub fn performance(this: &WorkerGlobalScope) -> Option; # [wasm_bindgen (structural , method , getter , js_class = "WorkerGlobalScope" , js_name = origin)] #[doc = "Getter for the `origin` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] - pub fn origin(this: &WorkerGlobalScope) -> String; + pub fn origin(this: &WorkerGlobalScope) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerGlobalScope" , js_name = isSecureContext)] #[doc = "Getter for the `isSecureContext` field of this object."] #[doc = ""] @@ -98,14 +115,6 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] pub fn is_secure_context(this: &WorkerGlobalScope) -> bool; - #[cfg(feature = "IdbFactory")] - # [wasm_bindgen (structural , catch , method , getter , js_class = "WorkerGlobalScope" , js_name = indexedDB)] - #[doc = "Getter for the `indexedDB` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/indexedDB)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `IdbFactory`, `WorkerGlobalScope`*"] - pub fn indexed_db(this: &WorkerGlobalScope) -> Result, JsValue>; #[cfg(feature = "CacheStorage")] # [wasm_bindgen (structural , catch , method , getter , js_class = "WorkerGlobalScope" , js_name = caches)] #[doc = "Getter for the `caches` field of this object."] @@ -114,6 +123,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CacheStorage`, `WorkerGlobalScope`*"] pub fn caches(this: &WorkerGlobalScope) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Scheduler")] + # [wasm_bindgen (structural , method , getter , js_class = "WorkerGlobalScope" , js_name = scheduler)] + #[doc = "Getter for the `scheduler` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/scheduler)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Scheduler`, `WorkerGlobalScope`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn scheduler(this: &WorkerGlobalScope) -> Scheduler; # [wasm_bindgen (catch , method , structural , variadic , js_class = "WorkerGlobalScope" , js_name = importScripts)] #[doc = "The `importScripts()` method."] #[doc = ""] @@ -222,14 +243,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/atob)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] - pub fn atob(this: &WorkerGlobalScope, atob: &str) -> Result; + pub fn atob(this: &WorkerGlobalScope, atob: &str) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = btoa)] #[doc = "The `btoa()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/btoa)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] - pub fn btoa(this: &WorkerGlobalScope, btoa: &str) -> Result; + pub fn btoa(this: &WorkerGlobalScope, btoa: &str) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (method , structural , js_class = "WorkerGlobalScope" , js_name = clearInterval)] #[doc = "The `clearInterval()` method."] #[doc = ""] @@ -269,16 +290,16 @@ extern "C" { this: &WorkerGlobalScope, a_image: &HtmlImageElement, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "HtmlVideoElement")] + #[cfg(feature = "SvgImageElement")] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_html_video_element( + #[doc = "*This API requires the following crate features to be activated: `SvgImageElement`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_svg_image_element( this: &WorkerGlobalScope, - a_image: &HtmlVideoElement, + a_image: &SvgImageElement, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "HtmlCanvasElement")] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] @@ -291,6 +312,54 @@ extern "C" { this: &WorkerGlobalScope, a_image: &HtmlCanvasElement, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "HtmlVideoElement")] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_html_video_element( + this: &WorkerGlobalScope, + a_image: &HtmlVideoElement, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "ImageBitmap")] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_image_bitmap( + this: &WorkerGlobalScope, + a_image: &ImageBitmap, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_offscreen_canvas( + this: &WorkerGlobalScope, + a_image: &OffscreenCanvas, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WorkerGlobalScope`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_image_bitmap_with_video_frame( + this: &WorkerGlobalScope, + a_image: &VideoFrame, + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] @@ -313,47 +382,117 @@ extern "C" { this: &WorkerGlobalScope, a_image: &ImageData, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "CanvasRenderingContext2d")] + #[cfg(all(feature = "HtmlImageElement", feature = "ImageBitmapOptions",))] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_canvas_rendering_context_2d( + #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_html_image_element_and_image_bitmap_options( this: &WorkerGlobalScope, - a_image: &CanvasRenderingContext2d, + a_image: &HtmlImageElement, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "ImageBitmap")] + #[cfg(all(feature = "ImageBitmapOptions", feature = "SvgImageElement",))] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_image_bitmap( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `SvgImageElement`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_svg_image_element_and_image_bitmap_options( + this: &WorkerGlobalScope, + a_image: &SvgImageElement, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "HtmlCanvasElement", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_html_canvas_element_and_image_bitmap_options( + this: &WorkerGlobalScope, + a_image: &HtmlCanvasElement, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "HtmlVideoElement", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_html_video_element_and_image_bitmap_options( + this: &WorkerGlobalScope, + a_image: &HtmlVideoElement, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmap", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_image_bitmap_and_image_bitmap_options( this: &WorkerGlobalScope, a_image: &ImageBitmap, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmapOptions", feature = "OffscreenCanvas",))] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_buffer_source( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `OffscreenCanvas`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_offscreen_canvas_and_image_bitmap_options( this: &WorkerGlobalScope, - a_image: &::js_sys::Object, + a_image: &OffscreenCanvas, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "ImageBitmapOptions", feature = "VideoFrame",))] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_u8_array( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `VideoFrame`, `WorkerGlobalScope`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_image_bitmap_with_video_frame_and_image_bitmap_options( this: &WorkerGlobalScope, - a_image: &mut [u8], + a_image: &VideoFrame, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "Blob", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Blob`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_blob_and_image_bitmap_options( + this: &WorkerGlobalScope, + a_image: &Blob, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmapOptions", feature = "ImageData",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ImageData`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_image_data_and_image_bitmap_options( + this: &WorkerGlobalScope, + a_image: &ImageData, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "HtmlImageElement")] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] @@ -370,16 +509,16 @@ extern "C" { a_sw: i32, a_sh: i32, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "HtmlVideoElement")] + #[cfg(feature = "SvgImageElement")] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_html_video_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `SvgImageElement`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_svg_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh( this: &WorkerGlobalScope, - a_image: &HtmlVideoElement, + a_image: &SvgImageElement, a_sx: i32, a_sy: i32, a_sw: i32, @@ -400,6 +539,70 @@ extern "C" { a_sw: i32, a_sh: i32, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "HtmlVideoElement")] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_html_video_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + this: &WorkerGlobalScope, + a_image: &HtmlVideoElement, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "ImageBitmap")] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_image_bitmap_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + this: &WorkerGlobalScope, + a_image: &ImageBitmap, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(feature = "OffscreenCanvas")] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `OffscreenCanvas`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_offscreen_canvas_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + this: &WorkerGlobalScope, + a_image: &OffscreenCanvas, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "VideoFrame")] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `VideoFrame`, `WorkerGlobalScope`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_image_bitmap_with_video_frame_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + this: &WorkerGlobalScope, + a_image: &VideoFrame, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "Blob")] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] @@ -430,63 +633,153 @@ extern "C" { a_sw: i32, a_sh: i32, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "CanvasRenderingContext2d")] + #[cfg(all(feature = "HtmlImageElement", feature = "ImageBitmapOptions",))] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_canvas_rendering_context_2d_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `HtmlImageElement`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_html_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( this: &WorkerGlobalScope, - a_image: &CanvasRenderingContext2d, + a_image: &HtmlImageElement, a_sx: i32, a_sy: i32, a_sw: i32, a_sh: i32, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; - #[cfg(feature = "ImageBitmap")] + #[cfg(all(feature = "ImageBitmapOptions", feature = "SvgImageElement",))] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_image_bitmap_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `SvgImageElement`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_svg_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &WorkerGlobalScope, + a_image: &SvgImageElement, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "HtmlCanvasElement", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlCanvasElement`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_html_canvas_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &WorkerGlobalScope, + a_image: &HtmlCanvasElement, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "HtmlVideoElement", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlVideoElement`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_html_video_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &WorkerGlobalScope, + a_image: &HtmlVideoElement, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmap", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_image_bitmap_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( this: &WorkerGlobalScope, a_image: &ImageBitmap, a_sx: i32, a_sy: i32, a_sw: i32, a_sh: i32, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmapOptions", feature = "OffscreenCanvas",))] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_buffer_source_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `OffscreenCanvas`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_offscreen_canvas_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( this: &WorkerGlobalScope, - a_image: &::js_sys::Object, + a_image: &OffscreenCanvas, a_sx: i32, a_sy: i32, a_sw: i32, a_sh: i32, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "ImageBitmapOptions", feature = "VideoFrame",))] # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] #[doc = "The `createImageBitmap()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] - pub fn create_image_bitmap_with_u8_array_and_a_sx_and_a_sy_and_a_sw_and_a_sh( + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `VideoFrame`, `WorkerGlobalScope`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn create_image_bitmap_with_video_frame_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( this: &WorkerGlobalScope, - a_image: &mut [u8], + a_image: &VideoFrame, a_sx: i32, a_sy: i32, a_sw: i32, a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "Blob", feature = "ImageBitmapOptions",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Blob`, `ImageBitmapOptions`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_blob_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &WorkerGlobalScope, + a_image: &Blob, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, + ) -> Result<::js_sys::Promise, JsValue>; + #[cfg(all(feature = "ImageBitmapOptions", feature = "ImageData",))] + # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = createImageBitmap)] + #[doc = "The `createImageBitmap()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/createImageBitmap)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ImageBitmapOptions`, `ImageData`, `WorkerGlobalScope`*"] + pub fn create_image_bitmap_with_image_data_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options( + this: &WorkerGlobalScope, + a_image: &ImageData, + a_sx: i32, + a_sy: i32, + a_sw: i32, + a_sh: i32, + a_options: &ImageBitmapOptions, ) -> Result<::js_sys::Promise, JsValue>; #[cfg(feature = "Request")] # [wasm_bindgen (method , structural , js_class = "WorkerGlobalScope" , js_name = fetch)] @@ -527,6 +820,13 @@ extern "C" { input: &str, init: &RequestInit, ) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "WorkerGlobalScope" , js_name = queueMicrotask)] + #[doc = "The `queueMicrotask()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/queueMicrotask)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WorkerGlobalScope`*"] + pub fn queue_microtask(this: &WorkerGlobalScope, callback: &::js_sys::Function); # [wasm_bindgen (catch , method , structural , js_class = "WorkerGlobalScope" , js_name = setInterval)] #[doc = "The `setInterval()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_WorkerLocation.rs b/crates/web-sys/src/features/gen_WorkerLocation.rs index 643fd1d3671..2bd6a64a799 100644 --- a/crates/web-sys/src/features/gen_WorkerLocation.rs +++ b/crates/web-sys/src/features/gen_WorkerLocation.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -17,61 +18,61 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/href)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn href(this: &WorkerLocation) -> String; + pub fn href(this: &WorkerLocation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerLocation" , js_name = origin)] #[doc = "Getter for the `origin` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/origin)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn origin(this: &WorkerLocation) -> String; + pub fn origin(this: &WorkerLocation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerLocation" , js_name = protocol)] #[doc = "Getter for the `protocol` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/protocol)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn protocol(this: &WorkerLocation) -> String; + pub fn protocol(this: &WorkerLocation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerLocation" , js_name = host)] #[doc = "Getter for the `host` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/host)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn host(this: &WorkerLocation) -> String; + pub fn host(this: &WorkerLocation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerLocation" , js_name = hostname)] #[doc = "Getter for the `hostname` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/hostname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn hostname(this: &WorkerLocation) -> String; + pub fn hostname(this: &WorkerLocation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerLocation" , 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/WorkerLocation/port)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn port(this: &WorkerLocation) -> String; + pub fn port(this: &WorkerLocation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerLocation" , js_name = pathname)] #[doc = "Getter for the `pathname` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/pathname)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn pathname(this: &WorkerLocation) -> String; + pub fn pathname(this: &WorkerLocation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerLocation" , js_name = search)] #[doc = "Getter for the `search` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/search)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn search(this: &WorkerLocation) -> String; + pub fn search(this: &WorkerLocation) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerLocation" , js_name = hash)] #[doc = "Getter for the `hash` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/hash)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerLocation`*"] - pub fn hash(this: &WorkerLocation) -> String; + pub fn hash(this: &WorkerLocation) -> ::alloc::string::String; } diff --git a/crates/web-sys/src/features/gen_WorkerNavigator.rs b/crates/web-sys/src/features/gen_WorkerNavigator.rs index 09e987ea016..45c5d17f898 100644 --- a/crates/web-sys/src/features/gen_WorkerNavigator.rs +++ b/crates/web-sys/src/features/gen_WorkerNavigator.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -28,6 +29,18 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `MediaCapabilities`, `WorkerNavigator`*"] pub fn media_capabilities(this: &WorkerNavigator) -> MediaCapabilities; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Serial")] + # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = serial)] + #[doc = "Getter for the `serial` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/serial)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Serial`, `WorkerNavigator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn serial(this: &WorkerNavigator) -> Serial; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Usb")] # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = usb)] #[doc = "Getter for the `usb` field of this object."] @@ -47,6 +60,17 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] pub fn hardware_concurrency(this: &WorkerNavigator) -> f64; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = deviceMemory)] + #[doc = "Getter for the `deviceMemory` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/deviceMemory)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn device_memory(this: &WorkerNavigator) -> f64; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "Gpu")] # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = gpu)] #[doc = "Getter for the `gpu` field of this object."] @@ -64,49 +88,49 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/appCodeName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] - pub fn app_code_name(this: &WorkerNavigator) -> Result; + pub fn app_code_name(this: &WorkerNavigator) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = appName)] #[doc = "Getter for the `appName` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/appName)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] - pub fn app_name(this: &WorkerNavigator) -> String; + pub fn app_name(this: &WorkerNavigator) -> ::alloc::string::String; # [wasm_bindgen (structural , catch , method , getter , js_class = "WorkerNavigator" , js_name = appVersion)] #[doc = "Getter for the `appVersion` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/appVersion)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] - pub fn app_version(this: &WorkerNavigator) -> Result; + pub fn app_version(this: &WorkerNavigator) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "WorkerNavigator" , js_name = platform)] #[doc = "Getter for the `platform` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/platform)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] - pub fn platform(this: &WorkerNavigator) -> Result; + pub fn platform(this: &WorkerNavigator) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "WorkerNavigator" , js_name = userAgent)] #[doc = "Getter for the `userAgent` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/userAgent)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] - pub fn user_agent(this: &WorkerNavigator) -> Result; + pub fn user_agent(this: &WorkerNavigator) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = product)] #[doc = "Getter for the `product` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/product)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] - pub fn product(this: &WorkerNavigator) -> String; + pub fn product(this: &WorkerNavigator) -> ::alloc::string::String; # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , 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/WorkerNavigator/language)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] - pub fn language(this: &WorkerNavigator) -> Option; + pub fn language(this: &WorkerNavigator) -> Option<::alloc::string::String>; # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = languages)] #[doc = "Getter for the `languages` field of this object."] #[doc = ""] @@ -114,6 +138,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerNavigator`*"] pub fn languages(this: &WorkerNavigator) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "LockManager")] + # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = locks)] + #[doc = "Getter for the `locks` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/locks)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `LockManager`, `WorkerNavigator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn locks(this: &WorkerNavigator) -> LockManager; # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = onLine)] #[doc = "Getter for the `onLine` field of this object."] #[doc = ""] @@ -129,6 +165,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `StorageManager`, `WorkerNavigator`*"] pub fn storage(this: &WorkerNavigator) -> StorageManager; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "NavigatorUaData")] + # [wasm_bindgen (structural , method , getter , js_class = "WorkerNavigator" , js_name = userAgentData)] + #[doc = "Getter for the `userAgentData` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/userAgentData)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `NavigatorUaData`, `WorkerNavigator`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn user_agent_data(this: &WorkerNavigator) -> NavigatorUaData; # [wasm_bindgen (method , structural , js_class = "WorkerNavigator" , js_name = taintEnabled)] #[doc = "The `taintEnabled()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_WorkerOptions.rs b/crates/web-sys/src/features/gen_WorkerOptions.rs index b4e6791454f..f21c37085d8 100644 --- a/crates/web-sys/src/features/gen_WorkerOptions.rs +++ b/crates/web-sys/src/features/gen_WorkerOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,40 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`*"] pub type WorkerOptions; + #[cfg(feature = "RequestCredentials")] + #[doc = "Get the `credentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkerOptions`*"] + #[wasm_bindgen(method, getter = "credentials")] + pub fn get_credentials(this: &WorkerOptions) -> Option; + #[cfg(feature = "RequestCredentials")] + #[doc = "Change the `credentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkerOptions`*"] + #[wasm_bindgen(method, setter = "credentials")] + pub fn set_credentials(this: &WorkerOptions, val: RequestCredentials); + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &WorkerOptions) -> Option<::alloc::string::String>; + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &WorkerOptions, val: &str); + #[cfg(feature = "WorkerType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`, `WorkerType`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &WorkerOptions) -> Option; + #[cfg(feature = "WorkerType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`, `WorkerType`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &WorkerOptions, val: WorkerType); } impl WorkerOptions { #[doc = "Construct a new `WorkerOptions`."] @@ -20,48 +55,20 @@ impl WorkerOptions { ret } #[cfg(feature = "RequestCredentials")] - #[doc = "Change the `credentials` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkerOptions`*"] + #[deprecated = "Use `set_credentials()` instead."] pub fn credentials(&mut self, val: RequestCredentials) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_credentials(val); self } - #[doc = "Change the `name` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`*"] + #[deprecated = "Use `set_name()` instead."] 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.set_name(val); self } #[cfg(feature = "WorkerType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WorkerOptions`, `WorkerType`*"] + #[deprecated = "Use `set_type()` instead."] pub fn type_(&mut self, val: WorkerType) -> &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.set_type(val); self } } diff --git a/crates/web-sys/src/features/gen_WorkerType.rs b/crates/web-sys/src/features/gen_WorkerType.rs index 3ae50015616..d67706b41cb 100644 --- a/crates/web-sys/src/features/gen_WorkerType.rs +++ b/crates/web-sys/src/features/gen_WorkerType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `WorkerType` enum."] diff --git a/crates/web-sys/src/features/gen_Worklet.rs b/crates/web-sys/src/features/gen_Worklet.rs index fec6b6dcc05..3c4ce39f866 100644 --- a/crates/web-sys/src/features/gen_Worklet.rs +++ b/crates/web-sys/src/features/gen_Worklet.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WorkletGlobalScope.rs b/crates/web-sys/src/features/gen_WorkletGlobalScope.rs index 26931699c8e..d37c4607a6f 100644 --- a/crates/web-sys/src/features/gen_WorkletGlobalScope.rs +++ b/crates/web-sys/src/features/gen_WorkletGlobalScope.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_WorkletOptions.rs b/crates/web-sys/src/features/gen_WorkletOptions.rs index d14e13b7acf..07089ac8d49 100644 --- a/crates/web-sys/src/features/gen_WorkletOptions.rs +++ b/crates/web-sys/src/features/gen_WorkletOptions.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WorkletOptions`*"] pub type WorkletOptions; + #[cfg(feature = "RequestCredentials")] + #[doc = "Get the `credentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkletOptions`*"] + #[wasm_bindgen(method, getter = "credentials")] + pub fn get_credentials(this: &WorkletOptions) -> Option; + #[cfg(feature = "RequestCredentials")] + #[doc = "Change the `credentials` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkletOptions`*"] + #[wasm_bindgen(method, setter = "credentials")] + pub fn set_credentials(this: &WorkletOptions, val: RequestCredentials); } impl WorkletOptions { #[doc = "Construct a new `WorkletOptions`."] @@ -20,21 +33,9 @@ impl WorkletOptions { ret } #[cfg(feature = "RequestCredentials")] - #[doc = "Change the `credentials` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`, `WorkletOptions`*"] + #[deprecated = "Use `set_credentials()` instead."] pub fn credentials(&mut self, val: RequestCredentials) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("credentials"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_credentials(val); self } } diff --git a/crates/web-sys/src/features/gen_WritableStream.rs b/crates/web-sys/src/features/gen_WritableStream.rs index 7f9ed141e58..f4943b466c5 100644 --- a/crates/web-sys/src/features/gen_WritableStream.rs +++ b/crates/web-sys/src/features/gen_WritableStream.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStream , typescript_type = "WritableStream")] @@ -11,46 +11,30 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStream; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStream" , js_name = locked)] #[doc = "Getter for the `locked` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/locked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn locked(this: &WritableStream) -> bool; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new() -> Result; - #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_underlying_sink( underlying_sink: &::js_sys::Object, ) -> Result; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "QueuingStrategy")] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."] @@ -58,59 +42,40 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new_with_underlying_sink_and_strategy( underlying_sink: &::js_sys::Object, strategy: &QueuingStrategy, ) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStream, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStreamDefaultWriter")] - # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = getWriter)] + # [wasm_bindgen (catch , method , structural , js_class = "WritableStream" , js_name = getWriter)] #[doc = "The `getWriter()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/getWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_writer(this: &WritableStream) -> WritableStreamDefaultWriter; + pub fn get_writer(this: &WritableStream) -> Result; } diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs new file mode 100644 index 00000000000..25d26faaf9e --- /dev/null +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs @@ -0,0 +1,37 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultController , typescript_type = "WritableStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WritableStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub type WritableStreamDefaultController; + #[cfg(feature = "AbortSignal")] + # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultController" , 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/WritableStreamDefaultController/signal)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WritableStreamDefaultController`*"] + pub fn signal(this: &WritableStreamDefaultController) -> AbortSignal; + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub fn error(this: &WritableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub fn error_with_e(this: &WritableStreamDefaultController, e: &::wasm_bindgen::JsValue); +} diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs index 1ba5bd8b6ce..536b935a4d9 100644 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultWriter , typescript_type = "WritableStreamDefaultWriter")] @@ -11,44 +11,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStreamDefaultWriter; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] + # [wasm_bindgen (structural , catch , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] #[doc = "Getter for the `desiredSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/desiredSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn desired_size(this: &WritableStreamDefaultWriter) -> Option; - #[cfg(web_sys_unstable_apis)] + pub fn desired_size(this: &WritableStreamDefaultWriter) -> Result, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , 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/WritableStreamDefaultWriter/ready)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn ready(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[wasm_bindgen(catch, constructor, js_class = "WritableStreamDefaultWriter")] #[doc = "The `new WritableStreamDefaultWriter(..)` constructor, creating a new instance of `WritableStreamDefaultWriter`."] @@ -56,78 +40,51 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &WritableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStreamDefaultWriter, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &WritableStreamDefaultWriter); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_chunk( this: &WritableStreamDefaultWriter, chunk: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_WriteCommandType.rs b/crates/web-sys/src/features/gen_WriteCommandType.rs new file mode 100644 index 00000000000..eb962259d79 --- /dev/null +++ b/crates/web-sys/src/features/gen_WriteCommandType.rs @@ -0,0 +1,13 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `WriteCommandType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `WriteCommandType`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum WriteCommandType { + Write = "write", + Seek = "seek", + Truncate = "truncate", +} diff --git a/crates/web-sys/src/features/gen_WriteParams.rs b/crates/web-sys/src/features/gen_WriteParams.rs new file mode 100644 index 00000000000..2a22546459c --- /dev/null +++ b/crates/web-sys/src/features/gen_WriteParams.rs @@ -0,0 +1,88 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WriteParams)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WriteParams` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] + pub type WriteParams; + #[doc = "Get the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] + #[wasm_bindgen(method, getter = "data")] + pub fn get_data(this: &WriteParams) -> ::wasm_bindgen::JsValue; + #[doc = "Change the `data` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] + #[wasm_bindgen(method, setter = "data")] + pub fn set_data(this: &WriteParams, val: &::wasm_bindgen::JsValue); + #[doc = "Get the `position` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] + #[wasm_bindgen(method, getter = "position")] + pub fn get_position(this: &WriteParams) -> Option; + #[doc = "Change the `position` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] + #[wasm_bindgen(method, setter = "position")] + pub fn set_position(this: &WriteParams, val: Option); + #[doc = "Get the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] + #[wasm_bindgen(method, getter = "size")] + pub fn get_size(this: &WriteParams) -> Option; + #[doc = "Change the `size` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteParams`*"] + #[wasm_bindgen(method, setter = "size")] + pub fn set_size(this: &WriteParams, val: Option); + #[cfg(feature = "WriteCommandType")] + #[doc = "Get the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"] + #[wasm_bindgen(method, getter = "type")] + pub fn get_type(this: &WriteParams) -> WriteCommandType; + #[cfg(feature = "WriteCommandType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"] + #[wasm_bindgen(method, setter = "type")] + pub fn set_type(this: &WriteParams, val: WriteCommandType); +} +impl WriteParams { + #[cfg(feature = "WriteCommandType")] + #[doc = "Construct a new `WriteParams`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`, `WriteParams`*"] + pub fn new(type_: WriteCommandType) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_type(type_); + ret + } + #[deprecated = "Use `set_data()` instead."] + pub fn data(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { + self.set_data(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); + self + } + #[deprecated = "Use `set_position()` instead."] + pub fn position(&mut self, val: Option) -> &mut Self { + self.set_position(val); + self + } + #[deprecated = "Use `set_size()` instead."] + pub fn size(&mut self, val: Option) -> &mut Self { + self.set_size(val); + self + } + #[cfg(feature = "WriteCommandType")] + #[deprecated = "Use `set_type()` instead."] + pub fn type_(&mut self, val: WriteCommandType) -> &mut Self { + self.set_type(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_XPathExpression.rs b/crates/web-sys/src/features/gen_XPathExpression.rs index 6a09c700a7c..c7c3626e84c 100644 --- a/crates/web-sys/src/features/gen_XPathExpression.rs +++ b/crates/web-sys/src/features/gen_XPathExpression.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XPathNsResolver.rs b/crates/web-sys/src/features/gen_XPathNsResolver.rs index 7420828774a..d158b05ac1c 100644 --- a/crates/web-sys/src/features/gen_XPathNsResolver.rs +++ b/crates/web-sys/src/features/gen_XPathNsResolver.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -9,6 +10,16 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XPathNsResolver`*"] pub type XPathNsResolver; + #[doc = "Get the `lookupNamespaceURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XPathNsResolver`*"] + #[wasm_bindgen(method, getter = "lookupNamespaceURI")] + pub fn get_lookup_namespace_uri(this: &XPathNsResolver) -> Option<::js_sys::Function>; + #[doc = "Change the `lookupNamespaceURI` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XPathNsResolver`*"] + #[wasm_bindgen(method, setter = "lookupNamespaceURI")] + pub fn set_lookup_namespace_uri(this: &XPathNsResolver, val: &::js_sys::Function); } impl XPathNsResolver { #[doc = "Construct a new `XPathNsResolver`."] @@ -19,21 +30,9 @@ impl XPathNsResolver { let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); ret } - #[doc = "Change the `lookupNamespaceURI` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `XPathNsResolver`*"] + #[deprecated = "Use `set_lookup_namespace_uri()` instead."] pub fn lookup_namespace_uri(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("lookupNamespaceURI"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_lookup_namespace_uri(val); self } } diff --git a/crates/web-sys/src/features/gen_XPathResult.rs b/crates/web-sys/src/features/gen_XPathResult.rs index a006a893d73..7a99a0e67c7 100644 --- a/crates/web-sys/src/features/gen_XPathResult.rs +++ b/crates/web-sys/src/features/gen_XPathResult.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -31,7 +32,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XPathResult/stringValue)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XPathResult`*"] - pub fn string_value(this: &XPathResult) -> Result; + pub fn string_value(this: &XPathResult) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (structural , catch , method , getter , js_class = "XPathResult" , js_name = booleanValue)] #[doc = "Getter for the `booleanValue` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_XmlDocument.rs b/crates/web-sys/src/features/gen_XmlDocument.rs index d1f2c85859c..572ab059620 100644 --- a/crates/web-sys/src/features/gen_XmlDocument.rs +++ b/crates/web-sys/src/features/gen_XmlDocument.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XmlHttpRequest.rs b/crates/web-sys/src/features/gen_XmlHttpRequest.rs index 06522f888cd..7f8b207dbae 100644 --- a/crates/web-sys/src/features/gen_XmlHttpRequest.rs +++ b/crates/web-sys/src/features/gen_XmlHttpRequest.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -74,7 +75,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"] - pub fn response_url(this: &XmlHttpRequest) -> String; + pub fn response_url(this: &XmlHttpRequest) -> ::alloc::string::String; # [wasm_bindgen (structural , catch , method , getter , js_class = "XMLHttpRequest" , js_name = status)] #[doc = "Getter for the `status` field of this object."] #[doc = ""] @@ -88,7 +89,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/statusText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"] - pub fn status_text(this: &XmlHttpRequest) -> Result; + pub fn status_text(this: &XmlHttpRequest) -> Result<::alloc::string::String, JsValue>; #[cfg(feature = "XmlHttpRequestResponseType")] # [wasm_bindgen (structural , method , getter , js_class = "XMLHttpRequest" , js_name = responseType)] #[doc = "Getter for the `responseType` field of this object."] @@ -118,7 +119,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseText)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"] - pub fn response_text(this: &XmlHttpRequest) -> Result, JsValue>; + pub fn response_text(this: &XmlHttpRequest) + -> Result, JsValue>; #[cfg(feature = "Document")] # [wasm_bindgen (structural , catch , method , getter , js_class = "XMLHttpRequest" , js_name = responseXML)] #[doc = "Getter for the `responseXML` field of this object."] @@ -154,7 +156,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"] - pub fn get_all_response_headers(this: &XmlHttpRequest) -> Result; + pub fn get_all_response_headers( + this: &XmlHttpRequest, + ) -> Result<::alloc::string::String, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = getResponseHeader)] #[doc = "The `getResponseHeader()` method."] #[doc = ""] @@ -164,7 +168,7 @@ extern "C" { pub fn get_response_header( this: &XmlHttpRequest, header: &str, - ) -> Result, JsValue>; + ) -> Result, JsValue>; # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = open)] #[doc = "The `open()` method."] #[doc = ""] @@ -264,6 +268,16 @@ extern "C" { this: &XmlHttpRequest, body: Option<&[u8]>, ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)] + #[doc = "The `send()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XmlHttpRequest`*"] + pub fn send_with_opt_js_u8_array( + this: &XmlHttpRequest, + body: Option<&::js_sys::Uint8Array>, + ) -> Result<(), JsValue>; #[cfg(feature = "FormData")] # [wasm_bindgen (catch , method , structural , js_class = "XMLHttpRequest" , js_name = send)] #[doc = "The `send()` method."] diff --git a/crates/web-sys/src/features/gen_XmlHttpRequestEventTarget.rs b/crates/web-sys/src/features/gen_XmlHttpRequestEventTarget.rs index f4e90fd6ce8..0ad1ae1a10e 100644 --- a/crates/web-sys/src/features/gen_XmlHttpRequestEventTarget.rs +++ b/crates/web-sys/src/features/gen_XmlHttpRequestEventTarget.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XmlHttpRequestResponseType.rs b/crates/web-sys/src/features/gen_XmlHttpRequestResponseType.rs index 8144e3e072c..f1c4feb6d1e 100644 --- a/crates/web-sys/src/features/gen_XmlHttpRequestResponseType.rs +++ b/crates/web-sys/src/features/gen_XmlHttpRequestResponseType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `XmlHttpRequestResponseType` enum."] diff --git a/crates/web-sys/src/features/gen_XmlHttpRequestUpload.rs b/crates/web-sys/src/features/gen_XmlHttpRequestUpload.rs index d21af9af460..efea1f71e9a 100644 --- a/crates/web-sys/src/features/gen_XmlHttpRequestUpload.rs +++ b/crates/web-sys/src/features/gen_XmlHttpRequestUpload.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XmlSerializer.rs b/crates/web-sys/src/features/gen_XmlSerializer.rs index 8243e969624..af075d62688 100644 --- a/crates/web-sys/src/features/gen_XmlSerializer.rs +++ b/crates/web-sys/src/features/gen_XmlSerializer.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -25,5 +26,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer/serializeToString)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `Node`, `XmlSerializer`*"] - pub fn serialize_to_string(this: &XmlSerializer, root: &Node) -> Result; + pub fn serialize_to_string( + this: &XmlSerializer, + root: &Node, + ) -> Result<::alloc::string::String, JsValue>; } diff --git a/crates/web-sys/src/features/gen_XrBoundedReferenceSpace.rs b/crates/web-sys/src/features/gen_XrBoundedReferenceSpace.rs index 79b217a08d8..e7b4f3f42b1 100644 --- a/crates/web-sys/src/features/gen_XrBoundedReferenceSpace.rs +++ b/crates/web-sys/src/features/gen_XrBoundedReferenceSpace.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrEye.rs b/crates/web-sys/src/features/gen_XrEye.rs index a09d8100c27..079c1ed2eef 100644 --- a/crates/web-sys/src/features/gen_XrEye.rs +++ b/crates/web-sys/src/features/gen_XrEye.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XrFrame.rs b/crates/web-sys/src/features/gen_XrFrame.rs index 9a4153e4c48..1122bae9f22 100644 --- a/crates/web-sys/src/features/gen_XrFrame.rs +++ b/crates/web-sys/src/features/gen_XrFrame.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -28,6 +29,97 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn session(this: &XrFrame) -> XrSession; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRFrame" , js_name = predictedDisplayTime)] + #[doc = "Getter for the `predictedDisplayTime` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/predictedDisplayTime)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn predicted_display_time(this: &XrFrame) -> f64; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "XRFrame" , js_name = fillJointRadii)] + #[doc = "The `fillJointRadii()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/fillJointRadii)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn fill_joint_radii_with_f32_slice( + this: &XrFrame, + joint_spaces: &::wasm_bindgen::JsValue, + radii: &mut [f32], + ) -> Result; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "XRFrame" , js_name = fillJointRadii)] + #[doc = "The `fillJointRadii()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/fillJointRadii)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrFrame`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn fill_joint_radii_with_f32_array( + this: &XrFrame, + joint_spaces: &::wasm_bindgen::JsValue, + radii: &::js_sys::Float32Array, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSpace")] + # [wasm_bindgen (catch , method , structural , js_class = "XRFrame" , js_name = fillPoses)] + #[doc = "The `fillPoses()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/fillPoses)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrSpace`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn fill_poses_with_f32_slice( + this: &XrFrame, + spaces: &::wasm_bindgen::JsValue, + base_space: &XrSpace, + transforms: &mut [f32], + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSpace")] + # [wasm_bindgen (catch , method , structural , js_class = "XRFrame" , js_name = fillPoses)] + #[doc = "The `fillPoses()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/fillPoses)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrSpace`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn fill_poses_with_f32_array( + this: &XrFrame, + spaces: &::wasm_bindgen::JsValue, + base_space: &XrSpace, + transforms: &::js_sys::Float32Array, + ) -> Result; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "XrJointPose", feature = "XrJointSpace", feature = "XrSpace",))] + # [wasm_bindgen (method , structural , js_class = "XRFrame" , js_name = getJointPose)] + #[doc = "The `getJointPose()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/getJointPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrJointPose`, `XrJointSpace`, `XrSpace`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get_joint_pose( + this: &XrFrame, + joint: &XrJointSpace, + base_space: &XrSpace, + ) -> Option; + #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "XrPose", feature = "XrSpace",))] # [wasm_bindgen (method , structural , js_class = "XRFrame" , js_name = getPose)] #[doc = "The `getPose()` method."] diff --git a/crates/web-sys/src/features/gen_XrHand.rs b/crates/web-sys/src/features/gen_XrHand.rs new file mode 100644 index 00000000000..0812d5a3e9c --- /dev/null +++ b/crates/web-sys/src/features/gen_XrHand.rs @@ -0,0 +1,86 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = XRHand , typescript_type = "XRHand")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `XrHand` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRHand)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHand`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type XrHand; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRHand" , 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/XRHand/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHand`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn size(this: &XrHand) -> u32; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "XRHand" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRHand/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHand`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(this: &XrHand) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "XRHand" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRHand/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHand`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn for_each(this: &XrHand, callback: &::js_sys::Function) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + #[cfg(all(feature = "XrHandJoint", feature = "XrJointSpace",))] + # [wasm_bindgen (method , structural , js_class = "XRHand" , js_name = get)] + #[doc = "The `get()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRHand/get)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHand`, `XrHandJoint`, `XrJointSpace`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn get(this: &XrHand, key: XrHandJoint) -> XrJointSpace; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "XRHand" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRHand/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHand`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn keys(this: &XrHand) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "XRHand" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRHand/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHand`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn values(this: &XrHand) -> ::js_sys::Iterator; +} diff --git a/crates/web-sys/src/features/gen_XrHandJoint.rs b/crates/web-sys/src/features/gen_XrHandJoint.rs new file mode 100644 index 00000000000..8edc7345284 --- /dev/null +++ b/crates/web-sys/src/features/gen_XrHandJoint.rs @@ -0,0 +1,39 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +#[doc = "The `XrHandJoint` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `XrHandJoint`*"] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum XrHandJoint { + Wrist = "wrist", + ThumbMetacarpal = "thumb-metacarpal", + ThumbPhalanxProximal = "thumb-phalanx-proximal", + ThumbPhalanxDistal = "thumb-phalanx-distal", + ThumbTip = "thumb-tip", + IndexFingerMetacarpal = "index-finger-metacarpal", + IndexFingerPhalanxProximal = "index-finger-phalanx-proximal", + IndexFingerPhalanxIntermediate = "index-finger-phalanx-intermediate", + IndexFingerPhalanxDistal = "index-finger-phalanx-distal", + IndexFingerTip = "index-finger-tip", + MiddleFingerMetacarpal = "middle-finger-metacarpal", + MiddleFingerPhalanxProximal = "middle-finger-phalanx-proximal", + MiddleFingerPhalanxIntermediate = "middle-finger-phalanx-intermediate", + MiddleFingerPhalanxDistal = "middle-finger-phalanx-distal", + MiddleFingerTip = "middle-finger-tip", + RingFingerMetacarpal = "ring-finger-metacarpal", + RingFingerPhalanxProximal = "ring-finger-phalanx-proximal", + RingFingerPhalanxIntermediate = "ring-finger-phalanx-intermediate", + RingFingerPhalanxDistal = "ring-finger-phalanx-distal", + RingFingerTip = "ring-finger-tip", + PinkyFingerMetacarpal = "pinky-finger-metacarpal", + PinkyFingerPhalanxProximal = "pinky-finger-phalanx-proximal", + PinkyFingerPhalanxIntermediate = "pinky-finger-phalanx-intermediate", + PinkyFingerPhalanxDistal = "pinky-finger-phalanx-distal", + PinkyFingerTip = "pinky-finger-tip", +} diff --git a/crates/web-sys/src/features/gen_XrHandedness.rs b/crates/web-sys/src/features/gen_XrHandedness.rs index a3095d7b772..faadaa848f3 100644 --- a/crates/web-sys/src/features/gen_XrHandedness.rs +++ b/crates/web-sys/src/features/gen_XrHandedness.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XrInputSource.rs b/crates/web-sys/src/features/gen_XrInputSource.rs index a9f8ac19332..d2f84dad5d5 100644 --- a/crates/web-sys/src/features/gen_XrInputSource.rs +++ b/crates/web-sys/src/features/gen_XrInputSource.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -16,18 +17,6 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type XrInputSource; #[cfg(web_sys_unstable_apis)] - #[cfg(feature = "Gamepad")] - # [wasm_bindgen (structural , method , getter , js_class = "XRInputSource" , js_name = gamepad)] - #[doc = "Getter for the `gamepad` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRInputSource/gamepad)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `XrInputSource`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn gamepad(this: &XrInputSource) -> Option; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrHandedness")] # [wasm_bindgen (structural , method , getter , js_class = "XRInputSource" , js_name = handedness)] #[doc = "Getter for the `handedness` field of this object."] @@ -86,4 +75,28 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn profiles(this: &XrInputSource) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "Gamepad")] + # [wasm_bindgen (structural , method , getter , js_class = "XRInputSource" , js_name = gamepad)] + #[doc = "Getter for the `gamepad` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRInputSource/gamepad)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Gamepad`, `XrInputSource`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn gamepad(this: &XrInputSource) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrHand")] + # [wasm_bindgen (structural , method , getter , js_class = "XRInputSource" , js_name = hand)] + #[doc = "Getter for the `hand` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRInputSource/hand)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHand`, `XrInputSource`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn hand(this: &XrInputSource) -> Option; } diff --git a/crates/web-sys/src/features/gen_XrInputSourceArray.rs b/crates/web-sys/src/features/gen_XrInputSourceArray.rs index 72c723b2884..131e956e569 100644 --- a/crates/web-sys/src/features/gen_XrInputSourceArray.rs +++ b/crates/web-sys/src/features/gen_XrInputSourceArray.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -27,9 +28,56 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn length(this: &XrInputSourceArray) -> u32; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "XRInputSourceArray" , js_name = entries)] + #[doc = "The `entries()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRInputSourceArray/entries)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourceArray`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn entries(this: &XrInputSourceArray) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (catch , method , structural , js_class = "XRInputSourceArray" , js_name = forEach)] + #[doc = "The `forEach()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRInputSourceArray/forEach)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourceArray`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn for_each( + this: &XrInputSourceArray, + callback: &::js_sys::Function, + ) -> Result<(), JsValue>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "XRInputSourceArray" , js_name = keys)] + #[doc = "The `keys()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRInputSourceArray/keys)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourceArray`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn keys(this: &XrInputSourceArray) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "XRInputSourceArray" , js_name = values)] + #[doc = "The `values()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRInputSourceArray/values)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourceArray`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn values(this: &XrInputSourceArray) -> ::js_sys::Iterator; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrInputSource")] #[wasm_bindgen(method, structural, js_class = "XRInputSourceArray", indexing_getter)] - #[doc = "Indexing getter."] + #[doc = "Indexing getter. As in the literal Javascript `this[key]`."] #[doc = ""] #[doc = ""] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_XrInputSourceEvent.rs b/crates/web-sys/src/features/gen_XrInputSourceEvent.rs index 3efc22ae46f..def63817223 100644 --- a/crates/web-sys/src/features/gen_XrInputSourceEvent.rs +++ b/crates/web-sys/src/features/gen_XrInputSourceEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrInputSourceEventInit.rs b/crates/web-sys/src/features/gen_XrInputSourceEventInit.rs index 64f9daf9407..e1d9f2df4de 100644 --- a/crates/web-sys/src/features/gen_XrInputSourceEventInit.rs +++ b/crates/web-sys/src/features/gen_XrInputSourceEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,23 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type XrInputSourceEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl XrInputSourceEventInit { - #[cfg(all(feature = "XrFrame", feature = "XrInputSource",))] - #[doc = "Construct a new `XrInputSourceEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrInputSource`, `XrInputSourceEventInit`*"] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourceEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(frame: &XrFrame, input_source: &XrInputSource) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.frame(frame); - ret.input_source(input_source); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &XrInputSourceEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -37,20 +30,17 @@ impl XrInputSourceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &XrInputSourceEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &XrInputSourceEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -58,20 +48,17 @@ impl XrInputSourceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &XrInputSourceEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &XrInputSourceEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -79,20 +66,18 @@ impl XrInputSourceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &XrInputSourceEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrFrame")] + #[doc = "Get the `frame` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrInputSourceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "frame")] + pub fn get_frame(this: &XrInputSourceEventInit) -> XrFrame; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrFrame")] #[doc = "Change the `frame` field of this object."] @@ -101,16 +86,18 @@ impl XrInputSourceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn frame(&mut self, val: &XrFrame) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("frame"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "frame")] + pub fn set_frame(this: &XrInputSourceEventInit, val: &XrFrame); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrInputSource")] + #[doc = "Get the `inputSource` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSource`, `XrInputSourceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "inputSource")] + pub fn get_input_source(this: &XrInputSourceEventInit) -> XrInputSource; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrInputSource")] #[doc = "Change the `inputSource` field of this object."] @@ -119,18 +106,55 @@ impl XrInputSourceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "inputSource")] + pub fn set_input_source(this: &XrInputSourceEventInit, val: &XrInputSource); +} +#[cfg(web_sys_unstable_apis)] +impl XrInputSourceEventInit { + #[cfg(all(feature = "XrFrame", feature = "XrInputSource",))] + #[doc = "Construct a new `XrInputSourceEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrInputSource`, `XrInputSourceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(frame: &XrFrame, input_source: &XrInputSource) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_frame(frame); + ret.set_input_source(input_source); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrFrame")] + #[deprecated = "Use `set_frame()` instead."] + pub fn frame(&mut self, val: &XrFrame) -> &mut Self { + self.set_frame(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrInputSource")] + #[deprecated = "Use `set_input_source()` instead."] pub fn input_source(&mut self, val: &XrInputSource) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inputSource"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_input_source(val); self } } diff --git a/crates/web-sys/src/features/gen_XrInputSourcesChangeEvent.rs b/crates/web-sys/src/features/gen_XrInputSourcesChangeEvent.rs index e20a89cb89b..e09c10cf118 100644 --- a/crates/web-sys/src/features/gen_XrInputSourcesChangeEvent.rs +++ b/crates/web-sys/src/features/gen_XrInputSourcesChangeEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrInputSourcesChangeEventInit.rs b/crates/web-sys/src/features/gen_XrInputSourcesChangeEventInit.rs index e23c3df36bb..03c272480e2 100644 --- a/crates/web-sys/src/features/gen_XrInputSourcesChangeEventInit.rs +++ b/crates/web-sys/src/features/gen_XrInputSourcesChangeEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,28 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type XrInputSourcesChangeEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl XrInputSourcesChangeEventInit { - #[cfg(feature = "XrSession")] - #[doc = "Construct a new `XrInputSourcesChangeEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`, `XrSession`*"] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new( - added: &::wasm_bindgen::JsValue, - removed: &::wasm_bindgen::JsValue, - session: &XrSession, - ) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.added(added); - ret.removed(removed); - ret.session(session); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &XrInputSourcesChangeEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -42,20 +30,17 @@ impl XrInputSourcesChangeEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &XrInputSourcesChangeEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &XrInputSourcesChangeEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -63,20 +48,17 @@ impl XrInputSourcesChangeEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &XrInputSourcesChangeEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &XrInputSourcesChangeEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -84,20 +66,17 @@ impl XrInputSourcesChangeEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &XrInputSourcesChangeEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `added` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "added")] + pub fn get_added(this: &XrInputSourcesChangeEventInit) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `added` field of this object."] #[doc = ""] @@ -105,16 +84,17 @@ impl XrInputSourcesChangeEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn added(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("added"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "added")] + pub fn set_added(this: &XrInputSourcesChangeEventInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `removed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "removed")] + pub fn get_removed(this: &XrInputSourcesChangeEventInit) -> ::js_sys::Array; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `removed` field of this object."] #[doc = ""] @@ -122,20 +102,18 @@ impl XrInputSourcesChangeEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn removed(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("removed"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "removed")] + pub fn set_removed(this: &XrInputSourcesChangeEventInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSession")] + #[doc = "Get the `session` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`, `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "session")] + pub fn get_session(this: &XrInputSourcesChangeEventInit) -> XrSession; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrSession")] #[doc = "Change the `session` field of this object."] @@ -144,18 +122,65 @@ impl XrInputSourcesChangeEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "session")] + pub fn set_session(this: &XrInputSourcesChangeEventInit, val: &XrSession); +} +#[cfg(web_sys_unstable_apis)] +impl XrInputSourcesChangeEventInit { + #[cfg(feature = "XrSession")] + #[doc = "Construct a new `XrInputSourcesChangeEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrInputSourcesChangeEventInit`, `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new( + added: &::wasm_bindgen::JsValue, + removed: &::wasm_bindgen::JsValue, + session: &XrSession, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_added(added); + ret.set_removed(removed); + ret.set_session(session); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_added()` instead."] + pub fn added(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_added(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_removed()` instead."] + pub fn removed(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_removed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSession")] + #[deprecated = "Use `set_session()` instead."] pub fn session(&mut self, val: &XrSession) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("session"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_session(val); self } } diff --git a/crates/web-sys/src/features/gen_XrJointPose.rs b/crates/web-sys/src/features/gen_XrJointPose.rs new file mode 100644 index 00000000000..543df71dd2d --- /dev/null +++ b/crates/web-sys/src/features/gen_XrJointPose.rs @@ -0,0 +1,30 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = XrPose , extends = :: js_sys :: Object , js_name = XRJointPose , typescript_type = "XRJointPose")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `XrJointPose` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRJointPose)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrJointPose`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type XrJointPose; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRJointPose" , js_name = radius)] + #[doc = "Getter for the `radius` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRJointPose/radius)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrJointPose`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn radius(this: &XrJointPose) -> f32; +} diff --git a/crates/web-sys/src/features/gen_XrJointSpace.rs b/crates/web-sys/src/features/gen_XrJointSpace.rs new file mode 100644 index 00000000000..645a8ee2cb9 --- /dev/null +++ b/crates/web-sys/src/features/gen_XrJointSpace.rs @@ -0,0 +1,31 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = XrSpace , extends = EventTarget , extends = :: js_sys :: Object , js_name = XRJointSpace , typescript_type = "XRJointSpace")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `XrJointSpace` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRJointSpace)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrJointSpace`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type XrJointSpace; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrHandJoint")] + # [wasm_bindgen (structural , method , getter , js_class = "XRJointSpace" , js_name = jointName)] + #[doc = "Getter for the `jointName` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRJointSpace/jointName)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrHandJoint`, `XrJointSpace`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn joint_name(this: &XrJointSpace) -> XrHandJoint; +} diff --git a/crates/web-sys/src/features/gen_XrLayer.rs b/crates/web-sys/src/features/gen_XrLayer.rs new file mode 100644 index 00000000000..5bdade50c94 --- /dev/null +++ b/crates/web-sys/src/features/gen_XrLayer.rs @@ -0,0 +1,19 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = XRLayer , typescript_type = "XRLayer")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `XrLayer` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRLayer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrLayer`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type XrLayer; +} diff --git a/crates/web-sys/src/features/gen_XrPermissionDescriptor.rs b/crates/web-sys/src/features/gen_XrPermissionDescriptor.rs new file mode 100644 index 00000000000..8c443ea5856 --- /dev/null +++ b/crates/web-sys/src/features/gen_XrPermissionDescriptor.rs @@ -0,0 +1,135 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = XRPermissionDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `XrPermissionDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type XrPermissionDescriptor; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &XrPermissionDescriptor) -> PermissionName; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &XrPermissionDescriptor, val: PermissionName); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSessionMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`, `XrSessionMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &XrPermissionDescriptor) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSessionMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`, `XrSessionMode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &XrPermissionDescriptor, val: XrSessionMode); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `optionalFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "optionalFeatures")] + pub fn get_optional_features(this: &XrPermissionDescriptor) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `optionalFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "optionalFeatures")] + pub fn set_optional_features(this: &XrPermissionDescriptor, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `requiredFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requiredFeatures")] + pub fn get_required_features(this: &XrPermissionDescriptor) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `requiredFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "requiredFeatures")] + pub fn set_required_features(this: &XrPermissionDescriptor, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl XrPermissionDescriptor { + #[cfg(feature = "PermissionName")] + #[doc = "Construct a new `XrPermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(name: PermissionName) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_name(name); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: PermissionName) -> &mut Self { + self.set_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSessionMode")] + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: XrSessionMode) -> &mut Self { + self.set_mode(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_optional_features()` instead."] + pub fn optional_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_optional_features(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_required_features()` instead."] + pub fn required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_required_features(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_XrPermissionStatus.rs b/crates/web-sys/src/features/gen_XrPermissionStatus.rs new file mode 100644 index 00000000000..58eb6b5ad13 --- /dev/null +++ b/crates/web-sys/src/features/gen_XrPermissionStatus.rs @@ -0,0 +1,41 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = PermissionStatus , extends = EventTarget , extends = :: js_sys :: Object , js_name = XRPermissionStatus , typescript_type = "XRPermissionStatus")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `XrPermissionStatus` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRPermissionStatus)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionStatus`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type XrPermissionStatus; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRPermissionStatus" , js_name = granted)] + #[doc = "Getter for the `granted` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRPermissionStatus/granted)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionStatus`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn granted(this: &XrPermissionStatus) -> ::js_sys::Array; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "XRPermissionStatus" , js_name = granted)] + #[doc = "Setter for the `granted` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRPermissionStatus/granted)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrPermissionStatus`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_granted(this: &XrPermissionStatus, value: &::wasm_bindgen::JsValue); +} diff --git a/crates/web-sys/src/features/gen_XrPose.rs b/crates/web-sys/src/features/gen_XrPose.rs index f8a690fcdd5..dd718fcccd3 100644 --- a/crates/web-sys/src/features/gen_XrPose.rs +++ b/crates/web-sys/src/features/gen_XrPose.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -28,6 +29,30 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn transform(this: &XrPose) -> XrRigidTransform; #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DomPointReadOnly")] + # [wasm_bindgen (structural , method , getter , js_class = "XRPose" , js_name = linearVelocity)] + #[doc = "Getter for the `linearVelocity` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRPose/linearVelocity)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointReadOnly`, `XrPose`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn linear_velocity(this: &XrPose) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "DomPointReadOnly")] + # [wasm_bindgen (structural , method , getter , js_class = "XRPose" , js_name = angularVelocity)] + #[doc = "Getter for the `angularVelocity` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRPose/angularVelocity)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `DomPointReadOnly`, `XrPose`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn angular_velocity(this: &XrPose) -> Option; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "XRPose" , js_name = emulatedPosition)] #[doc = "Getter for the `emulatedPosition` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_XrReferenceSpace.rs b/crates/web-sys/src/features/gen_XrReferenceSpace.rs index 3ca6d5a125f..487b194df1a 100644 --- a/crates/web-sys/src/features/gen_XrReferenceSpace.rs +++ b/crates/web-sys/src/features/gen_XrReferenceSpace.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrReferenceSpaceEvent.rs b/crates/web-sys/src/features/gen_XrReferenceSpaceEvent.rs index b677127131d..d113ba6b2e7 100644 --- a/crates/web-sys/src/features/gen_XrReferenceSpaceEvent.rs +++ b/crates/web-sys/src/features/gen_XrReferenceSpaceEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrReferenceSpaceEventInit.rs b/crates/web-sys/src/features/gen_XrReferenceSpaceEventInit.rs index 8ff8b96dd75..63ccbaac1d8 100644 --- a/crates/web-sys/src/features/gen_XrReferenceSpaceEventInit.rs +++ b/crates/web-sys/src/features/gen_XrReferenceSpaceEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type XrReferenceSpaceEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl XrReferenceSpaceEventInit { - #[cfg(feature = "XrReferenceSpace")] - #[doc = "Construct a new `XrReferenceSpaceEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `XrReferenceSpace`, `XrReferenceSpaceEventInit`*"] + #[doc = "*This API requires the following crate features to be activated: `XrReferenceSpaceEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(reference_space: &XrReferenceSpace) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.reference_space(reference_space); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &XrReferenceSpaceEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl XrReferenceSpaceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &XrReferenceSpaceEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrReferenceSpaceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &XrReferenceSpaceEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -57,20 +48,17 @@ impl XrReferenceSpaceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &XrReferenceSpaceEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrReferenceSpaceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &XrReferenceSpaceEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -78,20 +66,18 @@ impl XrReferenceSpaceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &XrReferenceSpaceEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrReferenceSpace")] + #[doc = "Get the `referenceSpace` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrReferenceSpace`, `XrReferenceSpaceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "referenceSpace")] + pub fn get_reference_space(this: &XrReferenceSpaceEventInit) -> XrReferenceSpace; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrReferenceSpace")] #[doc = "Change the `referenceSpace` field of this object."] @@ -100,20 +86,18 @@ impl XrReferenceSpaceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn reference_space(&mut self, val: &XrReferenceSpace) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referenceSpace"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "referenceSpace")] + pub fn set_reference_space(this: &XrReferenceSpaceEventInit, val: &XrReferenceSpace); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrRigidTransform")] + #[doc = "Get the `transform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrReferenceSpaceEventInit`, `XrRigidTransform`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "transform")] + pub fn get_transform(this: &XrReferenceSpaceEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrRigidTransform")] #[doc = "Change the `transform` field of this object."] @@ -122,18 +106,54 @@ impl XrReferenceSpaceEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn transform(&mut self, val: &XrRigidTransform) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transform"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + #[wasm_bindgen(method, setter = "transform")] + pub fn set_transform(this: &XrReferenceSpaceEventInit, val: Option<&XrRigidTransform>); +} +#[cfg(web_sys_unstable_apis)] +impl XrReferenceSpaceEventInit { + #[cfg(feature = "XrReferenceSpace")] + #[doc = "Construct a new `XrReferenceSpaceEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrReferenceSpace`, `XrReferenceSpaceEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(reference_space: &XrReferenceSpace) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_reference_space(reference_space); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrReferenceSpace")] + #[deprecated = "Use `set_reference_space()` instead."] + pub fn reference_space(&mut self, val: &XrReferenceSpace) -> &mut Self { + self.set_reference_space(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrRigidTransform")] + #[deprecated = "Use `set_transform()` instead."] + pub fn transform(&mut self, val: Option<&XrRigidTransform>) -> &mut Self { + self.set_transform(val); self } } diff --git a/crates/web-sys/src/features/gen_XrReferenceSpaceType.rs b/crates/web-sys/src/features/gen_XrReferenceSpaceType.rs index 6801e0f0130..3ee66e27206 100644 --- a/crates/web-sys/src/features/gen_XrReferenceSpaceType.rs +++ b/crates/web-sys/src/features/gen_XrReferenceSpaceType.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XrRenderState.rs b/crates/web-sys/src/features/gen_XrRenderState.rs index 98781adb73b..79076a1f9b2 100644 --- a/crates/web-sys/src/features/gen_XrRenderState.rs +++ b/crates/web-sys/src/features/gen_XrRenderState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrRenderStateInit.rs b/crates/web-sys/src/features/gen_XrRenderStateInit.rs index 2bff16c5e0c..80c948a87c0 100644 --- a/crates/web-sys/src/features/gen_XrRenderStateInit.rs +++ b/crates/web-sys/src/features/gen_XrRenderStateInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,16 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type XrRenderStateInit; -} -#[cfg(web_sys_unstable_apis)] -impl XrRenderStateInit { - #[doc = "Construct a new `XrRenderStateInit`."] + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrWebGlLayer")] + #[doc = "Get the `baseLayer` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"] + #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`, `XrWebGlLayer`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "baseLayer")] + pub fn get_base_layer(this: &XrRenderStateInit) -> Option; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrWebGlLayer")] #[doc = "Change the `baseLayer` field of this object."] @@ -35,20 +32,17 @@ impl XrRenderStateInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn base_layer(&mut self, val: Option<&XrWebGlLayer>) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("baseLayer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "baseLayer")] + pub fn set_base_layer(this: &XrRenderStateInit, val: Option<&XrWebGlLayer>); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthFar` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthFar")] + pub fn get_depth_far(this: &XrRenderStateInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthFar` field of this object."] #[doc = ""] @@ -56,20 +50,17 @@ impl XrRenderStateInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_far(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthFar"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthFar")] + pub fn set_depth_far(this: &XrRenderStateInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depthNear` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depthNear")] + pub fn get_depth_near(this: &XrRenderStateInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depthNear` field of this object."] #[doc = ""] @@ -77,20 +68,17 @@ impl XrRenderStateInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth_near(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("depthNear"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depthNear")] + pub fn set_depth_near(this: &XrRenderStateInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `inlineVerticalFieldOfView` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "inlineVerticalFieldOfView")] + pub fn get_inline_vertical_field_of_view(this: &XrRenderStateInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `inlineVerticalFieldOfView` field of this object."] #[doc = ""] @@ -98,18 +86,69 @@ impl XrRenderStateInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "inlineVerticalFieldOfView")] + pub fn set_inline_vertical_field_of_view(this: &XrRenderStateInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `layers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "layers")] + pub fn get_layers(this: &XrRenderStateInit) -> Option<::js_sys::Array>; + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `layers` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "layers")] + pub fn set_layers(this: &XrRenderStateInit, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl XrRenderStateInit { + #[doc = "Construct a new `XrRenderStateInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrWebGlLayer")] + #[deprecated = "Use `set_base_layer()` instead."] + pub fn base_layer(&mut self, val: Option<&XrWebGlLayer>) -> &mut Self { + self.set_base_layer(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_far()` instead."] + pub fn depth_far(&mut self, val: f64) -> &mut Self { + self.set_depth_far(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth_near()` instead."] + pub fn depth_near(&mut self, val: f64) -> &mut Self { + self.set_depth_near(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_inline_vertical_field_of_view()` instead."] pub fn inline_vertical_field_of_view(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("inlineVerticalFieldOfView"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_inline_vertical_field_of_view(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_layers()` instead."] + pub fn layers(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self { + self.set_layers(val.unwrap_or(&::wasm_bindgen::JsValue::NULL)); self } } diff --git a/crates/web-sys/src/features/gen_XrRigidTransform.rs b/crates/web-sys/src/features/gen_XrRigidTransform.rs index a171e4e5118..eaaaac7857b 100644 --- a/crates/web-sys/src/features/gen_XrRigidTransform.rs +++ b/crates/web-sys/src/features/gen_XrRigidTransform.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -49,7 +50,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn matrix(this: &XrRigidTransform) -> Vec; + pub fn matrix(this: &XrRigidTransform) -> ::alloc::vec::Vec; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "XRRigidTransform" , js_name = inverse)] #[doc = "Getter for the `inverse` field of this object."] diff --git a/crates/web-sys/src/features/gen_XrSession.rs b/crates/web-sys/src/features/gen_XrSession.rs index fd54bb99fb0..ea79ee7238f 100644 --- a/crates/web-sys/src/features/gen_XrSession.rs +++ b/crates/web-sys/src/features/gen_XrSession.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -28,6 +29,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn visibility_state(this: &XrSession) -> XrVisibilityState; #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = frameRate)] + #[doc = "Getter for the `frameRate` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/frameRate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn frame_rate(this: &XrSession) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = supportedFrameRates)] + #[doc = "Getter for the `supportedFrameRates` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/supportedFrameRates)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn supported_frame_rates(this: &XrSession) -> Option<::alloc::vec::Vec>; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrRenderState")] # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = renderState)] #[doc = "Getter for the `renderState` field of this object."] @@ -74,49 +97,49 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_onend(this: &XrSession, value: Option<&::js_sys::Function>); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = onselect)] - #[doc = "Getter for the `onselect` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = oninputsourceschange)] + #[doc = "Getter for the `oninputsourceschange` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onselect)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/oninputsourceschange)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn onselect(this: &XrSession) -> Option<::js_sys::Function>; + pub fn oninputsourceschange(this: &XrSession) -> Option<::js_sys::Function>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , setter , js_class = "XRSession" , js_name = onselect)] - #[doc = "Setter for the `onselect` field of this object."] + # [wasm_bindgen (structural , method , setter , js_class = "XRSession" , js_name = oninputsourceschange)] + #[doc = "Setter for the `oninputsourceschange` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onselect)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/oninputsourceschange)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_onselect(this: &XrSession, value: Option<&::js_sys::Function>); + pub fn set_oninputsourceschange(this: &XrSession, value: Option<&::js_sys::Function>); #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = oninputsourceschange)] - #[doc = "Getter for the `oninputsourceschange` field of this object."] + # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = onselect)] + #[doc = "Getter for the `onselect` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/oninputsourceschange)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onselect)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn oninputsourceschange(this: &XrSession) -> Option<::js_sys::Function>; + pub fn onselect(this: &XrSession) -> Option<::js_sys::Function>; #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , setter , js_class = "XRSession" , js_name = oninputsourceschange)] - #[doc = "Setter for the `oninputsourceschange` field of this object."] + # [wasm_bindgen (structural , method , setter , js_class = "XRSession" , js_name = onselect)] + #[doc = "Setter for the `onselect` field of this object."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/oninputsourceschange)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onselect)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn set_oninputsourceschange(this: &XrSession, value: Option<&::js_sys::Function>); + pub fn set_onselect(this: &XrSession, value: Option<&::js_sys::Function>); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = onselectstart)] #[doc = "Getter for the `onselectstart` field of this object."] @@ -162,6 +185,72 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_onselectend(this: &XrSession, value: Option<&::js_sys::Function>); #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = onsqueeze)] + #[doc = "Getter for the `onsqueeze` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onsqueeze)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onsqueeze(this: &XrSession) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "XRSession" , js_name = onsqueeze)] + #[doc = "Setter for the `onsqueeze` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onsqueeze)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onsqueeze(this: &XrSession, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = onsqueezestart)] + #[doc = "Getter for the `onsqueezestart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onsqueezestart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onsqueezestart(this: &XrSession) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "XRSession" , js_name = onsqueezestart)] + #[doc = "Setter for the `onsqueezestart` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onsqueezestart)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onsqueezestart(this: &XrSession, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = onsqueezeend)] + #[doc = "Getter for the `onsqueezeend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onsqueezeend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onsqueezeend(this: &XrSession) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "XRSession" , js_name = onsqueezeend)] + #[doc = "Setter for the `onsqueezeend` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onsqueezeend)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onsqueezeend(this: &XrSession, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = onvisibilitychange)] #[doc = "Getter for the `onvisibilitychange` field of this object."] #[doc = ""] @@ -184,6 +273,28 @@ extern "C" { #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_onvisibilitychange(this: &XrSession, value: Option<&::js_sys::Function>); #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = onframeratechange)] + #[doc = "Getter for the `onframeratechange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onframeratechange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn onframeratechange(this: &XrSession) -> Option<::js_sys::Function>; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , setter , js_class = "XRSession" , js_name = onframeratechange)] + #[doc = "Setter for the `onframeratechange` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/onframeratechange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn set_onframeratechange(this: &XrSession, value: Option<&::js_sys::Function>); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "XRSession" , js_name = cancelAnimationFrame)] #[doc = "The `cancelAnimationFrame()` method."] #[doc = ""] @@ -193,7 +304,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn cancel_animation_frame(this: &XrSession, handle: i32); + pub fn cancel_animation_frame(this: &XrSession, handle: u32); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "XRSession" , js_name = end)] #[doc = "The `end()` method."] @@ -215,7 +326,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn request_animation_frame(this: &XrSession, callback: &::js_sys::Function) -> i32; + pub fn request_animation_frame(this: &XrSession, callback: &::js_sys::Function) -> u32; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrReferenceSpaceType")] # [wasm_bindgen (method , structural , js_class = "XRSession" , js_name = requestReferenceSpace)] @@ -254,4 +365,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn update_render_state_with_state(this: &XrSession, state: &XrRenderStateInit); + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "XRSession" , js_name = updateTargetFrameRate)] + #[doc = "The `updateTargetFrameRate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRSession/updateTargetFrameRate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn update_target_frame_rate(this: &XrSession, rate: f32) -> ::js_sys::Promise; } diff --git a/crates/web-sys/src/features/gen_XrSessionEvent.rs b/crates/web-sys/src/features/gen_XrSessionEvent.rs index 748df3513eb..70c14cacdee 100644 --- a/crates/web-sys/src/features/gen_XrSessionEvent.rs +++ b/crates/web-sys/src/features/gen_XrSessionEvent.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrSessionEventInit.rs b/crates/web-sys/src/features/gen_XrSessionEventInit.rs index fbe6cf2831c..8bb4f6140ff 100644 --- a/crates/web-sys/src/features/gen_XrSessionEventInit.rs +++ b/crates/web-sys/src/features/gen_XrSessionEventInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,22 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type XrSessionEventInit; -} -#[cfg(web_sys_unstable_apis)] -impl XrSessionEventInit { - #[cfg(feature = "XrSession")] - #[doc = "Construct a new `XrSessionEventInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `bubbles` field of this object."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `XrSession`, `XrSessionEventInit`*"] + #[doc = "*This API requires the following crate features to be activated: `XrSessionEventInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new(session: &XrSession) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.session(session); - ret - } + #[wasm_bindgen(method, getter = "bubbles")] + pub fn get_bubbles(this: &XrSessionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `bubbles` field of this object."] #[doc = ""] @@ -36,20 +30,17 @@ impl XrSessionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "bubbles")] + pub fn set_bubbles(this: &XrSessionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `cancelable` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSessionEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "cancelable")] + pub fn get_cancelable(this: &XrSessionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `cancelable` field of this object."] #[doc = ""] @@ -57,20 +48,17 @@ impl XrSessionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "cancelable")] + pub fn set_cancelable(this: &XrSessionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `composed` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSessionEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "composed")] + pub fn get_composed(this: &XrSessionEventInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `composed` field of this object."] #[doc = ""] @@ -78,20 +66,18 @@ impl XrSessionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - 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 - } + #[wasm_bindgen(method, setter = "composed")] + pub fn set_composed(this: &XrSessionEventInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSession")] + #[doc = "Get the `session` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`, `XrSessionEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "session")] + pub fn get_session(this: &XrSessionEventInit) -> XrSession; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrSession")] #[doc = "Change the `session` field of this object."] @@ -100,18 +86,47 @@ impl XrSessionEventInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "session")] + pub fn set_session(this: &XrSessionEventInit, val: &XrSession); +} +#[cfg(web_sys_unstable_apis)] +impl XrSessionEventInit { + #[cfg(feature = "XrSession")] + #[doc = "Construct a new `XrSessionEventInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSession`, `XrSessionEventInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(session: &XrSession) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_session(session); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_bubbles()` instead."] + pub fn bubbles(&mut self, val: bool) -> &mut Self { + self.set_bubbles(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_cancelable()` instead."] + pub fn cancelable(&mut self, val: bool) -> &mut Self { + self.set_cancelable(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_composed()` instead."] + pub fn composed(&mut self, val: bool) -> &mut Self { + self.set_composed(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSession")] + #[deprecated = "Use `set_session()` instead."] pub fn session(&mut self, val: &XrSession) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("session"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_session(val); self } } diff --git a/crates/web-sys/src/features/gen_XrSessionInit.rs b/crates/web-sys/src/features/gen_XrSessionInit.rs index 999791d1fa7..1e31e73dbee 100644 --- a/crates/web-sys/src/features/gen_XrSessionInit.rs +++ b/crates/web-sys/src/features/gen_XrSessionInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type XrSessionInit; -} -#[cfg(web_sys_unstable_apis)] -impl XrSessionInit { - #[doc = "Construct a new `XrSessionInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `optionalFeatures` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XrSessionInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "optionalFeatures")] + pub fn get_optional_features(this: &XrSessionInit) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `optionalFeatures` field of this object."] #[doc = ""] @@ -34,20 +30,17 @@ impl XrSessionInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn optional_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("optionalFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "optionalFeatures")] + pub fn set_optional_features(this: &XrSessionInit, val: &::wasm_bindgen::JsValue); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `requiredFeatures` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSessionInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "requiredFeatures")] + pub fn get_required_features(this: &XrSessionInit) -> Option<::js_sys::Array>; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `requiredFeatures` field of this object."] #[doc = ""] @@ -55,18 +48,32 @@ impl XrSessionInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "requiredFeatures")] + pub fn set_required_features(this: &XrSessionInit, val: &::wasm_bindgen::JsValue); +} +#[cfg(web_sys_unstable_apis)] +impl XrSessionInit { + #[doc = "Construct a new `XrSessionInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSessionInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_optional_features()` instead."] + pub fn optional_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + self.set_optional_features(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_required_features()` instead."] pub fn required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("requiredFeatures"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_required_features(val); self } } diff --git a/crates/web-sys/src/features/gen_XrSessionMode.rs b/crates/web-sys/src/features/gen_XrSessionMode.rs index c4bdc89b7a8..becf96ed22c 100644 --- a/crates/web-sys/src/features/gen_XrSessionMode.rs +++ b/crates/web-sys/src/features/gen_XrSessionMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] @@ -12,4 +13,5 @@ use wasm_bindgen::prelude::*; pub enum XrSessionMode { Inline = "inline", ImmersiveVr = "immersive-vr", + ImmersiveAr = "immersive-ar", } diff --git a/crates/web-sys/src/features/gen_XrSessionSupportedPermissionDescriptor.rs b/crates/web-sys/src/features/gen_XrSessionSupportedPermissionDescriptor.rs new file mode 100644 index 00000000000..2c8755d9da4 --- /dev/null +++ b/crates/web-sys/src/features/gen_XrSessionSupportedPermissionDescriptor.rs @@ -0,0 +1,87 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = XRSessionSupportedPermissionDescriptor)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `XrSessionSupportedPermissionDescriptor` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSessionSupportedPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type XrSessionSupportedPermissionDescriptor; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[doc = "Get the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrSessionSupportedPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "name")] + pub fn get_name(this: &XrSessionSupportedPermissionDescriptor) -> PermissionName; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[doc = "Change the `name` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrSessionSupportedPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "name")] + pub fn set_name(this: &XrSessionSupportedPermissionDescriptor, val: PermissionName); + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSessionMode")] + #[doc = "Get the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSessionMode`, `XrSessionSupportedPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "mode")] + pub fn get_mode(this: &XrSessionSupportedPermissionDescriptor) -> Option; + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSessionMode")] + #[doc = "Change the `mode` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrSessionMode`, `XrSessionSupportedPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "mode")] + pub fn set_mode(this: &XrSessionSupportedPermissionDescriptor, val: XrSessionMode); +} +#[cfg(web_sys_unstable_apis)] +impl XrSessionSupportedPermissionDescriptor { + #[cfg(feature = "PermissionName")] + #[doc = "Construct a new `XrSessionSupportedPermissionDescriptor`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrSessionSupportedPermissionDescriptor`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new(name: PermissionName) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.set_name(name); + ret + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "PermissionName")] + #[deprecated = "Use `set_name()` instead."] + pub fn name(&mut self, val: PermissionName) -> &mut Self { + self.set_name(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[cfg(feature = "XrSessionMode")] + #[deprecated = "Use `set_mode()` instead."] + pub fn mode(&mut self, val: XrSessionMode) -> &mut Self { + self.set_mode(val); + self + } +} diff --git a/crates/web-sys/src/features/gen_XrSpace.rs b/crates/web-sys/src/features/gen_XrSpace.rs index e04941c050d..50c85f5bc36 100644 --- a/crates/web-sys/src/features/gen_XrSpace.rs +++ b/crates/web-sys/src/features/gen_XrSpace.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrSystem.rs b/crates/web-sys/src/features/gen_XrSystem.rs index a035b3ef625..054f7a4a262 100644 --- a/crates/web-sys/src/features/gen_XrSystem.rs +++ b/crates/web-sys/src/features/gen_XrSystem.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrTargetRayMode.rs b/crates/web-sys/src/features/gen_XrTargetRayMode.rs index 94b59335f0a..d4248fb8da4 100644 --- a/crates/web-sys/src/features/gen_XrTargetRayMode.rs +++ b/crates/web-sys/src/features/gen_XrTargetRayMode.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XrView.rs b/crates/web-sys/src/features/gen_XrView.rs index 1e5a3a3e379..a304c594bd3 100644 --- a/crates/web-sys/src/features/gen_XrView.rs +++ b/crates/web-sys/src/features/gen_XrView.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -37,7 +38,7 @@ extern "C" { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn projection_matrix(this: &XrView) -> Vec; + pub fn projection_matrix(this: &XrView) -> ::alloc::vec::Vec; #[cfg(web_sys_unstable_apis)] #[cfg(feature = "XrRigidTransform")] # [wasm_bindgen (structural , method , getter , js_class = "XRView" , js_name = transform)] @@ -50,4 +51,26 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn transform(this: &XrView) -> XrRigidTransform; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (structural , method , getter , js_class = "XRView" , js_name = recommendedViewportScale)] + #[doc = "Getter for the `recommendedViewportScale` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRView/recommendedViewportScale)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn recommended_viewport_scale(this: &XrView) -> Option; + #[cfg(web_sys_unstable_apis)] + # [wasm_bindgen (method , structural , js_class = "XRView" , js_name = requestViewportScale)] + #[doc = "The `requestViewportScale()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRView/requestViewportScale)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrView`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn request_viewport_scale(this: &XrView, scale: Option); } diff --git a/crates/web-sys/src/features/gen_XrViewerPose.rs b/crates/web-sys/src/features/gen_XrViewerPose.rs index 2e53ea6a40d..ca2e5967185 100644 --- a/crates/web-sys/src/features/gen_XrViewerPose.rs +++ b/crates/web-sys/src/features/gen_XrViewerPose.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrViewport.rs b/crates/web-sys/src/features/gen_XrViewport.rs index 7ffdabd83d0..eed7b0d16fe 100644 --- a/crates/web-sys/src/features/gen_XrViewport.rs +++ b/crates/web-sys/src/features/gen_XrViewport.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] diff --git a/crates/web-sys/src/features/gen_XrVisibilityState.rs b/crates/web-sys/src/features/gen_XrVisibilityState.rs index f82ab22a974..9b826370a4d 100644 --- a/crates/web-sys/src/features/gen_XrVisibilityState.rs +++ b/crates/web-sys/src/features/gen_XrVisibilityState.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_XrWebGlLayer.rs b/crates/web-sys/src/features/gen_XrWebGlLayer.rs index cec106b3a43..4344b044d52 100644 --- a/crates/web-sys/src/features/gen_XrWebGlLayer.rs +++ b/crates/web-sys/src/features/gen_XrWebGlLayer.rs @@ -1,10 +1,11 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = XRWebGLLayer , typescript_type = "XRWebGLLayer")] + # [wasm_bindgen (extends = XrLayer , extends = EventTarget , extends = :: js_sys :: Object , js_name = XRWebGLLayer , typescript_type = "XRWebGLLayer")] #[derive(Debug, Clone, PartialEq, Eq)] #[doc = "The `XrWebGlLayer` class."] #[doc = ""] @@ -168,7 +169,7 @@ extern "C" { # [wasm_bindgen (static_method_of = XrWebGlLayer , js_class = "XRWebGLLayer" , js_name = getNativeFramebufferScaleFactor)] #[doc = "The `getNativeFramebufferScaleFactor()` method."] #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/getNativeFramebufferScaleFactor)"] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/getNativeFramebufferScaleFactor_static)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XrSession`, `XrWebGlLayer`*"] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_XrWebGlLayerInit.rs b/crates/web-sys/src/features/gen_XrWebGlLayerInit.rs index f5233d6b1a1..9c813965d66 100644 --- a/crates/web-sys/src/features/gen_XrWebGlLayerInit.rs +++ b/crates/web-sys/src/features/gen_XrWebGlLayerInit.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] @@ -13,20 +14,15 @@ extern "C" { #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type XrWebGlLayerInit; -} -#[cfg(web_sys_unstable_apis)] -impl XrWebGlLayerInit { - #[doc = "Construct a new `XrWebGlLayerInit`."] + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `alpha` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayerInit`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } + #[wasm_bindgen(method, getter = "alpha")] + pub fn get_alpha(this: &XrWebGlLayerInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `alpha` field of this object."] #[doc = ""] @@ -34,16 +30,17 @@ impl XrWebGlLayerInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn alpha(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "alpha")] + pub fn set_alpha(this: &XrWebGlLayerInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `antialias` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "antialias")] + pub fn get_antialias(this: &XrWebGlLayerInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `antialias` field of this object."] #[doc = ""] @@ -51,20 +48,17 @@ impl XrWebGlLayerInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn antialias(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("antialias"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "antialias")] + pub fn set_antialias(this: &XrWebGlLayerInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `depth` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "depth")] + pub fn get_depth(this: &XrWebGlLayerInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `depth` field of this object."] #[doc = ""] @@ -72,16 +66,17 @@ impl XrWebGlLayerInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn depth(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("depth"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "depth")] + pub fn set_depth(this: &XrWebGlLayerInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `framebufferScaleFactor` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "framebufferScaleFactor")] + pub fn get_framebuffer_scale_factor(this: &XrWebGlLayerInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `framebufferScaleFactor` field of this object."] #[doc = ""] @@ -89,20 +84,17 @@ impl XrWebGlLayerInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn framebuffer_scale_factor(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("framebufferScaleFactor"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "framebufferScaleFactor")] + pub fn set_framebuffer_scale_factor(this: &XrWebGlLayerInit, val: f64); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `ignoreDepthValues` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "ignoreDepthValues")] + pub fn get_ignore_depth_values(this: &XrWebGlLayerInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `ignoreDepthValues` field of this object."] #[doc = ""] @@ -110,20 +102,17 @@ impl XrWebGlLayerInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn ignore_depth_values(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("ignoreDepthValues"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } + #[wasm_bindgen(method, setter = "ignoreDepthValues")] + pub fn set_ignore_depth_values(this: &XrWebGlLayerInit, val: bool); + #[cfg(web_sys_unstable_apis)] + #[doc = "Get the `stencil` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, getter = "stencil")] + pub fn get_stencil(this: &XrWebGlLayerInit) -> Option; #[cfg(web_sys_unstable_apis)] #[doc = "Change the `stencil` field of this object."] #[doc = ""] @@ -131,18 +120,56 @@ impl XrWebGlLayerInit { #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + #[wasm_bindgen(method, setter = "stencil")] + pub fn set_stencil(this: &XrWebGlLayerInit, val: bool); +} +#[cfg(web_sys_unstable_apis)] +impl XrWebGlLayerInit { + #[doc = "Construct a new `XrWebGlLayerInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayerInit`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_alpha()` instead."] + pub fn alpha(&mut self, val: bool) -> &mut Self { + self.set_alpha(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_antialias()` instead."] + pub fn antialias(&mut self, val: bool) -> &mut Self { + self.set_antialias(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_depth()` instead."] + pub fn depth(&mut self, val: bool) -> &mut Self { + self.set_depth(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_framebuffer_scale_factor()` instead."] + pub fn framebuffer_scale_factor(&mut self, val: f64) -> &mut Self { + self.set_framebuffer_scale_factor(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_ignore_depth_values()` instead."] + pub fn ignore_depth_values(&mut self, val: bool) -> &mut Self { + self.set_ignore_depth_values(val); + self + } + #[cfg(web_sys_unstable_apis)] + #[deprecated = "Use `set_stencil()` instead."] pub fn stencil(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("stencil"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; + self.set_stencil(val); self } } diff --git a/crates/web-sys/src/features/gen_XsltProcessor.rs b/crates/web-sys/src/features/gen_XsltProcessor.rs index c730032d445..51e5105f76a 100644 --- a/crates/web-sys/src/features/gen_XsltProcessor.rs +++ b/crates/web-sys/src/features/gen_XsltProcessor.rs @@ -1,4 +1,5 @@ #![allow(unused_imports)] +#![allow(clippy::all)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_console.rs b/crates/web-sys/src/features/gen_console.rs index a84ed2b4a5a..b7abd12c148 100644 --- a/crates/web-sys/src/features/gen_console.rs +++ b/crates/web-sys/src/features/gen_console.rs @@ -1,5 +1,6 @@ pub mod console { #![allow(unused_imports)] + #![allow(clippy::all)] use super::super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] diff --git a/crates/web-sys/src/features/gen_css.rs b/crates/web-sys/src/features/gen_css.rs index f18a5dad20f..94613d3f590 100644 --- a/crates/web-sys/src/features/gen_css.rs +++ b/crates/web-sys/src/features/gen_css.rs @@ -1,5 +1,6 @@ pub mod css { #![allow(unused_imports)] + #![allow(clippy::all)] use super::super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] @@ -10,7 +11,7 @@ pub mod css { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `css`*"] - pub fn escape(ident: &str) -> String; + pub fn escape(ident: &str) -> ::alloc::string::String; # [wasm_bindgen (catch , js_namespace = CSS , js_name = supports)] #[doc = "The `CSS.supports()` function."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_GpuBufferUsage.rs b/crates/web-sys/src/features/gen_gpu_buffer_usage.rs similarity index 79% rename from crates/web-sys/src/features/gen_GpuBufferUsage.rs rename to crates/web-sys/src/features/gen_gpu_buffer_usage.rs index 313d5730b18..5644ea04c43 100644 --- a/crates/web-sys/src/features/gen_GpuBufferUsage.rs +++ b/crates/web-sys/src/features/gen_gpu_buffer_usage.rs @@ -1,27 +1,16 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBufferUsage , typescript_type = "GPUBufferUsage")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuBufferUsage` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBufferUsage)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuBufferUsage; -} -#[cfg(web_sys_unstable_apis)] -impl GpuBufferUsage { +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +pub mod gpu_buffer_usage { + #![allow(unused_imports)] + #![allow(clippy::all)] + use super::super::*; + use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.MAP_READ` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -29,7 +18,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.MAP_WRITE` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -37,7 +26,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.COPY_SRC` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -45,7 +34,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.COPY_DST` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -53,7 +42,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.INDEX` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -61,7 +50,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.VERTEX` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -69,7 +58,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.UNIFORM` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -77,7 +66,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.STORAGE` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -85,7 +74,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.INDIRECT` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -93,7 +82,7 @@ impl GpuBufferUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUBufferUsage.QUERY_RESOLVE` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuBufferUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_buffer_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_GpuColorWrite.rs b/crates/web-sys/src/features/gen_gpu_color_write.rs similarity index 68% rename from crates/web-sys/src/features/gen_GpuColorWrite.rs rename to crates/web-sys/src/features/gen_gpu_color_write.rs index 47b1571225a..e9d94255725 100644 --- a/crates/web-sys/src/features/gen_GpuColorWrite.rs +++ b/crates/web-sys/src/features/gen_gpu_color_write.rs @@ -1,27 +1,16 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUColorWrite , typescript_type = "GPUColorWrite")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuColorWrite` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUColorWrite)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorWrite`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuColorWrite; -} -#[cfg(web_sys_unstable_apis)] -impl GpuColorWrite { +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +pub mod gpu_color_write { + #![allow(unused_imports)] + #![allow(clippy::all)] + use super::super::*; + use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUColorWrite.RED` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorWrite`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_color_write`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -29,7 +18,7 @@ impl GpuColorWrite { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUColorWrite.GREEN` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorWrite`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_color_write`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -37,7 +26,7 @@ impl GpuColorWrite { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUColorWrite.BLUE` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorWrite`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_color_write`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -45,7 +34,7 @@ impl GpuColorWrite { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUColorWrite.ALPHA` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorWrite`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_color_write`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -53,7 +42,7 @@ impl GpuColorWrite { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUColorWrite.ALL` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuColorWrite`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_color_write`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/gen_gpu_map_mode.rs b/crates/web-sys/src/features/gen_gpu_map_mode.rs new file mode 100644 index 00000000000..7ecc4b36c2d --- /dev/null +++ b/crates/web-sys/src/features/gen_gpu_map_mode.rs @@ -0,0 +1,26 @@ +#[cfg(web_sys_unstable_apis)] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +pub mod gpu_map_mode { + #![allow(unused_imports)] + #![allow(clippy::all)] + use super::super::*; + use wasm_bindgen::prelude::*; + #[cfg(web_sys_unstable_apis)] + #[doc = "The `GPUMapMode.READ` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `gpu_map_mode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const READ: u32 = 1u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "The `GPUMapMode.WRITE` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `gpu_map_mode`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const WRITE: u32 = 2u64 as u32; +} diff --git a/crates/web-sys/src/features/gen_gpu_shader_stage.rs b/crates/web-sys/src/features/gen_gpu_shader_stage.rs new file mode 100644 index 00000000000..9c192d00bb0 --- /dev/null +++ b/crates/web-sys/src/features/gen_gpu_shader_stage.rs @@ -0,0 +1,34 @@ +#[cfg(web_sys_unstable_apis)] +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +pub mod gpu_shader_stage { + #![allow(unused_imports)] + #![allow(clippy::all)] + use super::super::*; + use wasm_bindgen::prelude::*; + #[cfg(web_sys_unstable_apis)] + #[doc = "The `GPUShaderStage.VERTEX` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `gpu_shader_stage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const VERTEX: u32 = 1u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "The `GPUShaderStage.FRAGMENT` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `gpu_shader_stage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const FRAGMENT: u32 = 2u64 as u32; + #[cfg(web_sys_unstable_apis)] + #[doc = "The `GPUShaderStage.COMPUTE` const."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `gpu_shader_stage`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub const COMPUTE: u32 = 4u64 as u32; +} diff --git a/crates/web-sys/src/features/gen_GpuTextureUsage.rs b/crates/web-sys/src/features/gen_gpu_texture_usage.rs similarity index 69% rename from crates/web-sys/src/features/gen_GpuTextureUsage.rs rename to crates/web-sys/src/features/gen_gpu_texture_usage.rs index 208653c933e..f3197cca7e1 100644 --- a/crates/web-sys/src/features/gen_GpuTextureUsage.rs +++ b/crates/web-sys/src/features/gen_gpu_texture_usage.rs @@ -1,27 +1,16 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUTextureUsage , typescript_type = "GPUTextureUsage")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `GpuTextureUsage` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUTextureUsage)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureUsage`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type GpuTextureUsage; -} -#[cfg(web_sys_unstable_apis)] -impl GpuTextureUsage { +#[doc = ""] +#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] +#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] +pub mod gpu_texture_usage { + #![allow(unused_imports)] + #![allow(clippy::all)] + use super::super::*; + use wasm_bindgen::prelude::*; #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUTextureUsage.COPY_SRC` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_texture_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -29,7 +18,7 @@ impl GpuTextureUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUTextureUsage.COPY_DST` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_texture_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -37,7 +26,7 @@ impl GpuTextureUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUTextureUsage.TEXTURE_BINDING` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_texture_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -45,7 +34,7 @@ impl GpuTextureUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUTextureUsage.STORAGE_BINDING` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_texture_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] @@ -53,7 +42,7 @@ impl GpuTextureUsage { #[cfg(web_sys_unstable_apis)] #[doc = "The `GPUTextureUsage.RENDER_ATTACHMENT` const."] #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `GpuTextureUsage`*"] + #[doc = "*This API requires the following crate features to be activated: `gpu_texture_usage`*"] #[doc = ""] #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 56e88697404..4ffc9995e6f 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -2,8782 +2,11583 @@ #[allow(non_snake_case)] mod gen_AbortController; #[cfg(feature = "AbortController")] +#[allow(unused_imports)] pub use gen_AbortController::*; #[cfg(feature = "AbortSignal")] #[allow(non_snake_case)] mod gen_AbortSignal; #[cfg(feature = "AbortSignal")] +#[allow(unused_imports)] pub use gen_AbortSignal::*; #[cfg(feature = "AddEventListenerOptions")] #[allow(non_snake_case)] mod gen_AddEventListenerOptions; #[cfg(feature = "AddEventListenerOptions")] +#[allow(unused_imports)] pub use gen_AddEventListenerOptions::*; #[cfg(feature = "AesCbcParams")] #[allow(non_snake_case)] mod gen_AesCbcParams; #[cfg(feature = "AesCbcParams")] +#[allow(unused_imports)] pub use gen_AesCbcParams::*; #[cfg(feature = "AesCtrParams")] #[allow(non_snake_case)] mod gen_AesCtrParams; #[cfg(feature = "AesCtrParams")] +#[allow(unused_imports)] pub use gen_AesCtrParams::*; #[cfg(feature = "AesDerivedKeyParams")] #[allow(non_snake_case)] mod gen_AesDerivedKeyParams; #[cfg(feature = "AesDerivedKeyParams")] +#[allow(unused_imports)] pub use gen_AesDerivedKeyParams::*; #[cfg(feature = "AesGcmParams")] #[allow(non_snake_case)] mod gen_AesGcmParams; #[cfg(feature = "AesGcmParams")] +#[allow(unused_imports)] pub use gen_AesGcmParams::*; #[cfg(feature = "AesKeyAlgorithm")] #[allow(non_snake_case)] mod gen_AesKeyAlgorithm; #[cfg(feature = "AesKeyAlgorithm")] +#[allow(unused_imports)] pub use gen_AesKeyAlgorithm::*; #[cfg(feature = "AesKeyGenParams")] #[allow(non_snake_case)] mod gen_AesKeyGenParams; #[cfg(feature = "AesKeyGenParams")] +#[allow(unused_imports)] pub use gen_AesKeyGenParams::*; #[cfg(feature = "Algorithm")] #[allow(non_snake_case)] mod gen_Algorithm; #[cfg(feature = "Algorithm")] +#[allow(unused_imports)] pub use gen_Algorithm::*; #[cfg(feature = "AlignSetting")] #[allow(non_snake_case)] mod gen_AlignSetting; #[cfg(feature = "AlignSetting")] +#[allow(unused_imports)] pub use gen_AlignSetting::*; #[cfg(feature = "AllowedBluetoothDevice")] #[allow(non_snake_case)] mod gen_AllowedBluetoothDevice; #[cfg(feature = "AllowedBluetoothDevice")] +#[allow(unused_imports)] pub use gen_AllowedBluetoothDevice::*; #[cfg(feature = "AllowedUsbDevice")] #[allow(non_snake_case)] mod gen_AllowedUsbDevice; #[cfg(feature = "AllowedUsbDevice")] +#[allow(unused_imports)] pub use gen_AllowedUsbDevice::*; #[cfg(feature = "AlphaOption")] #[allow(non_snake_case)] mod gen_AlphaOption; #[cfg(feature = "AlphaOption")] +#[allow(unused_imports)] pub use gen_AlphaOption::*; #[cfg(feature = "AnalyserNode")] #[allow(non_snake_case)] mod gen_AnalyserNode; #[cfg(feature = "AnalyserNode")] +#[allow(unused_imports)] pub use gen_AnalyserNode::*; #[cfg(feature = "AnalyserOptions")] #[allow(non_snake_case)] mod gen_AnalyserOptions; #[cfg(feature = "AnalyserOptions")] +#[allow(unused_imports)] pub use gen_AnalyserOptions::*; #[cfg(feature = "AngleInstancedArrays")] #[allow(non_snake_case)] mod gen_AngleInstancedArrays; #[cfg(feature = "AngleInstancedArrays")] +#[allow(unused_imports)] pub use gen_AngleInstancedArrays::*; #[cfg(feature = "Animation")] #[allow(non_snake_case)] mod gen_Animation; #[cfg(feature = "Animation")] +#[allow(unused_imports)] pub use gen_Animation::*; #[cfg(feature = "AnimationEffect")] #[allow(non_snake_case)] mod gen_AnimationEffect; #[cfg(feature = "AnimationEffect")] +#[allow(unused_imports)] pub use gen_AnimationEffect::*; #[cfg(feature = "AnimationEvent")] #[allow(non_snake_case)] mod gen_AnimationEvent; #[cfg(feature = "AnimationEvent")] +#[allow(unused_imports)] pub use gen_AnimationEvent::*; #[cfg(feature = "AnimationEventInit")] #[allow(non_snake_case)] mod gen_AnimationEventInit; #[cfg(feature = "AnimationEventInit")] +#[allow(unused_imports)] pub use gen_AnimationEventInit::*; #[cfg(feature = "AnimationPlayState")] #[allow(non_snake_case)] mod gen_AnimationPlayState; #[cfg(feature = "AnimationPlayState")] +#[allow(unused_imports)] pub use gen_AnimationPlayState::*; #[cfg(feature = "AnimationPlaybackEvent")] #[allow(non_snake_case)] mod gen_AnimationPlaybackEvent; #[cfg(feature = "AnimationPlaybackEvent")] +#[allow(unused_imports)] pub use gen_AnimationPlaybackEvent::*; #[cfg(feature = "AnimationPlaybackEventInit")] #[allow(non_snake_case)] mod gen_AnimationPlaybackEventInit; #[cfg(feature = "AnimationPlaybackEventInit")] +#[allow(unused_imports)] pub use gen_AnimationPlaybackEventInit::*; #[cfg(feature = "AnimationPropertyDetails")] #[allow(non_snake_case)] mod gen_AnimationPropertyDetails; #[cfg(feature = "AnimationPropertyDetails")] +#[allow(unused_imports)] pub use gen_AnimationPropertyDetails::*; #[cfg(feature = "AnimationPropertyValueDetails")] #[allow(non_snake_case)] mod gen_AnimationPropertyValueDetails; #[cfg(feature = "AnimationPropertyValueDetails")] +#[allow(unused_imports)] pub use gen_AnimationPropertyValueDetails::*; #[cfg(feature = "AnimationTimeline")] #[allow(non_snake_case)] mod gen_AnimationTimeline; #[cfg(feature = "AnimationTimeline")] +#[allow(unused_imports)] pub use gen_AnimationTimeline::*; #[cfg(feature = "AssignedNodesOptions")] #[allow(non_snake_case)] mod gen_AssignedNodesOptions; #[cfg(feature = "AssignedNodesOptions")] +#[allow(unused_imports)] pub use gen_AssignedNodesOptions::*; #[cfg(feature = "AttestationConveyancePreference")] #[allow(non_snake_case)] mod gen_AttestationConveyancePreference; #[cfg(feature = "AttestationConveyancePreference")] +#[allow(unused_imports)] pub use gen_AttestationConveyancePreference::*; #[cfg(feature = "Attr")] #[allow(non_snake_case)] mod gen_Attr; #[cfg(feature = "Attr")] +#[allow(unused_imports)] pub use gen_Attr::*; #[cfg(feature = "AttributeNameValue")] #[allow(non_snake_case)] mod gen_AttributeNameValue; #[cfg(feature = "AttributeNameValue")] +#[allow(unused_imports)] pub use gen_AttributeNameValue::*; #[cfg(feature = "AudioBuffer")] #[allow(non_snake_case)] mod gen_AudioBuffer; #[cfg(feature = "AudioBuffer")] +#[allow(unused_imports)] pub use gen_AudioBuffer::*; #[cfg(feature = "AudioBufferOptions")] #[allow(non_snake_case)] mod gen_AudioBufferOptions; #[cfg(feature = "AudioBufferOptions")] +#[allow(unused_imports)] pub use gen_AudioBufferOptions::*; #[cfg(feature = "AudioBufferSourceNode")] #[allow(non_snake_case)] mod gen_AudioBufferSourceNode; #[cfg(feature = "AudioBufferSourceNode")] +#[allow(unused_imports)] pub use gen_AudioBufferSourceNode::*; #[cfg(feature = "AudioBufferSourceOptions")] #[allow(non_snake_case)] mod gen_AudioBufferSourceOptions; #[cfg(feature = "AudioBufferSourceOptions")] +#[allow(unused_imports)] pub use gen_AudioBufferSourceOptions::*; #[cfg(feature = "AudioConfiguration")] #[allow(non_snake_case)] mod gen_AudioConfiguration; #[cfg(feature = "AudioConfiguration")] +#[allow(unused_imports)] pub use gen_AudioConfiguration::*; #[cfg(feature = "AudioContext")] #[allow(non_snake_case)] mod gen_AudioContext; #[cfg(feature = "AudioContext")] +#[allow(unused_imports)] pub use gen_AudioContext::*; +#[cfg(feature = "AudioContextLatencyCategory")] +#[allow(non_snake_case)] +mod gen_AudioContextLatencyCategory; +#[cfg(feature = "AudioContextLatencyCategory")] +#[allow(unused_imports)] +pub use gen_AudioContextLatencyCategory::*; + #[cfg(feature = "AudioContextOptions")] #[allow(non_snake_case)] mod gen_AudioContextOptions; #[cfg(feature = "AudioContextOptions")] +#[allow(unused_imports)] pub use gen_AudioContextOptions::*; #[cfg(feature = "AudioContextState")] #[allow(non_snake_case)] mod gen_AudioContextState; #[cfg(feature = "AudioContextState")] +#[allow(unused_imports)] pub use gen_AudioContextState::*; #[cfg(feature = "AudioData")] #[allow(non_snake_case)] mod gen_AudioData; #[cfg(feature = "AudioData")] +#[allow(unused_imports)] pub use gen_AudioData::*; #[cfg(feature = "AudioDataCopyToOptions")] #[allow(non_snake_case)] mod gen_AudioDataCopyToOptions; #[cfg(feature = "AudioDataCopyToOptions")] +#[allow(unused_imports)] pub use gen_AudioDataCopyToOptions::*; #[cfg(feature = "AudioDataInit")] #[allow(non_snake_case)] mod gen_AudioDataInit; #[cfg(feature = "AudioDataInit")] +#[allow(unused_imports)] pub use gen_AudioDataInit::*; #[cfg(feature = "AudioDecoder")] #[allow(non_snake_case)] mod gen_AudioDecoder; #[cfg(feature = "AudioDecoder")] +#[allow(unused_imports)] pub use gen_AudioDecoder::*; #[cfg(feature = "AudioDecoderConfig")] #[allow(non_snake_case)] mod gen_AudioDecoderConfig; #[cfg(feature = "AudioDecoderConfig")] +#[allow(unused_imports)] pub use gen_AudioDecoderConfig::*; #[cfg(feature = "AudioDecoderInit")] #[allow(non_snake_case)] mod gen_AudioDecoderInit; #[cfg(feature = "AudioDecoderInit")] +#[allow(unused_imports)] pub use gen_AudioDecoderInit::*; #[cfg(feature = "AudioDecoderSupport")] #[allow(non_snake_case)] mod gen_AudioDecoderSupport; #[cfg(feature = "AudioDecoderSupport")] +#[allow(unused_imports)] pub use gen_AudioDecoderSupport::*; #[cfg(feature = "AudioDestinationNode")] #[allow(non_snake_case)] mod gen_AudioDestinationNode; #[cfg(feature = "AudioDestinationNode")] +#[allow(unused_imports)] pub use gen_AudioDestinationNode::*; #[cfg(feature = "AudioEncoder")] #[allow(non_snake_case)] mod gen_AudioEncoder; #[cfg(feature = "AudioEncoder")] +#[allow(unused_imports)] pub use gen_AudioEncoder::*; #[cfg(feature = "AudioEncoderConfig")] #[allow(non_snake_case)] mod gen_AudioEncoderConfig; #[cfg(feature = "AudioEncoderConfig")] +#[allow(unused_imports)] pub use gen_AudioEncoderConfig::*; #[cfg(feature = "AudioEncoderInit")] #[allow(non_snake_case)] mod gen_AudioEncoderInit; #[cfg(feature = "AudioEncoderInit")] +#[allow(unused_imports)] pub use gen_AudioEncoderInit::*; #[cfg(feature = "AudioEncoderSupport")] #[allow(non_snake_case)] mod gen_AudioEncoderSupport; #[cfg(feature = "AudioEncoderSupport")] +#[allow(unused_imports)] pub use gen_AudioEncoderSupport::*; #[cfg(feature = "AudioListener")] #[allow(non_snake_case)] mod gen_AudioListener; #[cfg(feature = "AudioListener")] +#[allow(unused_imports)] pub use gen_AudioListener::*; #[cfg(feature = "AudioNode")] #[allow(non_snake_case)] mod gen_AudioNode; #[cfg(feature = "AudioNode")] +#[allow(unused_imports)] pub use gen_AudioNode::*; #[cfg(feature = "AudioNodeOptions")] #[allow(non_snake_case)] mod gen_AudioNodeOptions; #[cfg(feature = "AudioNodeOptions")] +#[allow(unused_imports)] pub use gen_AudioNodeOptions::*; #[cfg(feature = "AudioParam")] #[allow(non_snake_case)] mod gen_AudioParam; #[cfg(feature = "AudioParam")] +#[allow(unused_imports)] pub use gen_AudioParam::*; #[cfg(feature = "AudioParamMap")] #[allow(non_snake_case)] mod gen_AudioParamMap; #[cfg(feature = "AudioParamMap")] +#[allow(unused_imports)] pub use gen_AudioParamMap::*; #[cfg(feature = "AudioProcessingEvent")] #[allow(non_snake_case)] mod gen_AudioProcessingEvent; #[cfg(feature = "AudioProcessingEvent")] +#[allow(unused_imports)] pub use gen_AudioProcessingEvent::*; #[cfg(feature = "AudioSampleFormat")] #[allow(non_snake_case)] mod gen_AudioSampleFormat; #[cfg(feature = "AudioSampleFormat")] +#[allow(unused_imports)] pub use gen_AudioSampleFormat::*; #[cfg(feature = "AudioScheduledSourceNode")] #[allow(non_snake_case)] mod gen_AudioScheduledSourceNode; #[cfg(feature = "AudioScheduledSourceNode")] +#[allow(unused_imports)] pub use gen_AudioScheduledSourceNode::*; +#[cfg(feature = "AudioSinkInfo")] +#[allow(non_snake_case)] +mod gen_AudioSinkInfo; +#[cfg(feature = "AudioSinkInfo")] +#[allow(unused_imports)] +pub use gen_AudioSinkInfo::*; + +#[cfg(feature = "AudioSinkOptions")] +#[allow(non_snake_case)] +mod gen_AudioSinkOptions; +#[cfg(feature = "AudioSinkOptions")] +#[allow(unused_imports)] +pub use gen_AudioSinkOptions::*; + +#[cfg(feature = "AudioSinkType")] +#[allow(non_snake_case)] +mod gen_AudioSinkType; +#[cfg(feature = "AudioSinkType")] +#[allow(unused_imports)] +pub use gen_AudioSinkType::*; + #[cfg(feature = "AudioStreamTrack")] #[allow(non_snake_case)] mod gen_AudioStreamTrack; #[cfg(feature = "AudioStreamTrack")] +#[allow(unused_imports)] pub use gen_AudioStreamTrack::*; #[cfg(feature = "AudioTrack")] #[allow(non_snake_case)] mod gen_AudioTrack; #[cfg(feature = "AudioTrack")] +#[allow(unused_imports)] pub use gen_AudioTrack::*; #[cfg(feature = "AudioTrackList")] #[allow(non_snake_case)] mod gen_AudioTrackList; #[cfg(feature = "AudioTrackList")] +#[allow(unused_imports)] pub use gen_AudioTrackList::*; #[cfg(feature = "AudioWorklet")] #[allow(non_snake_case)] mod gen_AudioWorklet; #[cfg(feature = "AudioWorklet")] +#[allow(unused_imports)] pub use gen_AudioWorklet::*; #[cfg(feature = "AudioWorkletGlobalScope")] #[allow(non_snake_case)] mod gen_AudioWorkletGlobalScope; #[cfg(feature = "AudioWorkletGlobalScope")] +#[allow(unused_imports)] pub use gen_AudioWorkletGlobalScope::*; #[cfg(feature = "AudioWorkletNode")] #[allow(non_snake_case)] mod gen_AudioWorkletNode; #[cfg(feature = "AudioWorkletNode")] +#[allow(unused_imports)] pub use gen_AudioWorkletNode::*; #[cfg(feature = "AudioWorkletNodeOptions")] #[allow(non_snake_case)] mod gen_AudioWorkletNodeOptions; #[cfg(feature = "AudioWorkletNodeOptions")] +#[allow(unused_imports)] pub use gen_AudioWorkletNodeOptions::*; #[cfg(feature = "AudioWorkletProcessor")] #[allow(non_snake_case)] mod gen_AudioWorkletProcessor; #[cfg(feature = "AudioWorkletProcessor")] +#[allow(unused_imports)] pub use gen_AudioWorkletProcessor::*; #[cfg(feature = "AuthenticationExtensionsClientInputs")] #[allow(non_snake_case)] mod gen_AuthenticationExtensionsClientInputs; #[cfg(feature = "AuthenticationExtensionsClientInputs")] +#[allow(unused_imports)] pub use gen_AuthenticationExtensionsClientInputs::*; +#[cfg(feature = "AuthenticationExtensionsClientInputsJson")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsClientInputsJson; +#[cfg(feature = "AuthenticationExtensionsClientInputsJson")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsClientInputsJson::*; + #[cfg(feature = "AuthenticationExtensionsClientOutputs")] #[allow(non_snake_case)] mod gen_AuthenticationExtensionsClientOutputs; #[cfg(feature = "AuthenticationExtensionsClientOutputs")] +#[allow(unused_imports)] pub use gen_AuthenticationExtensionsClientOutputs::*; +#[cfg(feature = "AuthenticationExtensionsClientOutputsJson")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsClientOutputsJson; +#[cfg(feature = "AuthenticationExtensionsClientOutputsJson")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsClientOutputsJson::*; + +#[cfg(feature = "AuthenticationExtensionsDevicePublicKeyInputs")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsDevicePublicKeyInputs; +#[cfg(feature = "AuthenticationExtensionsDevicePublicKeyInputs")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsDevicePublicKeyInputs::*; + +#[cfg(feature = "AuthenticationExtensionsDevicePublicKeyOutputs")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsDevicePublicKeyOutputs; +#[cfg(feature = "AuthenticationExtensionsDevicePublicKeyOutputs")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsDevicePublicKeyOutputs::*; + +#[cfg(feature = "AuthenticationExtensionsLargeBlobInputs")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsLargeBlobInputs; +#[cfg(feature = "AuthenticationExtensionsLargeBlobInputs")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsLargeBlobInputs::*; + +#[cfg(feature = "AuthenticationExtensionsLargeBlobOutputs")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsLargeBlobOutputs; +#[cfg(feature = "AuthenticationExtensionsLargeBlobOutputs")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsLargeBlobOutputs::*; + +#[cfg(feature = "AuthenticationExtensionsPrfInputs")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsPrfInputs; +#[cfg(feature = "AuthenticationExtensionsPrfInputs")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsPrfInputs::*; + +#[cfg(feature = "AuthenticationExtensionsPrfOutputs")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsPrfOutputs; +#[cfg(feature = "AuthenticationExtensionsPrfOutputs")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsPrfOutputs::*; + +#[cfg(feature = "AuthenticationExtensionsPrfValues")] +#[allow(non_snake_case)] +mod gen_AuthenticationExtensionsPrfValues; +#[cfg(feature = "AuthenticationExtensionsPrfValues")] +#[allow(unused_imports)] +pub use gen_AuthenticationExtensionsPrfValues::*; + +#[cfg(feature = "AuthenticationResponseJson")] +#[allow(non_snake_case)] +mod gen_AuthenticationResponseJson; +#[cfg(feature = "AuthenticationResponseJson")] +#[allow(unused_imports)] +pub use gen_AuthenticationResponseJson::*; + #[cfg(feature = "AuthenticatorAssertionResponse")] #[allow(non_snake_case)] mod gen_AuthenticatorAssertionResponse; #[cfg(feature = "AuthenticatorAssertionResponse")] +#[allow(unused_imports)] pub use gen_AuthenticatorAssertionResponse::*; +#[cfg(feature = "AuthenticatorAssertionResponseJson")] +#[allow(non_snake_case)] +mod gen_AuthenticatorAssertionResponseJson; +#[cfg(feature = "AuthenticatorAssertionResponseJson")] +#[allow(unused_imports)] +pub use gen_AuthenticatorAssertionResponseJson::*; + #[cfg(feature = "AuthenticatorAttachment")] #[allow(non_snake_case)] mod gen_AuthenticatorAttachment; #[cfg(feature = "AuthenticatorAttachment")] +#[allow(unused_imports)] pub use gen_AuthenticatorAttachment::*; #[cfg(feature = "AuthenticatorAttestationResponse")] #[allow(non_snake_case)] mod gen_AuthenticatorAttestationResponse; #[cfg(feature = "AuthenticatorAttestationResponse")] +#[allow(unused_imports)] pub use gen_AuthenticatorAttestationResponse::*; +#[cfg(feature = "AuthenticatorAttestationResponseJson")] +#[allow(non_snake_case)] +mod gen_AuthenticatorAttestationResponseJson; +#[cfg(feature = "AuthenticatorAttestationResponseJson")] +#[allow(unused_imports)] +pub use gen_AuthenticatorAttestationResponseJson::*; + #[cfg(feature = "AuthenticatorResponse")] #[allow(non_snake_case)] mod gen_AuthenticatorResponse; #[cfg(feature = "AuthenticatorResponse")] +#[allow(unused_imports)] pub use gen_AuthenticatorResponse::*; #[cfg(feature = "AuthenticatorSelectionCriteria")] #[allow(non_snake_case)] mod gen_AuthenticatorSelectionCriteria; #[cfg(feature = "AuthenticatorSelectionCriteria")] +#[allow(unused_imports)] pub use gen_AuthenticatorSelectionCriteria::*; #[cfg(feature = "AuthenticatorTransport")] #[allow(non_snake_case)] mod gen_AuthenticatorTransport; #[cfg(feature = "AuthenticatorTransport")] +#[allow(unused_imports)] pub use gen_AuthenticatorTransport::*; #[cfg(feature = "AutoKeyword")] #[allow(non_snake_case)] mod gen_AutoKeyword; #[cfg(feature = "AutoKeyword")] +#[allow(unused_imports)] pub use gen_AutoKeyword::*; #[cfg(feature = "AutocompleteInfo")] #[allow(non_snake_case)] mod gen_AutocompleteInfo; #[cfg(feature = "AutocompleteInfo")] +#[allow(unused_imports)] pub use gen_AutocompleteInfo::*; #[cfg(feature = "BarProp")] #[allow(non_snake_case)] mod gen_BarProp; #[cfg(feature = "BarProp")] +#[allow(unused_imports)] pub use gen_BarProp::*; #[cfg(feature = "BaseAudioContext")] #[allow(non_snake_case)] mod gen_BaseAudioContext; #[cfg(feature = "BaseAudioContext")] +#[allow(unused_imports)] pub use gen_BaseAudioContext::*; #[cfg(feature = "BaseComputedKeyframe")] #[allow(non_snake_case)] mod gen_BaseComputedKeyframe; #[cfg(feature = "BaseComputedKeyframe")] +#[allow(unused_imports)] pub use gen_BaseComputedKeyframe::*; #[cfg(feature = "BaseKeyframe")] #[allow(non_snake_case)] mod gen_BaseKeyframe; #[cfg(feature = "BaseKeyframe")] +#[allow(unused_imports)] pub use gen_BaseKeyframe::*; #[cfg(feature = "BasePropertyIndexedKeyframe")] #[allow(non_snake_case)] mod gen_BasePropertyIndexedKeyframe; #[cfg(feature = "BasePropertyIndexedKeyframe")] +#[allow(unused_imports)] pub use gen_BasePropertyIndexedKeyframe::*; #[cfg(feature = "BasicCardRequest")] #[allow(non_snake_case)] mod gen_BasicCardRequest; #[cfg(feature = "BasicCardRequest")] +#[allow(unused_imports)] pub use gen_BasicCardRequest::*; #[cfg(feature = "BasicCardResponse")] #[allow(non_snake_case)] mod gen_BasicCardResponse; #[cfg(feature = "BasicCardResponse")] +#[allow(unused_imports)] pub use gen_BasicCardResponse::*; #[cfg(feature = "BasicCardType")] #[allow(non_snake_case)] mod gen_BasicCardType; #[cfg(feature = "BasicCardType")] +#[allow(unused_imports)] pub use gen_BasicCardType::*; #[cfg(feature = "BatteryManager")] #[allow(non_snake_case)] mod gen_BatteryManager; #[cfg(feature = "BatteryManager")] +#[allow(unused_imports)] pub use gen_BatteryManager::*; #[cfg(feature = "BeforeUnloadEvent")] #[allow(non_snake_case)] mod gen_BeforeUnloadEvent; #[cfg(feature = "BeforeUnloadEvent")] +#[allow(unused_imports)] pub use gen_BeforeUnloadEvent::*; #[cfg(feature = "BinaryType")] #[allow(non_snake_case)] mod gen_BinaryType; #[cfg(feature = "BinaryType")] +#[allow(unused_imports)] pub use gen_BinaryType::*; #[cfg(feature = "BiquadFilterNode")] #[allow(non_snake_case)] mod gen_BiquadFilterNode; #[cfg(feature = "BiquadFilterNode")] +#[allow(unused_imports)] pub use gen_BiquadFilterNode::*; #[cfg(feature = "BiquadFilterOptions")] #[allow(non_snake_case)] mod gen_BiquadFilterOptions; #[cfg(feature = "BiquadFilterOptions")] +#[allow(unused_imports)] pub use gen_BiquadFilterOptions::*; #[cfg(feature = "BiquadFilterType")] #[allow(non_snake_case)] mod gen_BiquadFilterType; #[cfg(feature = "BiquadFilterType")] +#[allow(unused_imports)] pub use gen_BiquadFilterType::*; #[cfg(feature = "Blob")] #[allow(non_snake_case)] mod gen_Blob; #[cfg(feature = "Blob")] +#[allow(unused_imports)] pub use gen_Blob::*; #[cfg(feature = "BlobEvent")] #[allow(non_snake_case)] mod gen_BlobEvent; #[cfg(feature = "BlobEvent")] +#[allow(unused_imports)] pub use gen_BlobEvent::*; #[cfg(feature = "BlobEventInit")] #[allow(non_snake_case)] mod gen_BlobEventInit; #[cfg(feature = "BlobEventInit")] +#[allow(unused_imports)] pub use gen_BlobEventInit::*; #[cfg(feature = "BlobPropertyBag")] #[allow(non_snake_case)] mod gen_BlobPropertyBag; #[cfg(feature = "BlobPropertyBag")] +#[allow(unused_imports)] pub use gen_BlobPropertyBag::*; #[cfg(feature = "BlockParsingOptions")] #[allow(non_snake_case)] mod gen_BlockParsingOptions; #[cfg(feature = "BlockParsingOptions")] +#[allow(unused_imports)] pub use gen_BlockParsingOptions::*; #[cfg(feature = "Bluetooth")] #[allow(non_snake_case)] mod gen_Bluetooth; #[cfg(feature = "Bluetooth")] +#[allow(unused_imports)] pub use gen_Bluetooth::*; #[cfg(feature = "BluetoothAdvertisingEvent")] #[allow(non_snake_case)] mod gen_BluetoothAdvertisingEvent; #[cfg(feature = "BluetoothAdvertisingEvent")] +#[allow(unused_imports)] pub use gen_BluetoothAdvertisingEvent::*; #[cfg(feature = "BluetoothAdvertisingEventInit")] #[allow(non_snake_case)] mod gen_BluetoothAdvertisingEventInit; #[cfg(feature = "BluetoothAdvertisingEventInit")] +#[allow(unused_imports)] pub use gen_BluetoothAdvertisingEventInit::*; #[cfg(feature = "BluetoothCharacteristicProperties")] #[allow(non_snake_case)] mod gen_BluetoothCharacteristicProperties; #[cfg(feature = "BluetoothCharacteristicProperties")] +#[allow(unused_imports)] pub use gen_BluetoothCharacteristicProperties::*; #[cfg(feature = "BluetoothDataFilterInit")] #[allow(non_snake_case)] mod gen_BluetoothDataFilterInit; #[cfg(feature = "BluetoothDataFilterInit")] +#[allow(unused_imports)] pub use gen_BluetoothDataFilterInit::*; #[cfg(feature = "BluetoothDevice")] #[allow(non_snake_case)] mod gen_BluetoothDevice; #[cfg(feature = "BluetoothDevice")] +#[allow(unused_imports)] pub use gen_BluetoothDevice::*; #[cfg(feature = "BluetoothLeScanFilterInit")] #[allow(non_snake_case)] mod gen_BluetoothLeScanFilterInit; #[cfg(feature = "BluetoothLeScanFilterInit")] +#[allow(unused_imports)] pub use gen_BluetoothLeScanFilterInit::*; #[cfg(feature = "BluetoothManufacturerDataMap")] #[allow(non_snake_case)] mod gen_BluetoothManufacturerDataMap; #[cfg(feature = "BluetoothManufacturerDataMap")] +#[allow(unused_imports)] pub use gen_BluetoothManufacturerDataMap::*; #[cfg(feature = "BluetoothPermissionDescriptor")] #[allow(non_snake_case)] mod gen_BluetoothPermissionDescriptor; #[cfg(feature = "BluetoothPermissionDescriptor")] +#[allow(unused_imports)] pub use gen_BluetoothPermissionDescriptor::*; #[cfg(feature = "BluetoothPermissionResult")] #[allow(non_snake_case)] mod gen_BluetoothPermissionResult; #[cfg(feature = "BluetoothPermissionResult")] +#[allow(unused_imports)] pub use gen_BluetoothPermissionResult::*; #[cfg(feature = "BluetoothPermissionStorage")] #[allow(non_snake_case)] mod gen_BluetoothPermissionStorage; #[cfg(feature = "BluetoothPermissionStorage")] +#[allow(unused_imports)] pub use gen_BluetoothPermissionStorage::*; #[cfg(feature = "BluetoothRemoteGattCharacteristic")] #[allow(non_snake_case)] mod gen_BluetoothRemoteGattCharacteristic; #[cfg(feature = "BluetoothRemoteGattCharacteristic")] +#[allow(unused_imports)] pub use gen_BluetoothRemoteGattCharacteristic::*; #[cfg(feature = "BluetoothRemoteGattDescriptor")] #[allow(non_snake_case)] mod gen_BluetoothRemoteGattDescriptor; #[cfg(feature = "BluetoothRemoteGattDescriptor")] +#[allow(unused_imports)] pub use gen_BluetoothRemoteGattDescriptor::*; #[cfg(feature = "BluetoothRemoteGattServer")] #[allow(non_snake_case)] mod gen_BluetoothRemoteGattServer; #[cfg(feature = "BluetoothRemoteGattServer")] +#[allow(unused_imports)] pub use gen_BluetoothRemoteGattServer::*; #[cfg(feature = "BluetoothRemoteGattService")] #[allow(non_snake_case)] mod gen_BluetoothRemoteGattService; #[cfg(feature = "BluetoothRemoteGattService")] +#[allow(unused_imports)] pub use gen_BluetoothRemoteGattService::*; #[cfg(feature = "BluetoothServiceDataMap")] #[allow(non_snake_case)] mod gen_BluetoothServiceDataMap; #[cfg(feature = "BluetoothServiceDataMap")] +#[allow(unused_imports)] pub use gen_BluetoothServiceDataMap::*; #[cfg(feature = "BluetoothUuid")] #[allow(non_snake_case)] mod gen_BluetoothUuid; #[cfg(feature = "BluetoothUuid")] +#[allow(unused_imports)] pub use gen_BluetoothUuid::*; #[cfg(feature = "BoxQuadOptions")] #[allow(non_snake_case)] mod gen_BoxQuadOptions; #[cfg(feature = "BoxQuadOptions")] +#[allow(unused_imports)] pub use gen_BoxQuadOptions::*; #[cfg(feature = "BroadcastChannel")] #[allow(non_snake_case)] mod gen_BroadcastChannel; #[cfg(feature = "BroadcastChannel")] +#[allow(unused_imports)] pub use gen_BroadcastChannel::*; #[cfg(feature = "BrowserElementDownloadOptions")] #[allow(non_snake_case)] mod gen_BrowserElementDownloadOptions; #[cfg(feature = "BrowserElementDownloadOptions")] +#[allow(unused_imports)] pub use gen_BrowserElementDownloadOptions::*; #[cfg(feature = "BrowserElementExecuteScriptOptions")] #[allow(non_snake_case)] mod gen_BrowserElementExecuteScriptOptions; #[cfg(feature = "BrowserElementExecuteScriptOptions")] +#[allow(unused_imports)] pub use gen_BrowserElementExecuteScriptOptions::*; #[cfg(feature = "BrowserFeedWriter")] #[allow(non_snake_case)] mod gen_BrowserFeedWriter; #[cfg(feature = "BrowserFeedWriter")] +#[allow(unused_imports)] pub use gen_BrowserFeedWriter::*; #[cfg(feature = "BrowserFindCaseSensitivity")] #[allow(non_snake_case)] mod gen_BrowserFindCaseSensitivity; #[cfg(feature = "BrowserFindCaseSensitivity")] +#[allow(unused_imports)] pub use gen_BrowserFindCaseSensitivity::*; #[cfg(feature = "BrowserFindDirection")] #[allow(non_snake_case)] mod gen_BrowserFindDirection; #[cfg(feature = "BrowserFindDirection")] +#[allow(unused_imports)] pub use gen_BrowserFindDirection::*; +#[cfg(feature = "ByteLengthQueuingStrategy")] +#[allow(non_snake_case)] +mod gen_ByteLengthQueuingStrategy; +#[cfg(feature = "ByteLengthQueuingStrategy")] +#[allow(unused_imports)] +pub use gen_ByteLengthQueuingStrategy::*; + #[cfg(feature = "Cache")] #[allow(non_snake_case)] mod gen_Cache; #[cfg(feature = "Cache")] +#[allow(unused_imports)] pub use gen_Cache::*; #[cfg(feature = "CacheBatchOperation")] #[allow(non_snake_case)] mod gen_CacheBatchOperation; #[cfg(feature = "CacheBatchOperation")] +#[allow(unused_imports)] pub use gen_CacheBatchOperation::*; #[cfg(feature = "CacheQueryOptions")] #[allow(non_snake_case)] mod gen_CacheQueryOptions; #[cfg(feature = "CacheQueryOptions")] +#[allow(unused_imports)] pub use gen_CacheQueryOptions::*; #[cfg(feature = "CacheStorage")] #[allow(non_snake_case)] mod gen_CacheStorage; #[cfg(feature = "CacheStorage")] +#[allow(unused_imports)] pub use gen_CacheStorage::*; #[cfg(feature = "CacheStorageNamespace")] #[allow(non_snake_case)] mod gen_CacheStorageNamespace; #[cfg(feature = "CacheStorageNamespace")] +#[allow(unused_imports)] pub use gen_CacheStorageNamespace::*; #[cfg(feature = "CanvasCaptureMediaStream")] #[allow(non_snake_case)] mod gen_CanvasCaptureMediaStream; #[cfg(feature = "CanvasCaptureMediaStream")] +#[allow(unused_imports)] pub use gen_CanvasCaptureMediaStream::*; +#[cfg(feature = "CanvasCaptureMediaStreamTrack")] +#[allow(non_snake_case)] +mod gen_CanvasCaptureMediaStreamTrack; +#[cfg(feature = "CanvasCaptureMediaStreamTrack")] +#[allow(unused_imports)] +pub use gen_CanvasCaptureMediaStreamTrack::*; + #[cfg(feature = "CanvasGradient")] #[allow(non_snake_case)] mod gen_CanvasGradient; #[cfg(feature = "CanvasGradient")] +#[allow(unused_imports)] pub use gen_CanvasGradient::*; #[cfg(feature = "CanvasPattern")] #[allow(non_snake_case)] mod gen_CanvasPattern; #[cfg(feature = "CanvasPattern")] +#[allow(unused_imports)] pub use gen_CanvasPattern::*; #[cfg(feature = "CanvasRenderingContext2d")] #[allow(non_snake_case)] mod gen_CanvasRenderingContext2d; #[cfg(feature = "CanvasRenderingContext2d")] +#[allow(unused_imports)] pub use gen_CanvasRenderingContext2d::*; #[cfg(feature = "CanvasWindingRule")] #[allow(non_snake_case)] mod gen_CanvasWindingRule; #[cfg(feature = "CanvasWindingRule")] +#[allow(unused_imports)] pub use gen_CanvasWindingRule::*; #[cfg(feature = "CaretChangedReason")] #[allow(non_snake_case)] mod gen_CaretChangedReason; #[cfg(feature = "CaretChangedReason")] +#[allow(unused_imports)] pub use gen_CaretChangedReason::*; #[cfg(feature = "CaretPosition")] #[allow(non_snake_case)] mod gen_CaretPosition; #[cfg(feature = "CaretPosition")] +#[allow(unused_imports)] pub use gen_CaretPosition::*; #[cfg(feature = "CaretStateChangedEventInit")] #[allow(non_snake_case)] mod gen_CaretStateChangedEventInit; #[cfg(feature = "CaretStateChangedEventInit")] +#[allow(unused_imports)] pub use gen_CaretStateChangedEventInit::*; #[cfg(feature = "CdataSection")] #[allow(non_snake_case)] mod gen_CdataSection; #[cfg(feature = "CdataSection")] +#[allow(unused_imports)] pub use gen_CdataSection::*; #[cfg(feature = "ChannelCountMode")] #[allow(non_snake_case)] mod gen_ChannelCountMode; #[cfg(feature = "ChannelCountMode")] +#[allow(unused_imports)] pub use gen_ChannelCountMode::*; #[cfg(feature = "ChannelInterpretation")] #[allow(non_snake_case)] mod gen_ChannelInterpretation; #[cfg(feature = "ChannelInterpretation")] +#[allow(unused_imports)] pub use gen_ChannelInterpretation::*; #[cfg(feature = "ChannelMergerNode")] #[allow(non_snake_case)] mod gen_ChannelMergerNode; #[cfg(feature = "ChannelMergerNode")] +#[allow(unused_imports)] pub use gen_ChannelMergerNode::*; #[cfg(feature = "ChannelMergerOptions")] #[allow(non_snake_case)] mod gen_ChannelMergerOptions; #[cfg(feature = "ChannelMergerOptions")] +#[allow(unused_imports)] pub use gen_ChannelMergerOptions::*; -#[cfg(feature = "ChannelPixelLayout")] -#[allow(non_snake_case)] -mod gen_ChannelPixelLayout; -#[cfg(feature = "ChannelPixelLayout")] -pub use gen_ChannelPixelLayout::*; - -#[cfg(feature = "ChannelPixelLayoutDataType")] -#[allow(non_snake_case)] -mod gen_ChannelPixelLayoutDataType; -#[cfg(feature = "ChannelPixelLayoutDataType")] -pub use gen_ChannelPixelLayoutDataType::*; - #[cfg(feature = "ChannelSplitterNode")] #[allow(non_snake_case)] mod gen_ChannelSplitterNode; #[cfg(feature = "ChannelSplitterNode")] +#[allow(unused_imports)] pub use gen_ChannelSplitterNode::*; #[cfg(feature = "ChannelSplitterOptions")] #[allow(non_snake_case)] mod gen_ChannelSplitterOptions; #[cfg(feature = "ChannelSplitterOptions")] +#[allow(unused_imports)] pub use gen_ChannelSplitterOptions::*; #[cfg(feature = "CharacterData")] #[allow(non_snake_case)] mod gen_CharacterData; #[cfg(feature = "CharacterData")] +#[allow(unused_imports)] pub use gen_CharacterData::*; #[cfg(feature = "CheckerboardReason")] #[allow(non_snake_case)] mod gen_CheckerboardReason; #[cfg(feature = "CheckerboardReason")] +#[allow(unused_imports)] pub use gen_CheckerboardReason::*; #[cfg(feature = "CheckerboardReport")] #[allow(non_snake_case)] mod gen_CheckerboardReport; #[cfg(feature = "CheckerboardReport")] +#[allow(unused_imports)] pub use gen_CheckerboardReport::*; #[cfg(feature = "CheckerboardReportService")] #[allow(non_snake_case)] mod gen_CheckerboardReportService; #[cfg(feature = "CheckerboardReportService")] +#[allow(unused_imports)] pub use gen_CheckerboardReportService::*; #[cfg(feature = "ChromeFilePropertyBag")] #[allow(non_snake_case)] mod gen_ChromeFilePropertyBag; #[cfg(feature = "ChromeFilePropertyBag")] +#[allow(unused_imports)] pub use gen_ChromeFilePropertyBag::*; #[cfg(feature = "ChromeWorker")] #[allow(non_snake_case)] mod gen_ChromeWorker; #[cfg(feature = "ChromeWorker")] +#[allow(unused_imports)] pub use gen_ChromeWorker::*; #[cfg(feature = "Client")] #[allow(non_snake_case)] mod gen_Client; #[cfg(feature = "Client")] +#[allow(unused_imports)] pub use gen_Client::*; #[cfg(feature = "ClientQueryOptions")] #[allow(non_snake_case)] mod gen_ClientQueryOptions; #[cfg(feature = "ClientQueryOptions")] +#[allow(unused_imports)] pub use gen_ClientQueryOptions::*; #[cfg(feature = "ClientRectsAndTexts")] #[allow(non_snake_case)] mod gen_ClientRectsAndTexts; #[cfg(feature = "ClientRectsAndTexts")] +#[allow(unused_imports)] pub use gen_ClientRectsAndTexts::*; #[cfg(feature = "ClientType")] #[allow(non_snake_case)] mod gen_ClientType; #[cfg(feature = "ClientType")] +#[allow(unused_imports)] pub use gen_ClientType::*; #[cfg(feature = "Clients")] #[allow(non_snake_case)] mod gen_Clients; #[cfg(feature = "Clients")] +#[allow(unused_imports)] pub use gen_Clients::*; #[cfg(feature = "Clipboard")] #[allow(non_snake_case)] mod gen_Clipboard; #[cfg(feature = "Clipboard")] +#[allow(unused_imports)] pub use gen_Clipboard::*; #[cfg(feature = "ClipboardEvent")] #[allow(non_snake_case)] mod gen_ClipboardEvent; #[cfg(feature = "ClipboardEvent")] +#[allow(unused_imports)] pub use gen_ClipboardEvent::*; #[cfg(feature = "ClipboardEventInit")] #[allow(non_snake_case)] mod gen_ClipboardEventInit; #[cfg(feature = "ClipboardEventInit")] +#[allow(unused_imports)] pub use gen_ClipboardEventInit::*; #[cfg(feature = "ClipboardItem")] #[allow(non_snake_case)] mod gen_ClipboardItem; #[cfg(feature = "ClipboardItem")] +#[allow(unused_imports)] pub use gen_ClipboardItem::*; #[cfg(feature = "ClipboardItemOptions")] #[allow(non_snake_case)] mod gen_ClipboardItemOptions; #[cfg(feature = "ClipboardItemOptions")] +#[allow(unused_imports)] pub use gen_ClipboardItemOptions::*; #[cfg(feature = "ClipboardPermissionDescriptor")] #[allow(non_snake_case)] mod gen_ClipboardPermissionDescriptor; #[cfg(feature = "ClipboardPermissionDescriptor")] +#[allow(unused_imports)] pub use gen_ClipboardPermissionDescriptor::*; +#[cfg(feature = "ClipboardUnsanitizedFormats")] +#[allow(non_snake_case)] +mod gen_ClipboardUnsanitizedFormats; +#[cfg(feature = "ClipboardUnsanitizedFormats")] +#[allow(unused_imports)] +pub use gen_ClipboardUnsanitizedFormats::*; + #[cfg(feature = "CloseEvent")] #[allow(non_snake_case)] mod gen_CloseEvent; #[cfg(feature = "CloseEvent")] +#[allow(unused_imports)] pub use gen_CloseEvent::*; #[cfg(feature = "CloseEventInit")] #[allow(non_snake_case)] mod gen_CloseEventInit; #[cfg(feature = "CloseEventInit")] +#[allow(unused_imports)] pub use gen_CloseEventInit::*; #[cfg(feature = "CodecState")] #[allow(non_snake_case)] mod gen_CodecState; #[cfg(feature = "CodecState")] +#[allow(unused_imports)] pub use gen_CodecState::*; #[cfg(feature = "CollectedClientData")] #[allow(non_snake_case)] mod gen_CollectedClientData; #[cfg(feature = "CollectedClientData")] +#[allow(unused_imports)] pub use gen_CollectedClientData::*; +#[cfg(feature = "ColorSpaceConversion")] +#[allow(non_snake_case)] +mod gen_ColorSpaceConversion; +#[cfg(feature = "ColorSpaceConversion")] +#[allow(unused_imports)] +pub use gen_ColorSpaceConversion::*; + #[cfg(feature = "Comment")] #[allow(non_snake_case)] mod gen_Comment; #[cfg(feature = "Comment")] +#[allow(unused_imports)] pub use gen_Comment::*; #[cfg(feature = "CompositeOperation")] #[allow(non_snake_case)] mod gen_CompositeOperation; #[cfg(feature = "CompositeOperation")] +#[allow(unused_imports)] pub use gen_CompositeOperation::*; #[cfg(feature = "CompositionEvent")] #[allow(non_snake_case)] mod gen_CompositionEvent; #[cfg(feature = "CompositionEvent")] +#[allow(unused_imports)] pub use gen_CompositionEvent::*; #[cfg(feature = "CompositionEventInit")] #[allow(non_snake_case)] mod gen_CompositionEventInit; #[cfg(feature = "CompositionEventInit")] +#[allow(unused_imports)] pub use gen_CompositionEventInit::*; +#[cfg(feature = "CompressionFormat")] +#[allow(non_snake_case)] +mod gen_CompressionFormat; +#[cfg(feature = "CompressionFormat")] +#[allow(unused_imports)] +pub use gen_CompressionFormat::*; + +#[cfg(feature = "CompressionStream")] +#[allow(non_snake_case)] +mod gen_CompressionStream; +#[cfg(feature = "CompressionStream")] +#[allow(unused_imports)] +pub use gen_CompressionStream::*; + #[cfg(feature = "ComputedEffectTiming")] #[allow(non_snake_case)] mod gen_ComputedEffectTiming; #[cfg(feature = "ComputedEffectTiming")] +#[allow(unused_imports)] pub use gen_ComputedEffectTiming::*; #[cfg(feature = "ConnStatusDict")] #[allow(non_snake_case)] mod gen_ConnStatusDict; #[cfg(feature = "ConnStatusDict")] +#[allow(unused_imports)] pub use gen_ConnStatusDict::*; #[cfg(feature = "ConnectionType")] #[allow(non_snake_case)] mod gen_ConnectionType; #[cfg(feature = "ConnectionType")] +#[allow(unused_imports)] pub use gen_ConnectionType::*; #[cfg(feature = "ConsoleCounter")] #[allow(non_snake_case)] mod gen_ConsoleCounter; #[cfg(feature = "ConsoleCounter")] +#[allow(unused_imports)] pub use gen_ConsoleCounter::*; #[cfg(feature = "ConsoleCounterError")] #[allow(non_snake_case)] mod gen_ConsoleCounterError; #[cfg(feature = "ConsoleCounterError")] +#[allow(unused_imports)] pub use gen_ConsoleCounterError::*; #[cfg(feature = "ConsoleEvent")] #[allow(non_snake_case)] mod gen_ConsoleEvent; #[cfg(feature = "ConsoleEvent")] +#[allow(unused_imports)] pub use gen_ConsoleEvent::*; #[cfg(feature = "ConsoleInstance")] #[allow(non_snake_case)] mod gen_ConsoleInstance; #[cfg(feature = "ConsoleInstance")] +#[allow(unused_imports)] pub use gen_ConsoleInstance::*; #[cfg(feature = "ConsoleInstanceOptions")] #[allow(non_snake_case)] mod gen_ConsoleInstanceOptions; #[cfg(feature = "ConsoleInstanceOptions")] +#[allow(unused_imports)] pub use gen_ConsoleInstanceOptions::*; #[cfg(feature = "ConsoleLevel")] #[allow(non_snake_case)] mod gen_ConsoleLevel; #[cfg(feature = "ConsoleLevel")] +#[allow(unused_imports)] pub use gen_ConsoleLevel::*; #[cfg(feature = "ConsoleLogLevel")] #[allow(non_snake_case)] mod gen_ConsoleLogLevel; #[cfg(feature = "ConsoleLogLevel")] +#[allow(unused_imports)] pub use gen_ConsoleLogLevel::*; #[cfg(feature = "ConsoleProfileEvent")] #[allow(non_snake_case)] mod gen_ConsoleProfileEvent; #[cfg(feature = "ConsoleProfileEvent")] +#[allow(unused_imports)] pub use gen_ConsoleProfileEvent::*; #[cfg(feature = "ConsoleStackEntry")] #[allow(non_snake_case)] mod gen_ConsoleStackEntry; #[cfg(feature = "ConsoleStackEntry")] +#[allow(unused_imports)] pub use gen_ConsoleStackEntry::*; #[cfg(feature = "ConsoleTimerError")] #[allow(non_snake_case)] mod gen_ConsoleTimerError; #[cfg(feature = "ConsoleTimerError")] +#[allow(unused_imports)] pub use gen_ConsoleTimerError::*; #[cfg(feature = "ConsoleTimerLogOrEnd")] #[allow(non_snake_case)] mod gen_ConsoleTimerLogOrEnd; #[cfg(feature = "ConsoleTimerLogOrEnd")] +#[allow(unused_imports)] pub use gen_ConsoleTimerLogOrEnd::*; #[cfg(feature = "ConsoleTimerStart")] #[allow(non_snake_case)] mod gen_ConsoleTimerStart; #[cfg(feature = "ConsoleTimerStart")] +#[allow(unused_imports)] pub use gen_ConsoleTimerStart::*; #[cfg(feature = "ConstantSourceNode")] #[allow(non_snake_case)] mod gen_ConstantSourceNode; #[cfg(feature = "ConstantSourceNode")] +#[allow(unused_imports)] pub use gen_ConstantSourceNode::*; #[cfg(feature = "ConstantSourceOptions")] #[allow(non_snake_case)] mod gen_ConstantSourceOptions; #[cfg(feature = "ConstantSourceOptions")] +#[allow(unused_imports)] pub use gen_ConstantSourceOptions::*; #[cfg(feature = "ConstrainBooleanParameters")] #[allow(non_snake_case)] mod gen_ConstrainBooleanParameters; #[cfg(feature = "ConstrainBooleanParameters")] +#[allow(unused_imports)] pub use gen_ConstrainBooleanParameters::*; #[cfg(feature = "ConstrainDomStringParameters")] #[allow(non_snake_case)] mod gen_ConstrainDomStringParameters; #[cfg(feature = "ConstrainDomStringParameters")] +#[allow(unused_imports)] pub use gen_ConstrainDomStringParameters::*; #[cfg(feature = "ConstrainDoubleRange")] #[allow(non_snake_case)] mod gen_ConstrainDoubleRange; #[cfg(feature = "ConstrainDoubleRange")] +#[allow(unused_imports)] pub use gen_ConstrainDoubleRange::*; #[cfg(feature = "ConstrainLongRange")] #[allow(non_snake_case)] mod gen_ConstrainLongRange; #[cfg(feature = "ConstrainLongRange")] +#[allow(unused_imports)] pub use gen_ConstrainLongRange::*; #[cfg(feature = "ContextAttributes2d")] #[allow(non_snake_case)] mod gen_ContextAttributes2d; #[cfg(feature = "ContextAttributes2d")] +#[allow(unused_imports)] pub use gen_ContextAttributes2d::*; #[cfg(feature = "ConvertCoordinateOptions")] #[allow(non_snake_case)] mod gen_ConvertCoordinateOptions; #[cfg(feature = "ConvertCoordinateOptions")] +#[allow(unused_imports)] pub use gen_ConvertCoordinateOptions::*; #[cfg(feature = "ConvolverNode")] #[allow(non_snake_case)] mod gen_ConvolverNode; #[cfg(feature = "ConvolverNode")] +#[allow(unused_imports)] pub use gen_ConvolverNode::*; #[cfg(feature = "ConvolverOptions")] #[allow(non_snake_case)] mod gen_ConvolverOptions; #[cfg(feature = "ConvolverOptions")] +#[allow(unused_imports)] pub use gen_ConvolverOptions::*; #[cfg(feature = "Coordinates")] #[allow(non_snake_case)] mod gen_Coordinates; #[cfg(feature = "Coordinates")] +#[allow(unused_imports)] pub use gen_Coordinates::*; +#[cfg(feature = "CountQueuingStrategy")] +#[allow(non_snake_case)] +mod gen_CountQueuingStrategy; +#[cfg(feature = "CountQueuingStrategy")] +#[allow(unused_imports)] +pub use gen_CountQueuingStrategy::*; + #[cfg(feature = "Credential")] #[allow(non_snake_case)] mod gen_Credential; #[cfg(feature = "Credential")] +#[allow(unused_imports)] pub use gen_Credential::*; #[cfg(feature = "CredentialCreationOptions")] #[allow(non_snake_case)] mod gen_CredentialCreationOptions; #[cfg(feature = "CredentialCreationOptions")] +#[allow(unused_imports)] pub use gen_CredentialCreationOptions::*; +#[cfg(feature = "CredentialPropertiesOutput")] +#[allow(non_snake_case)] +mod gen_CredentialPropertiesOutput; +#[cfg(feature = "CredentialPropertiesOutput")] +#[allow(unused_imports)] +pub use gen_CredentialPropertiesOutput::*; + #[cfg(feature = "CredentialRequestOptions")] #[allow(non_snake_case)] mod gen_CredentialRequestOptions; #[cfg(feature = "CredentialRequestOptions")] +#[allow(unused_imports)] pub use gen_CredentialRequestOptions::*; #[cfg(feature = "CredentialsContainer")] #[allow(non_snake_case)] mod gen_CredentialsContainer; #[cfg(feature = "CredentialsContainer")] +#[allow(unused_imports)] pub use gen_CredentialsContainer::*; #[cfg(feature = "Crypto")] #[allow(non_snake_case)] mod gen_Crypto; #[cfg(feature = "Crypto")] +#[allow(unused_imports)] pub use gen_Crypto::*; #[cfg(feature = "CryptoKey")] #[allow(non_snake_case)] mod gen_CryptoKey; #[cfg(feature = "CryptoKey")] +#[allow(unused_imports)] pub use gen_CryptoKey::*; #[cfg(feature = "CryptoKeyPair")] #[allow(non_snake_case)] mod gen_CryptoKeyPair; #[cfg(feature = "CryptoKeyPair")] +#[allow(unused_imports)] pub use gen_CryptoKeyPair::*; -#[cfg(feature = "Csp")] -#[allow(non_snake_case)] -mod gen_Csp; -#[cfg(feature = "Csp")] -pub use gen_Csp::*; - -#[cfg(feature = "CspPolicies")] -#[allow(non_snake_case)] -mod gen_CspPolicies; -#[cfg(feature = "CspPolicies")] -pub use gen_CspPolicies::*; - -#[cfg(feature = "CspReport")] -#[allow(non_snake_case)] -mod gen_CspReport; -#[cfg(feature = "CspReport")] -pub use gen_CspReport::*; - -#[cfg(feature = "CspReportProperties")] -#[allow(non_snake_case)] -mod gen_CspReportProperties; -#[cfg(feature = "CspReportProperties")] -pub use gen_CspReportProperties::*; - #[cfg(feature = "CssAnimation")] #[allow(non_snake_case)] mod gen_CssAnimation; #[cfg(feature = "CssAnimation")] +#[allow(unused_imports)] pub use gen_CssAnimation::*; #[cfg(feature = "CssBoxType")] #[allow(non_snake_case)] mod gen_CssBoxType; #[cfg(feature = "CssBoxType")] +#[allow(unused_imports)] pub use gen_CssBoxType::*; #[cfg(feature = "CssConditionRule")] #[allow(non_snake_case)] mod gen_CssConditionRule; #[cfg(feature = "CssConditionRule")] +#[allow(unused_imports)] pub use gen_CssConditionRule::*; #[cfg(feature = "CssCounterStyleRule")] #[allow(non_snake_case)] mod gen_CssCounterStyleRule; #[cfg(feature = "CssCounterStyleRule")] +#[allow(unused_imports)] pub use gen_CssCounterStyleRule::*; #[cfg(feature = "CssFontFaceRule")] #[allow(non_snake_case)] mod gen_CssFontFaceRule; #[cfg(feature = "CssFontFaceRule")] +#[allow(unused_imports)] pub use gen_CssFontFaceRule::*; #[cfg(feature = "CssFontFeatureValuesRule")] #[allow(non_snake_case)] mod gen_CssFontFeatureValuesRule; #[cfg(feature = "CssFontFeatureValuesRule")] +#[allow(unused_imports)] pub use gen_CssFontFeatureValuesRule::*; #[cfg(feature = "CssGroupingRule")] #[allow(non_snake_case)] mod gen_CssGroupingRule; #[cfg(feature = "CssGroupingRule")] +#[allow(unused_imports)] pub use gen_CssGroupingRule::*; #[cfg(feature = "CssImportRule")] #[allow(non_snake_case)] mod gen_CssImportRule; #[cfg(feature = "CssImportRule")] +#[allow(unused_imports)] pub use gen_CssImportRule::*; #[cfg(feature = "CssKeyframeRule")] #[allow(non_snake_case)] mod gen_CssKeyframeRule; #[cfg(feature = "CssKeyframeRule")] +#[allow(unused_imports)] pub use gen_CssKeyframeRule::*; #[cfg(feature = "CssKeyframesRule")] #[allow(non_snake_case)] mod gen_CssKeyframesRule; #[cfg(feature = "CssKeyframesRule")] +#[allow(unused_imports)] pub use gen_CssKeyframesRule::*; #[cfg(feature = "CssMediaRule")] #[allow(non_snake_case)] mod gen_CssMediaRule; #[cfg(feature = "CssMediaRule")] +#[allow(unused_imports)] pub use gen_CssMediaRule::*; #[cfg(feature = "CssNamespaceRule")] #[allow(non_snake_case)] mod gen_CssNamespaceRule; #[cfg(feature = "CssNamespaceRule")] +#[allow(unused_imports)] pub use gen_CssNamespaceRule::*; #[cfg(feature = "CssPageRule")] #[allow(non_snake_case)] mod gen_CssPageRule; #[cfg(feature = "CssPageRule")] +#[allow(unused_imports)] pub use gen_CssPageRule::*; #[cfg(feature = "CssPseudoElement")] #[allow(non_snake_case)] mod gen_CssPseudoElement; #[cfg(feature = "CssPseudoElement")] +#[allow(unused_imports)] pub use gen_CssPseudoElement::*; #[cfg(feature = "CssRule")] #[allow(non_snake_case)] mod gen_CssRule; #[cfg(feature = "CssRule")] +#[allow(unused_imports)] pub use gen_CssRule::*; #[cfg(feature = "CssRuleList")] #[allow(non_snake_case)] mod gen_CssRuleList; #[cfg(feature = "CssRuleList")] +#[allow(unused_imports)] pub use gen_CssRuleList::*; #[cfg(feature = "CssStyleDeclaration")] #[allow(non_snake_case)] mod gen_CssStyleDeclaration; #[cfg(feature = "CssStyleDeclaration")] +#[allow(unused_imports)] pub use gen_CssStyleDeclaration::*; #[cfg(feature = "CssStyleRule")] #[allow(non_snake_case)] mod gen_CssStyleRule; #[cfg(feature = "CssStyleRule")] +#[allow(unused_imports)] pub use gen_CssStyleRule::*; #[cfg(feature = "CssStyleSheet")] #[allow(non_snake_case)] mod gen_CssStyleSheet; #[cfg(feature = "CssStyleSheet")] +#[allow(unused_imports)] pub use gen_CssStyleSheet::*; #[cfg(feature = "CssStyleSheetParsingMode")] #[allow(non_snake_case)] mod gen_CssStyleSheetParsingMode; #[cfg(feature = "CssStyleSheetParsingMode")] +#[allow(unused_imports)] pub use gen_CssStyleSheetParsingMode::*; #[cfg(feature = "CssSupportsRule")] #[allow(non_snake_case)] mod gen_CssSupportsRule; #[cfg(feature = "CssSupportsRule")] +#[allow(unused_imports)] pub use gen_CssSupportsRule::*; #[cfg(feature = "CssTransition")] #[allow(non_snake_case)] mod gen_CssTransition; #[cfg(feature = "CssTransition")] +#[allow(unused_imports)] pub use gen_CssTransition::*; #[cfg(feature = "CustomElementRegistry")] #[allow(non_snake_case)] mod gen_CustomElementRegistry; #[cfg(feature = "CustomElementRegistry")] +#[allow(unused_imports)] pub use gen_CustomElementRegistry::*; #[cfg(feature = "CustomEvent")] #[allow(non_snake_case)] mod gen_CustomEvent; #[cfg(feature = "CustomEvent")] +#[allow(unused_imports)] pub use gen_CustomEvent::*; #[cfg(feature = "CustomEventInit")] #[allow(non_snake_case)] mod gen_CustomEventInit; #[cfg(feature = "CustomEventInit")] +#[allow(unused_imports)] pub use gen_CustomEventInit::*; #[cfg(feature = "DataTransfer")] #[allow(non_snake_case)] mod gen_DataTransfer; #[cfg(feature = "DataTransfer")] +#[allow(unused_imports)] pub use gen_DataTransfer::*; #[cfg(feature = "DataTransferItem")] #[allow(non_snake_case)] mod gen_DataTransferItem; #[cfg(feature = "DataTransferItem")] +#[allow(unused_imports)] pub use gen_DataTransferItem::*; #[cfg(feature = "DataTransferItemList")] #[allow(non_snake_case)] mod gen_DataTransferItemList; #[cfg(feature = "DataTransferItemList")] +#[allow(unused_imports)] pub use gen_DataTransferItemList::*; #[cfg(feature = "DateTimeValue")] #[allow(non_snake_case)] mod gen_DateTimeValue; #[cfg(feature = "DateTimeValue")] +#[allow(unused_imports)] pub use gen_DateTimeValue::*; #[cfg(feature = "DecoderDoctorNotification")] #[allow(non_snake_case)] mod gen_DecoderDoctorNotification; #[cfg(feature = "DecoderDoctorNotification")] +#[allow(unused_imports)] pub use gen_DecoderDoctorNotification::*; #[cfg(feature = "DecoderDoctorNotificationType")] #[allow(non_snake_case)] mod gen_DecoderDoctorNotificationType; #[cfg(feature = "DecoderDoctorNotificationType")] +#[allow(unused_imports)] pub use gen_DecoderDoctorNotificationType::*; +#[cfg(feature = "DecompressionStream")] +#[allow(non_snake_case)] +mod gen_DecompressionStream; +#[cfg(feature = "DecompressionStream")] +#[allow(unused_imports)] +pub use gen_DecompressionStream::*; + #[cfg(feature = "DedicatedWorkerGlobalScope")] #[allow(non_snake_case)] mod gen_DedicatedWorkerGlobalScope; #[cfg(feature = "DedicatedWorkerGlobalScope")] +#[allow(unused_imports)] pub use gen_DedicatedWorkerGlobalScope::*; #[cfg(feature = "DelayNode")] #[allow(non_snake_case)] mod gen_DelayNode; #[cfg(feature = "DelayNode")] +#[allow(unused_imports)] pub use gen_DelayNode::*; #[cfg(feature = "DelayOptions")] #[allow(non_snake_case)] mod gen_DelayOptions; #[cfg(feature = "DelayOptions")] +#[allow(unused_imports)] pub use gen_DelayOptions::*; #[cfg(feature = "DeviceAcceleration")] #[allow(non_snake_case)] mod gen_DeviceAcceleration; #[cfg(feature = "DeviceAcceleration")] +#[allow(unused_imports)] pub use gen_DeviceAcceleration::*; #[cfg(feature = "DeviceAccelerationInit")] #[allow(non_snake_case)] mod gen_DeviceAccelerationInit; #[cfg(feature = "DeviceAccelerationInit")] +#[allow(unused_imports)] pub use gen_DeviceAccelerationInit::*; #[cfg(feature = "DeviceLightEvent")] #[allow(non_snake_case)] mod gen_DeviceLightEvent; #[cfg(feature = "DeviceLightEvent")] +#[allow(unused_imports)] pub use gen_DeviceLightEvent::*; #[cfg(feature = "DeviceLightEventInit")] #[allow(non_snake_case)] mod gen_DeviceLightEventInit; #[cfg(feature = "DeviceLightEventInit")] +#[allow(unused_imports)] pub use gen_DeviceLightEventInit::*; #[cfg(feature = "DeviceMotionEvent")] #[allow(non_snake_case)] mod gen_DeviceMotionEvent; #[cfg(feature = "DeviceMotionEvent")] +#[allow(unused_imports)] pub use gen_DeviceMotionEvent::*; #[cfg(feature = "DeviceMotionEventInit")] #[allow(non_snake_case)] mod gen_DeviceMotionEventInit; #[cfg(feature = "DeviceMotionEventInit")] +#[allow(unused_imports)] pub use gen_DeviceMotionEventInit::*; #[cfg(feature = "DeviceOrientationEvent")] #[allow(non_snake_case)] mod gen_DeviceOrientationEvent; #[cfg(feature = "DeviceOrientationEvent")] +#[allow(unused_imports)] pub use gen_DeviceOrientationEvent::*; #[cfg(feature = "DeviceOrientationEventInit")] #[allow(non_snake_case)] mod gen_DeviceOrientationEventInit; #[cfg(feature = "DeviceOrientationEventInit")] +#[allow(unused_imports)] pub use gen_DeviceOrientationEventInit::*; #[cfg(feature = "DeviceProximityEvent")] #[allow(non_snake_case)] mod gen_DeviceProximityEvent; #[cfg(feature = "DeviceProximityEvent")] +#[allow(unused_imports)] pub use gen_DeviceProximityEvent::*; #[cfg(feature = "DeviceProximityEventInit")] #[allow(non_snake_case)] mod gen_DeviceProximityEventInit; #[cfg(feature = "DeviceProximityEventInit")] +#[allow(unused_imports)] pub use gen_DeviceProximityEventInit::*; #[cfg(feature = "DeviceRotationRate")] #[allow(non_snake_case)] mod gen_DeviceRotationRate; #[cfg(feature = "DeviceRotationRate")] +#[allow(unused_imports)] pub use gen_DeviceRotationRate::*; #[cfg(feature = "DeviceRotationRateInit")] #[allow(non_snake_case)] mod gen_DeviceRotationRateInit; #[cfg(feature = "DeviceRotationRateInit")] +#[allow(unused_imports)] pub use gen_DeviceRotationRateInit::*; #[cfg(feature = "DhKeyDeriveParams")] #[allow(non_snake_case)] mod gen_DhKeyDeriveParams; #[cfg(feature = "DhKeyDeriveParams")] +#[allow(unused_imports)] pub use gen_DhKeyDeriveParams::*; #[cfg(feature = "DirectionSetting")] #[allow(non_snake_case)] mod gen_DirectionSetting; #[cfg(feature = "DirectionSetting")] +#[allow(unused_imports)] pub use gen_DirectionSetting::*; #[cfg(feature = "Directory")] #[allow(non_snake_case)] mod gen_Directory; #[cfg(feature = "Directory")] +#[allow(unused_imports)] pub use gen_Directory::*; +#[cfg(feature = "DirectoryPickerOptions")] +#[allow(non_snake_case)] +mod gen_DirectoryPickerOptions; +#[cfg(feature = "DirectoryPickerOptions")] +#[allow(unused_imports)] +pub use gen_DirectoryPickerOptions::*; + #[cfg(feature = "DisplayMediaStreamConstraints")] #[allow(non_snake_case)] mod gen_DisplayMediaStreamConstraints; #[cfg(feature = "DisplayMediaStreamConstraints")] +#[allow(unused_imports)] pub use gen_DisplayMediaStreamConstraints::*; #[cfg(feature = "DisplayNameOptions")] #[allow(non_snake_case)] mod gen_DisplayNameOptions; #[cfg(feature = "DisplayNameOptions")] +#[allow(unused_imports)] pub use gen_DisplayNameOptions::*; #[cfg(feature = "DisplayNameResult")] #[allow(non_snake_case)] mod gen_DisplayNameResult; #[cfg(feature = "DisplayNameResult")] +#[allow(unused_imports)] pub use gen_DisplayNameResult::*; #[cfg(feature = "DistanceModelType")] #[allow(non_snake_case)] mod gen_DistanceModelType; #[cfg(feature = "DistanceModelType")] +#[allow(unused_imports)] pub use gen_DistanceModelType::*; #[cfg(feature = "DnsCacheDict")] #[allow(non_snake_case)] mod gen_DnsCacheDict; #[cfg(feature = "DnsCacheDict")] +#[allow(unused_imports)] pub use gen_DnsCacheDict::*; #[cfg(feature = "DnsCacheEntry")] #[allow(non_snake_case)] mod gen_DnsCacheEntry; #[cfg(feature = "DnsCacheEntry")] +#[allow(unused_imports)] pub use gen_DnsCacheEntry::*; #[cfg(feature = "DnsLookupDict")] #[allow(non_snake_case)] mod gen_DnsLookupDict; #[cfg(feature = "DnsLookupDict")] +#[allow(unused_imports)] pub use gen_DnsLookupDict::*; #[cfg(feature = "Document")] #[allow(non_snake_case)] mod gen_Document; #[cfg(feature = "Document")] +#[allow(unused_imports)] pub use gen_Document::*; #[cfg(feature = "DocumentFragment")] #[allow(non_snake_case)] mod gen_DocumentFragment; #[cfg(feature = "DocumentFragment")] +#[allow(unused_imports)] pub use gen_DocumentFragment::*; #[cfg(feature = "DocumentTimeline")] #[allow(non_snake_case)] mod gen_DocumentTimeline; #[cfg(feature = "DocumentTimeline")] +#[allow(unused_imports)] pub use gen_DocumentTimeline::*; #[cfg(feature = "DocumentTimelineOptions")] #[allow(non_snake_case)] mod gen_DocumentTimelineOptions; #[cfg(feature = "DocumentTimelineOptions")] +#[allow(unused_imports)] pub use gen_DocumentTimelineOptions::*; #[cfg(feature = "DocumentType")] #[allow(non_snake_case)] mod gen_DocumentType; #[cfg(feature = "DocumentType")] +#[allow(unused_imports)] pub use gen_DocumentType::*; #[cfg(feature = "DomError")] #[allow(non_snake_case)] mod gen_DomError; #[cfg(feature = "DomError")] +#[allow(unused_imports)] pub use gen_DomError::*; #[cfg(feature = "DomException")] #[allow(non_snake_case)] mod gen_DomException; #[cfg(feature = "DomException")] +#[allow(unused_imports)] pub use gen_DomException::*; #[cfg(feature = "DomImplementation")] #[allow(non_snake_case)] mod gen_DomImplementation; #[cfg(feature = "DomImplementation")] +#[allow(unused_imports)] pub use gen_DomImplementation::*; #[cfg(feature = "DomMatrix")] #[allow(non_snake_case)] mod gen_DomMatrix; #[cfg(feature = "DomMatrix")] +#[allow(unused_imports)] pub use gen_DomMatrix::*; +#[cfg(feature = "DomMatrix2dInit")] +#[allow(non_snake_case)] +mod gen_DomMatrix2dInit; +#[cfg(feature = "DomMatrix2dInit")] +#[allow(unused_imports)] +pub use gen_DomMatrix2dInit::*; + +#[cfg(feature = "DomMatrixInit")] +#[allow(non_snake_case)] +mod gen_DomMatrixInit; +#[cfg(feature = "DomMatrixInit")] +#[allow(unused_imports)] +pub use gen_DomMatrixInit::*; + #[cfg(feature = "DomMatrixReadOnly")] #[allow(non_snake_case)] mod gen_DomMatrixReadOnly; #[cfg(feature = "DomMatrixReadOnly")] +#[allow(unused_imports)] pub use gen_DomMatrixReadOnly::*; #[cfg(feature = "DomParser")] #[allow(non_snake_case)] mod gen_DomParser; #[cfg(feature = "DomParser")] +#[allow(unused_imports)] pub use gen_DomParser::*; #[cfg(feature = "DomPoint")] #[allow(non_snake_case)] mod gen_DomPoint; #[cfg(feature = "DomPoint")] +#[allow(unused_imports)] pub use gen_DomPoint::*; #[cfg(feature = "DomPointInit")] #[allow(non_snake_case)] mod gen_DomPointInit; #[cfg(feature = "DomPointInit")] +#[allow(unused_imports)] pub use gen_DomPointInit::*; #[cfg(feature = "DomPointReadOnly")] #[allow(non_snake_case)] mod gen_DomPointReadOnly; #[cfg(feature = "DomPointReadOnly")] +#[allow(unused_imports)] pub use gen_DomPointReadOnly::*; #[cfg(feature = "DomQuad")] #[allow(non_snake_case)] mod gen_DomQuad; #[cfg(feature = "DomQuad")] +#[allow(unused_imports)] pub use gen_DomQuad::*; #[cfg(feature = "DomQuadInit")] #[allow(non_snake_case)] mod gen_DomQuadInit; #[cfg(feature = "DomQuadInit")] +#[allow(unused_imports)] pub use gen_DomQuadInit::*; #[cfg(feature = "DomQuadJson")] #[allow(non_snake_case)] mod gen_DomQuadJson; #[cfg(feature = "DomQuadJson")] +#[allow(unused_imports)] pub use gen_DomQuadJson::*; #[cfg(feature = "DomRect")] #[allow(non_snake_case)] mod gen_DomRect; #[cfg(feature = "DomRect")] +#[allow(unused_imports)] pub use gen_DomRect::*; #[cfg(feature = "DomRectInit")] #[allow(non_snake_case)] mod gen_DomRectInit; #[cfg(feature = "DomRectInit")] +#[allow(unused_imports)] pub use gen_DomRectInit::*; #[cfg(feature = "DomRectList")] #[allow(non_snake_case)] mod gen_DomRectList; #[cfg(feature = "DomRectList")] +#[allow(unused_imports)] pub use gen_DomRectList::*; #[cfg(feature = "DomRectReadOnly")] #[allow(non_snake_case)] mod gen_DomRectReadOnly; #[cfg(feature = "DomRectReadOnly")] +#[allow(unused_imports)] pub use gen_DomRectReadOnly::*; #[cfg(feature = "DomRequest")] #[allow(non_snake_case)] mod gen_DomRequest; #[cfg(feature = "DomRequest")] +#[allow(unused_imports)] pub use gen_DomRequest::*; #[cfg(feature = "DomRequestReadyState")] #[allow(non_snake_case)] mod gen_DomRequestReadyState; #[cfg(feature = "DomRequestReadyState")] +#[allow(unused_imports)] pub use gen_DomRequestReadyState::*; #[cfg(feature = "DomStringList")] #[allow(non_snake_case)] mod gen_DomStringList; #[cfg(feature = "DomStringList")] +#[allow(unused_imports)] pub use gen_DomStringList::*; #[cfg(feature = "DomStringMap")] #[allow(non_snake_case)] mod gen_DomStringMap; #[cfg(feature = "DomStringMap")] +#[allow(unused_imports)] pub use gen_DomStringMap::*; #[cfg(feature = "DomTokenList")] #[allow(non_snake_case)] mod gen_DomTokenList; #[cfg(feature = "DomTokenList")] +#[allow(unused_imports)] pub use gen_DomTokenList::*; #[cfg(feature = "DomWindowResizeEventDetail")] #[allow(non_snake_case)] mod gen_DomWindowResizeEventDetail; #[cfg(feature = "DomWindowResizeEventDetail")] +#[allow(unused_imports)] pub use gen_DomWindowResizeEventDetail::*; +#[cfg(feature = "DoubleRange")] +#[allow(non_snake_case)] +mod gen_DoubleRange; +#[cfg(feature = "DoubleRange")] +#[allow(unused_imports)] +pub use gen_DoubleRange::*; + #[cfg(feature = "DragEvent")] #[allow(non_snake_case)] mod gen_DragEvent; #[cfg(feature = "DragEvent")] +#[allow(unused_imports)] pub use gen_DragEvent::*; #[cfg(feature = "DragEventInit")] #[allow(non_snake_case)] mod gen_DragEventInit; #[cfg(feature = "DragEventInit")] +#[allow(unused_imports)] pub use gen_DragEventInit::*; #[cfg(feature = "DynamicsCompressorNode")] #[allow(non_snake_case)] mod gen_DynamicsCompressorNode; #[cfg(feature = "DynamicsCompressorNode")] +#[allow(unused_imports)] pub use gen_DynamicsCompressorNode::*; #[cfg(feature = "DynamicsCompressorOptions")] #[allow(non_snake_case)] mod gen_DynamicsCompressorOptions; #[cfg(feature = "DynamicsCompressorOptions")] +#[allow(unused_imports)] pub use gen_DynamicsCompressorOptions::*; #[cfg(feature = "EcKeyAlgorithm")] #[allow(non_snake_case)] mod gen_EcKeyAlgorithm; #[cfg(feature = "EcKeyAlgorithm")] +#[allow(unused_imports)] pub use gen_EcKeyAlgorithm::*; #[cfg(feature = "EcKeyGenParams")] #[allow(non_snake_case)] mod gen_EcKeyGenParams; #[cfg(feature = "EcKeyGenParams")] +#[allow(unused_imports)] pub use gen_EcKeyGenParams::*; #[cfg(feature = "EcKeyImportParams")] #[allow(non_snake_case)] mod gen_EcKeyImportParams; #[cfg(feature = "EcKeyImportParams")] +#[allow(unused_imports)] pub use gen_EcKeyImportParams::*; #[cfg(feature = "EcdhKeyDeriveParams")] #[allow(non_snake_case)] mod gen_EcdhKeyDeriveParams; #[cfg(feature = "EcdhKeyDeriveParams")] +#[allow(unused_imports)] pub use gen_EcdhKeyDeriveParams::*; #[cfg(feature = "EcdsaParams")] #[allow(non_snake_case)] mod gen_EcdsaParams; #[cfg(feature = "EcdsaParams")] +#[allow(unused_imports)] pub use gen_EcdsaParams::*; #[cfg(feature = "EffectTiming")] #[allow(non_snake_case)] mod gen_EffectTiming; #[cfg(feature = "EffectTiming")] +#[allow(unused_imports)] pub use gen_EffectTiming::*; #[cfg(feature = "Element")] #[allow(non_snake_case)] mod gen_Element; #[cfg(feature = "Element")] +#[allow(unused_imports)] pub use gen_Element::*; #[cfg(feature = "ElementCreationOptions")] #[allow(non_snake_case)] mod gen_ElementCreationOptions; #[cfg(feature = "ElementCreationOptions")] +#[allow(unused_imports)] pub use gen_ElementCreationOptions::*; #[cfg(feature = "ElementDefinitionOptions")] #[allow(non_snake_case)] mod gen_ElementDefinitionOptions; #[cfg(feature = "ElementDefinitionOptions")] +#[allow(unused_imports)] pub use gen_ElementDefinitionOptions::*; #[cfg(feature = "EncodedAudioChunk")] #[allow(non_snake_case)] mod gen_EncodedAudioChunk; #[cfg(feature = "EncodedAudioChunk")] +#[allow(unused_imports)] pub use gen_EncodedAudioChunk::*; #[cfg(feature = "EncodedAudioChunkInit")] #[allow(non_snake_case)] mod gen_EncodedAudioChunkInit; #[cfg(feature = "EncodedAudioChunkInit")] +#[allow(unused_imports)] pub use gen_EncodedAudioChunkInit::*; #[cfg(feature = "EncodedAudioChunkMetadata")] #[allow(non_snake_case)] mod gen_EncodedAudioChunkMetadata; #[cfg(feature = "EncodedAudioChunkMetadata")] +#[allow(unused_imports)] pub use gen_EncodedAudioChunkMetadata::*; #[cfg(feature = "EncodedAudioChunkType")] #[allow(non_snake_case)] mod gen_EncodedAudioChunkType; #[cfg(feature = "EncodedAudioChunkType")] +#[allow(unused_imports)] pub use gen_EncodedAudioChunkType::*; #[cfg(feature = "EncodedVideoChunk")] #[allow(non_snake_case)] mod gen_EncodedVideoChunk; #[cfg(feature = "EncodedVideoChunk")] +#[allow(unused_imports)] pub use gen_EncodedVideoChunk::*; #[cfg(feature = "EncodedVideoChunkInit")] #[allow(non_snake_case)] mod gen_EncodedVideoChunkInit; #[cfg(feature = "EncodedVideoChunkInit")] +#[allow(unused_imports)] pub use gen_EncodedVideoChunkInit::*; #[cfg(feature = "EncodedVideoChunkMetadata")] #[allow(non_snake_case)] mod gen_EncodedVideoChunkMetadata; #[cfg(feature = "EncodedVideoChunkMetadata")] +#[allow(unused_imports)] pub use gen_EncodedVideoChunkMetadata::*; #[cfg(feature = "EncodedVideoChunkType")] #[allow(non_snake_case)] mod gen_EncodedVideoChunkType; #[cfg(feature = "EncodedVideoChunkType")] +#[allow(unused_imports)] pub use gen_EncodedVideoChunkType::*; #[cfg(feature = "EndingTypes")] #[allow(non_snake_case)] mod gen_EndingTypes; #[cfg(feature = "EndingTypes")] +#[allow(unused_imports)] pub use gen_EndingTypes::*; #[cfg(feature = "ErrorCallback")] #[allow(non_snake_case)] mod gen_ErrorCallback; #[cfg(feature = "ErrorCallback")] +#[allow(unused_imports)] pub use gen_ErrorCallback::*; #[cfg(feature = "ErrorEvent")] #[allow(non_snake_case)] mod gen_ErrorEvent; #[cfg(feature = "ErrorEvent")] +#[allow(unused_imports)] pub use gen_ErrorEvent::*; #[cfg(feature = "ErrorEventInit")] #[allow(non_snake_case)] mod gen_ErrorEventInit; #[cfg(feature = "ErrorEventInit")] +#[allow(unused_imports)] pub use gen_ErrorEventInit::*; #[cfg(feature = "Event")] #[allow(non_snake_case)] mod gen_Event; #[cfg(feature = "Event")] +#[allow(unused_imports)] pub use gen_Event::*; #[cfg(feature = "EventInit")] #[allow(non_snake_case)] mod gen_EventInit; #[cfg(feature = "EventInit")] +#[allow(unused_imports)] pub use gen_EventInit::*; #[cfg(feature = "EventListener")] #[allow(non_snake_case)] mod gen_EventListener; #[cfg(feature = "EventListener")] +#[allow(unused_imports)] pub use gen_EventListener::*; #[cfg(feature = "EventListenerOptions")] #[allow(non_snake_case)] mod gen_EventListenerOptions; #[cfg(feature = "EventListenerOptions")] +#[allow(unused_imports)] pub use gen_EventListenerOptions::*; #[cfg(feature = "EventModifierInit")] #[allow(non_snake_case)] mod gen_EventModifierInit; #[cfg(feature = "EventModifierInit")] +#[allow(unused_imports)] pub use gen_EventModifierInit::*; #[cfg(feature = "EventSource")] #[allow(non_snake_case)] mod gen_EventSource; #[cfg(feature = "EventSource")] +#[allow(unused_imports)] pub use gen_EventSource::*; #[cfg(feature = "EventSourceInit")] #[allow(non_snake_case)] mod gen_EventSourceInit; #[cfg(feature = "EventSourceInit")] +#[allow(unused_imports)] pub use gen_EventSourceInit::*; #[cfg(feature = "EventTarget")] #[allow(non_snake_case)] mod gen_EventTarget; #[cfg(feature = "EventTarget")] +#[allow(unused_imports)] pub use gen_EventTarget::*; #[cfg(feature = "Exception")] #[allow(non_snake_case)] mod gen_Exception; #[cfg(feature = "Exception")] +#[allow(unused_imports)] pub use gen_Exception::*; #[cfg(feature = "ExtBlendMinmax")] #[allow(non_snake_case)] mod gen_ExtBlendMinmax; #[cfg(feature = "ExtBlendMinmax")] +#[allow(unused_imports)] pub use gen_ExtBlendMinmax::*; #[cfg(feature = "ExtColorBufferFloat")] #[allow(non_snake_case)] mod gen_ExtColorBufferFloat; #[cfg(feature = "ExtColorBufferFloat")] +#[allow(unused_imports)] pub use gen_ExtColorBufferFloat::*; #[cfg(feature = "ExtColorBufferHalfFloat")] #[allow(non_snake_case)] mod gen_ExtColorBufferHalfFloat; #[cfg(feature = "ExtColorBufferHalfFloat")] +#[allow(unused_imports)] pub use gen_ExtColorBufferHalfFloat::*; #[cfg(feature = "ExtDisjointTimerQuery")] #[allow(non_snake_case)] mod gen_ExtDisjointTimerQuery; #[cfg(feature = "ExtDisjointTimerQuery")] +#[allow(unused_imports)] pub use gen_ExtDisjointTimerQuery::*; #[cfg(feature = "ExtFragDepth")] #[allow(non_snake_case)] mod gen_ExtFragDepth; #[cfg(feature = "ExtFragDepth")] +#[allow(unused_imports)] pub use gen_ExtFragDepth::*; #[cfg(feature = "ExtSRgb")] #[allow(non_snake_case)] mod gen_ExtSRgb; #[cfg(feature = "ExtSRgb")] +#[allow(unused_imports)] pub use gen_ExtSRgb::*; #[cfg(feature = "ExtShaderTextureLod")] #[allow(non_snake_case)] mod gen_ExtShaderTextureLod; #[cfg(feature = "ExtShaderTextureLod")] +#[allow(unused_imports)] pub use gen_ExtShaderTextureLod::*; #[cfg(feature = "ExtTextureFilterAnisotropic")] #[allow(non_snake_case)] mod gen_ExtTextureFilterAnisotropic; #[cfg(feature = "ExtTextureFilterAnisotropic")] +#[allow(unused_imports)] pub use gen_ExtTextureFilterAnisotropic::*; +#[cfg(feature = "ExtTextureNorm16")] +#[allow(non_snake_case)] +mod gen_ExtTextureNorm16; +#[cfg(feature = "ExtTextureNorm16")] +#[allow(unused_imports)] +pub use gen_ExtTextureNorm16::*; + #[cfg(feature = "ExtendableEvent")] #[allow(non_snake_case)] mod gen_ExtendableEvent; #[cfg(feature = "ExtendableEvent")] +#[allow(unused_imports)] pub use gen_ExtendableEvent::*; #[cfg(feature = "ExtendableEventInit")] #[allow(non_snake_case)] mod gen_ExtendableEventInit; #[cfg(feature = "ExtendableEventInit")] +#[allow(unused_imports)] pub use gen_ExtendableEventInit::*; #[cfg(feature = "ExtendableMessageEvent")] #[allow(non_snake_case)] mod gen_ExtendableMessageEvent; #[cfg(feature = "ExtendableMessageEvent")] +#[allow(unused_imports)] pub use gen_ExtendableMessageEvent::*; #[cfg(feature = "ExtendableMessageEventInit")] #[allow(non_snake_case)] mod gen_ExtendableMessageEventInit; #[cfg(feature = "ExtendableMessageEventInit")] +#[allow(unused_imports)] pub use gen_ExtendableMessageEventInit::*; #[cfg(feature = "External")] #[allow(non_snake_case)] mod gen_External; #[cfg(feature = "External")] +#[allow(unused_imports)] pub use gen_External::*; #[cfg(feature = "FakePluginMimeEntry")] #[allow(non_snake_case)] mod gen_FakePluginMimeEntry; #[cfg(feature = "FakePluginMimeEntry")] +#[allow(unused_imports)] pub use gen_FakePluginMimeEntry::*; #[cfg(feature = "FakePluginTagInit")] #[allow(non_snake_case)] mod gen_FakePluginTagInit; #[cfg(feature = "FakePluginTagInit")] +#[allow(unused_imports)] pub use gen_FakePluginTagInit::*; #[cfg(feature = "FetchEvent")] #[allow(non_snake_case)] mod gen_FetchEvent; #[cfg(feature = "FetchEvent")] +#[allow(unused_imports)] pub use gen_FetchEvent::*; #[cfg(feature = "FetchEventInit")] #[allow(non_snake_case)] mod gen_FetchEventInit; #[cfg(feature = "FetchEventInit")] +#[allow(unused_imports)] pub use gen_FetchEventInit::*; #[cfg(feature = "FetchObserver")] #[allow(non_snake_case)] mod gen_FetchObserver; #[cfg(feature = "FetchObserver")] +#[allow(unused_imports)] pub use gen_FetchObserver::*; #[cfg(feature = "FetchReadableStreamReadDataArray")] #[allow(non_snake_case)] mod gen_FetchReadableStreamReadDataArray; #[cfg(feature = "FetchReadableStreamReadDataArray")] +#[allow(unused_imports)] pub use gen_FetchReadableStreamReadDataArray::*; #[cfg(feature = "FetchReadableStreamReadDataDone")] #[allow(non_snake_case)] mod gen_FetchReadableStreamReadDataDone; #[cfg(feature = "FetchReadableStreamReadDataDone")] +#[allow(unused_imports)] pub use gen_FetchReadableStreamReadDataDone::*; #[cfg(feature = "FetchState")] #[allow(non_snake_case)] mod gen_FetchState; #[cfg(feature = "FetchState")] +#[allow(unused_imports)] pub use gen_FetchState::*; #[cfg(feature = "File")] #[allow(non_snake_case)] mod gen_File; #[cfg(feature = "File")] +#[allow(unused_imports)] pub use gen_File::*; #[cfg(feature = "FileCallback")] #[allow(non_snake_case)] mod gen_FileCallback; #[cfg(feature = "FileCallback")] +#[allow(unused_imports)] pub use gen_FileCallback::*; #[cfg(feature = "FileList")] #[allow(non_snake_case)] mod gen_FileList; #[cfg(feature = "FileList")] +#[allow(unused_imports)] pub use gen_FileList::*; +#[cfg(feature = "FilePickerAcceptType")] +#[allow(non_snake_case)] +mod gen_FilePickerAcceptType; +#[cfg(feature = "FilePickerAcceptType")] +#[allow(unused_imports)] +pub use gen_FilePickerAcceptType::*; + +#[cfg(feature = "FilePickerOptions")] +#[allow(non_snake_case)] +mod gen_FilePickerOptions; +#[cfg(feature = "FilePickerOptions")] +#[allow(unused_imports)] +pub use gen_FilePickerOptions::*; + #[cfg(feature = "FilePropertyBag")] #[allow(non_snake_case)] mod gen_FilePropertyBag; #[cfg(feature = "FilePropertyBag")] +#[allow(unused_imports)] pub use gen_FilePropertyBag::*; #[cfg(feature = "FileReader")] #[allow(non_snake_case)] mod gen_FileReader; #[cfg(feature = "FileReader")] +#[allow(unused_imports)] pub use gen_FileReader::*; #[cfg(feature = "FileReaderSync")] #[allow(non_snake_case)] mod gen_FileReaderSync; #[cfg(feature = "FileReaderSync")] +#[allow(unused_imports)] pub use gen_FileReaderSync::*; #[cfg(feature = "FileSystem")] #[allow(non_snake_case)] mod gen_FileSystem; #[cfg(feature = "FileSystem")] +#[allow(unused_imports)] pub use gen_FileSystem::*; +#[cfg(feature = "FileSystemCreateWritableOptions")] +#[allow(non_snake_case)] +mod gen_FileSystemCreateWritableOptions; +#[cfg(feature = "FileSystemCreateWritableOptions")] +#[allow(unused_imports)] +pub use gen_FileSystemCreateWritableOptions::*; + #[cfg(feature = "FileSystemDirectoryEntry")] #[allow(non_snake_case)] mod gen_FileSystemDirectoryEntry; #[cfg(feature = "FileSystemDirectoryEntry")] +#[allow(unused_imports)] pub use gen_FileSystemDirectoryEntry::*; +#[cfg(feature = "FileSystemDirectoryHandle")] +#[allow(non_snake_case)] +mod gen_FileSystemDirectoryHandle; +#[cfg(feature = "FileSystemDirectoryHandle")] +#[allow(unused_imports)] +pub use gen_FileSystemDirectoryHandle::*; + #[cfg(feature = "FileSystemDirectoryReader")] #[allow(non_snake_case)] mod gen_FileSystemDirectoryReader; #[cfg(feature = "FileSystemDirectoryReader")] +#[allow(unused_imports)] pub use gen_FileSystemDirectoryReader::*; #[cfg(feature = "FileSystemEntriesCallback")] #[allow(non_snake_case)] mod gen_FileSystemEntriesCallback; #[cfg(feature = "FileSystemEntriesCallback")] +#[allow(unused_imports)] pub use gen_FileSystemEntriesCallback::*; #[cfg(feature = "FileSystemEntry")] #[allow(non_snake_case)] mod gen_FileSystemEntry; #[cfg(feature = "FileSystemEntry")] +#[allow(unused_imports)] pub use gen_FileSystemEntry::*; #[cfg(feature = "FileSystemEntryCallback")] #[allow(non_snake_case)] mod gen_FileSystemEntryCallback; #[cfg(feature = "FileSystemEntryCallback")] +#[allow(unused_imports)] pub use gen_FileSystemEntryCallback::*; #[cfg(feature = "FileSystemFileEntry")] #[allow(non_snake_case)] mod gen_FileSystemFileEntry; #[cfg(feature = "FileSystemFileEntry")] +#[allow(unused_imports)] pub use gen_FileSystemFileEntry::*; +#[cfg(feature = "FileSystemFileHandle")] +#[allow(non_snake_case)] +mod gen_FileSystemFileHandle; +#[cfg(feature = "FileSystemFileHandle")] +#[allow(unused_imports)] +pub use gen_FileSystemFileHandle::*; + #[cfg(feature = "FileSystemFlags")] #[allow(non_snake_case)] mod gen_FileSystemFlags; #[cfg(feature = "FileSystemFlags")] +#[allow(unused_imports)] pub use gen_FileSystemFlags::*; +#[cfg(feature = "FileSystemGetDirectoryOptions")] +#[allow(non_snake_case)] +mod gen_FileSystemGetDirectoryOptions; +#[cfg(feature = "FileSystemGetDirectoryOptions")] +#[allow(unused_imports)] +pub use gen_FileSystemGetDirectoryOptions::*; + +#[cfg(feature = "FileSystemGetFileOptions")] +#[allow(non_snake_case)] +mod gen_FileSystemGetFileOptions; +#[cfg(feature = "FileSystemGetFileOptions")] +#[allow(unused_imports)] +pub use gen_FileSystemGetFileOptions::*; + +#[cfg(feature = "FileSystemHandle")] +#[allow(non_snake_case)] +mod gen_FileSystemHandle; +#[cfg(feature = "FileSystemHandle")] +#[allow(unused_imports)] +pub use gen_FileSystemHandle::*; + +#[cfg(feature = "FileSystemHandleKind")] +#[allow(non_snake_case)] +mod gen_FileSystemHandleKind; +#[cfg(feature = "FileSystemHandleKind")] +#[allow(unused_imports)] +pub use gen_FileSystemHandleKind::*; + +#[cfg(feature = "FileSystemHandlePermissionDescriptor")] +#[allow(non_snake_case)] +mod gen_FileSystemHandlePermissionDescriptor; +#[cfg(feature = "FileSystemHandlePermissionDescriptor")] +#[allow(unused_imports)] +pub use gen_FileSystemHandlePermissionDescriptor::*; + +#[cfg(feature = "FileSystemPermissionDescriptor")] +#[allow(non_snake_case)] +mod gen_FileSystemPermissionDescriptor; +#[cfg(feature = "FileSystemPermissionDescriptor")] +#[allow(unused_imports)] +pub use gen_FileSystemPermissionDescriptor::*; + +#[cfg(feature = "FileSystemPermissionMode")] +#[allow(non_snake_case)] +mod gen_FileSystemPermissionMode; +#[cfg(feature = "FileSystemPermissionMode")] +#[allow(unused_imports)] +pub use gen_FileSystemPermissionMode::*; + +#[cfg(feature = "FileSystemReadWriteOptions")] +#[allow(non_snake_case)] +mod gen_FileSystemReadWriteOptions; +#[cfg(feature = "FileSystemReadWriteOptions")] +#[allow(unused_imports)] +pub use gen_FileSystemReadWriteOptions::*; + +#[cfg(feature = "FileSystemRemoveOptions")] +#[allow(non_snake_case)] +mod gen_FileSystemRemoveOptions; +#[cfg(feature = "FileSystemRemoveOptions")] +#[allow(unused_imports)] +pub use gen_FileSystemRemoveOptions::*; + +#[cfg(feature = "FileSystemSyncAccessHandle")] +#[allow(non_snake_case)] +mod gen_FileSystemSyncAccessHandle; +#[cfg(feature = "FileSystemSyncAccessHandle")] +#[allow(unused_imports)] +pub use gen_FileSystemSyncAccessHandle::*; + +#[cfg(feature = "FileSystemWritableFileStream")] +#[allow(non_snake_case)] +mod gen_FileSystemWritableFileStream; +#[cfg(feature = "FileSystemWritableFileStream")] +#[allow(unused_imports)] +pub use gen_FileSystemWritableFileStream::*; + #[cfg(feature = "FillMode")] #[allow(non_snake_case)] mod gen_FillMode; #[cfg(feature = "FillMode")] +#[allow(unused_imports)] pub use gen_FillMode::*; #[cfg(feature = "FlashClassification")] #[allow(non_snake_case)] mod gen_FlashClassification; #[cfg(feature = "FlashClassification")] +#[allow(unused_imports)] pub use gen_FlashClassification::*; -#[cfg(feature = "FlexLineGrowthState")] +#[cfg(feature = "FlowControlType")] #[allow(non_snake_case)] -mod gen_FlexLineGrowthState; -#[cfg(feature = "FlexLineGrowthState")] -pub use gen_FlexLineGrowthState::*; +mod gen_FlowControlType; +#[cfg(feature = "FlowControlType")] +#[allow(unused_imports)] +pub use gen_FlowControlType::*; #[cfg(feature = "FocusEvent")] #[allow(non_snake_case)] mod gen_FocusEvent; #[cfg(feature = "FocusEvent")] +#[allow(unused_imports)] pub use gen_FocusEvent::*; #[cfg(feature = "FocusEventInit")] #[allow(non_snake_case)] mod gen_FocusEventInit; #[cfg(feature = "FocusEventInit")] +#[allow(unused_imports)] pub use gen_FocusEventInit::*; +#[cfg(feature = "FocusOptions")] +#[allow(non_snake_case)] +mod gen_FocusOptions; +#[cfg(feature = "FocusOptions")] +#[allow(unused_imports)] +pub use gen_FocusOptions::*; + +#[cfg(feature = "FontData")] +#[allow(non_snake_case)] +mod gen_FontData; +#[cfg(feature = "FontData")] +#[allow(unused_imports)] +pub use gen_FontData::*; + #[cfg(feature = "FontFace")] #[allow(non_snake_case)] mod gen_FontFace; #[cfg(feature = "FontFace")] +#[allow(unused_imports)] pub use gen_FontFace::*; #[cfg(feature = "FontFaceDescriptors")] #[allow(non_snake_case)] mod gen_FontFaceDescriptors; #[cfg(feature = "FontFaceDescriptors")] +#[allow(unused_imports)] pub use gen_FontFaceDescriptors::*; #[cfg(feature = "FontFaceLoadStatus")] #[allow(non_snake_case)] mod gen_FontFaceLoadStatus; #[cfg(feature = "FontFaceLoadStatus")] +#[allow(unused_imports)] pub use gen_FontFaceLoadStatus::*; #[cfg(feature = "FontFaceSet")] #[allow(non_snake_case)] mod gen_FontFaceSet; #[cfg(feature = "FontFaceSet")] +#[allow(unused_imports)] pub use gen_FontFaceSet::*; #[cfg(feature = "FontFaceSetIterator")] #[allow(non_snake_case)] mod gen_FontFaceSetIterator; #[cfg(feature = "FontFaceSetIterator")] +#[allow(unused_imports)] pub use gen_FontFaceSetIterator::*; #[cfg(feature = "FontFaceSetIteratorResult")] #[allow(non_snake_case)] mod gen_FontFaceSetIteratorResult; #[cfg(feature = "FontFaceSetIteratorResult")] +#[allow(unused_imports)] pub use gen_FontFaceSetIteratorResult::*; #[cfg(feature = "FontFaceSetLoadEvent")] #[allow(non_snake_case)] mod gen_FontFaceSetLoadEvent; #[cfg(feature = "FontFaceSetLoadEvent")] +#[allow(unused_imports)] pub use gen_FontFaceSetLoadEvent::*; #[cfg(feature = "FontFaceSetLoadEventInit")] #[allow(non_snake_case)] mod gen_FontFaceSetLoadEventInit; #[cfg(feature = "FontFaceSetLoadEventInit")] +#[allow(unused_imports)] pub use gen_FontFaceSetLoadEventInit::*; #[cfg(feature = "FontFaceSetLoadStatus")] #[allow(non_snake_case)] mod gen_FontFaceSetLoadStatus; #[cfg(feature = "FontFaceSetLoadStatus")] +#[allow(unused_imports)] pub use gen_FontFaceSetLoadStatus::*; #[cfg(feature = "FormData")] #[allow(non_snake_case)] mod gen_FormData; #[cfg(feature = "FormData")] +#[allow(unused_imports)] pub use gen_FormData::*; #[cfg(feature = "FrameType")] #[allow(non_snake_case)] mod gen_FrameType; #[cfg(feature = "FrameType")] +#[allow(unused_imports)] pub use gen_FrameType::*; #[cfg(feature = "FuzzingFunctions")] #[allow(non_snake_case)] mod gen_FuzzingFunctions; #[cfg(feature = "FuzzingFunctions")] +#[allow(unused_imports)] pub use gen_FuzzingFunctions::*; #[cfg(feature = "GainNode")] #[allow(non_snake_case)] mod gen_GainNode; #[cfg(feature = "GainNode")] +#[allow(unused_imports)] pub use gen_GainNode::*; #[cfg(feature = "GainOptions")] #[allow(non_snake_case)] mod gen_GainOptions; #[cfg(feature = "GainOptions")] +#[allow(unused_imports)] pub use gen_GainOptions::*; #[cfg(feature = "Gamepad")] #[allow(non_snake_case)] mod gen_Gamepad; #[cfg(feature = "Gamepad")] +#[allow(unused_imports)] pub use gen_Gamepad::*; -#[cfg(feature = "GamepadAxisMoveEvent")] -#[allow(non_snake_case)] -mod gen_GamepadAxisMoveEvent; -#[cfg(feature = "GamepadAxisMoveEvent")] -pub use gen_GamepadAxisMoveEvent::*; - -#[cfg(feature = "GamepadAxisMoveEventInit")] -#[allow(non_snake_case)] -mod gen_GamepadAxisMoveEventInit; -#[cfg(feature = "GamepadAxisMoveEventInit")] -pub use gen_GamepadAxisMoveEventInit::*; - #[cfg(feature = "GamepadButton")] #[allow(non_snake_case)] mod gen_GamepadButton; #[cfg(feature = "GamepadButton")] +#[allow(unused_imports)] pub use gen_GamepadButton::*; -#[cfg(feature = "GamepadButtonEvent")] +#[cfg(feature = "GamepadEffectParameters")] #[allow(non_snake_case)] -mod gen_GamepadButtonEvent; -#[cfg(feature = "GamepadButtonEvent")] -pub use gen_GamepadButtonEvent::*; - -#[cfg(feature = "GamepadButtonEventInit")] -#[allow(non_snake_case)] -mod gen_GamepadButtonEventInit; -#[cfg(feature = "GamepadButtonEventInit")] -pub use gen_GamepadButtonEventInit::*; +mod gen_GamepadEffectParameters; +#[cfg(feature = "GamepadEffectParameters")] +#[allow(unused_imports)] +pub use gen_GamepadEffectParameters::*; #[cfg(feature = "GamepadEvent")] #[allow(non_snake_case)] mod gen_GamepadEvent; #[cfg(feature = "GamepadEvent")] +#[allow(unused_imports)] pub use gen_GamepadEvent::*; #[cfg(feature = "GamepadEventInit")] #[allow(non_snake_case)] mod gen_GamepadEventInit; #[cfg(feature = "GamepadEventInit")] +#[allow(unused_imports)] pub use gen_GamepadEventInit::*; #[cfg(feature = "GamepadHand")] #[allow(non_snake_case)] mod gen_GamepadHand; #[cfg(feature = "GamepadHand")] +#[allow(unused_imports)] pub use gen_GamepadHand::*; #[cfg(feature = "GamepadHapticActuator")] #[allow(non_snake_case)] mod gen_GamepadHapticActuator; #[cfg(feature = "GamepadHapticActuator")] +#[allow(unused_imports)] pub use gen_GamepadHapticActuator::*; #[cfg(feature = "GamepadHapticActuatorType")] #[allow(non_snake_case)] mod gen_GamepadHapticActuatorType; #[cfg(feature = "GamepadHapticActuatorType")] +#[allow(unused_imports)] pub use gen_GamepadHapticActuatorType::*; +#[cfg(feature = "GamepadHapticEffectType")] +#[allow(non_snake_case)] +mod gen_GamepadHapticEffectType; +#[cfg(feature = "GamepadHapticEffectType")] +#[allow(unused_imports)] +pub use gen_GamepadHapticEffectType::*; + +#[cfg(feature = "GamepadHapticsResult")] +#[allow(non_snake_case)] +mod gen_GamepadHapticsResult; +#[cfg(feature = "GamepadHapticsResult")] +#[allow(unused_imports)] +pub use gen_GamepadHapticsResult::*; + #[cfg(feature = "GamepadMappingType")] #[allow(non_snake_case)] mod gen_GamepadMappingType; #[cfg(feature = "GamepadMappingType")] +#[allow(unused_imports)] pub use gen_GamepadMappingType::*; #[cfg(feature = "GamepadPose")] #[allow(non_snake_case)] mod gen_GamepadPose; #[cfg(feature = "GamepadPose")] +#[allow(unused_imports)] pub use gen_GamepadPose::*; -#[cfg(feature = "GamepadServiceTest")] +#[cfg(feature = "GamepadTouch")] #[allow(non_snake_case)] -mod gen_GamepadServiceTest; -#[cfg(feature = "GamepadServiceTest")] -pub use gen_GamepadServiceTest::*; +mod gen_GamepadTouch; +#[cfg(feature = "GamepadTouch")] +#[allow(unused_imports)] +pub use gen_GamepadTouch::*; #[cfg(feature = "Geolocation")] #[allow(non_snake_case)] mod gen_Geolocation; #[cfg(feature = "Geolocation")] +#[allow(unused_imports)] pub use gen_Geolocation::*; -#[cfg(feature = "GetNotificationOptions")] +#[cfg(feature = "GetAnimationsOptions")] #[allow(non_snake_case)] -mod gen_GetNotificationOptions; -#[cfg(feature = "GetNotificationOptions")] -pub use gen_GetNotificationOptions::*; +mod gen_GetAnimationsOptions; +#[cfg(feature = "GetAnimationsOptions")] +#[allow(unused_imports)] +pub use gen_GetAnimationsOptions::*; #[cfg(feature = "GetRootNodeOptions")] #[allow(non_snake_case)] mod gen_GetRootNodeOptions; #[cfg(feature = "GetRootNodeOptions")] +#[allow(unused_imports)] pub use gen_GetRootNodeOptions::*; #[cfg(feature = "GetUserMediaRequest")] #[allow(non_snake_case)] mod gen_GetUserMediaRequest; #[cfg(feature = "GetUserMediaRequest")] +#[allow(unused_imports)] pub use gen_GetUserMediaRequest::*; #[cfg(feature = "Gpu")] #[allow(non_snake_case)] mod gen_Gpu; #[cfg(feature = "Gpu")] +#[allow(unused_imports)] pub use gen_Gpu::*; #[cfg(feature = "GpuAdapter")] #[allow(non_snake_case)] mod gen_GpuAdapter; #[cfg(feature = "GpuAdapter")] +#[allow(unused_imports)] pub use gen_GpuAdapter::*; +#[cfg(feature = "GpuAdapterInfo")] +#[allow(non_snake_case)] +mod gen_GpuAdapterInfo; +#[cfg(feature = "GpuAdapterInfo")] +#[allow(unused_imports)] +pub use gen_GpuAdapterInfo::*; + #[cfg(feature = "GpuAddressMode")] #[allow(non_snake_case)] mod gen_GpuAddressMode; #[cfg(feature = "GpuAddressMode")] +#[allow(unused_imports)] pub use gen_GpuAddressMode::*; +#[cfg(feature = "GpuAutoLayoutMode")] +#[allow(non_snake_case)] +mod gen_GpuAutoLayoutMode; +#[cfg(feature = "GpuAutoLayoutMode")] +#[allow(unused_imports)] +pub use gen_GpuAutoLayoutMode::*; + #[cfg(feature = "GpuBindGroup")] #[allow(non_snake_case)] mod gen_GpuBindGroup; #[cfg(feature = "GpuBindGroup")] +#[allow(unused_imports)] pub use gen_GpuBindGroup::*; #[cfg(feature = "GpuBindGroupDescriptor")] #[allow(non_snake_case)] mod gen_GpuBindGroupDescriptor; #[cfg(feature = "GpuBindGroupDescriptor")] +#[allow(unused_imports)] pub use gen_GpuBindGroupDescriptor::*; #[cfg(feature = "GpuBindGroupEntry")] #[allow(non_snake_case)] mod gen_GpuBindGroupEntry; #[cfg(feature = "GpuBindGroupEntry")] +#[allow(unused_imports)] pub use gen_GpuBindGroupEntry::*; #[cfg(feature = "GpuBindGroupLayout")] #[allow(non_snake_case)] mod gen_GpuBindGroupLayout; #[cfg(feature = "GpuBindGroupLayout")] +#[allow(unused_imports)] pub use gen_GpuBindGroupLayout::*; #[cfg(feature = "GpuBindGroupLayoutDescriptor")] #[allow(non_snake_case)] mod gen_GpuBindGroupLayoutDescriptor; #[cfg(feature = "GpuBindGroupLayoutDescriptor")] +#[allow(unused_imports)] pub use gen_GpuBindGroupLayoutDescriptor::*; #[cfg(feature = "GpuBindGroupLayoutEntry")] #[allow(non_snake_case)] mod gen_GpuBindGroupLayoutEntry; #[cfg(feature = "GpuBindGroupLayoutEntry")] +#[allow(unused_imports)] pub use gen_GpuBindGroupLayoutEntry::*; #[cfg(feature = "GpuBlendComponent")] #[allow(non_snake_case)] mod gen_GpuBlendComponent; #[cfg(feature = "GpuBlendComponent")] +#[allow(unused_imports)] pub use gen_GpuBlendComponent::*; #[cfg(feature = "GpuBlendFactor")] #[allow(non_snake_case)] mod gen_GpuBlendFactor; #[cfg(feature = "GpuBlendFactor")] +#[allow(unused_imports)] pub use gen_GpuBlendFactor::*; #[cfg(feature = "GpuBlendOperation")] #[allow(non_snake_case)] mod gen_GpuBlendOperation; #[cfg(feature = "GpuBlendOperation")] +#[allow(unused_imports)] pub use gen_GpuBlendOperation::*; #[cfg(feature = "GpuBlendState")] #[allow(non_snake_case)] mod gen_GpuBlendState; #[cfg(feature = "GpuBlendState")] +#[allow(unused_imports)] pub use gen_GpuBlendState::*; #[cfg(feature = "GpuBuffer")] #[allow(non_snake_case)] mod gen_GpuBuffer; #[cfg(feature = "GpuBuffer")] +#[allow(unused_imports)] pub use gen_GpuBuffer::*; #[cfg(feature = "GpuBufferBinding")] #[allow(non_snake_case)] mod gen_GpuBufferBinding; #[cfg(feature = "GpuBufferBinding")] +#[allow(unused_imports)] pub use gen_GpuBufferBinding::*; #[cfg(feature = "GpuBufferBindingLayout")] #[allow(non_snake_case)] mod gen_GpuBufferBindingLayout; #[cfg(feature = "GpuBufferBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuBufferBindingLayout::*; #[cfg(feature = "GpuBufferBindingType")] #[allow(non_snake_case)] mod gen_GpuBufferBindingType; #[cfg(feature = "GpuBufferBindingType")] +#[allow(unused_imports)] pub use gen_GpuBufferBindingType::*; #[cfg(feature = "GpuBufferDescriptor")] #[allow(non_snake_case)] mod gen_GpuBufferDescriptor; #[cfg(feature = "GpuBufferDescriptor")] +#[allow(unused_imports)] pub use gen_GpuBufferDescriptor::*; -#[cfg(feature = "GpuBufferUsage")] +#[cfg(feature = "GpuBufferMapState")] #[allow(non_snake_case)] -mod gen_GpuBufferUsage; -#[cfg(feature = "GpuBufferUsage")] -pub use gen_GpuBufferUsage::*; +mod gen_GpuBufferMapState; +#[cfg(feature = "GpuBufferMapState")] +#[allow(unused_imports)] +pub use gen_GpuBufferMapState::*; -#[cfg(feature = "GpuCanvasCompositingAlphaMode")] +#[cfg(feature = "GpuCanvasAlphaMode")] #[allow(non_snake_case)] -mod gen_GpuCanvasCompositingAlphaMode; -#[cfg(feature = "GpuCanvasCompositingAlphaMode")] -pub use gen_GpuCanvasCompositingAlphaMode::*; +mod gen_GpuCanvasAlphaMode; +#[cfg(feature = "GpuCanvasAlphaMode")] +#[allow(unused_imports)] +pub use gen_GpuCanvasAlphaMode::*; #[cfg(feature = "GpuCanvasConfiguration")] #[allow(non_snake_case)] mod gen_GpuCanvasConfiguration; #[cfg(feature = "GpuCanvasConfiguration")] +#[allow(unused_imports)] pub use gen_GpuCanvasConfiguration::*; #[cfg(feature = "GpuCanvasContext")] #[allow(non_snake_case)] mod gen_GpuCanvasContext; #[cfg(feature = "GpuCanvasContext")] +#[allow(unused_imports)] pub use gen_GpuCanvasContext::*; +#[cfg(feature = "GpuCanvasToneMapping")] +#[allow(non_snake_case)] +mod gen_GpuCanvasToneMapping; +#[cfg(feature = "GpuCanvasToneMapping")] +#[allow(unused_imports)] +pub use gen_GpuCanvasToneMapping::*; + +#[cfg(feature = "GpuCanvasToneMappingMode")] +#[allow(non_snake_case)] +mod gen_GpuCanvasToneMappingMode; +#[cfg(feature = "GpuCanvasToneMappingMode")] +#[allow(unused_imports)] +pub use gen_GpuCanvasToneMappingMode::*; + #[cfg(feature = "GpuColorDict")] #[allow(non_snake_case)] mod gen_GpuColorDict; #[cfg(feature = "GpuColorDict")] +#[allow(unused_imports)] pub use gen_GpuColorDict::*; #[cfg(feature = "GpuColorTargetState")] #[allow(non_snake_case)] mod gen_GpuColorTargetState; #[cfg(feature = "GpuColorTargetState")] +#[allow(unused_imports)] pub use gen_GpuColorTargetState::*; -#[cfg(feature = "GpuColorWrite")] -#[allow(non_snake_case)] -mod gen_GpuColorWrite; -#[cfg(feature = "GpuColorWrite")] -pub use gen_GpuColorWrite::*; - #[cfg(feature = "GpuCommandBuffer")] #[allow(non_snake_case)] mod gen_GpuCommandBuffer; #[cfg(feature = "GpuCommandBuffer")] +#[allow(unused_imports)] pub use gen_GpuCommandBuffer::*; #[cfg(feature = "GpuCommandBufferDescriptor")] #[allow(non_snake_case)] mod gen_GpuCommandBufferDescriptor; #[cfg(feature = "GpuCommandBufferDescriptor")] +#[allow(unused_imports)] pub use gen_GpuCommandBufferDescriptor::*; #[cfg(feature = "GpuCommandEncoder")] #[allow(non_snake_case)] mod gen_GpuCommandEncoder; #[cfg(feature = "GpuCommandEncoder")] +#[allow(unused_imports)] pub use gen_GpuCommandEncoder::*; #[cfg(feature = "GpuCommandEncoderDescriptor")] #[allow(non_snake_case)] mod gen_GpuCommandEncoderDescriptor; #[cfg(feature = "GpuCommandEncoderDescriptor")] +#[allow(unused_imports)] pub use gen_GpuCommandEncoderDescriptor::*; #[cfg(feature = "GpuCompareFunction")] #[allow(non_snake_case)] mod gen_GpuCompareFunction; #[cfg(feature = "GpuCompareFunction")] +#[allow(unused_imports)] pub use gen_GpuCompareFunction::*; #[cfg(feature = "GpuCompilationInfo")] #[allow(non_snake_case)] mod gen_GpuCompilationInfo; #[cfg(feature = "GpuCompilationInfo")] +#[allow(unused_imports)] pub use gen_GpuCompilationInfo::*; #[cfg(feature = "GpuCompilationMessage")] #[allow(non_snake_case)] mod gen_GpuCompilationMessage; #[cfg(feature = "GpuCompilationMessage")] +#[allow(unused_imports)] pub use gen_GpuCompilationMessage::*; #[cfg(feature = "GpuCompilationMessageType")] #[allow(non_snake_case)] mod gen_GpuCompilationMessageType; #[cfg(feature = "GpuCompilationMessageType")] +#[allow(unused_imports)] pub use gen_GpuCompilationMessageType::*; #[cfg(feature = "GpuComputePassDescriptor")] #[allow(non_snake_case)] mod gen_GpuComputePassDescriptor; #[cfg(feature = "GpuComputePassDescriptor")] +#[allow(unused_imports)] pub use gen_GpuComputePassDescriptor::*; #[cfg(feature = "GpuComputePassEncoder")] #[allow(non_snake_case)] mod gen_GpuComputePassEncoder; #[cfg(feature = "GpuComputePassEncoder")] +#[allow(unused_imports)] pub use gen_GpuComputePassEncoder::*; +#[cfg(feature = "GpuComputePassTimestampWrites")] +#[allow(non_snake_case)] +mod gen_GpuComputePassTimestampWrites; +#[cfg(feature = "GpuComputePassTimestampWrites")] +#[allow(unused_imports)] +pub use gen_GpuComputePassTimestampWrites::*; + #[cfg(feature = "GpuComputePipeline")] #[allow(non_snake_case)] mod gen_GpuComputePipeline; #[cfg(feature = "GpuComputePipeline")] +#[allow(unused_imports)] pub use gen_GpuComputePipeline::*; #[cfg(feature = "GpuComputePipelineDescriptor")] #[allow(non_snake_case)] mod gen_GpuComputePipelineDescriptor; #[cfg(feature = "GpuComputePipelineDescriptor")] +#[allow(unused_imports)] pub use gen_GpuComputePipelineDescriptor::*; +#[cfg(feature = "GpuCopyExternalImageDestInfo")] +#[allow(non_snake_case)] +mod gen_GpuCopyExternalImageDestInfo; +#[cfg(feature = "GpuCopyExternalImageDestInfo")] +#[allow(unused_imports)] +pub use gen_GpuCopyExternalImageDestInfo::*; + +#[cfg(feature = "GpuCopyExternalImageSourceInfo")] +#[allow(non_snake_case)] +mod gen_GpuCopyExternalImageSourceInfo; +#[cfg(feature = "GpuCopyExternalImageSourceInfo")] +#[allow(unused_imports)] +pub use gen_GpuCopyExternalImageSourceInfo::*; + #[cfg(feature = "GpuCullMode")] #[allow(non_snake_case)] mod gen_GpuCullMode; #[cfg(feature = "GpuCullMode")] +#[allow(unused_imports)] pub use gen_GpuCullMode::*; #[cfg(feature = "GpuDepthStencilState")] #[allow(non_snake_case)] mod gen_GpuDepthStencilState; #[cfg(feature = "GpuDepthStencilState")] +#[allow(unused_imports)] pub use gen_GpuDepthStencilState::*; #[cfg(feature = "GpuDevice")] #[allow(non_snake_case)] mod gen_GpuDevice; #[cfg(feature = "GpuDevice")] +#[allow(unused_imports)] pub use gen_GpuDevice::*; #[cfg(feature = "GpuDeviceDescriptor")] #[allow(non_snake_case)] mod gen_GpuDeviceDescriptor; #[cfg(feature = "GpuDeviceDescriptor")] +#[allow(unused_imports)] pub use gen_GpuDeviceDescriptor::*; #[cfg(feature = "GpuDeviceLostInfo")] #[allow(non_snake_case)] mod gen_GpuDeviceLostInfo; #[cfg(feature = "GpuDeviceLostInfo")] +#[allow(unused_imports)] pub use gen_GpuDeviceLostInfo::*; #[cfg(feature = "GpuDeviceLostReason")] #[allow(non_snake_case)] mod gen_GpuDeviceLostReason; #[cfg(feature = "GpuDeviceLostReason")] +#[allow(unused_imports)] pub use gen_GpuDeviceLostReason::*; +#[cfg(feature = "GpuError")] +#[allow(non_snake_case)] +mod gen_GpuError; +#[cfg(feature = "GpuError")] +#[allow(unused_imports)] +pub use gen_GpuError::*; + #[cfg(feature = "GpuErrorFilter")] #[allow(non_snake_case)] mod gen_GpuErrorFilter; #[cfg(feature = "GpuErrorFilter")] +#[allow(unused_imports)] pub use gen_GpuErrorFilter::*; #[cfg(feature = "GpuExtent3dDict")] #[allow(non_snake_case)] mod gen_GpuExtent3dDict; #[cfg(feature = "GpuExtent3dDict")] +#[allow(unused_imports)] pub use gen_GpuExtent3dDict::*; #[cfg(feature = "GpuExternalTexture")] #[allow(non_snake_case)] mod gen_GpuExternalTexture; #[cfg(feature = "GpuExternalTexture")] +#[allow(unused_imports)] pub use gen_GpuExternalTexture::*; #[cfg(feature = "GpuExternalTextureBindingLayout")] #[allow(non_snake_case)] mod gen_GpuExternalTextureBindingLayout; #[cfg(feature = "GpuExternalTextureBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuExternalTextureBindingLayout::*; #[cfg(feature = "GpuExternalTextureDescriptor")] #[allow(non_snake_case)] mod gen_GpuExternalTextureDescriptor; #[cfg(feature = "GpuExternalTextureDescriptor")] +#[allow(unused_imports)] pub use gen_GpuExternalTextureDescriptor::*; #[cfg(feature = "GpuFeatureName")] #[allow(non_snake_case)] mod gen_GpuFeatureName; #[cfg(feature = "GpuFeatureName")] +#[allow(unused_imports)] pub use gen_GpuFeatureName::*; #[cfg(feature = "GpuFilterMode")] #[allow(non_snake_case)] mod gen_GpuFilterMode; #[cfg(feature = "GpuFilterMode")] +#[allow(unused_imports)] pub use gen_GpuFilterMode::*; #[cfg(feature = "GpuFragmentState")] #[allow(non_snake_case)] mod gen_GpuFragmentState; #[cfg(feature = "GpuFragmentState")] +#[allow(unused_imports)] pub use gen_GpuFragmentState::*; #[cfg(feature = "GpuFrontFace")] #[allow(non_snake_case)] mod gen_GpuFrontFace; #[cfg(feature = "GpuFrontFace")] +#[allow(unused_imports)] pub use gen_GpuFrontFace::*; -#[cfg(feature = "GpuImageCopyBuffer")] -#[allow(non_snake_case)] -mod gen_GpuImageCopyBuffer; -#[cfg(feature = "GpuImageCopyBuffer")] -pub use gen_GpuImageCopyBuffer::*; - -#[cfg(feature = "GpuImageCopyExternalImage")] -#[allow(non_snake_case)] -mod gen_GpuImageCopyExternalImage; -#[cfg(feature = "GpuImageCopyExternalImage")] -pub use gen_GpuImageCopyExternalImage::*; - -#[cfg(feature = "GpuImageCopyTexture")] -#[allow(non_snake_case)] -mod gen_GpuImageCopyTexture; -#[cfg(feature = "GpuImageCopyTexture")] -pub use gen_GpuImageCopyTexture::*; - -#[cfg(feature = "GpuImageCopyTextureTagged")] -#[allow(non_snake_case)] -mod gen_GpuImageCopyTextureTagged; -#[cfg(feature = "GpuImageCopyTextureTagged")] -pub use gen_GpuImageCopyTextureTagged::*; - -#[cfg(feature = "GpuImageDataLayout")] -#[allow(non_snake_case)] -mod gen_GpuImageDataLayout; -#[cfg(feature = "GpuImageDataLayout")] -pub use gen_GpuImageDataLayout::*; - #[cfg(feature = "GpuIndexFormat")] #[allow(non_snake_case)] mod gen_GpuIndexFormat; #[cfg(feature = "GpuIndexFormat")] +#[allow(unused_imports)] pub use gen_GpuIndexFormat::*; +#[cfg(feature = "GpuInternalError")] +#[allow(non_snake_case)] +mod gen_GpuInternalError; +#[cfg(feature = "GpuInternalError")] +#[allow(unused_imports)] +pub use gen_GpuInternalError::*; + #[cfg(feature = "GpuLoadOp")] #[allow(non_snake_case)] mod gen_GpuLoadOp; #[cfg(feature = "GpuLoadOp")] +#[allow(unused_imports)] pub use gen_GpuLoadOp::*; -#[cfg(feature = "GpuMapMode")] +#[cfg(feature = "GpuMipmapFilterMode")] #[allow(non_snake_case)] -mod gen_GpuMapMode; -#[cfg(feature = "GpuMapMode")] -pub use gen_GpuMapMode::*; +mod gen_GpuMipmapFilterMode; +#[cfg(feature = "GpuMipmapFilterMode")] +#[allow(unused_imports)] +pub use gen_GpuMipmapFilterMode::*; #[cfg(feature = "GpuMultisampleState")] #[allow(non_snake_case)] mod gen_GpuMultisampleState; #[cfg(feature = "GpuMultisampleState")] +#[allow(unused_imports)] pub use gen_GpuMultisampleState::*; #[cfg(feature = "GpuObjectDescriptorBase")] #[allow(non_snake_case)] mod gen_GpuObjectDescriptorBase; #[cfg(feature = "GpuObjectDescriptorBase")] +#[allow(unused_imports)] pub use gen_GpuObjectDescriptorBase::*; #[cfg(feature = "GpuOrigin2dDict")] #[allow(non_snake_case)] mod gen_GpuOrigin2dDict; #[cfg(feature = "GpuOrigin2dDict")] +#[allow(unused_imports)] pub use gen_GpuOrigin2dDict::*; #[cfg(feature = "GpuOrigin3dDict")] #[allow(non_snake_case)] mod gen_GpuOrigin3dDict; #[cfg(feature = "GpuOrigin3dDict")] +#[allow(unused_imports)] pub use gen_GpuOrigin3dDict::*; #[cfg(feature = "GpuOutOfMemoryError")] #[allow(non_snake_case)] mod gen_GpuOutOfMemoryError; #[cfg(feature = "GpuOutOfMemoryError")] +#[allow(unused_imports)] pub use gen_GpuOutOfMemoryError::*; #[cfg(feature = "GpuPipelineDescriptorBase")] #[allow(non_snake_case)] mod gen_GpuPipelineDescriptorBase; #[cfg(feature = "GpuPipelineDescriptorBase")] +#[allow(unused_imports)] pub use gen_GpuPipelineDescriptorBase::*; +#[cfg(feature = "GpuPipelineError")] +#[allow(non_snake_case)] +mod gen_GpuPipelineError; +#[cfg(feature = "GpuPipelineError")] +#[allow(unused_imports)] +pub use gen_GpuPipelineError::*; + +#[cfg(feature = "GpuPipelineErrorInit")] +#[allow(non_snake_case)] +mod gen_GpuPipelineErrorInit; +#[cfg(feature = "GpuPipelineErrorInit")] +#[allow(unused_imports)] +pub use gen_GpuPipelineErrorInit::*; + +#[cfg(feature = "GpuPipelineErrorReason")] +#[allow(non_snake_case)] +mod gen_GpuPipelineErrorReason; +#[cfg(feature = "GpuPipelineErrorReason")] +#[allow(unused_imports)] +pub use gen_GpuPipelineErrorReason::*; + #[cfg(feature = "GpuPipelineLayout")] #[allow(non_snake_case)] mod gen_GpuPipelineLayout; #[cfg(feature = "GpuPipelineLayout")] +#[allow(unused_imports)] pub use gen_GpuPipelineLayout::*; #[cfg(feature = "GpuPipelineLayoutDescriptor")] #[allow(non_snake_case)] mod gen_GpuPipelineLayoutDescriptor; #[cfg(feature = "GpuPipelineLayoutDescriptor")] +#[allow(unused_imports)] pub use gen_GpuPipelineLayoutDescriptor::*; -#[cfg(feature = "GpuPipelineStatisticName")] -#[allow(non_snake_case)] -mod gen_GpuPipelineStatisticName; -#[cfg(feature = "GpuPipelineStatisticName")] -pub use gen_GpuPipelineStatisticName::*; - #[cfg(feature = "GpuPowerPreference")] #[allow(non_snake_case)] mod gen_GpuPowerPreference; #[cfg(feature = "GpuPowerPreference")] +#[allow(unused_imports)] pub use gen_GpuPowerPreference::*; -#[cfg(feature = "GpuPredefinedColorSpace")] -#[allow(non_snake_case)] -mod gen_GpuPredefinedColorSpace; -#[cfg(feature = "GpuPredefinedColorSpace")] -pub use gen_GpuPredefinedColorSpace::*; - #[cfg(feature = "GpuPrimitiveState")] #[allow(non_snake_case)] mod gen_GpuPrimitiveState; #[cfg(feature = "GpuPrimitiveState")] +#[allow(unused_imports)] pub use gen_GpuPrimitiveState::*; #[cfg(feature = "GpuPrimitiveTopology")] #[allow(non_snake_case)] mod gen_GpuPrimitiveTopology; #[cfg(feature = "GpuPrimitiveTopology")] +#[allow(unused_imports)] pub use gen_GpuPrimitiveTopology::*; #[cfg(feature = "GpuProgrammableStage")] #[allow(non_snake_case)] mod gen_GpuProgrammableStage; #[cfg(feature = "GpuProgrammableStage")] +#[allow(unused_imports)] pub use gen_GpuProgrammableStage::*; #[cfg(feature = "GpuQuerySet")] #[allow(non_snake_case)] mod gen_GpuQuerySet; #[cfg(feature = "GpuQuerySet")] +#[allow(unused_imports)] pub use gen_GpuQuerySet::*; #[cfg(feature = "GpuQuerySetDescriptor")] #[allow(non_snake_case)] mod gen_GpuQuerySetDescriptor; #[cfg(feature = "GpuQuerySetDescriptor")] +#[allow(unused_imports)] pub use gen_GpuQuerySetDescriptor::*; #[cfg(feature = "GpuQueryType")] #[allow(non_snake_case)] mod gen_GpuQueryType; #[cfg(feature = "GpuQueryType")] +#[allow(unused_imports)] pub use gen_GpuQueryType::*; #[cfg(feature = "GpuQueue")] #[allow(non_snake_case)] mod gen_GpuQueue; #[cfg(feature = "GpuQueue")] +#[allow(unused_imports)] pub use gen_GpuQueue::*; +#[cfg(feature = "GpuQueueDescriptor")] +#[allow(non_snake_case)] +mod gen_GpuQueueDescriptor; +#[cfg(feature = "GpuQueueDescriptor")] +#[allow(unused_imports)] +pub use gen_GpuQueueDescriptor::*; + #[cfg(feature = "GpuRenderBundle")] #[allow(non_snake_case)] mod gen_GpuRenderBundle; #[cfg(feature = "GpuRenderBundle")] +#[allow(unused_imports)] pub use gen_GpuRenderBundle::*; #[cfg(feature = "GpuRenderBundleDescriptor")] #[allow(non_snake_case)] mod gen_GpuRenderBundleDescriptor; #[cfg(feature = "GpuRenderBundleDescriptor")] +#[allow(unused_imports)] pub use gen_GpuRenderBundleDescriptor::*; #[cfg(feature = "GpuRenderBundleEncoder")] #[allow(non_snake_case)] mod gen_GpuRenderBundleEncoder; #[cfg(feature = "GpuRenderBundleEncoder")] +#[allow(unused_imports)] pub use gen_GpuRenderBundleEncoder::*; #[cfg(feature = "GpuRenderBundleEncoderDescriptor")] #[allow(non_snake_case)] mod gen_GpuRenderBundleEncoderDescriptor; #[cfg(feature = "GpuRenderBundleEncoderDescriptor")] +#[allow(unused_imports)] pub use gen_GpuRenderBundleEncoderDescriptor::*; #[cfg(feature = "GpuRenderPassColorAttachment")] #[allow(non_snake_case)] mod gen_GpuRenderPassColorAttachment; #[cfg(feature = "GpuRenderPassColorAttachment")] +#[allow(unused_imports)] pub use gen_GpuRenderPassColorAttachment::*; #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] #[allow(non_snake_case)] mod gen_GpuRenderPassDepthStencilAttachment; #[cfg(feature = "GpuRenderPassDepthStencilAttachment")] +#[allow(unused_imports)] pub use gen_GpuRenderPassDepthStencilAttachment::*; #[cfg(feature = "GpuRenderPassDescriptor")] #[allow(non_snake_case)] mod gen_GpuRenderPassDescriptor; #[cfg(feature = "GpuRenderPassDescriptor")] +#[allow(unused_imports)] pub use gen_GpuRenderPassDescriptor::*; #[cfg(feature = "GpuRenderPassEncoder")] #[allow(non_snake_case)] mod gen_GpuRenderPassEncoder; #[cfg(feature = "GpuRenderPassEncoder")] +#[allow(unused_imports)] pub use gen_GpuRenderPassEncoder::*; #[cfg(feature = "GpuRenderPassLayout")] #[allow(non_snake_case)] mod gen_GpuRenderPassLayout; #[cfg(feature = "GpuRenderPassLayout")] +#[allow(unused_imports)] pub use gen_GpuRenderPassLayout::*; +#[cfg(feature = "GpuRenderPassTimestampWrites")] +#[allow(non_snake_case)] +mod gen_GpuRenderPassTimestampWrites; +#[cfg(feature = "GpuRenderPassTimestampWrites")] +#[allow(unused_imports)] +pub use gen_GpuRenderPassTimestampWrites::*; + #[cfg(feature = "GpuRenderPipeline")] #[allow(non_snake_case)] mod gen_GpuRenderPipeline; #[cfg(feature = "GpuRenderPipeline")] +#[allow(unused_imports)] pub use gen_GpuRenderPipeline::*; #[cfg(feature = "GpuRenderPipelineDescriptor")] #[allow(non_snake_case)] mod gen_GpuRenderPipelineDescriptor; #[cfg(feature = "GpuRenderPipelineDescriptor")] +#[allow(unused_imports)] pub use gen_GpuRenderPipelineDescriptor::*; #[cfg(feature = "GpuRequestAdapterOptions")] #[allow(non_snake_case)] mod gen_GpuRequestAdapterOptions; #[cfg(feature = "GpuRequestAdapterOptions")] +#[allow(unused_imports)] pub use gen_GpuRequestAdapterOptions::*; #[cfg(feature = "GpuSampler")] #[allow(non_snake_case)] mod gen_GpuSampler; #[cfg(feature = "GpuSampler")] +#[allow(unused_imports)] pub use gen_GpuSampler::*; #[cfg(feature = "GpuSamplerBindingLayout")] #[allow(non_snake_case)] mod gen_GpuSamplerBindingLayout; #[cfg(feature = "GpuSamplerBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuSamplerBindingLayout::*; #[cfg(feature = "GpuSamplerBindingType")] #[allow(non_snake_case)] mod gen_GpuSamplerBindingType; #[cfg(feature = "GpuSamplerBindingType")] +#[allow(unused_imports)] pub use gen_GpuSamplerBindingType::*; #[cfg(feature = "GpuSamplerDescriptor")] #[allow(non_snake_case)] mod gen_GpuSamplerDescriptor; #[cfg(feature = "GpuSamplerDescriptor")] +#[allow(unused_imports)] pub use gen_GpuSamplerDescriptor::*; #[cfg(feature = "GpuShaderModule")] #[allow(non_snake_case)] mod gen_GpuShaderModule; #[cfg(feature = "GpuShaderModule")] +#[allow(unused_imports)] pub use gen_GpuShaderModule::*; +#[cfg(feature = "GpuShaderModuleCompilationHint")] +#[allow(non_snake_case)] +mod gen_GpuShaderModuleCompilationHint; +#[cfg(feature = "GpuShaderModuleCompilationHint")] +#[allow(unused_imports)] +pub use gen_GpuShaderModuleCompilationHint::*; + #[cfg(feature = "GpuShaderModuleDescriptor")] #[allow(non_snake_case)] mod gen_GpuShaderModuleDescriptor; #[cfg(feature = "GpuShaderModuleDescriptor")] +#[allow(unused_imports)] pub use gen_GpuShaderModuleDescriptor::*; -#[cfg(feature = "GpuShaderStage")] -#[allow(non_snake_case)] -mod gen_GpuShaderStage; -#[cfg(feature = "GpuShaderStage")] -pub use gen_GpuShaderStage::*; - #[cfg(feature = "GpuStencilFaceState")] #[allow(non_snake_case)] mod gen_GpuStencilFaceState; #[cfg(feature = "GpuStencilFaceState")] +#[allow(unused_imports)] pub use gen_GpuStencilFaceState::*; #[cfg(feature = "GpuStencilOperation")] #[allow(non_snake_case)] mod gen_GpuStencilOperation; #[cfg(feature = "GpuStencilOperation")] +#[allow(unused_imports)] pub use gen_GpuStencilOperation::*; #[cfg(feature = "GpuStorageTextureAccess")] #[allow(non_snake_case)] mod gen_GpuStorageTextureAccess; #[cfg(feature = "GpuStorageTextureAccess")] +#[allow(unused_imports)] pub use gen_GpuStorageTextureAccess::*; #[cfg(feature = "GpuStorageTextureBindingLayout")] #[allow(non_snake_case)] mod gen_GpuStorageTextureBindingLayout; #[cfg(feature = "GpuStorageTextureBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuStorageTextureBindingLayout::*; #[cfg(feature = "GpuStoreOp")] #[allow(non_snake_case)] mod gen_GpuStoreOp; #[cfg(feature = "GpuStoreOp")] +#[allow(unused_imports)] pub use gen_GpuStoreOp::*; #[cfg(feature = "GpuSupportedFeatures")] #[allow(non_snake_case)] mod gen_GpuSupportedFeatures; #[cfg(feature = "GpuSupportedFeatures")] +#[allow(unused_imports)] pub use gen_GpuSupportedFeatures::*; #[cfg(feature = "GpuSupportedLimits")] #[allow(non_snake_case)] mod gen_GpuSupportedLimits; #[cfg(feature = "GpuSupportedLimits")] +#[allow(unused_imports)] pub use gen_GpuSupportedLimits::*; +#[cfg(feature = "GpuTexelCopyBufferInfo")] +#[allow(non_snake_case)] +mod gen_GpuTexelCopyBufferInfo; +#[cfg(feature = "GpuTexelCopyBufferInfo")] +#[allow(unused_imports)] +pub use gen_GpuTexelCopyBufferInfo::*; + +#[cfg(feature = "GpuTexelCopyBufferLayout")] +#[allow(non_snake_case)] +mod gen_GpuTexelCopyBufferLayout; +#[cfg(feature = "GpuTexelCopyBufferLayout")] +#[allow(unused_imports)] +pub use gen_GpuTexelCopyBufferLayout::*; + +#[cfg(feature = "GpuTexelCopyTextureInfo")] +#[allow(non_snake_case)] +mod gen_GpuTexelCopyTextureInfo; +#[cfg(feature = "GpuTexelCopyTextureInfo")] +#[allow(unused_imports)] +pub use gen_GpuTexelCopyTextureInfo::*; + #[cfg(feature = "GpuTexture")] #[allow(non_snake_case)] mod gen_GpuTexture; #[cfg(feature = "GpuTexture")] +#[allow(unused_imports)] pub use gen_GpuTexture::*; #[cfg(feature = "GpuTextureAspect")] #[allow(non_snake_case)] mod gen_GpuTextureAspect; #[cfg(feature = "GpuTextureAspect")] +#[allow(unused_imports)] pub use gen_GpuTextureAspect::*; #[cfg(feature = "GpuTextureBindingLayout")] #[allow(non_snake_case)] mod gen_GpuTextureBindingLayout; #[cfg(feature = "GpuTextureBindingLayout")] +#[allow(unused_imports)] pub use gen_GpuTextureBindingLayout::*; #[cfg(feature = "GpuTextureDescriptor")] #[allow(non_snake_case)] mod gen_GpuTextureDescriptor; #[cfg(feature = "GpuTextureDescriptor")] +#[allow(unused_imports)] pub use gen_GpuTextureDescriptor::*; #[cfg(feature = "GpuTextureDimension")] #[allow(non_snake_case)] mod gen_GpuTextureDimension; #[cfg(feature = "GpuTextureDimension")] +#[allow(unused_imports)] pub use gen_GpuTextureDimension::*; #[cfg(feature = "GpuTextureFormat")] #[allow(non_snake_case)] mod gen_GpuTextureFormat; #[cfg(feature = "GpuTextureFormat")] +#[allow(unused_imports)] pub use gen_GpuTextureFormat::*; #[cfg(feature = "GpuTextureSampleType")] #[allow(non_snake_case)] mod gen_GpuTextureSampleType; #[cfg(feature = "GpuTextureSampleType")] +#[allow(unused_imports)] pub use gen_GpuTextureSampleType::*; -#[cfg(feature = "GpuTextureUsage")] -#[allow(non_snake_case)] -mod gen_GpuTextureUsage; -#[cfg(feature = "GpuTextureUsage")] -pub use gen_GpuTextureUsage::*; - #[cfg(feature = "GpuTextureView")] #[allow(non_snake_case)] mod gen_GpuTextureView; #[cfg(feature = "GpuTextureView")] +#[allow(unused_imports)] pub use gen_GpuTextureView::*; #[cfg(feature = "GpuTextureViewDescriptor")] #[allow(non_snake_case)] mod gen_GpuTextureViewDescriptor; #[cfg(feature = "GpuTextureViewDescriptor")] +#[allow(unused_imports)] pub use gen_GpuTextureViewDescriptor::*; #[cfg(feature = "GpuTextureViewDimension")] #[allow(non_snake_case)] mod gen_GpuTextureViewDimension; #[cfg(feature = "GpuTextureViewDimension")] +#[allow(unused_imports)] pub use gen_GpuTextureViewDimension::*; #[cfg(feature = "GpuUncapturedErrorEvent")] #[allow(non_snake_case)] mod gen_GpuUncapturedErrorEvent; #[cfg(feature = "GpuUncapturedErrorEvent")] +#[allow(unused_imports)] pub use gen_GpuUncapturedErrorEvent::*; #[cfg(feature = "GpuUncapturedErrorEventInit")] #[allow(non_snake_case)] mod gen_GpuUncapturedErrorEventInit; #[cfg(feature = "GpuUncapturedErrorEventInit")] +#[allow(unused_imports)] pub use gen_GpuUncapturedErrorEventInit::*; #[cfg(feature = "GpuValidationError")] #[allow(non_snake_case)] mod gen_GpuValidationError; #[cfg(feature = "GpuValidationError")] +#[allow(unused_imports)] pub use gen_GpuValidationError::*; #[cfg(feature = "GpuVertexAttribute")] #[allow(non_snake_case)] mod gen_GpuVertexAttribute; #[cfg(feature = "GpuVertexAttribute")] +#[allow(unused_imports)] pub use gen_GpuVertexAttribute::*; #[cfg(feature = "GpuVertexBufferLayout")] #[allow(non_snake_case)] mod gen_GpuVertexBufferLayout; #[cfg(feature = "GpuVertexBufferLayout")] +#[allow(unused_imports)] pub use gen_GpuVertexBufferLayout::*; #[cfg(feature = "GpuVertexFormat")] #[allow(non_snake_case)] mod gen_GpuVertexFormat; #[cfg(feature = "GpuVertexFormat")] +#[allow(unused_imports)] pub use gen_GpuVertexFormat::*; #[cfg(feature = "GpuVertexState")] #[allow(non_snake_case)] mod gen_GpuVertexState; #[cfg(feature = "GpuVertexState")] +#[allow(unused_imports)] pub use gen_GpuVertexState::*; #[cfg(feature = "GpuVertexStepMode")] #[allow(non_snake_case)] mod gen_GpuVertexStepMode; #[cfg(feature = "GpuVertexStepMode")] +#[allow(unused_imports)] pub use gen_GpuVertexStepMode::*; -#[cfg(feature = "GridDeclaration")] -#[allow(non_snake_case)] -mod gen_GridDeclaration; -#[cfg(feature = "GridDeclaration")] -pub use gen_GridDeclaration::*; - -#[cfg(feature = "GridTrackState")] -#[allow(non_snake_case)] -mod gen_GridTrackState; -#[cfg(feature = "GridTrackState")] -pub use gen_GridTrackState::*; - #[cfg(feature = "GroupedHistoryEventInit")] #[allow(non_snake_case)] mod gen_GroupedHistoryEventInit; #[cfg(feature = "GroupedHistoryEventInit")] +#[allow(unused_imports)] pub use gen_GroupedHistoryEventInit::*; #[cfg(feature = "HalfOpenInfoDict")] #[allow(non_snake_case)] mod gen_HalfOpenInfoDict; #[cfg(feature = "HalfOpenInfoDict")] +#[allow(unused_imports)] pub use gen_HalfOpenInfoDict::*; #[cfg(feature = "HardwareAcceleration")] #[allow(non_snake_case)] mod gen_HardwareAcceleration; #[cfg(feature = "HardwareAcceleration")] +#[allow(unused_imports)] pub use gen_HardwareAcceleration::*; #[cfg(feature = "HashChangeEvent")] #[allow(non_snake_case)] mod gen_HashChangeEvent; #[cfg(feature = "HashChangeEvent")] +#[allow(unused_imports)] pub use gen_HashChangeEvent::*; #[cfg(feature = "HashChangeEventInit")] #[allow(non_snake_case)] mod gen_HashChangeEventInit; #[cfg(feature = "HashChangeEventInit")] +#[allow(unused_imports)] pub use gen_HashChangeEventInit::*; #[cfg(feature = "Headers")] #[allow(non_snake_case)] mod gen_Headers; #[cfg(feature = "Headers")] +#[allow(unused_imports)] pub use gen_Headers::*; #[cfg(feature = "HeadersGuardEnum")] #[allow(non_snake_case)] mod gen_HeadersGuardEnum; #[cfg(feature = "HeadersGuardEnum")] +#[allow(unused_imports)] pub use gen_HeadersGuardEnum::*; #[cfg(feature = "Hid")] #[allow(non_snake_case)] mod gen_Hid; #[cfg(feature = "Hid")] +#[allow(unused_imports)] pub use gen_Hid::*; #[cfg(feature = "HidCollectionInfo")] #[allow(non_snake_case)] mod gen_HidCollectionInfo; #[cfg(feature = "HidCollectionInfo")] +#[allow(unused_imports)] pub use gen_HidCollectionInfo::*; #[cfg(feature = "HidConnectionEvent")] #[allow(non_snake_case)] mod gen_HidConnectionEvent; #[cfg(feature = "HidConnectionEvent")] +#[allow(unused_imports)] pub use gen_HidConnectionEvent::*; #[cfg(feature = "HidConnectionEventInit")] #[allow(non_snake_case)] mod gen_HidConnectionEventInit; #[cfg(feature = "HidConnectionEventInit")] +#[allow(unused_imports)] pub use gen_HidConnectionEventInit::*; #[cfg(feature = "HidDevice")] #[allow(non_snake_case)] mod gen_HidDevice; #[cfg(feature = "HidDevice")] +#[allow(unused_imports)] pub use gen_HidDevice::*; #[cfg(feature = "HidDeviceFilter")] #[allow(non_snake_case)] mod gen_HidDeviceFilter; #[cfg(feature = "HidDeviceFilter")] +#[allow(unused_imports)] pub use gen_HidDeviceFilter::*; #[cfg(feature = "HidDeviceRequestOptions")] #[allow(non_snake_case)] mod gen_HidDeviceRequestOptions; #[cfg(feature = "HidDeviceRequestOptions")] +#[allow(unused_imports)] pub use gen_HidDeviceRequestOptions::*; #[cfg(feature = "HidInputReportEvent")] #[allow(non_snake_case)] mod gen_HidInputReportEvent; #[cfg(feature = "HidInputReportEvent")] +#[allow(unused_imports)] pub use gen_HidInputReportEvent::*; #[cfg(feature = "HidInputReportEventInit")] #[allow(non_snake_case)] mod gen_HidInputReportEventInit; #[cfg(feature = "HidInputReportEventInit")] +#[allow(unused_imports)] pub use gen_HidInputReportEventInit::*; #[cfg(feature = "HidReportInfo")] #[allow(non_snake_case)] mod gen_HidReportInfo; #[cfg(feature = "HidReportInfo")] +#[allow(unused_imports)] pub use gen_HidReportInfo::*; #[cfg(feature = "HidReportItem")] #[allow(non_snake_case)] mod gen_HidReportItem; #[cfg(feature = "HidReportItem")] +#[allow(unused_imports)] pub use gen_HidReportItem::*; #[cfg(feature = "HidUnitSystem")] #[allow(non_snake_case)] mod gen_HidUnitSystem; #[cfg(feature = "HidUnitSystem")] +#[allow(unused_imports)] pub use gen_HidUnitSystem::*; #[cfg(feature = "HiddenPluginEventInit")] #[allow(non_snake_case)] mod gen_HiddenPluginEventInit; #[cfg(feature = "HiddenPluginEventInit")] +#[allow(unused_imports)] pub use gen_HiddenPluginEventInit::*; #[cfg(feature = "History")] #[allow(non_snake_case)] mod gen_History; #[cfg(feature = "History")] +#[allow(unused_imports)] pub use gen_History::*; #[cfg(feature = "HitRegionOptions")] #[allow(non_snake_case)] mod gen_HitRegionOptions; #[cfg(feature = "HitRegionOptions")] +#[allow(unused_imports)] pub use gen_HitRegionOptions::*; #[cfg(feature = "HkdfParams")] #[allow(non_snake_case)] mod gen_HkdfParams; #[cfg(feature = "HkdfParams")] +#[allow(unused_imports)] pub use gen_HkdfParams::*; #[cfg(feature = "HmacDerivedKeyParams")] #[allow(non_snake_case)] mod gen_HmacDerivedKeyParams; #[cfg(feature = "HmacDerivedKeyParams")] +#[allow(unused_imports)] pub use gen_HmacDerivedKeyParams::*; #[cfg(feature = "HmacImportParams")] #[allow(non_snake_case)] mod gen_HmacImportParams; #[cfg(feature = "HmacImportParams")] +#[allow(unused_imports)] pub use gen_HmacImportParams::*; #[cfg(feature = "HmacKeyAlgorithm")] #[allow(non_snake_case)] mod gen_HmacKeyAlgorithm; #[cfg(feature = "HmacKeyAlgorithm")] +#[allow(unused_imports)] pub use gen_HmacKeyAlgorithm::*; #[cfg(feature = "HmacKeyGenParams")] #[allow(non_snake_case)] mod gen_HmacKeyGenParams; #[cfg(feature = "HmacKeyGenParams")] +#[allow(unused_imports)] pub use gen_HmacKeyGenParams::*; #[cfg(feature = "HtmlAllCollection")] #[allow(non_snake_case)] mod gen_HtmlAllCollection; #[cfg(feature = "HtmlAllCollection")] +#[allow(unused_imports)] pub use gen_HtmlAllCollection::*; #[cfg(feature = "HtmlAnchorElement")] #[allow(non_snake_case)] mod gen_HtmlAnchorElement; #[cfg(feature = "HtmlAnchorElement")] +#[allow(unused_imports)] pub use gen_HtmlAnchorElement::*; #[cfg(feature = "HtmlAreaElement")] #[allow(non_snake_case)] mod gen_HtmlAreaElement; #[cfg(feature = "HtmlAreaElement")] +#[allow(unused_imports)] pub use gen_HtmlAreaElement::*; #[cfg(feature = "HtmlAudioElement")] #[allow(non_snake_case)] mod gen_HtmlAudioElement; #[cfg(feature = "HtmlAudioElement")] +#[allow(unused_imports)] pub use gen_HtmlAudioElement::*; #[cfg(feature = "HtmlBaseElement")] #[allow(non_snake_case)] mod gen_HtmlBaseElement; #[cfg(feature = "HtmlBaseElement")] +#[allow(unused_imports)] pub use gen_HtmlBaseElement::*; #[cfg(feature = "HtmlBodyElement")] #[allow(non_snake_case)] mod gen_HtmlBodyElement; #[cfg(feature = "HtmlBodyElement")] +#[allow(unused_imports)] pub use gen_HtmlBodyElement::*; #[cfg(feature = "HtmlBrElement")] #[allow(non_snake_case)] mod gen_HtmlBrElement; #[cfg(feature = "HtmlBrElement")] +#[allow(unused_imports)] pub use gen_HtmlBrElement::*; #[cfg(feature = "HtmlButtonElement")] #[allow(non_snake_case)] mod gen_HtmlButtonElement; #[cfg(feature = "HtmlButtonElement")] +#[allow(unused_imports)] pub use gen_HtmlButtonElement::*; #[cfg(feature = "HtmlCanvasElement")] #[allow(non_snake_case)] mod gen_HtmlCanvasElement; #[cfg(feature = "HtmlCanvasElement")] +#[allow(unused_imports)] pub use gen_HtmlCanvasElement::*; #[cfg(feature = "HtmlCollection")] #[allow(non_snake_case)] mod gen_HtmlCollection; #[cfg(feature = "HtmlCollection")] +#[allow(unused_imports)] pub use gen_HtmlCollection::*; #[cfg(feature = "HtmlDListElement")] #[allow(non_snake_case)] mod gen_HtmlDListElement; #[cfg(feature = "HtmlDListElement")] +#[allow(unused_imports)] pub use gen_HtmlDListElement::*; #[cfg(feature = "HtmlDataElement")] #[allow(non_snake_case)] mod gen_HtmlDataElement; #[cfg(feature = "HtmlDataElement")] +#[allow(unused_imports)] pub use gen_HtmlDataElement::*; #[cfg(feature = "HtmlDataListElement")] #[allow(non_snake_case)] mod gen_HtmlDataListElement; #[cfg(feature = "HtmlDataListElement")] +#[allow(unused_imports)] pub use gen_HtmlDataListElement::*; #[cfg(feature = "HtmlDetailsElement")] #[allow(non_snake_case)] mod gen_HtmlDetailsElement; #[cfg(feature = "HtmlDetailsElement")] +#[allow(unused_imports)] pub use gen_HtmlDetailsElement::*; #[cfg(feature = "HtmlDialogElement")] #[allow(non_snake_case)] mod gen_HtmlDialogElement; #[cfg(feature = "HtmlDialogElement")] +#[allow(unused_imports)] pub use gen_HtmlDialogElement::*; #[cfg(feature = "HtmlDirectoryElement")] #[allow(non_snake_case)] mod gen_HtmlDirectoryElement; #[cfg(feature = "HtmlDirectoryElement")] +#[allow(unused_imports)] pub use gen_HtmlDirectoryElement::*; #[cfg(feature = "HtmlDivElement")] #[allow(non_snake_case)] mod gen_HtmlDivElement; #[cfg(feature = "HtmlDivElement")] +#[allow(unused_imports)] pub use gen_HtmlDivElement::*; #[cfg(feature = "HtmlDocument")] #[allow(non_snake_case)] mod gen_HtmlDocument; #[cfg(feature = "HtmlDocument")] +#[allow(unused_imports)] pub use gen_HtmlDocument::*; #[cfg(feature = "HtmlElement")] #[allow(non_snake_case)] mod gen_HtmlElement; #[cfg(feature = "HtmlElement")] +#[allow(unused_imports)] pub use gen_HtmlElement::*; #[cfg(feature = "HtmlEmbedElement")] #[allow(non_snake_case)] mod gen_HtmlEmbedElement; #[cfg(feature = "HtmlEmbedElement")] +#[allow(unused_imports)] pub use gen_HtmlEmbedElement::*; #[cfg(feature = "HtmlFieldSetElement")] #[allow(non_snake_case)] mod gen_HtmlFieldSetElement; #[cfg(feature = "HtmlFieldSetElement")] +#[allow(unused_imports)] pub use gen_HtmlFieldSetElement::*; #[cfg(feature = "HtmlFontElement")] #[allow(non_snake_case)] mod gen_HtmlFontElement; #[cfg(feature = "HtmlFontElement")] +#[allow(unused_imports)] pub use gen_HtmlFontElement::*; #[cfg(feature = "HtmlFormControlsCollection")] #[allow(non_snake_case)] mod gen_HtmlFormControlsCollection; #[cfg(feature = "HtmlFormControlsCollection")] +#[allow(unused_imports)] pub use gen_HtmlFormControlsCollection::*; #[cfg(feature = "HtmlFormElement")] #[allow(non_snake_case)] mod gen_HtmlFormElement; #[cfg(feature = "HtmlFormElement")] +#[allow(unused_imports)] pub use gen_HtmlFormElement::*; #[cfg(feature = "HtmlFrameElement")] #[allow(non_snake_case)] mod gen_HtmlFrameElement; #[cfg(feature = "HtmlFrameElement")] +#[allow(unused_imports)] pub use gen_HtmlFrameElement::*; #[cfg(feature = "HtmlFrameSetElement")] #[allow(non_snake_case)] mod gen_HtmlFrameSetElement; #[cfg(feature = "HtmlFrameSetElement")] +#[allow(unused_imports)] pub use gen_HtmlFrameSetElement::*; #[cfg(feature = "HtmlHeadElement")] #[allow(non_snake_case)] mod gen_HtmlHeadElement; #[cfg(feature = "HtmlHeadElement")] +#[allow(unused_imports)] pub use gen_HtmlHeadElement::*; #[cfg(feature = "HtmlHeadingElement")] #[allow(non_snake_case)] mod gen_HtmlHeadingElement; #[cfg(feature = "HtmlHeadingElement")] +#[allow(unused_imports)] pub use gen_HtmlHeadingElement::*; #[cfg(feature = "HtmlHrElement")] #[allow(non_snake_case)] mod gen_HtmlHrElement; #[cfg(feature = "HtmlHrElement")] +#[allow(unused_imports)] pub use gen_HtmlHrElement::*; #[cfg(feature = "HtmlHtmlElement")] #[allow(non_snake_case)] mod gen_HtmlHtmlElement; #[cfg(feature = "HtmlHtmlElement")] +#[allow(unused_imports)] pub use gen_HtmlHtmlElement::*; #[cfg(feature = "HtmlIFrameElement")] #[allow(non_snake_case)] mod gen_HtmlIFrameElement; #[cfg(feature = "HtmlIFrameElement")] +#[allow(unused_imports)] pub use gen_HtmlIFrameElement::*; #[cfg(feature = "HtmlImageElement")] #[allow(non_snake_case)] mod gen_HtmlImageElement; #[cfg(feature = "HtmlImageElement")] +#[allow(unused_imports)] pub use gen_HtmlImageElement::*; #[cfg(feature = "HtmlInputElement")] #[allow(non_snake_case)] mod gen_HtmlInputElement; #[cfg(feature = "HtmlInputElement")] +#[allow(unused_imports)] pub use gen_HtmlInputElement::*; #[cfg(feature = "HtmlLabelElement")] #[allow(non_snake_case)] mod gen_HtmlLabelElement; #[cfg(feature = "HtmlLabelElement")] +#[allow(unused_imports)] pub use gen_HtmlLabelElement::*; #[cfg(feature = "HtmlLegendElement")] #[allow(non_snake_case)] mod gen_HtmlLegendElement; #[cfg(feature = "HtmlLegendElement")] +#[allow(unused_imports)] pub use gen_HtmlLegendElement::*; #[cfg(feature = "HtmlLiElement")] #[allow(non_snake_case)] mod gen_HtmlLiElement; #[cfg(feature = "HtmlLiElement")] +#[allow(unused_imports)] pub use gen_HtmlLiElement::*; #[cfg(feature = "HtmlLinkElement")] #[allow(non_snake_case)] mod gen_HtmlLinkElement; #[cfg(feature = "HtmlLinkElement")] +#[allow(unused_imports)] pub use gen_HtmlLinkElement::*; #[cfg(feature = "HtmlMapElement")] #[allow(non_snake_case)] mod gen_HtmlMapElement; #[cfg(feature = "HtmlMapElement")] +#[allow(unused_imports)] pub use gen_HtmlMapElement::*; #[cfg(feature = "HtmlMediaElement")] #[allow(non_snake_case)] mod gen_HtmlMediaElement; #[cfg(feature = "HtmlMediaElement")] +#[allow(unused_imports)] pub use gen_HtmlMediaElement::*; #[cfg(feature = "HtmlMenuElement")] #[allow(non_snake_case)] mod gen_HtmlMenuElement; #[cfg(feature = "HtmlMenuElement")] +#[allow(unused_imports)] pub use gen_HtmlMenuElement::*; #[cfg(feature = "HtmlMenuItemElement")] #[allow(non_snake_case)] mod gen_HtmlMenuItemElement; #[cfg(feature = "HtmlMenuItemElement")] +#[allow(unused_imports)] pub use gen_HtmlMenuItemElement::*; #[cfg(feature = "HtmlMetaElement")] #[allow(non_snake_case)] mod gen_HtmlMetaElement; #[cfg(feature = "HtmlMetaElement")] +#[allow(unused_imports)] pub use gen_HtmlMetaElement::*; #[cfg(feature = "HtmlMeterElement")] #[allow(non_snake_case)] mod gen_HtmlMeterElement; #[cfg(feature = "HtmlMeterElement")] +#[allow(unused_imports)] pub use gen_HtmlMeterElement::*; #[cfg(feature = "HtmlModElement")] #[allow(non_snake_case)] mod gen_HtmlModElement; #[cfg(feature = "HtmlModElement")] +#[allow(unused_imports)] pub use gen_HtmlModElement::*; #[cfg(feature = "HtmlOListElement")] #[allow(non_snake_case)] mod gen_HtmlOListElement; #[cfg(feature = "HtmlOListElement")] +#[allow(unused_imports)] pub use gen_HtmlOListElement::*; #[cfg(feature = "HtmlObjectElement")] #[allow(non_snake_case)] mod gen_HtmlObjectElement; #[cfg(feature = "HtmlObjectElement")] +#[allow(unused_imports)] pub use gen_HtmlObjectElement::*; #[cfg(feature = "HtmlOptGroupElement")] #[allow(non_snake_case)] mod gen_HtmlOptGroupElement; #[cfg(feature = "HtmlOptGroupElement")] +#[allow(unused_imports)] pub use gen_HtmlOptGroupElement::*; #[cfg(feature = "HtmlOptionElement")] #[allow(non_snake_case)] mod gen_HtmlOptionElement; #[cfg(feature = "HtmlOptionElement")] +#[allow(unused_imports)] pub use gen_HtmlOptionElement::*; #[cfg(feature = "HtmlOptionsCollection")] #[allow(non_snake_case)] mod gen_HtmlOptionsCollection; #[cfg(feature = "HtmlOptionsCollection")] +#[allow(unused_imports)] pub use gen_HtmlOptionsCollection::*; #[cfg(feature = "HtmlOutputElement")] #[allow(non_snake_case)] mod gen_HtmlOutputElement; #[cfg(feature = "HtmlOutputElement")] +#[allow(unused_imports)] pub use gen_HtmlOutputElement::*; #[cfg(feature = "HtmlParagraphElement")] #[allow(non_snake_case)] mod gen_HtmlParagraphElement; #[cfg(feature = "HtmlParagraphElement")] +#[allow(unused_imports)] pub use gen_HtmlParagraphElement::*; #[cfg(feature = "HtmlParamElement")] #[allow(non_snake_case)] mod gen_HtmlParamElement; #[cfg(feature = "HtmlParamElement")] +#[allow(unused_imports)] pub use gen_HtmlParamElement::*; #[cfg(feature = "HtmlPictureElement")] #[allow(non_snake_case)] mod gen_HtmlPictureElement; #[cfg(feature = "HtmlPictureElement")] +#[allow(unused_imports)] pub use gen_HtmlPictureElement::*; #[cfg(feature = "HtmlPreElement")] #[allow(non_snake_case)] mod gen_HtmlPreElement; #[cfg(feature = "HtmlPreElement")] +#[allow(unused_imports)] pub use gen_HtmlPreElement::*; #[cfg(feature = "HtmlProgressElement")] #[allow(non_snake_case)] mod gen_HtmlProgressElement; #[cfg(feature = "HtmlProgressElement")] +#[allow(unused_imports)] pub use gen_HtmlProgressElement::*; #[cfg(feature = "HtmlQuoteElement")] #[allow(non_snake_case)] mod gen_HtmlQuoteElement; #[cfg(feature = "HtmlQuoteElement")] +#[allow(unused_imports)] pub use gen_HtmlQuoteElement::*; #[cfg(feature = "HtmlScriptElement")] #[allow(non_snake_case)] mod gen_HtmlScriptElement; #[cfg(feature = "HtmlScriptElement")] +#[allow(unused_imports)] pub use gen_HtmlScriptElement::*; #[cfg(feature = "HtmlSelectElement")] #[allow(non_snake_case)] mod gen_HtmlSelectElement; #[cfg(feature = "HtmlSelectElement")] +#[allow(unused_imports)] pub use gen_HtmlSelectElement::*; #[cfg(feature = "HtmlSlotElement")] #[allow(non_snake_case)] mod gen_HtmlSlotElement; #[cfg(feature = "HtmlSlotElement")] +#[allow(unused_imports)] pub use gen_HtmlSlotElement::*; #[cfg(feature = "HtmlSourceElement")] #[allow(non_snake_case)] mod gen_HtmlSourceElement; #[cfg(feature = "HtmlSourceElement")] +#[allow(unused_imports)] pub use gen_HtmlSourceElement::*; #[cfg(feature = "HtmlSpanElement")] #[allow(non_snake_case)] mod gen_HtmlSpanElement; #[cfg(feature = "HtmlSpanElement")] +#[allow(unused_imports)] pub use gen_HtmlSpanElement::*; #[cfg(feature = "HtmlStyleElement")] #[allow(non_snake_case)] mod gen_HtmlStyleElement; #[cfg(feature = "HtmlStyleElement")] +#[allow(unused_imports)] pub use gen_HtmlStyleElement::*; #[cfg(feature = "HtmlTableCaptionElement")] #[allow(non_snake_case)] mod gen_HtmlTableCaptionElement; #[cfg(feature = "HtmlTableCaptionElement")] +#[allow(unused_imports)] pub use gen_HtmlTableCaptionElement::*; #[cfg(feature = "HtmlTableCellElement")] #[allow(non_snake_case)] mod gen_HtmlTableCellElement; #[cfg(feature = "HtmlTableCellElement")] +#[allow(unused_imports)] pub use gen_HtmlTableCellElement::*; #[cfg(feature = "HtmlTableColElement")] #[allow(non_snake_case)] mod gen_HtmlTableColElement; #[cfg(feature = "HtmlTableColElement")] +#[allow(unused_imports)] pub use gen_HtmlTableColElement::*; #[cfg(feature = "HtmlTableElement")] #[allow(non_snake_case)] mod gen_HtmlTableElement; #[cfg(feature = "HtmlTableElement")] +#[allow(unused_imports)] pub use gen_HtmlTableElement::*; #[cfg(feature = "HtmlTableRowElement")] #[allow(non_snake_case)] mod gen_HtmlTableRowElement; #[cfg(feature = "HtmlTableRowElement")] +#[allow(unused_imports)] pub use gen_HtmlTableRowElement::*; #[cfg(feature = "HtmlTableSectionElement")] #[allow(non_snake_case)] mod gen_HtmlTableSectionElement; #[cfg(feature = "HtmlTableSectionElement")] +#[allow(unused_imports)] pub use gen_HtmlTableSectionElement::*; #[cfg(feature = "HtmlTemplateElement")] #[allow(non_snake_case)] mod gen_HtmlTemplateElement; #[cfg(feature = "HtmlTemplateElement")] +#[allow(unused_imports)] pub use gen_HtmlTemplateElement::*; #[cfg(feature = "HtmlTextAreaElement")] #[allow(non_snake_case)] mod gen_HtmlTextAreaElement; #[cfg(feature = "HtmlTextAreaElement")] +#[allow(unused_imports)] pub use gen_HtmlTextAreaElement::*; #[cfg(feature = "HtmlTimeElement")] #[allow(non_snake_case)] mod gen_HtmlTimeElement; #[cfg(feature = "HtmlTimeElement")] +#[allow(unused_imports)] pub use gen_HtmlTimeElement::*; #[cfg(feature = "HtmlTitleElement")] #[allow(non_snake_case)] mod gen_HtmlTitleElement; #[cfg(feature = "HtmlTitleElement")] +#[allow(unused_imports)] pub use gen_HtmlTitleElement::*; #[cfg(feature = "HtmlTrackElement")] #[allow(non_snake_case)] mod gen_HtmlTrackElement; #[cfg(feature = "HtmlTrackElement")] +#[allow(unused_imports)] pub use gen_HtmlTrackElement::*; #[cfg(feature = "HtmlUListElement")] #[allow(non_snake_case)] mod gen_HtmlUListElement; #[cfg(feature = "HtmlUListElement")] +#[allow(unused_imports)] pub use gen_HtmlUListElement::*; #[cfg(feature = "HtmlUnknownElement")] #[allow(non_snake_case)] mod gen_HtmlUnknownElement; #[cfg(feature = "HtmlUnknownElement")] +#[allow(unused_imports)] pub use gen_HtmlUnknownElement::*; #[cfg(feature = "HtmlVideoElement")] #[allow(non_snake_case)] mod gen_HtmlVideoElement; #[cfg(feature = "HtmlVideoElement")] +#[allow(unused_imports)] pub use gen_HtmlVideoElement::*; #[cfg(feature = "HttpConnDict")] #[allow(non_snake_case)] mod gen_HttpConnDict; #[cfg(feature = "HttpConnDict")] +#[allow(unused_imports)] pub use gen_HttpConnDict::*; #[cfg(feature = "HttpConnInfo")] #[allow(non_snake_case)] mod gen_HttpConnInfo; #[cfg(feature = "HttpConnInfo")] +#[allow(unused_imports)] pub use gen_HttpConnInfo::*; #[cfg(feature = "HttpConnectionElement")] #[allow(non_snake_case)] mod gen_HttpConnectionElement; #[cfg(feature = "HttpConnectionElement")] +#[allow(unused_imports)] pub use gen_HttpConnectionElement::*; #[cfg(feature = "IdbCursor")] #[allow(non_snake_case)] mod gen_IdbCursor; #[cfg(feature = "IdbCursor")] +#[allow(unused_imports)] pub use gen_IdbCursor::*; #[cfg(feature = "IdbCursorDirection")] #[allow(non_snake_case)] mod gen_IdbCursorDirection; #[cfg(feature = "IdbCursorDirection")] +#[allow(unused_imports)] pub use gen_IdbCursorDirection::*; #[cfg(feature = "IdbCursorWithValue")] #[allow(non_snake_case)] mod gen_IdbCursorWithValue; #[cfg(feature = "IdbCursorWithValue")] +#[allow(unused_imports)] pub use gen_IdbCursorWithValue::*; #[cfg(feature = "IdbDatabase")] #[allow(non_snake_case)] mod gen_IdbDatabase; #[cfg(feature = "IdbDatabase")] +#[allow(unused_imports)] pub use gen_IdbDatabase::*; #[cfg(feature = "IdbFactory")] #[allow(non_snake_case)] mod gen_IdbFactory; #[cfg(feature = "IdbFactory")] +#[allow(unused_imports)] pub use gen_IdbFactory::*; #[cfg(feature = "IdbFileHandle")] #[allow(non_snake_case)] mod gen_IdbFileHandle; #[cfg(feature = "IdbFileHandle")] +#[allow(unused_imports)] pub use gen_IdbFileHandle::*; #[cfg(feature = "IdbFileMetadataParameters")] #[allow(non_snake_case)] mod gen_IdbFileMetadataParameters; #[cfg(feature = "IdbFileMetadataParameters")] +#[allow(unused_imports)] pub use gen_IdbFileMetadataParameters::*; #[cfg(feature = "IdbFileRequest")] #[allow(non_snake_case)] mod gen_IdbFileRequest; #[cfg(feature = "IdbFileRequest")] +#[allow(unused_imports)] pub use gen_IdbFileRequest::*; #[cfg(feature = "IdbIndex")] #[allow(non_snake_case)] mod gen_IdbIndex; #[cfg(feature = "IdbIndex")] +#[allow(unused_imports)] pub use gen_IdbIndex::*; #[cfg(feature = "IdbIndexParameters")] #[allow(non_snake_case)] mod gen_IdbIndexParameters; #[cfg(feature = "IdbIndexParameters")] +#[allow(unused_imports)] pub use gen_IdbIndexParameters::*; #[cfg(feature = "IdbKeyRange")] #[allow(non_snake_case)] mod gen_IdbKeyRange; #[cfg(feature = "IdbKeyRange")] +#[allow(unused_imports)] pub use gen_IdbKeyRange::*; #[cfg(feature = "IdbLocaleAwareKeyRange")] #[allow(non_snake_case)] mod gen_IdbLocaleAwareKeyRange; #[cfg(feature = "IdbLocaleAwareKeyRange")] +#[allow(unused_imports)] pub use gen_IdbLocaleAwareKeyRange::*; #[cfg(feature = "IdbMutableFile")] #[allow(non_snake_case)] mod gen_IdbMutableFile; #[cfg(feature = "IdbMutableFile")] +#[allow(unused_imports)] pub use gen_IdbMutableFile::*; #[cfg(feature = "IdbObjectStore")] #[allow(non_snake_case)] mod gen_IdbObjectStore; #[cfg(feature = "IdbObjectStore")] +#[allow(unused_imports)] pub use gen_IdbObjectStore::*; #[cfg(feature = "IdbObjectStoreParameters")] #[allow(non_snake_case)] mod gen_IdbObjectStoreParameters; #[cfg(feature = "IdbObjectStoreParameters")] +#[allow(unused_imports)] pub use gen_IdbObjectStoreParameters::*; #[cfg(feature = "IdbOpenDbOptions")] #[allow(non_snake_case)] mod gen_IdbOpenDbOptions; #[cfg(feature = "IdbOpenDbOptions")] +#[allow(unused_imports)] pub use gen_IdbOpenDbOptions::*; #[cfg(feature = "IdbOpenDbRequest")] #[allow(non_snake_case)] mod gen_IdbOpenDbRequest; #[cfg(feature = "IdbOpenDbRequest")] +#[allow(unused_imports)] pub use gen_IdbOpenDbRequest::*; #[cfg(feature = "IdbRequest")] #[allow(non_snake_case)] mod gen_IdbRequest; #[cfg(feature = "IdbRequest")] +#[allow(unused_imports)] pub use gen_IdbRequest::*; #[cfg(feature = "IdbRequestReadyState")] #[allow(non_snake_case)] mod gen_IdbRequestReadyState; #[cfg(feature = "IdbRequestReadyState")] +#[allow(unused_imports)] pub use gen_IdbRequestReadyState::*; #[cfg(feature = "IdbTransaction")] #[allow(non_snake_case)] mod gen_IdbTransaction; #[cfg(feature = "IdbTransaction")] +#[allow(unused_imports)] pub use gen_IdbTransaction::*; +#[cfg(feature = "IdbTransactionDurability")] +#[allow(non_snake_case)] +mod gen_IdbTransactionDurability; +#[cfg(feature = "IdbTransactionDurability")] +#[allow(unused_imports)] +pub use gen_IdbTransactionDurability::*; + #[cfg(feature = "IdbTransactionMode")] #[allow(non_snake_case)] mod gen_IdbTransactionMode; #[cfg(feature = "IdbTransactionMode")] +#[allow(unused_imports)] pub use gen_IdbTransactionMode::*; +#[cfg(feature = "IdbTransactionOptions")] +#[allow(non_snake_case)] +mod gen_IdbTransactionOptions; +#[cfg(feature = "IdbTransactionOptions")] +#[allow(unused_imports)] +pub use gen_IdbTransactionOptions::*; + #[cfg(feature = "IdbVersionChangeEvent")] #[allow(non_snake_case)] mod gen_IdbVersionChangeEvent; #[cfg(feature = "IdbVersionChangeEvent")] +#[allow(unused_imports)] pub use gen_IdbVersionChangeEvent::*; #[cfg(feature = "IdbVersionChangeEventInit")] #[allow(non_snake_case)] mod gen_IdbVersionChangeEventInit; #[cfg(feature = "IdbVersionChangeEventInit")] +#[allow(unused_imports)] pub use gen_IdbVersionChangeEventInit::*; #[cfg(feature = "IdleDeadline")] #[allow(non_snake_case)] mod gen_IdleDeadline; #[cfg(feature = "IdleDeadline")] +#[allow(unused_imports)] pub use gen_IdleDeadline::*; #[cfg(feature = "IdleRequestOptions")] #[allow(non_snake_case)] mod gen_IdleRequestOptions; #[cfg(feature = "IdleRequestOptions")] +#[allow(unused_imports)] pub use gen_IdleRequestOptions::*; #[cfg(feature = "IirFilterNode")] #[allow(non_snake_case)] mod gen_IirFilterNode; #[cfg(feature = "IirFilterNode")] +#[allow(unused_imports)] pub use gen_IirFilterNode::*; #[cfg(feature = "IirFilterOptions")] #[allow(non_snake_case)] mod gen_IirFilterOptions; #[cfg(feature = "IirFilterOptions")] +#[allow(unused_imports)] pub use gen_IirFilterOptions::*; #[cfg(feature = "ImageBitmap")] #[allow(non_snake_case)] mod gen_ImageBitmap; #[cfg(feature = "ImageBitmap")] +#[allow(unused_imports)] pub use gen_ImageBitmap::*; -#[cfg(feature = "ImageBitmapFormat")] +#[cfg(feature = "ImageBitmapOptions")] #[allow(non_snake_case)] -mod gen_ImageBitmapFormat; -#[cfg(feature = "ImageBitmapFormat")] -pub use gen_ImageBitmapFormat::*; +mod gen_ImageBitmapOptions; +#[cfg(feature = "ImageBitmapOptions")] +#[allow(unused_imports)] +pub use gen_ImageBitmapOptions::*; #[cfg(feature = "ImageBitmapRenderingContext")] #[allow(non_snake_case)] mod gen_ImageBitmapRenderingContext; #[cfg(feature = "ImageBitmapRenderingContext")] +#[allow(unused_imports)] pub use gen_ImageBitmapRenderingContext::*; #[cfg(feature = "ImageCapture")] #[allow(non_snake_case)] mod gen_ImageCapture; #[cfg(feature = "ImageCapture")] +#[allow(unused_imports)] pub use gen_ImageCapture::*; #[cfg(feature = "ImageCaptureError")] #[allow(non_snake_case)] mod gen_ImageCaptureError; #[cfg(feature = "ImageCaptureError")] +#[allow(unused_imports)] pub use gen_ImageCaptureError::*; #[cfg(feature = "ImageCaptureErrorEvent")] #[allow(non_snake_case)] mod gen_ImageCaptureErrorEvent; #[cfg(feature = "ImageCaptureErrorEvent")] +#[allow(unused_imports)] pub use gen_ImageCaptureErrorEvent::*; #[cfg(feature = "ImageCaptureErrorEventInit")] #[allow(non_snake_case)] mod gen_ImageCaptureErrorEventInit; #[cfg(feature = "ImageCaptureErrorEventInit")] +#[allow(unused_imports)] pub use gen_ImageCaptureErrorEventInit::*; #[cfg(feature = "ImageData")] #[allow(non_snake_case)] mod gen_ImageData; #[cfg(feature = "ImageData")] +#[allow(unused_imports)] pub use gen_ImageData::*; #[cfg(feature = "ImageDecodeOptions")] #[allow(non_snake_case)] mod gen_ImageDecodeOptions; #[cfg(feature = "ImageDecodeOptions")] +#[allow(unused_imports)] pub use gen_ImageDecodeOptions::*; #[cfg(feature = "ImageDecodeResult")] #[allow(non_snake_case)] mod gen_ImageDecodeResult; #[cfg(feature = "ImageDecodeResult")] +#[allow(unused_imports)] pub use gen_ImageDecodeResult::*; #[cfg(feature = "ImageDecoder")] #[allow(non_snake_case)] mod gen_ImageDecoder; #[cfg(feature = "ImageDecoder")] +#[allow(unused_imports)] pub use gen_ImageDecoder::*; #[cfg(feature = "ImageDecoderInit")] #[allow(non_snake_case)] mod gen_ImageDecoderInit; #[cfg(feature = "ImageDecoderInit")] +#[allow(unused_imports)] pub use gen_ImageDecoderInit::*; +#[cfg(feature = "ImageEncodeOptions")] +#[allow(non_snake_case)] +mod gen_ImageEncodeOptions; +#[cfg(feature = "ImageEncodeOptions")] +#[allow(unused_imports)] +pub use gen_ImageEncodeOptions::*; + +#[cfg(feature = "ImageOrientation")] +#[allow(non_snake_case)] +mod gen_ImageOrientation; +#[cfg(feature = "ImageOrientation")] +#[allow(unused_imports)] +pub use gen_ImageOrientation::*; + #[cfg(feature = "ImageTrack")] #[allow(non_snake_case)] mod gen_ImageTrack; #[cfg(feature = "ImageTrack")] +#[allow(unused_imports)] pub use gen_ImageTrack::*; #[cfg(feature = "ImageTrackList")] #[allow(non_snake_case)] mod gen_ImageTrackList; #[cfg(feature = "ImageTrackList")] +#[allow(unused_imports)] pub use gen_ImageTrackList::*; +#[cfg(feature = "InputDeviceInfo")] +#[allow(non_snake_case)] +mod gen_InputDeviceInfo; +#[cfg(feature = "InputDeviceInfo")] +#[allow(unused_imports)] +pub use gen_InputDeviceInfo::*; + #[cfg(feature = "InputEvent")] #[allow(non_snake_case)] mod gen_InputEvent; #[cfg(feature = "InputEvent")] +#[allow(unused_imports)] pub use gen_InputEvent::*; #[cfg(feature = "InputEventInit")] #[allow(non_snake_case)] mod gen_InputEventInit; #[cfg(feature = "InputEventInit")] +#[allow(unused_imports)] pub use gen_InputEventInit::*; -#[cfg(feature = "InstallTriggerData")] -#[allow(non_snake_case)] -mod gen_InstallTriggerData; -#[cfg(feature = "InstallTriggerData")] -pub use gen_InstallTriggerData::*; - #[cfg(feature = "IntersectionObserver")] #[allow(non_snake_case)] mod gen_IntersectionObserver; #[cfg(feature = "IntersectionObserver")] +#[allow(unused_imports)] pub use gen_IntersectionObserver::*; #[cfg(feature = "IntersectionObserverEntry")] #[allow(non_snake_case)] mod gen_IntersectionObserverEntry; #[cfg(feature = "IntersectionObserverEntry")] +#[allow(unused_imports)] pub use gen_IntersectionObserverEntry::*; #[cfg(feature = "IntersectionObserverEntryInit")] #[allow(non_snake_case)] mod gen_IntersectionObserverEntryInit; #[cfg(feature = "IntersectionObserverEntryInit")] +#[allow(unused_imports)] pub use gen_IntersectionObserverEntryInit::*; #[cfg(feature = "IntersectionObserverInit")] #[allow(non_snake_case)] mod gen_IntersectionObserverInit; #[cfg(feature = "IntersectionObserverInit")] +#[allow(unused_imports)] pub use gen_IntersectionObserverInit::*; #[cfg(feature = "IntlUtils")] #[allow(non_snake_case)] mod gen_IntlUtils; #[cfg(feature = "IntlUtils")] +#[allow(unused_imports)] pub use gen_IntlUtils::*; +#[cfg(feature = "IsInputPendingOptions")] +#[allow(non_snake_case)] +mod gen_IsInputPendingOptions; +#[cfg(feature = "IsInputPendingOptions")] +#[allow(unused_imports)] +pub use gen_IsInputPendingOptions::*; + #[cfg(feature = "IterableKeyAndValueResult")] #[allow(non_snake_case)] mod gen_IterableKeyAndValueResult; #[cfg(feature = "IterableKeyAndValueResult")] +#[allow(unused_imports)] pub use gen_IterableKeyAndValueResult::*; #[cfg(feature = "IterableKeyOrValueResult")] #[allow(non_snake_case)] mod gen_IterableKeyOrValueResult; #[cfg(feature = "IterableKeyOrValueResult")] +#[allow(unused_imports)] pub use gen_IterableKeyOrValueResult::*; #[cfg(feature = "IterationCompositeOperation")] #[allow(non_snake_case)] mod gen_IterationCompositeOperation; #[cfg(feature = "IterationCompositeOperation")] +#[allow(unused_imports)] pub use gen_IterationCompositeOperation::*; #[cfg(feature = "JsonWebKey")] #[allow(non_snake_case)] mod gen_JsonWebKey; #[cfg(feature = "JsonWebKey")] +#[allow(unused_imports)] pub use gen_JsonWebKey::*; #[cfg(feature = "KeyAlgorithm")] #[allow(non_snake_case)] mod gen_KeyAlgorithm; #[cfg(feature = "KeyAlgorithm")] +#[allow(unused_imports)] pub use gen_KeyAlgorithm::*; #[cfg(feature = "KeyEvent")] #[allow(non_snake_case)] mod gen_KeyEvent; #[cfg(feature = "KeyEvent")] +#[allow(unused_imports)] pub use gen_KeyEvent::*; +#[cfg(feature = "KeyFrameRequestEvent")] +#[allow(non_snake_case)] +mod gen_KeyFrameRequestEvent; +#[cfg(feature = "KeyFrameRequestEvent")] +#[allow(unused_imports)] +pub use gen_KeyFrameRequestEvent::*; + #[cfg(feature = "KeyIdsInitData")] #[allow(non_snake_case)] mod gen_KeyIdsInitData; #[cfg(feature = "KeyIdsInitData")] +#[allow(unused_imports)] pub use gen_KeyIdsInitData::*; #[cfg(feature = "KeyboardEvent")] #[allow(non_snake_case)] mod gen_KeyboardEvent; #[cfg(feature = "KeyboardEvent")] +#[allow(unused_imports)] pub use gen_KeyboardEvent::*; #[cfg(feature = "KeyboardEventInit")] #[allow(non_snake_case)] mod gen_KeyboardEventInit; #[cfg(feature = "KeyboardEventInit")] +#[allow(unused_imports)] pub use gen_KeyboardEventInit::*; +#[cfg(feature = "KeyframeAnimationOptions")] +#[allow(non_snake_case)] +mod gen_KeyframeAnimationOptions; +#[cfg(feature = "KeyframeAnimationOptions")] +#[allow(unused_imports)] +pub use gen_KeyframeAnimationOptions::*; + #[cfg(feature = "KeyframeEffect")] #[allow(non_snake_case)] mod gen_KeyframeEffect; #[cfg(feature = "KeyframeEffect")] +#[allow(unused_imports)] pub use gen_KeyframeEffect::*; #[cfg(feature = "KeyframeEffectOptions")] #[allow(non_snake_case)] mod gen_KeyframeEffectOptions; #[cfg(feature = "KeyframeEffectOptions")] +#[allow(unused_imports)] pub use gen_KeyframeEffectOptions::*; #[cfg(feature = "L10nElement")] #[allow(non_snake_case)] mod gen_L10nElement; #[cfg(feature = "L10nElement")] +#[allow(unused_imports)] pub use gen_L10nElement::*; #[cfg(feature = "L10nValue")] #[allow(non_snake_case)] mod gen_L10nValue; #[cfg(feature = "L10nValue")] +#[allow(unused_imports)] pub use gen_L10nValue::*; +#[cfg(feature = "LargeBlobSupport")] +#[allow(non_snake_case)] +mod gen_LargeBlobSupport; +#[cfg(feature = "LargeBlobSupport")] +#[allow(unused_imports)] +pub use gen_LargeBlobSupport::*; + #[cfg(feature = "LatencyMode")] #[allow(non_snake_case)] mod gen_LatencyMode; #[cfg(feature = "LatencyMode")] +#[allow(unused_imports)] pub use gen_LatencyMode::*; #[cfg(feature = "LifecycleCallbacks")] #[allow(non_snake_case)] mod gen_LifecycleCallbacks; #[cfg(feature = "LifecycleCallbacks")] +#[allow(unused_imports)] pub use gen_LifecycleCallbacks::*; #[cfg(feature = "LineAlignSetting")] #[allow(non_snake_case)] mod gen_LineAlignSetting; #[cfg(feature = "LineAlignSetting")] +#[allow(unused_imports)] pub use gen_LineAlignSetting::*; #[cfg(feature = "ListBoxObject")] #[allow(non_snake_case)] mod gen_ListBoxObject; #[cfg(feature = "ListBoxObject")] +#[allow(unused_imports)] pub use gen_ListBoxObject::*; #[cfg(feature = "LocalMediaStream")] #[allow(non_snake_case)] mod gen_LocalMediaStream; #[cfg(feature = "LocalMediaStream")] +#[allow(unused_imports)] pub use gen_LocalMediaStream::*; #[cfg(feature = "LocaleInfo")] #[allow(non_snake_case)] mod gen_LocaleInfo; #[cfg(feature = "LocaleInfo")] +#[allow(unused_imports)] pub use gen_LocaleInfo::*; #[cfg(feature = "Location")] #[allow(non_snake_case)] mod gen_Location; #[cfg(feature = "Location")] +#[allow(unused_imports)] pub use gen_Location::*; +#[cfg(feature = "Lock")] +#[allow(non_snake_case)] +mod gen_Lock; +#[cfg(feature = "Lock")] +#[allow(unused_imports)] +pub use gen_Lock::*; + +#[cfg(feature = "LockInfo")] +#[allow(non_snake_case)] +mod gen_LockInfo; +#[cfg(feature = "LockInfo")] +#[allow(unused_imports)] +pub use gen_LockInfo::*; + +#[cfg(feature = "LockManager")] +#[allow(non_snake_case)] +mod gen_LockManager; +#[cfg(feature = "LockManager")] +#[allow(unused_imports)] +pub use gen_LockManager::*; + +#[cfg(feature = "LockManagerSnapshot")] +#[allow(non_snake_case)] +mod gen_LockManagerSnapshot; +#[cfg(feature = "LockManagerSnapshot")] +#[allow(unused_imports)] +pub use gen_LockManagerSnapshot::*; + +#[cfg(feature = "LockMode")] +#[allow(non_snake_case)] +mod gen_LockMode; +#[cfg(feature = "LockMode")] +#[allow(unused_imports)] +pub use gen_LockMode::*; + +#[cfg(feature = "LockOptions")] +#[allow(non_snake_case)] +mod gen_LockOptions; +#[cfg(feature = "LockOptions")] +#[allow(unused_imports)] +pub use gen_LockOptions::*; + +#[cfg(feature = "MathMlElement")] +#[allow(non_snake_case)] +mod gen_MathMlElement; +#[cfg(feature = "MathMlElement")] +#[allow(unused_imports)] +pub use gen_MathMlElement::*; + #[cfg(feature = "MediaCapabilities")] #[allow(non_snake_case)] mod gen_MediaCapabilities; #[cfg(feature = "MediaCapabilities")] +#[allow(unused_imports)] pub use gen_MediaCapabilities::*; #[cfg(feature = "MediaCapabilitiesInfo")] #[allow(non_snake_case)] mod gen_MediaCapabilitiesInfo; #[cfg(feature = "MediaCapabilitiesInfo")] +#[allow(unused_imports)] pub use gen_MediaCapabilitiesInfo::*; #[cfg(feature = "MediaConfiguration")] #[allow(non_snake_case)] mod gen_MediaConfiguration; #[cfg(feature = "MediaConfiguration")] +#[allow(unused_imports)] pub use gen_MediaConfiguration::*; #[cfg(feature = "MediaDecodingConfiguration")] #[allow(non_snake_case)] mod gen_MediaDecodingConfiguration; #[cfg(feature = "MediaDecodingConfiguration")] +#[allow(unused_imports)] pub use gen_MediaDecodingConfiguration::*; #[cfg(feature = "MediaDecodingType")] #[allow(non_snake_case)] mod gen_MediaDecodingType; #[cfg(feature = "MediaDecodingType")] +#[allow(unused_imports)] pub use gen_MediaDecodingType::*; #[cfg(feature = "MediaDeviceInfo")] #[allow(non_snake_case)] mod gen_MediaDeviceInfo; #[cfg(feature = "MediaDeviceInfo")] +#[allow(unused_imports)] pub use gen_MediaDeviceInfo::*; #[cfg(feature = "MediaDeviceKind")] #[allow(non_snake_case)] mod gen_MediaDeviceKind; #[cfg(feature = "MediaDeviceKind")] +#[allow(unused_imports)] pub use gen_MediaDeviceKind::*; #[cfg(feature = "MediaDevices")] #[allow(non_snake_case)] mod gen_MediaDevices; #[cfg(feature = "MediaDevices")] +#[allow(unused_imports)] pub use gen_MediaDevices::*; #[cfg(feature = "MediaElementAudioSourceNode")] #[allow(non_snake_case)] mod gen_MediaElementAudioSourceNode; #[cfg(feature = "MediaElementAudioSourceNode")] +#[allow(unused_imports)] pub use gen_MediaElementAudioSourceNode::*; #[cfg(feature = "MediaElementAudioSourceOptions")] #[allow(non_snake_case)] mod gen_MediaElementAudioSourceOptions; #[cfg(feature = "MediaElementAudioSourceOptions")] +#[allow(unused_imports)] pub use gen_MediaElementAudioSourceOptions::*; #[cfg(feature = "MediaEncodingConfiguration")] #[allow(non_snake_case)] mod gen_MediaEncodingConfiguration; #[cfg(feature = "MediaEncodingConfiguration")] +#[allow(unused_imports)] pub use gen_MediaEncodingConfiguration::*; #[cfg(feature = "MediaEncodingType")] #[allow(non_snake_case)] mod gen_MediaEncodingType; #[cfg(feature = "MediaEncodingType")] +#[allow(unused_imports)] pub use gen_MediaEncodingType::*; #[cfg(feature = "MediaEncryptedEvent")] #[allow(non_snake_case)] mod gen_MediaEncryptedEvent; #[cfg(feature = "MediaEncryptedEvent")] +#[allow(unused_imports)] pub use gen_MediaEncryptedEvent::*; #[cfg(feature = "MediaError")] #[allow(non_snake_case)] mod gen_MediaError; #[cfg(feature = "MediaError")] +#[allow(unused_imports)] pub use gen_MediaError::*; +#[cfg(feature = "MediaImage")] +#[allow(non_snake_case)] +mod gen_MediaImage; +#[cfg(feature = "MediaImage")] +#[allow(unused_imports)] +pub use gen_MediaImage::*; + #[cfg(feature = "MediaKeyError")] #[allow(non_snake_case)] mod gen_MediaKeyError; #[cfg(feature = "MediaKeyError")] +#[allow(unused_imports)] pub use gen_MediaKeyError::*; #[cfg(feature = "MediaKeyMessageEvent")] #[allow(non_snake_case)] mod gen_MediaKeyMessageEvent; #[cfg(feature = "MediaKeyMessageEvent")] +#[allow(unused_imports)] pub use gen_MediaKeyMessageEvent::*; #[cfg(feature = "MediaKeyMessageEventInit")] #[allow(non_snake_case)] mod gen_MediaKeyMessageEventInit; #[cfg(feature = "MediaKeyMessageEventInit")] +#[allow(unused_imports)] pub use gen_MediaKeyMessageEventInit::*; #[cfg(feature = "MediaKeyMessageType")] #[allow(non_snake_case)] mod gen_MediaKeyMessageType; #[cfg(feature = "MediaKeyMessageType")] +#[allow(unused_imports)] pub use gen_MediaKeyMessageType::*; #[cfg(feature = "MediaKeyNeededEventInit")] #[allow(non_snake_case)] mod gen_MediaKeyNeededEventInit; #[cfg(feature = "MediaKeyNeededEventInit")] +#[allow(unused_imports)] pub use gen_MediaKeyNeededEventInit::*; #[cfg(feature = "MediaKeySession")] #[allow(non_snake_case)] mod gen_MediaKeySession; #[cfg(feature = "MediaKeySession")] +#[allow(unused_imports)] pub use gen_MediaKeySession::*; #[cfg(feature = "MediaKeySessionType")] #[allow(non_snake_case)] mod gen_MediaKeySessionType; #[cfg(feature = "MediaKeySessionType")] +#[allow(unused_imports)] pub use gen_MediaKeySessionType::*; #[cfg(feature = "MediaKeyStatus")] #[allow(non_snake_case)] mod gen_MediaKeyStatus; #[cfg(feature = "MediaKeyStatus")] +#[allow(unused_imports)] pub use gen_MediaKeyStatus::*; #[cfg(feature = "MediaKeyStatusMap")] #[allow(non_snake_case)] mod gen_MediaKeyStatusMap; #[cfg(feature = "MediaKeyStatusMap")] +#[allow(unused_imports)] pub use gen_MediaKeyStatusMap::*; #[cfg(feature = "MediaKeySystemAccess")] #[allow(non_snake_case)] mod gen_MediaKeySystemAccess; #[cfg(feature = "MediaKeySystemAccess")] +#[allow(unused_imports)] pub use gen_MediaKeySystemAccess::*; #[cfg(feature = "MediaKeySystemConfiguration")] #[allow(non_snake_case)] mod gen_MediaKeySystemConfiguration; #[cfg(feature = "MediaKeySystemConfiguration")] +#[allow(unused_imports)] pub use gen_MediaKeySystemConfiguration::*; #[cfg(feature = "MediaKeySystemMediaCapability")] #[allow(non_snake_case)] mod gen_MediaKeySystemMediaCapability; #[cfg(feature = "MediaKeySystemMediaCapability")] +#[allow(unused_imports)] pub use gen_MediaKeySystemMediaCapability::*; #[cfg(feature = "MediaKeySystemStatus")] #[allow(non_snake_case)] mod gen_MediaKeySystemStatus; #[cfg(feature = "MediaKeySystemStatus")] +#[allow(unused_imports)] pub use gen_MediaKeySystemStatus::*; #[cfg(feature = "MediaKeys")] #[allow(non_snake_case)] mod gen_MediaKeys; #[cfg(feature = "MediaKeys")] +#[allow(unused_imports)] pub use gen_MediaKeys::*; #[cfg(feature = "MediaKeysPolicy")] #[allow(non_snake_case)] mod gen_MediaKeysPolicy; #[cfg(feature = "MediaKeysPolicy")] +#[allow(unused_imports)] pub use gen_MediaKeysPolicy::*; #[cfg(feature = "MediaKeysRequirement")] #[allow(non_snake_case)] mod gen_MediaKeysRequirement; #[cfg(feature = "MediaKeysRequirement")] +#[allow(unused_imports)] pub use gen_MediaKeysRequirement::*; #[cfg(feature = "MediaList")] #[allow(non_snake_case)] mod gen_MediaList; #[cfg(feature = "MediaList")] +#[allow(unused_imports)] pub use gen_MediaList::*; +#[cfg(feature = "MediaMetadata")] +#[allow(non_snake_case)] +mod gen_MediaMetadata; +#[cfg(feature = "MediaMetadata")] +#[allow(unused_imports)] +pub use gen_MediaMetadata::*; + +#[cfg(feature = "MediaMetadataInit")] +#[allow(non_snake_case)] +mod gen_MediaMetadataInit; +#[cfg(feature = "MediaMetadataInit")] +#[allow(unused_imports)] +pub use gen_MediaMetadataInit::*; + +#[cfg(feature = "MediaPositionState")] +#[allow(non_snake_case)] +mod gen_MediaPositionState; +#[cfg(feature = "MediaPositionState")] +#[allow(unused_imports)] +pub use gen_MediaPositionState::*; + #[cfg(feature = "MediaQueryList")] #[allow(non_snake_case)] mod gen_MediaQueryList; #[cfg(feature = "MediaQueryList")] +#[allow(unused_imports)] pub use gen_MediaQueryList::*; #[cfg(feature = "MediaQueryListEvent")] #[allow(non_snake_case)] mod gen_MediaQueryListEvent; #[cfg(feature = "MediaQueryListEvent")] +#[allow(unused_imports)] pub use gen_MediaQueryListEvent::*; #[cfg(feature = "MediaQueryListEventInit")] #[allow(non_snake_case)] mod gen_MediaQueryListEventInit; #[cfg(feature = "MediaQueryListEventInit")] +#[allow(unused_imports)] pub use gen_MediaQueryListEventInit::*; #[cfg(feature = "MediaRecorder")] #[allow(non_snake_case)] mod gen_MediaRecorder; #[cfg(feature = "MediaRecorder")] +#[allow(unused_imports)] pub use gen_MediaRecorder::*; #[cfg(feature = "MediaRecorderErrorEvent")] #[allow(non_snake_case)] mod gen_MediaRecorderErrorEvent; #[cfg(feature = "MediaRecorderErrorEvent")] +#[allow(unused_imports)] pub use gen_MediaRecorderErrorEvent::*; #[cfg(feature = "MediaRecorderErrorEventInit")] #[allow(non_snake_case)] mod gen_MediaRecorderErrorEventInit; #[cfg(feature = "MediaRecorderErrorEventInit")] +#[allow(unused_imports)] pub use gen_MediaRecorderErrorEventInit::*; #[cfg(feature = "MediaRecorderOptions")] #[allow(non_snake_case)] mod gen_MediaRecorderOptions; #[cfg(feature = "MediaRecorderOptions")] +#[allow(unused_imports)] pub use gen_MediaRecorderOptions::*; +#[cfg(feature = "MediaSession")] +#[allow(non_snake_case)] +mod gen_MediaSession; +#[cfg(feature = "MediaSession")] +#[allow(unused_imports)] +pub use gen_MediaSession::*; + +#[cfg(feature = "MediaSessionAction")] +#[allow(non_snake_case)] +mod gen_MediaSessionAction; +#[cfg(feature = "MediaSessionAction")] +#[allow(unused_imports)] +pub use gen_MediaSessionAction::*; + +#[cfg(feature = "MediaSessionActionDetails")] +#[allow(non_snake_case)] +mod gen_MediaSessionActionDetails; +#[cfg(feature = "MediaSessionActionDetails")] +#[allow(unused_imports)] +pub use gen_MediaSessionActionDetails::*; + +#[cfg(feature = "MediaSessionPlaybackState")] +#[allow(non_snake_case)] +mod gen_MediaSessionPlaybackState; +#[cfg(feature = "MediaSessionPlaybackState")] +#[allow(unused_imports)] +pub use gen_MediaSessionPlaybackState::*; + #[cfg(feature = "MediaSource")] #[allow(non_snake_case)] mod gen_MediaSource; #[cfg(feature = "MediaSource")] +#[allow(unused_imports)] pub use gen_MediaSource::*; #[cfg(feature = "MediaSourceEndOfStreamError")] #[allow(non_snake_case)] mod gen_MediaSourceEndOfStreamError; #[cfg(feature = "MediaSourceEndOfStreamError")] +#[allow(unused_imports)] pub use gen_MediaSourceEndOfStreamError::*; #[cfg(feature = "MediaSourceEnum")] #[allow(non_snake_case)] mod gen_MediaSourceEnum; #[cfg(feature = "MediaSourceEnum")] +#[allow(unused_imports)] pub use gen_MediaSourceEnum::*; #[cfg(feature = "MediaSourceReadyState")] #[allow(non_snake_case)] mod gen_MediaSourceReadyState; #[cfg(feature = "MediaSourceReadyState")] +#[allow(unused_imports)] pub use gen_MediaSourceReadyState::*; #[cfg(feature = "MediaStream")] #[allow(non_snake_case)] mod gen_MediaStream; #[cfg(feature = "MediaStream")] +#[allow(unused_imports)] pub use gen_MediaStream::*; #[cfg(feature = "MediaStreamAudioDestinationNode")] #[allow(non_snake_case)] mod gen_MediaStreamAudioDestinationNode; #[cfg(feature = "MediaStreamAudioDestinationNode")] +#[allow(unused_imports)] pub use gen_MediaStreamAudioDestinationNode::*; #[cfg(feature = "MediaStreamAudioSourceNode")] #[allow(non_snake_case)] mod gen_MediaStreamAudioSourceNode; #[cfg(feature = "MediaStreamAudioSourceNode")] +#[allow(unused_imports)] pub use gen_MediaStreamAudioSourceNode::*; #[cfg(feature = "MediaStreamAudioSourceOptions")] #[allow(non_snake_case)] mod gen_MediaStreamAudioSourceOptions; #[cfg(feature = "MediaStreamAudioSourceOptions")] +#[allow(unused_imports)] pub use gen_MediaStreamAudioSourceOptions::*; #[cfg(feature = "MediaStreamConstraints")] #[allow(non_snake_case)] mod gen_MediaStreamConstraints; #[cfg(feature = "MediaStreamConstraints")] +#[allow(unused_imports)] pub use gen_MediaStreamConstraints::*; #[cfg(feature = "MediaStreamError")] #[allow(non_snake_case)] mod gen_MediaStreamError; #[cfg(feature = "MediaStreamError")] +#[allow(unused_imports)] pub use gen_MediaStreamError::*; #[cfg(feature = "MediaStreamEvent")] #[allow(non_snake_case)] mod gen_MediaStreamEvent; #[cfg(feature = "MediaStreamEvent")] +#[allow(unused_imports)] pub use gen_MediaStreamEvent::*; #[cfg(feature = "MediaStreamEventInit")] #[allow(non_snake_case)] mod gen_MediaStreamEventInit; #[cfg(feature = "MediaStreamEventInit")] +#[allow(unused_imports)] pub use gen_MediaStreamEventInit::*; #[cfg(feature = "MediaStreamTrack")] #[allow(non_snake_case)] mod gen_MediaStreamTrack; #[cfg(feature = "MediaStreamTrack")] +#[allow(unused_imports)] pub use gen_MediaStreamTrack::*; #[cfg(feature = "MediaStreamTrackEvent")] #[allow(non_snake_case)] mod gen_MediaStreamTrackEvent; #[cfg(feature = "MediaStreamTrackEvent")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackEvent::*; #[cfg(feature = "MediaStreamTrackEventInit")] #[allow(non_snake_case)] mod gen_MediaStreamTrackEventInit; #[cfg(feature = "MediaStreamTrackEventInit")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackEventInit::*; +#[cfg(feature = "MediaStreamTrackGenerator")] +#[allow(non_snake_case)] +mod gen_MediaStreamTrackGenerator; +#[cfg(feature = "MediaStreamTrackGenerator")] +#[allow(unused_imports)] +pub use gen_MediaStreamTrackGenerator::*; + +#[cfg(feature = "MediaStreamTrackGeneratorInit")] +#[allow(non_snake_case)] +mod gen_MediaStreamTrackGeneratorInit; +#[cfg(feature = "MediaStreamTrackGeneratorInit")] +#[allow(unused_imports)] +pub use gen_MediaStreamTrackGeneratorInit::*; + +#[cfg(feature = "MediaStreamTrackProcessor")] +#[allow(non_snake_case)] +mod gen_MediaStreamTrackProcessor; +#[cfg(feature = "MediaStreamTrackProcessor")] +#[allow(unused_imports)] +pub use gen_MediaStreamTrackProcessor::*; + +#[cfg(feature = "MediaStreamTrackProcessorInit")] +#[allow(non_snake_case)] +mod gen_MediaStreamTrackProcessorInit; +#[cfg(feature = "MediaStreamTrackProcessorInit")] +#[allow(unused_imports)] +pub use gen_MediaStreamTrackProcessorInit::*; + #[cfg(feature = "MediaStreamTrackState")] #[allow(non_snake_case)] mod gen_MediaStreamTrackState; #[cfg(feature = "MediaStreamTrackState")] +#[allow(unused_imports)] pub use gen_MediaStreamTrackState::*; +#[cfg(feature = "MediaTrackCapabilities")] +#[allow(non_snake_case)] +mod gen_MediaTrackCapabilities; +#[cfg(feature = "MediaTrackCapabilities")] +#[allow(unused_imports)] +pub use gen_MediaTrackCapabilities::*; + #[cfg(feature = "MediaTrackConstraintSet")] #[allow(non_snake_case)] mod gen_MediaTrackConstraintSet; #[cfg(feature = "MediaTrackConstraintSet")] +#[allow(unused_imports)] pub use gen_MediaTrackConstraintSet::*; #[cfg(feature = "MediaTrackConstraints")] #[allow(non_snake_case)] mod gen_MediaTrackConstraints; #[cfg(feature = "MediaTrackConstraints")] +#[allow(unused_imports)] pub use gen_MediaTrackConstraints::*; #[cfg(feature = "MediaTrackSettings")] #[allow(non_snake_case)] mod gen_MediaTrackSettings; #[cfg(feature = "MediaTrackSettings")] +#[allow(unused_imports)] pub use gen_MediaTrackSettings::*; #[cfg(feature = "MediaTrackSupportedConstraints")] #[allow(non_snake_case)] mod gen_MediaTrackSupportedConstraints; #[cfg(feature = "MediaTrackSupportedConstraints")] +#[allow(unused_imports)] pub use gen_MediaTrackSupportedConstraints::*; +#[cfg(feature = "MemoryAttribution")] +#[allow(non_snake_case)] +mod gen_MemoryAttribution; +#[cfg(feature = "MemoryAttribution")] +#[allow(unused_imports)] +pub use gen_MemoryAttribution::*; + +#[cfg(feature = "MemoryAttributionContainer")] +#[allow(non_snake_case)] +mod gen_MemoryAttributionContainer; +#[cfg(feature = "MemoryAttributionContainer")] +#[allow(unused_imports)] +pub use gen_MemoryAttributionContainer::*; + +#[cfg(feature = "MemoryBreakdownEntry")] +#[allow(non_snake_case)] +mod gen_MemoryBreakdownEntry; +#[cfg(feature = "MemoryBreakdownEntry")] +#[allow(unused_imports)] +pub use gen_MemoryBreakdownEntry::*; + +#[cfg(feature = "MemoryMeasurement")] +#[allow(non_snake_case)] +mod gen_MemoryMeasurement; +#[cfg(feature = "MemoryMeasurement")] +#[allow(unused_imports)] +pub use gen_MemoryMeasurement::*; + #[cfg(feature = "MessageChannel")] #[allow(non_snake_case)] mod gen_MessageChannel; #[cfg(feature = "MessageChannel")] +#[allow(unused_imports)] pub use gen_MessageChannel::*; #[cfg(feature = "MessageEvent")] #[allow(non_snake_case)] mod gen_MessageEvent; #[cfg(feature = "MessageEvent")] +#[allow(unused_imports)] pub use gen_MessageEvent::*; #[cfg(feature = "MessageEventInit")] #[allow(non_snake_case)] mod gen_MessageEventInit; #[cfg(feature = "MessageEventInit")] +#[allow(unused_imports)] pub use gen_MessageEventInit::*; #[cfg(feature = "MessagePort")] #[allow(non_snake_case)] mod gen_MessagePort; #[cfg(feature = "MessagePort")] +#[allow(unused_imports)] pub use gen_MessagePort::*; #[cfg(feature = "MidiAccess")] #[allow(non_snake_case)] mod gen_MidiAccess; #[cfg(feature = "MidiAccess")] +#[allow(unused_imports)] pub use gen_MidiAccess::*; #[cfg(feature = "MidiConnectionEvent")] #[allow(non_snake_case)] mod gen_MidiConnectionEvent; #[cfg(feature = "MidiConnectionEvent")] +#[allow(unused_imports)] pub use gen_MidiConnectionEvent::*; #[cfg(feature = "MidiConnectionEventInit")] #[allow(non_snake_case)] mod gen_MidiConnectionEventInit; #[cfg(feature = "MidiConnectionEventInit")] +#[allow(unused_imports)] pub use gen_MidiConnectionEventInit::*; #[cfg(feature = "MidiInput")] #[allow(non_snake_case)] mod gen_MidiInput; #[cfg(feature = "MidiInput")] +#[allow(unused_imports)] pub use gen_MidiInput::*; #[cfg(feature = "MidiInputMap")] #[allow(non_snake_case)] mod gen_MidiInputMap; #[cfg(feature = "MidiInputMap")] +#[allow(unused_imports)] pub use gen_MidiInputMap::*; #[cfg(feature = "MidiMessageEvent")] #[allow(non_snake_case)] mod gen_MidiMessageEvent; #[cfg(feature = "MidiMessageEvent")] +#[allow(unused_imports)] pub use gen_MidiMessageEvent::*; #[cfg(feature = "MidiMessageEventInit")] #[allow(non_snake_case)] mod gen_MidiMessageEventInit; #[cfg(feature = "MidiMessageEventInit")] +#[allow(unused_imports)] pub use gen_MidiMessageEventInit::*; #[cfg(feature = "MidiOptions")] #[allow(non_snake_case)] mod gen_MidiOptions; #[cfg(feature = "MidiOptions")] +#[allow(unused_imports)] pub use gen_MidiOptions::*; #[cfg(feature = "MidiOutput")] #[allow(non_snake_case)] mod gen_MidiOutput; #[cfg(feature = "MidiOutput")] +#[allow(unused_imports)] pub use gen_MidiOutput::*; #[cfg(feature = "MidiOutputMap")] #[allow(non_snake_case)] mod gen_MidiOutputMap; #[cfg(feature = "MidiOutputMap")] +#[allow(unused_imports)] pub use gen_MidiOutputMap::*; #[cfg(feature = "MidiPort")] #[allow(non_snake_case)] mod gen_MidiPort; #[cfg(feature = "MidiPort")] +#[allow(unused_imports)] pub use gen_MidiPort::*; #[cfg(feature = "MidiPortConnectionState")] #[allow(non_snake_case)] mod gen_MidiPortConnectionState; #[cfg(feature = "MidiPortConnectionState")] +#[allow(unused_imports)] pub use gen_MidiPortConnectionState::*; #[cfg(feature = "MidiPortDeviceState")] #[allow(non_snake_case)] mod gen_MidiPortDeviceState; #[cfg(feature = "MidiPortDeviceState")] +#[allow(unused_imports)] pub use gen_MidiPortDeviceState::*; #[cfg(feature = "MidiPortType")] #[allow(non_snake_case)] mod gen_MidiPortType; #[cfg(feature = "MidiPortType")] +#[allow(unused_imports)] pub use gen_MidiPortType::*; #[cfg(feature = "MimeType")] #[allow(non_snake_case)] mod gen_MimeType; #[cfg(feature = "MimeType")] +#[allow(unused_imports)] pub use gen_MimeType::*; #[cfg(feature = "MimeTypeArray")] #[allow(non_snake_case)] mod gen_MimeTypeArray; #[cfg(feature = "MimeTypeArray")] +#[allow(unused_imports)] pub use gen_MimeTypeArray::*; #[cfg(feature = "MouseEvent")] #[allow(non_snake_case)] mod gen_MouseEvent; #[cfg(feature = "MouseEvent")] +#[allow(unused_imports)] pub use gen_MouseEvent::*; #[cfg(feature = "MouseEventInit")] #[allow(non_snake_case)] mod gen_MouseEventInit; #[cfg(feature = "MouseEventInit")] +#[allow(unused_imports)] pub use gen_MouseEventInit::*; #[cfg(feature = "MouseScrollEvent")] #[allow(non_snake_case)] mod gen_MouseScrollEvent; #[cfg(feature = "MouseScrollEvent")] +#[allow(unused_imports)] pub use gen_MouseScrollEvent::*; #[cfg(feature = "MozDebug")] #[allow(non_snake_case)] mod gen_MozDebug; #[cfg(feature = "MozDebug")] +#[allow(unused_imports)] pub use gen_MozDebug::*; #[cfg(feature = "MutationEvent")] #[allow(non_snake_case)] mod gen_MutationEvent; #[cfg(feature = "MutationEvent")] +#[allow(unused_imports)] pub use gen_MutationEvent::*; #[cfg(feature = "MutationObserver")] #[allow(non_snake_case)] mod gen_MutationObserver; #[cfg(feature = "MutationObserver")] +#[allow(unused_imports)] pub use gen_MutationObserver::*; #[cfg(feature = "MutationObserverInit")] #[allow(non_snake_case)] mod gen_MutationObserverInit; #[cfg(feature = "MutationObserverInit")] +#[allow(unused_imports)] pub use gen_MutationObserverInit::*; #[cfg(feature = "MutationObservingInfo")] #[allow(non_snake_case)] mod gen_MutationObservingInfo; #[cfg(feature = "MutationObservingInfo")] +#[allow(unused_imports)] pub use gen_MutationObservingInfo::*; #[cfg(feature = "MutationRecord")] #[allow(non_snake_case)] mod gen_MutationRecord; #[cfg(feature = "MutationRecord")] +#[allow(unused_imports)] pub use gen_MutationRecord::*; #[cfg(feature = "NamedNodeMap")] #[allow(non_snake_case)] mod gen_NamedNodeMap; #[cfg(feature = "NamedNodeMap")] +#[allow(unused_imports)] pub use gen_NamedNodeMap::*; #[cfg(feature = "NativeOsFileReadOptions")] #[allow(non_snake_case)] mod gen_NativeOsFileReadOptions; #[cfg(feature = "NativeOsFileReadOptions")] +#[allow(unused_imports)] pub use gen_NativeOsFileReadOptions::*; #[cfg(feature = "NativeOsFileWriteAtomicOptions")] #[allow(non_snake_case)] mod gen_NativeOsFileWriteAtomicOptions; #[cfg(feature = "NativeOsFileWriteAtomicOptions")] +#[allow(unused_imports)] pub use gen_NativeOsFileWriteAtomicOptions::*; #[cfg(feature = "NavigationType")] #[allow(non_snake_case)] mod gen_NavigationType; #[cfg(feature = "NavigationType")] +#[allow(unused_imports)] pub use gen_NavigationType::*; #[cfg(feature = "Navigator")] #[allow(non_snake_case)] mod gen_Navigator; #[cfg(feature = "Navigator")] +#[allow(unused_imports)] pub use gen_Navigator::*; #[cfg(feature = "NavigatorAutomationInformation")] #[allow(non_snake_case)] mod gen_NavigatorAutomationInformation; #[cfg(feature = "NavigatorAutomationInformation")] +#[allow(unused_imports)] pub use gen_NavigatorAutomationInformation::*; +#[cfg(feature = "NavigatorUaBrandVersion")] +#[allow(non_snake_case)] +mod gen_NavigatorUaBrandVersion; +#[cfg(feature = "NavigatorUaBrandVersion")] +#[allow(unused_imports)] +pub use gen_NavigatorUaBrandVersion::*; + +#[cfg(feature = "NavigatorUaData")] +#[allow(non_snake_case)] +mod gen_NavigatorUaData; +#[cfg(feature = "NavigatorUaData")] +#[allow(unused_imports)] +pub use gen_NavigatorUaData::*; + #[cfg(feature = "NetworkCommandOptions")] #[allow(non_snake_case)] mod gen_NetworkCommandOptions; #[cfg(feature = "NetworkCommandOptions")] +#[allow(unused_imports)] pub use gen_NetworkCommandOptions::*; #[cfg(feature = "NetworkInformation")] #[allow(non_snake_case)] mod gen_NetworkInformation; #[cfg(feature = "NetworkInformation")] +#[allow(unused_imports)] pub use gen_NetworkInformation::*; #[cfg(feature = "NetworkResultOptions")] #[allow(non_snake_case)] mod gen_NetworkResultOptions; #[cfg(feature = "NetworkResultOptions")] +#[allow(unused_imports)] pub use gen_NetworkResultOptions::*; #[cfg(feature = "Node")] #[allow(non_snake_case)] mod gen_Node; #[cfg(feature = "Node")] +#[allow(unused_imports)] pub use gen_Node::*; #[cfg(feature = "NodeFilter")] #[allow(non_snake_case)] mod gen_NodeFilter; #[cfg(feature = "NodeFilter")] +#[allow(unused_imports)] pub use gen_NodeFilter::*; #[cfg(feature = "NodeIterator")] #[allow(non_snake_case)] mod gen_NodeIterator; #[cfg(feature = "NodeIterator")] +#[allow(unused_imports)] pub use gen_NodeIterator::*; #[cfg(feature = "NodeList")] #[allow(non_snake_case)] mod gen_NodeList; #[cfg(feature = "NodeList")] +#[allow(unused_imports)] pub use gen_NodeList::*; #[cfg(feature = "Notification")] #[allow(non_snake_case)] mod gen_Notification; #[cfg(feature = "Notification")] +#[allow(unused_imports)] pub use gen_Notification::*; -#[cfg(feature = "NotificationBehavior")] +#[cfg(feature = "NotificationAction")] #[allow(non_snake_case)] -mod gen_NotificationBehavior; -#[cfg(feature = "NotificationBehavior")] -pub use gen_NotificationBehavior::*; +mod gen_NotificationAction; +#[cfg(feature = "NotificationAction")] +#[allow(unused_imports)] +pub use gen_NotificationAction::*; #[cfg(feature = "NotificationDirection")] #[allow(non_snake_case)] mod gen_NotificationDirection; #[cfg(feature = "NotificationDirection")] +#[allow(unused_imports)] pub use gen_NotificationDirection::*; #[cfg(feature = "NotificationEvent")] #[allow(non_snake_case)] mod gen_NotificationEvent; #[cfg(feature = "NotificationEvent")] +#[allow(unused_imports)] pub use gen_NotificationEvent::*; #[cfg(feature = "NotificationEventInit")] #[allow(non_snake_case)] mod gen_NotificationEventInit; #[cfg(feature = "NotificationEventInit")] +#[allow(unused_imports)] pub use gen_NotificationEventInit::*; #[cfg(feature = "NotificationOptions")] #[allow(non_snake_case)] mod gen_NotificationOptions; #[cfg(feature = "NotificationOptions")] +#[allow(unused_imports)] pub use gen_NotificationOptions::*; #[cfg(feature = "NotificationPermission")] #[allow(non_snake_case)] mod gen_NotificationPermission; #[cfg(feature = "NotificationPermission")] +#[allow(unused_imports)] pub use gen_NotificationPermission::*; #[cfg(feature = "ObserverCallback")] #[allow(non_snake_case)] mod gen_ObserverCallback; #[cfg(feature = "ObserverCallback")] +#[allow(unused_imports)] pub use gen_ObserverCallback::*; #[cfg(feature = "OesElementIndexUint")] #[allow(non_snake_case)] mod gen_OesElementIndexUint; #[cfg(feature = "OesElementIndexUint")] +#[allow(unused_imports)] pub use gen_OesElementIndexUint::*; #[cfg(feature = "OesStandardDerivatives")] #[allow(non_snake_case)] mod gen_OesStandardDerivatives; #[cfg(feature = "OesStandardDerivatives")] +#[allow(unused_imports)] pub use gen_OesStandardDerivatives::*; #[cfg(feature = "OesTextureFloat")] #[allow(non_snake_case)] mod gen_OesTextureFloat; #[cfg(feature = "OesTextureFloat")] +#[allow(unused_imports)] pub use gen_OesTextureFloat::*; #[cfg(feature = "OesTextureFloatLinear")] #[allow(non_snake_case)] mod gen_OesTextureFloatLinear; #[cfg(feature = "OesTextureFloatLinear")] +#[allow(unused_imports)] pub use gen_OesTextureFloatLinear::*; #[cfg(feature = "OesTextureHalfFloat")] #[allow(non_snake_case)] mod gen_OesTextureHalfFloat; #[cfg(feature = "OesTextureHalfFloat")] +#[allow(unused_imports)] pub use gen_OesTextureHalfFloat::*; #[cfg(feature = "OesTextureHalfFloatLinear")] #[allow(non_snake_case)] mod gen_OesTextureHalfFloatLinear; #[cfg(feature = "OesTextureHalfFloatLinear")] +#[allow(unused_imports)] pub use gen_OesTextureHalfFloatLinear::*; #[cfg(feature = "OesVertexArrayObject")] #[allow(non_snake_case)] mod gen_OesVertexArrayObject; #[cfg(feature = "OesVertexArrayObject")] +#[allow(unused_imports)] pub use gen_OesVertexArrayObject::*; #[cfg(feature = "OfflineAudioCompletionEvent")] #[allow(non_snake_case)] mod gen_OfflineAudioCompletionEvent; #[cfg(feature = "OfflineAudioCompletionEvent")] +#[allow(unused_imports)] pub use gen_OfflineAudioCompletionEvent::*; #[cfg(feature = "OfflineAudioCompletionEventInit")] #[allow(non_snake_case)] mod gen_OfflineAudioCompletionEventInit; #[cfg(feature = "OfflineAudioCompletionEventInit")] +#[allow(unused_imports)] pub use gen_OfflineAudioCompletionEventInit::*; #[cfg(feature = "OfflineAudioContext")] #[allow(non_snake_case)] mod gen_OfflineAudioContext; #[cfg(feature = "OfflineAudioContext")] +#[allow(unused_imports)] pub use gen_OfflineAudioContext::*; #[cfg(feature = "OfflineAudioContextOptions")] #[allow(non_snake_case)] mod gen_OfflineAudioContextOptions; #[cfg(feature = "OfflineAudioContextOptions")] +#[allow(unused_imports)] pub use gen_OfflineAudioContextOptions::*; #[cfg(feature = "OfflineResourceList")] #[allow(non_snake_case)] mod gen_OfflineResourceList; #[cfg(feature = "OfflineResourceList")] +#[allow(unused_imports)] pub use gen_OfflineResourceList::*; #[cfg(feature = "OffscreenCanvas")] #[allow(non_snake_case)] mod gen_OffscreenCanvas; #[cfg(feature = "OffscreenCanvas")] +#[allow(unused_imports)] pub use gen_OffscreenCanvas::*; +#[cfg(feature = "OffscreenCanvasRenderingContext2d")] +#[allow(non_snake_case)] +mod gen_OffscreenCanvasRenderingContext2d; +#[cfg(feature = "OffscreenCanvasRenderingContext2d")] +#[allow(unused_imports)] +pub use gen_OffscreenCanvasRenderingContext2d::*; + +#[cfg(feature = "OpenFilePickerOptions")] +#[allow(non_snake_case)] +mod gen_OpenFilePickerOptions; +#[cfg(feature = "OpenFilePickerOptions")] +#[allow(unused_imports)] +pub use gen_OpenFilePickerOptions::*; + #[cfg(feature = "OpenWindowEventDetail")] #[allow(non_snake_case)] mod gen_OpenWindowEventDetail; #[cfg(feature = "OpenWindowEventDetail")] +#[allow(unused_imports)] pub use gen_OpenWindowEventDetail::*; #[cfg(feature = "OptionalEffectTiming")] #[allow(non_snake_case)] mod gen_OptionalEffectTiming; #[cfg(feature = "OptionalEffectTiming")] +#[allow(unused_imports)] pub use gen_OptionalEffectTiming::*; #[cfg(feature = "OrientationLockType")] #[allow(non_snake_case)] mod gen_OrientationLockType; #[cfg(feature = "OrientationLockType")] +#[allow(unused_imports)] pub use gen_OrientationLockType::*; #[cfg(feature = "OrientationType")] #[allow(non_snake_case)] mod gen_OrientationType; #[cfg(feature = "OrientationType")] +#[allow(unused_imports)] pub use gen_OrientationType::*; #[cfg(feature = "OscillatorNode")] #[allow(non_snake_case)] mod gen_OscillatorNode; #[cfg(feature = "OscillatorNode")] +#[allow(unused_imports)] pub use gen_OscillatorNode::*; #[cfg(feature = "OscillatorOptions")] #[allow(non_snake_case)] mod gen_OscillatorOptions; #[cfg(feature = "OscillatorOptions")] +#[allow(unused_imports)] pub use gen_OscillatorOptions::*; #[cfg(feature = "OscillatorType")] #[allow(non_snake_case)] mod gen_OscillatorType; #[cfg(feature = "OscillatorType")] +#[allow(unused_imports)] pub use gen_OscillatorType::*; #[cfg(feature = "OverSampleType")] #[allow(non_snake_case)] mod gen_OverSampleType; #[cfg(feature = "OverSampleType")] +#[allow(unused_imports)] pub use gen_OverSampleType::*; +#[cfg(feature = "OvrMultiview2")] +#[allow(non_snake_case)] +mod gen_OvrMultiview2; +#[cfg(feature = "OvrMultiview2")] +#[allow(unused_imports)] +pub use gen_OvrMultiview2::*; + #[cfg(feature = "PageTransitionEvent")] #[allow(non_snake_case)] mod gen_PageTransitionEvent; #[cfg(feature = "PageTransitionEvent")] +#[allow(unused_imports)] pub use gen_PageTransitionEvent::*; #[cfg(feature = "PageTransitionEventInit")] #[allow(non_snake_case)] mod gen_PageTransitionEventInit; #[cfg(feature = "PageTransitionEventInit")] +#[allow(unused_imports)] pub use gen_PageTransitionEventInit::*; #[cfg(feature = "PaintRequest")] #[allow(non_snake_case)] mod gen_PaintRequest; #[cfg(feature = "PaintRequest")] +#[allow(unused_imports)] pub use gen_PaintRequest::*; #[cfg(feature = "PaintRequestList")] #[allow(non_snake_case)] mod gen_PaintRequestList; #[cfg(feature = "PaintRequestList")] +#[allow(unused_imports)] pub use gen_PaintRequestList::*; #[cfg(feature = "PaintWorkletGlobalScope")] #[allow(non_snake_case)] mod gen_PaintWorkletGlobalScope; #[cfg(feature = "PaintWorkletGlobalScope")] +#[allow(unused_imports)] pub use gen_PaintWorkletGlobalScope::*; #[cfg(feature = "PannerNode")] #[allow(non_snake_case)] mod gen_PannerNode; #[cfg(feature = "PannerNode")] +#[allow(unused_imports)] pub use gen_PannerNode::*; #[cfg(feature = "PannerOptions")] #[allow(non_snake_case)] mod gen_PannerOptions; #[cfg(feature = "PannerOptions")] +#[allow(unused_imports)] pub use gen_PannerOptions::*; #[cfg(feature = "PanningModelType")] #[allow(non_snake_case)] mod gen_PanningModelType; #[cfg(feature = "PanningModelType")] +#[allow(unused_imports)] pub use gen_PanningModelType::*; +#[cfg(feature = "ParityType")] +#[allow(non_snake_case)] +mod gen_ParityType; +#[cfg(feature = "ParityType")] +#[allow(unused_imports)] +pub use gen_ParityType::*; + #[cfg(feature = "Path2d")] #[allow(non_snake_case)] mod gen_Path2d; #[cfg(feature = "Path2d")] +#[allow(unused_imports)] pub use gen_Path2d::*; #[cfg(feature = "PaymentAddress")] #[allow(non_snake_case)] mod gen_PaymentAddress; #[cfg(feature = "PaymentAddress")] +#[allow(unused_imports)] pub use gen_PaymentAddress::*; #[cfg(feature = "PaymentComplete")] #[allow(non_snake_case)] mod gen_PaymentComplete; #[cfg(feature = "PaymentComplete")] +#[allow(unused_imports)] pub use gen_PaymentComplete::*; #[cfg(feature = "PaymentMethodChangeEvent")] #[allow(non_snake_case)] mod gen_PaymentMethodChangeEvent; #[cfg(feature = "PaymentMethodChangeEvent")] +#[allow(unused_imports)] pub use gen_PaymentMethodChangeEvent::*; #[cfg(feature = "PaymentMethodChangeEventInit")] #[allow(non_snake_case)] mod gen_PaymentMethodChangeEventInit; #[cfg(feature = "PaymentMethodChangeEventInit")] +#[allow(unused_imports)] pub use gen_PaymentMethodChangeEventInit::*; #[cfg(feature = "PaymentRequestUpdateEvent")] #[allow(non_snake_case)] mod gen_PaymentRequestUpdateEvent; #[cfg(feature = "PaymentRequestUpdateEvent")] +#[allow(unused_imports)] pub use gen_PaymentRequestUpdateEvent::*; #[cfg(feature = "PaymentRequestUpdateEventInit")] #[allow(non_snake_case)] mod gen_PaymentRequestUpdateEventInit; #[cfg(feature = "PaymentRequestUpdateEventInit")] +#[allow(unused_imports)] pub use gen_PaymentRequestUpdateEventInit::*; #[cfg(feature = "PaymentResponse")] #[allow(non_snake_case)] mod gen_PaymentResponse; #[cfg(feature = "PaymentResponse")] +#[allow(unused_imports)] pub use gen_PaymentResponse::*; #[cfg(feature = "Pbkdf2Params")] #[allow(non_snake_case)] mod gen_Pbkdf2Params; #[cfg(feature = "Pbkdf2Params")] +#[allow(unused_imports)] pub use gen_Pbkdf2Params::*; #[cfg(feature = "PcImplIceConnectionState")] #[allow(non_snake_case)] mod gen_PcImplIceConnectionState; #[cfg(feature = "PcImplIceConnectionState")] +#[allow(unused_imports)] pub use gen_PcImplIceConnectionState::*; #[cfg(feature = "PcImplIceGatheringState")] #[allow(non_snake_case)] mod gen_PcImplIceGatheringState; #[cfg(feature = "PcImplIceGatheringState")] +#[allow(unused_imports)] pub use gen_PcImplIceGatheringState::*; #[cfg(feature = "PcImplSignalingState")] #[allow(non_snake_case)] mod gen_PcImplSignalingState; #[cfg(feature = "PcImplSignalingState")] +#[allow(unused_imports)] pub use gen_PcImplSignalingState::*; #[cfg(feature = "PcObserverStateType")] #[allow(non_snake_case)] mod gen_PcObserverStateType; #[cfg(feature = "PcObserverStateType")] +#[allow(unused_imports)] pub use gen_PcObserverStateType::*; #[cfg(feature = "Performance")] #[allow(non_snake_case)] mod gen_Performance; #[cfg(feature = "Performance")] +#[allow(unused_imports)] pub use gen_Performance::*; #[cfg(feature = "PerformanceEntry")] #[allow(non_snake_case)] mod gen_PerformanceEntry; #[cfg(feature = "PerformanceEntry")] +#[allow(unused_imports)] pub use gen_PerformanceEntry::*; #[cfg(feature = "PerformanceEntryEventInit")] #[allow(non_snake_case)] mod gen_PerformanceEntryEventInit; #[cfg(feature = "PerformanceEntryEventInit")] +#[allow(unused_imports)] pub use gen_PerformanceEntryEventInit::*; #[cfg(feature = "PerformanceEntryFilterOptions")] #[allow(non_snake_case)] mod gen_PerformanceEntryFilterOptions; #[cfg(feature = "PerformanceEntryFilterOptions")] +#[allow(unused_imports)] pub use gen_PerformanceEntryFilterOptions::*; #[cfg(feature = "PerformanceMark")] #[allow(non_snake_case)] mod gen_PerformanceMark; #[cfg(feature = "PerformanceMark")] +#[allow(unused_imports)] pub use gen_PerformanceMark::*; #[cfg(feature = "PerformanceMeasure")] #[allow(non_snake_case)] mod gen_PerformanceMeasure; #[cfg(feature = "PerformanceMeasure")] +#[allow(unused_imports)] pub use gen_PerformanceMeasure::*; #[cfg(feature = "PerformanceNavigation")] #[allow(non_snake_case)] mod gen_PerformanceNavigation; #[cfg(feature = "PerformanceNavigation")] +#[allow(unused_imports)] pub use gen_PerformanceNavigation::*; #[cfg(feature = "PerformanceNavigationTiming")] #[allow(non_snake_case)] mod gen_PerformanceNavigationTiming; #[cfg(feature = "PerformanceNavigationTiming")] +#[allow(unused_imports)] pub use gen_PerformanceNavigationTiming::*; #[cfg(feature = "PerformanceObserver")] #[allow(non_snake_case)] mod gen_PerformanceObserver; #[cfg(feature = "PerformanceObserver")] +#[allow(unused_imports)] pub use gen_PerformanceObserver::*; #[cfg(feature = "PerformanceObserverEntryList")] #[allow(non_snake_case)] mod gen_PerformanceObserverEntryList; #[cfg(feature = "PerformanceObserverEntryList")] +#[allow(unused_imports)] pub use gen_PerformanceObserverEntryList::*; #[cfg(feature = "PerformanceObserverInit")] #[allow(non_snake_case)] mod gen_PerformanceObserverInit; #[cfg(feature = "PerformanceObserverInit")] +#[allow(unused_imports)] pub use gen_PerformanceObserverInit::*; #[cfg(feature = "PerformanceResourceTiming")] #[allow(non_snake_case)] mod gen_PerformanceResourceTiming; #[cfg(feature = "PerformanceResourceTiming")] +#[allow(unused_imports)] pub use gen_PerformanceResourceTiming::*; #[cfg(feature = "PerformanceServerTiming")] #[allow(non_snake_case)] mod gen_PerformanceServerTiming; #[cfg(feature = "PerformanceServerTiming")] +#[allow(unused_imports)] pub use gen_PerformanceServerTiming::*; #[cfg(feature = "PerformanceTiming")] #[allow(non_snake_case)] mod gen_PerformanceTiming; #[cfg(feature = "PerformanceTiming")] +#[allow(unused_imports)] pub use gen_PerformanceTiming::*; #[cfg(feature = "PeriodicWave")] #[allow(non_snake_case)] mod gen_PeriodicWave; #[cfg(feature = "PeriodicWave")] +#[allow(unused_imports)] pub use gen_PeriodicWave::*; #[cfg(feature = "PeriodicWaveConstraints")] #[allow(non_snake_case)] mod gen_PeriodicWaveConstraints; #[cfg(feature = "PeriodicWaveConstraints")] +#[allow(unused_imports)] pub use gen_PeriodicWaveConstraints::*; #[cfg(feature = "PeriodicWaveOptions")] #[allow(non_snake_case)] mod gen_PeriodicWaveOptions; #[cfg(feature = "PeriodicWaveOptions")] +#[allow(unused_imports)] pub use gen_PeriodicWaveOptions::*; #[cfg(feature = "PermissionDescriptor")] #[allow(non_snake_case)] mod gen_PermissionDescriptor; #[cfg(feature = "PermissionDescriptor")] +#[allow(unused_imports)] pub use gen_PermissionDescriptor::*; #[cfg(feature = "PermissionName")] #[allow(non_snake_case)] mod gen_PermissionName; #[cfg(feature = "PermissionName")] +#[allow(unused_imports)] pub use gen_PermissionName::*; #[cfg(feature = "PermissionState")] #[allow(non_snake_case)] mod gen_PermissionState; #[cfg(feature = "PermissionState")] +#[allow(unused_imports)] pub use gen_PermissionState::*; #[cfg(feature = "PermissionStatus")] #[allow(non_snake_case)] mod gen_PermissionStatus; #[cfg(feature = "PermissionStatus")] +#[allow(unused_imports)] pub use gen_PermissionStatus::*; #[cfg(feature = "Permissions")] #[allow(non_snake_case)] mod gen_Permissions; #[cfg(feature = "Permissions")] +#[allow(unused_imports)] pub use gen_Permissions::*; #[cfg(feature = "PlaneLayout")] #[allow(non_snake_case)] mod gen_PlaneLayout; #[cfg(feature = "PlaneLayout")] +#[allow(unused_imports)] pub use gen_PlaneLayout::*; #[cfg(feature = "PlaybackDirection")] #[allow(non_snake_case)] mod gen_PlaybackDirection; #[cfg(feature = "PlaybackDirection")] +#[allow(unused_imports)] pub use gen_PlaybackDirection::*; #[cfg(feature = "Plugin")] #[allow(non_snake_case)] mod gen_Plugin; #[cfg(feature = "Plugin")] +#[allow(unused_imports)] pub use gen_Plugin::*; #[cfg(feature = "PluginArray")] #[allow(non_snake_case)] mod gen_PluginArray; #[cfg(feature = "PluginArray")] +#[allow(unused_imports)] pub use gen_PluginArray::*; #[cfg(feature = "PluginCrashedEventInit")] #[allow(non_snake_case)] mod gen_PluginCrashedEventInit; #[cfg(feature = "PluginCrashedEventInit")] +#[allow(unused_imports)] pub use gen_PluginCrashedEventInit::*; #[cfg(feature = "PointerEvent")] #[allow(non_snake_case)] mod gen_PointerEvent; #[cfg(feature = "PointerEvent")] +#[allow(unused_imports)] pub use gen_PointerEvent::*; #[cfg(feature = "PointerEventInit")] #[allow(non_snake_case)] mod gen_PointerEventInit; #[cfg(feature = "PointerEventInit")] +#[allow(unused_imports)] pub use gen_PointerEventInit::*; #[cfg(feature = "PopStateEvent")] #[allow(non_snake_case)] mod gen_PopStateEvent; #[cfg(feature = "PopStateEvent")] +#[allow(unused_imports)] pub use gen_PopStateEvent::*; #[cfg(feature = "PopStateEventInit")] #[allow(non_snake_case)] mod gen_PopStateEventInit; #[cfg(feature = "PopStateEventInit")] +#[allow(unused_imports)] pub use gen_PopStateEventInit::*; #[cfg(feature = "PopupBlockedEvent")] #[allow(non_snake_case)] mod gen_PopupBlockedEvent; #[cfg(feature = "PopupBlockedEvent")] +#[allow(unused_imports)] pub use gen_PopupBlockedEvent::*; #[cfg(feature = "PopupBlockedEventInit")] #[allow(non_snake_case)] mod gen_PopupBlockedEventInit; #[cfg(feature = "PopupBlockedEventInit")] +#[allow(unused_imports)] pub use gen_PopupBlockedEventInit::*; #[cfg(feature = "Position")] #[allow(non_snake_case)] mod gen_Position; #[cfg(feature = "Position")] +#[allow(unused_imports)] pub use gen_Position::*; #[cfg(feature = "PositionAlignSetting")] #[allow(non_snake_case)] mod gen_PositionAlignSetting; #[cfg(feature = "PositionAlignSetting")] +#[allow(unused_imports)] pub use gen_PositionAlignSetting::*; #[cfg(feature = "PositionError")] #[allow(non_snake_case)] mod gen_PositionError; #[cfg(feature = "PositionError")] +#[allow(unused_imports)] pub use gen_PositionError::*; #[cfg(feature = "PositionOptions")] #[allow(non_snake_case)] mod gen_PositionOptions; #[cfg(feature = "PositionOptions")] +#[allow(unused_imports)] pub use gen_PositionOptions::*; +#[cfg(feature = "PremultiplyAlpha")] +#[allow(non_snake_case)] +mod gen_PremultiplyAlpha; +#[cfg(feature = "PremultiplyAlpha")] +#[allow(unused_imports)] +pub use gen_PremultiplyAlpha::*; + #[cfg(feature = "Presentation")] #[allow(non_snake_case)] mod gen_Presentation; #[cfg(feature = "Presentation")] +#[allow(unused_imports)] pub use gen_Presentation::*; #[cfg(feature = "PresentationAvailability")] #[allow(non_snake_case)] mod gen_PresentationAvailability; #[cfg(feature = "PresentationAvailability")] +#[allow(unused_imports)] pub use gen_PresentationAvailability::*; #[cfg(feature = "PresentationConnection")] #[allow(non_snake_case)] mod gen_PresentationConnection; #[cfg(feature = "PresentationConnection")] +#[allow(unused_imports)] pub use gen_PresentationConnection::*; #[cfg(feature = "PresentationConnectionAvailableEvent")] #[allow(non_snake_case)] mod gen_PresentationConnectionAvailableEvent; #[cfg(feature = "PresentationConnectionAvailableEvent")] +#[allow(unused_imports)] pub use gen_PresentationConnectionAvailableEvent::*; #[cfg(feature = "PresentationConnectionAvailableEventInit")] #[allow(non_snake_case)] mod gen_PresentationConnectionAvailableEventInit; #[cfg(feature = "PresentationConnectionAvailableEventInit")] +#[allow(unused_imports)] pub use gen_PresentationConnectionAvailableEventInit::*; #[cfg(feature = "PresentationConnectionBinaryType")] #[allow(non_snake_case)] mod gen_PresentationConnectionBinaryType; #[cfg(feature = "PresentationConnectionBinaryType")] +#[allow(unused_imports)] pub use gen_PresentationConnectionBinaryType::*; #[cfg(feature = "PresentationConnectionCloseEvent")] #[allow(non_snake_case)] mod gen_PresentationConnectionCloseEvent; #[cfg(feature = "PresentationConnectionCloseEvent")] +#[allow(unused_imports)] pub use gen_PresentationConnectionCloseEvent::*; #[cfg(feature = "PresentationConnectionCloseEventInit")] #[allow(non_snake_case)] mod gen_PresentationConnectionCloseEventInit; #[cfg(feature = "PresentationConnectionCloseEventInit")] +#[allow(unused_imports)] pub use gen_PresentationConnectionCloseEventInit::*; #[cfg(feature = "PresentationConnectionClosedReason")] #[allow(non_snake_case)] mod gen_PresentationConnectionClosedReason; #[cfg(feature = "PresentationConnectionClosedReason")] +#[allow(unused_imports)] pub use gen_PresentationConnectionClosedReason::*; #[cfg(feature = "PresentationConnectionList")] #[allow(non_snake_case)] mod gen_PresentationConnectionList; #[cfg(feature = "PresentationConnectionList")] +#[allow(unused_imports)] pub use gen_PresentationConnectionList::*; #[cfg(feature = "PresentationConnectionState")] #[allow(non_snake_case)] mod gen_PresentationConnectionState; #[cfg(feature = "PresentationConnectionState")] +#[allow(unused_imports)] pub use gen_PresentationConnectionState::*; #[cfg(feature = "PresentationReceiver")] #[allow(non_snake_case)] mod gen_PresentationReceiver; #[cfg(feature = "PresentationReceiver")] +#[allow(unused_imports)] pub use gen_PresentationReceiver::*; #[cfg(feature = "PresentationRequest")] #[allow(non_snake_case)] mod gen_PresentationRequest; #[cfg(feature = "PresentationRequest")] +#[allow(unused_imports)] pub use gen_PresentationRequest::*; #[cfg(feature = "PresentationStyle")] #[allow(non_snake_case)] mod gen_PresentationStyle; #[cfg(feature = "PresentationStyle")] +#[allow(unused_imports)] pub use gen_PresentationStyle::*; #[cfg(feature = "ProcessingInstruction")] #[allow(non_snake_case)] mod gen_ProcessingInstruction; #[cfg(feature = "ProcessingInstruction")] +#[allow(unused_imports)] pub use gen_ProcessingInstruction::*; #[cfg(feature = "ProfileTimelineLayerRect")] #[allow(non_snake_case)] mod gen_ProfileTimelineLayerRect; #[cfg(feature = "ProfileTimelineLayerRect")] +#[allow(unused_imports)] pub use gen_ProfileTimelineLayerRect::*; #[cfg(feature = "ProfileTimelineMarker")] #[allow(non_snake_case)] mod gen_ProfileTimelineMarker; #[cfg(feature = "ProfileTimelineMarker")] +#[allow(unused_imports)] pub use gen_ProfileTimelineMarker::*; #[cfg(feature = "ProfileTimelineMessagePortOperationType")] #[allow(non_snake_case)] mod gen_ProfileTimelineMessagePortOperationType; #[cfg(feature = "ProfileTimelineMessagePortOperationType")] +#[allow(unused_imports)] pub use gen_ProfileTimelineMessagePortOperationType::*; #[cfg(feature = "ProfileTimelineStackFrame")] #[allow(non_snake_case)] mod gen_ProfileTimelineStackFrame; #[cfg(feature = "ProfileTimelineStackFrame")] +#[allow(unused_imports)] pub use gen_ProfileTimelineStackFrame::*; #[cfg(feature = "ProfileTimelineWorkerOperationType")] #[allow(non_snake_case)] mod gen_ProfileTimelineWorkerOperationType; #[cfg(feature = "ProfileTimelineWorkerOperationType")] +#[allow(unused_imports)] pub use gen_ProfileTimelineWorkerOperationType::*; #[cfg(feature = "ProgressEvent")] #[allow(non_snake_case)] mod gen_ProgressEvent; #[cfg(feature = "ProgressEvent")] +#[allow(unused_imports)] pub use gen_ProgressEvent::*; #[cfg(feature = "ProgressEventInit")] #[allow(non_snake_case)] mod gen_ProgressEventInit; #[cfg(feature = "ProgressEventInit")] +#[allow(unused_imports)] pub use gen_ProgressEventInit::*; #[cfg(feature = "PromiseNativeHandler")] #[allow(non_snake_case)] mod gen_PromiseNativeHandler; #[cfg(feature = "PromiseNativeHandler")] +#[allow(unused_imports)] pub use gen_PromiseNativeHandler::*; #[cfg(feature = "PromiseRejectionEvent")] #[allow(non_snake_case)] mod gen_PromiseRejectionEvent; #[cfg(feature = "PromiseRejectionEvent")] +#[allow(unused_imports)] pub use gen_PromiseRejectionEvent::*; #[cfg(feature = "PromiseRejectionEventInit")] #[allow(non_snake_case)] mod gen_PromiseRejectionEventInit; #[cfg(feature = "PromiseRejectionEventInit")] +#[allow(unused_imports)] pub use gen_PromiseRejectionEventInit::*; #[cfg(feature = "PublicKeyCredential")] #[allow(non_snake_case)] mod gen_PublicKeyCredential; #[cfg(feature = "PublicKeyCredential")] +#[allow(unused_imports)] pub use gen_PublicKeyCredential::*; #[cfg(feature = "PublicKeyCredentialCreationOptions")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialCreationOptions; #[cfg(feature = "PublicKeyCredentialCreationOptions")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialCreationOptions::*; +#[cfg(feature = "PublicKeyCredentialCreationOptionsJson")] +#[allow(non_snake_case)] +mod gen_PublicKeyCredentialCreationOptionsJson; +#[cfg(feature = "PublicKeyCredentialCreationOptionsJson")] +#[allow(unused_imports)] +pub use gen_PublicKeyCredentialCreationOptionsJson::*; + #[cfg(feature = "PublicKeyCredentialDescriptor")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialDescriptor; #[cfg(feature = "PublicKeyCredentialDescriptor")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialDescriptor::*; +#[cfg(feature = "PublicKeyCredentialDescriptorJson")] +#[allow(non_snake_case)] +mod gen_PublicKeyCredentialDescriptorJson; +#[cfg(feature = "PublicKeyCredentialDescriptorJson")] +#[allow(unused_imports)] +pub use gen_PublicKeyCredentialDescriptorJson::*; + #[cfg(feature = "PublicKeyCredentialEntity")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialEntity; #[cfg(feature = "PublicKeyCredentialEntity")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialEntity::*; +#[cfg(feature = "PublicKeyCredentialHints")] +#[allow(non_snake_case)] +mod gen_PublicKeyCredentialHints; +#[cfg(feature = "PublicKeyCredentialHints")] +#[allow(unused_imports)] +pub use gen_PublicKeyCredentialHints::*; + #[cfg(feature = "PublicKeyCredentialParameters")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialParameters; #[cfg(feature = "PublicKeyCredentialParameters")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialParameters::*; #[cfg(feature = "PublicKeyCredentialRequestOptions")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialRequestOptions; #[cfg(feature = "PublicKeyCredentialRequestOptions")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialRequestOptions::*; +#[cfg(feature = "PublicKeyCredentialRequestOptionsJson")] +#[allow(non_snake_case)] +mod gen_PublicKeyCredentialRequestOptionsJson; +#[cfg(feature = "PublicKeyCredentialRequestOptionsJson")] +#[allow(unused_imports)] +pub use gen_PublicKeyCredentialRequestOptionsJson::*; + #[cfg(feature = "PublicKeyCredentialRpEntity")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialRpEntity; #[cfg(feature = "PublicKeyCredentialRpEntity")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialRpEntity::*; #[cfg(feature = "PublicKeyCredentialType")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialType; #[cfg(feature = "PublicKeyCredentialType")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialType::*; #[cfg(feature = "PublicKeyCredentialUserEntity")] #[allow(non_snake_case)] mod gen_PublicKeyCredentialUserEntity; #[cfg(feature = "PublicKeyCredentialUserEntity")] +#[allow(unused_imports)] pub use gen_PublicKeyCredentialUserEntity::*; +#[cfg(feature = "PublicKeyCredentialUserEntityJson")] +#[allow(non_snake_case)] +mod gen_PublicKeyCredentialUserEntityJson; +#[cfg(feature = "PublicKeyCredentialUserEntityJson")] +#[allow(unused_imports)] +pub use gen_PublicKeyCredentialUserEntityJson::*; + #[cfg(feature = "PushEncryptionKeyName")] #[allow(non_snake_case)] mod gen_PushEncryptionKeyName; #[cfg(feature = "PushEncryptionKeyName")] +#[allow(unused_imports)] pub use gen_PushEncryptionKeyName::*; #[cfg(feature = "PushEvent")] #[allow(non_snake_case)] mod gen_PushEvent; #[cfg(feature = "PushEvent")] +#[allow(unused_imports)] pub use gen_PushEvent::*; #[cfg(feature = "PushEventInit")] #[allow(non_snake_case)] mod gen_PushEventInit; #[cfg(feature = "PushEventInit")] +#[allow(unused_imports)] pub use gen_PushEventInit::*; #[cfg(feature = "PushManager")] #[allow(non_snake_case)] mod gen_PushManager; #[cfg(feature = "PushManager")] +#[allow(unused_imports)] pub use gen_PushManager::*; #[cfg(feature = "PushMessageData")] #[allow(non_snake_case)] mod gen_PushMessageData; #[cfg(feature = "PushMessageData")] +#[allow(unused_imports)] pub use gen_PushMessageData::*; #[cfg(feature = "PushPermissionState")] #[allow(non_snake_case)] mod gen_PushPermissionState; #[cfg(feature = "PushPermissionState")] +#[allow(unused_imports)] pub use gen_PushPermissionState::*; #[cfg(feature = "PushSubscription")] #[allow(non_snake_case)] mod gen_PushSubscription; #[cfg(feature = "PushSubscription")] +#[allow(unused_imports)] pub use gen_PushSubscription::*; #[cfg(feature = "PushSubscriptionInit")] #[allow(non_snake_case)] mod gen_PushSubscriptionInit; #[cfg(feature = "PushSubscriptionInit")] +#[allow(unused_imports)] pub use gen_PushSubscriptionInit::*; #[cfg(feature = "PushSubscriptionJson")] #[allow(non_snake_case)] mod gen_PushSubscriptionJson; #[cfg(feature = "PushSubscriptionJson")] +#[allow(unused_imports)] pub use gen_PushSubscriptionJson::*; #[cfg(feature = "PushSubscriptionKeys")] #[allow(non_snake_case)] mod gen_PushSubscriptionKeys; #[cfg(feature = "PushSubscriptionKeys")] +#[allow(unused_imports)] pub use gen_PushSubscriptionKeys::*; #[cfg(feature = "PushSubscriptionOptions")] #[allow(non_snake_case)] mod gen_PushSubscriptionOptions; #[cfg(feature = "PushSubscriptionOptions")] +#[allow(unused_imports)] pub use gen_PushSubscriptionOptions::*; #[cfg(feature = "PushSubscriptionOptionsInit")] #[allow(non_snake_case)] mod gen_PushSubscriptionOptionsInit; #[cfg(feature = "PushSubscriptionOptionsInit")] +#[allow(unused_imports)] pub use gen_PushSubscriptionOptionsInit::*; +#[cfg(feature = "QueryOptions")] +#[allow(non_snake_case)] +mod gen_QueryOptions; +#[cfg(feature = "QueryOptions")] +#[allow(unused_imports)] +pub use gen_QueryOptions::*; + #[cfg(feature = "QueuingStrategy")] #[allow(non_snake_case)] mod gen_QueuingStrategy; #[cfg(feature = "QueuingStrategy")] +#[allow(unused_imports)] pub use gen_QueuingStrategy::*; +#[cfg(feature = "QueuingStrategyInit")] +#[allow(non_snake_case)] +mod gen_QueuingStrategyInit; +#[cfg(feature = "QueuingStrategyInit")] +#[allow(unused_imports)] +pub use gen_QueuingStrategyInit::*; + #[cfg(feature = "RadioNodeList")] #[allow(non_snake_case)] mod gen_RadioNodeList; #[cfg(feature = "RadioNodeList")] +#[allow(unused_imports)] pub use gen_RadioNodeList::*; #[cfg(feature = "Range")] #[allow(non_snake_case)] mod gen_Range; #[cfg(feature = "Range")] +#[allow(unused_imports)] pub use gen_Range::*; #[cfg(feature = "RcwnPerfStats")] #[allow(non_snake_case)] mod gen_RcwnPerfStats; #[cfg(feature = "RcwnPerfStats")] +#[allow(unused_imports)] pub use gen_RcwnPerfStats::*; #[cfg(feature = "RcwnStatus")] #[allow(non_snake_case)] mod gen_RcwnStatus; #[cfg(feature = "RcwnStatus")] +#[allow(unused_imports)] pub use gen_RcwnStatus::*; +#[cfg(feature = "ReadableByteStreamController")] +#[allow(non_snake_case)] +mod gen_ReadableByteStreamController; +#[cfg(feature = "ReadableByteStreamController")] +#[allow(unused_imports)] +pub use gen_ReadableByteStreamController::*; + #[cfg(feature = "ReadableStream")] #[allow(non_snake_case)] mod gen_ReadableStream; #[cfg(feature = "ReadableStream")] +#[allow(unused_imports)] pub use gen_ReadableStream::*; -#[cfg(feature = "ReadableStreamByobReadResult")] -#[allow(non_snake_case)] -mod gen_ReadableStreamByobReadResult; -#[cfg(feature = "ReadableStreamByobReadResult")] -pub use gen_ReadableStreamByobReadResult::*; - #[cfg(feature = "ReadableStreamByobReader")] #[allow(non_snake_case)] mod gen_ReadableStreamByobReader; #[cfg(feature = "ReadableStreamByobReader")] +#[allow(unused_imports)] pub use gen_ReadableStreamByobReader::*; -#[cfg(feature = "ReadableStreamDefaultReadResult")] +#[cfg(feature = "ReadableStreamByobRequest")] +#[allow(non_snake_case)] +mod gen_ReadableStreamByobRequest; +#[cfg(feature = "ReadableStreamByobRequest")] +#[allow(unused_imports)] +pub use gen_ReadableStreamByobRequest::*; + +#[cfg(feature = "ReadableStreamDefaultController")] #[allow(non_snake_case)] -mod gen_ReadableStreamDefaultReadResult; -#[cfg(feature = "ReadableStreamDefaultReadResult")] -pub use gen_ReadableStreamDefaultReadResult::*; +mod gen_ReadableStreamDefaultController; +#[cfg(feature = "ReadableStreamDefaultController")] +#[allow(unused_imports)] +pub use gen_ReadableStreamDefaultController::*; #[cfg(feature = "ReadableStreamDefaultReader")] #[allow(non_snake_case)] mod gen_ReadableStreamDefaultReader; #[cfg(feature = "ReadableStreamDefaultReader")] +#[allow(unused_imports)] pub use gen_ReadableStreamDefaultReader::*; #[cfg(feature = "ReadableStreamGetReaderOptions")] #[allow(non_snake_case)] mod gen_ReadableStreamGetReaderOptions; #[cfg(feature = "ReadableStreamGetReaderOptions")] +#[allow(unused_imports)] pub use gen_ReadableStreamGetReaderOptions::*; #[cfg(feature = "ReadableStreamIteratorOptions")] #[allow(non_snake_case)] mod gen_ReadableStreamIteratorOptions; #[cfg(feature = "ReadableStreamIteratorOptions")] +#[allow(unused_imports)] pub use gen_ReadableStreamIteratorOptions::*; +#[cfg(feature = "ReadableStreamReadResult")] +#[allow(non_snake_case)] +mod gen_ReadableStreamReadResult; +#[cfg(feature = "ReadableStreamReadResult")] +#[allow(unused_imports)] +pub use gen_ReadableStreamReadResult::*; + #[cfg(feature = "ReadableStreamReaderMode")] #[allow(non_snake_case)] mod gen_ReadableStreamReaderMode; #[cfg(feature = "ReadableStreamReaderMode")] +#[allow(unused_imports)] pub use gen_ReadableStreamReaderMode::*; +#[cfg(feature = "ReadableStreamType")] +#[allow(non_snake_case)] +mod gen_ReadableStreamType; +#[cfg(feature = "ReadableStreamType")] +#[allow(unused_imports)] +pub use gen_ReadableStreamType::*; + #[cfg(feature = "ReadableWritablePair")] #[allow(non_snake_case)] mod gen_ReadableWritablePair; #[cfg(feature = "ReadableWritablePair")] +#[allow(unused_imports)] pub use gen_ReadableWritablePair::*; #[cfg(feature = "RecordingState")] #[allow(non_snake_case)] mod gen_RecordingState; #[cfg(feature = "RecordingState")] +#[allow(unused_imports)] pub use gen_RecordingState::*; #[cfg(feature = "ReferrerPolicy")] #[allow(non_snake_case)] mod gen_ReferrerPolicy; #[cfg(feature = "ReferrerPolicy")] +#[allow(unused_imports)] pub use gen_ReferrerPolicy::*; #[cfg(feature = "RegisterRequest")] #[allow(non_snake_case)] mod gen_RegisterRequest; #[cfg(feature = "RegisterRequest")] +#[allow(unused_imports)] pub use gen_RegisterRequest::*; #[cfg(feature = "RegisterResponse")] #[allow(non_snake_case)] mod gen_RegisterResponse; #[cfg(feature = "RegisterResponse")] +#[allow(unused_imports)] pub use gen_RegisterResponse::*; #[cfg(feature = "RegisteredKey")] #[allow(non_snake_case)] mod gen_RegisteredKey; #[cfg(feature = "RegisteredKey")] +#[allow(unused_imports)] pub use gen_RegisteredKey::*; #[cfg(feature = "RegistrationOptions")] #[allow(non_snake_case)] mod gen_RegistrationOptions; #[cfg(feature = "RegistrationOptions")] +#[allow(unused_imports)] pub use gen_RegistrationOptions::*; +#[cfg(feature = "RegistrationResponseJson")] +#[allow(non_snake_case)] +mod gen_RegistrationResponseJson; +#[cfg(feature = "RegistrationResponseJson")] +#[allow(unused_imports)] +pub use gen_RegistrationResponseJson::*; + #[cfg(feature = "Request")] #[allow(non_snake_case)] mod gen_Request; #[cfg(feature = "Request")] +#[allow(unused_imports)] pub use gen_Request::*; #[cfg(feature = "RequestCache")] #[allow(non_snake_case)] mod gen_RequestCache; #[cfg(feature = "RequestCache")] +#[allow(unused_imports)] pub use gen_RequestCache::*; #[cfg(feature = "RequestCredentials")] #[allow(non_snake_case)] mod gen_RequestCredentials; #[cfg(feature = "RequestCredentials")] +#[allow(unused_imports)] pub use gen_RequestCredentials::*; #[cfg(feature = "RequestDestination")] #[allow(non_snake_case)] mod gen_RequestDestination; #[cfg(feature = "RequestDestination")] +#[allow(unused_imports)] pub use gen_RequestDestination::*; #[cfg(feature = "RequestDeviceOptions")] #[allow(non_snake_case)] mod gen_RequestDeviceOptions; #[cfg(feature = "RequestDeviceOptions")] +#[allow(unused_imports)] pub use gen_RequestDeviceOptions::*; #[cfg(feature = "RequestInit")] #[allow(non_snake_case)] mod gen_RequestInit; #[cfg(feature = "RequestInit")] +#[allow(unused_imports)] pub use gen_RequestInit::*; #[cfg(feature = "RequestMediaKeySystemAccessNotification")] #[allow(non_snake_case)] mod gen_RequestMediaKeySystemAccessNotification; #[cfg(feature = "RequestMediaKeySystemAccessNotification")] +#[allow(unused_imports)] pub use gen_RequestMediaKeySystemAccessNotification::*; #[cfg(feature = "RequestMode")] #[allow(non_snake_case)] mod gen_RequestMode; #[cfg(feature = "RequestMode")] +#[allow(unused_imports)] pub use gen_RequestMode::*; #[cfg(feature = "RequestRedirect")] #[allow(non_snake_case)] mod gen_RequestRedirect; #[cfg(feature = "RequestRedirect")] +#[allow(unused_imports)] pub use gen_RequestRedirect::*; +#[cfg(feature = "ResidentKeyRequirement")] +#[allow(non_snake_case)] +mod gen_ResidentKeyRequirement; +#[cfg(feature = "ResidentKeyRequirement")] +#[allow(unused_imports)] +pub use gen_ResidentKeyRequirement::*; + #[cfg(feature = "ResizeObserver")] #[allow(non_snake_case)] mod gen_ResizeObserver; #[cfg(feature = "ResizeObserver")] +#[allow(unused_imports)] pub use gen_ResizeObserver::*; #[cfg(feature = "ResizeObserverBoxOptions")] #[allow(non_snake_case)] mod gen_ResizeObserverBoxOptions; #[cfg(feature = "ResizeObserverBoxOptions")] +#[allow(unused_imports)] pub use gen_ResizeObserverBoxOptions::*; #[cfg(feature = "ResizeObserverEntry")] #[allow(non_snake_case)] mod gen_ResizeObserverEntry; #[cfg(feature = "ResizeObserverEntry")] +#[allow(unused_imports)] pub use gen_ResizeObserverEntry::*; #[cfg(feature = "ResizeObserverOptions")] #[allow(non_snake_case)] mod gen_ResizeObserverOptions; #[cfg(feature = "ResizeObserverOptions")] +#[allow(unused_imports)] pub use gen_ResizeObserverOptions::*; #[cfg(feature = "ResizeObserverSize")] #[allow(non_snake_case)] mod gen_ResizeObserverSize; #[cfg(feature = "ResizeObserverSize")] +#[allow(unused_imports)] pub use gen_ResizeObserverSize::*; +#[cfg(feature = "ResizeQuality")] +#[allow(non_snake_case)] +mod gen_ResizeQuality; +#[cfg(feature = "ResizeQuality")] +#[allow(unused_imports)] +pub use gen_ResizeQuality::*; + #[cfg(feature = "Response")] #[allow(non_snake_case)] mod gen_Response; #[cfg(feature = "Response")] +#[allow(unused_imports)] pub use gen_Response::*; #[cfg(feature = "ResponseInit")] #[allow(non_snake_case)] mod gen_ResponseInit; #[cfg(feature = "ResponseInit")] +#[allow(unused_imports)] pub use gen_ResponseInit::*; #[cfg(feature = "ResponseType")] #[allow(non_snake_case)] mod gen_ResponseType; #[cfg(feature = "ResponseType")] +#[allow(unused_imports)] pub use gen_ResponseType::*; #[cfg(feature = "RsaHashedImportParams")] #[allow(non_snake_case)] mod gen_RsaHashedImportParams; #[cfg(feature = "RsaHashedImportParams")] +#[allow(unused_imports)] pub use gen_RsaHashedImportParams::*; #[cfg(feature = "RsaOaepParams")] #[allow(non_snake_case)] mod gen_RsaOaepParams; #[cfg(feature = "RsaOaepParams")] +#[allow(unused_imports)] pub use gen_RsaOaepParams::*; #[cfg(feature = "RsaOtherPrimesInfo")] #[allow(non_snake_case)] mod gen_RsaOtherPrimesInfo; #[cfg(feature = "RsaOtherPrimesInfo")] +#[allow(unused_imports)] pub use gen_RsaOtherPrimesInfo::*; #[cfg(feature = "RsaPssParams")] #[allow(non_snake_case)] mod gen_RsaPssParams; #[cfg(feature = "RsaPssParams")] +#[allow(unused_imports)] pub use gen_RsaPssParams::*; #[cfg(feature = "RtcAnswerOptions")] #[allow(non_snake_case)] mod gen_RtcAnswerOptions; #[cfg(feature = "RtcAnswerOptions")] +#[allow(unused_imports)] pub use gen_RtcAnswerOptions::*; #[cfg(feature = "RtcBundlePolicy")] #[allow(non_snake_case)] mod gen_RtcBundlePolicy; #[cfg(feature = "RtcBundlePolicy")] +#[allow(unused_imports)] pub use gen_RtcBundlePolicy::*; #[cfg(feature = "RtcCertificate")] #[allow(non_snake_case)] mod gen_RtcCertificate; #[cfg(feature = "RtcCertificate")] +#[allow(unused_imports)] pub use gen_RtcCertificate::*; #[cfg(feature = "RtcCertificateExpiration")] #[allow(non_snake_case)] mod gen_RtcCertificateExpiration; #[cfg(feature = "RtcCertificateExpiration")] +#[allow(unused_imports)] pub use gen_RtcCertificateExpiration::*; #[cfg(feature = "RtcCodecStats")] #[allow(non_snake_case)] mod gen_RtcCodecStats; #[cfg(feature = "RtcCodecStats")] +#[allow(unused_imports)] pub use gen_RtcCodecStats::*; #[cfg(feature = "RtcConfiguration")] #[allow(non_snake_case)] mod gen_RtcConfiguration; #[cfg(feature = "RtcConfiguration")] +#[allow(unused_imports)] pub use gen_RtcConfiguration::*; #[cfg(feature = "RtcDataChannel")] #[allow(non_snake_case)] mod gen_RtcDataChannel; #[cfg(feature = "RtcDataChannel")] +#[allow(unused_imports)] pub use gen_RtcDataChannel::*; #[cfg(feature = "RtcDataChannelEvent")] #[allow(non_snake_case)] mod gen_RtcDataChannelEvent; #[cfg(feature = "RtcDataChannelEvent")] +#[allow(unused_imports)] pub use gen_RtcDataChannelEvent::*; #[cfg(feature = "RtcDataChannelEventInit")] #[allow(non_snake_case)] mod gen_RtcDataChannelEventInit; #[cfg(feature = "RtcDataChannelEventInit")] +#[allow(unused_imports)] pub use gen_RtcDataChannelEventInit::*; #[cfg(feature = "RtcDataChannelInit")] #[allow(non_snake_case)] mod gen_RtcDataChannelInit; #[cfg(feature = "RtcDataChannelInit")] +#[allow(unused_imports)] pub use gen_RtcDataChannelInit::*; #[cfg(feature = "RtcDataChannelState")] #[allow(non_snake_case)] mod gen_RtcDataChannelState; #[cfg(feature = "RtcDataChannelState")] +#[allow(unused_imports)] pub use gen_RtcDataChannelState::*; #[cfg(feature = "RtcDataChannelType")] #[allow(non_snake_case)] mod gen_RtcDataChannelType; #[cfg(feature = "RtcDataChannelType")] +#[allow(unused_imports)] pub use gen_RtcDataChannelType::*; #[cfg(feature = "RtcDegradationPreference")] #[allow(non_snake_case)] mod gen_RtcDegradationPreference; #[cfg(feature = "RtcDegradationPreference")] +#[allow(unused_imports)] pub use gen_RtcDegradationPreference::*; +#[cfg(feature = "RtcEncodedAudioFrame")] +#[allow(non_snake_case)] +mod gen_RtcEncodedAudioFrame; +#[cfg(feature = "RtcEncodedAudioFrame")] +#[allow(unused_imports)] +pub use gen_RtcEncodedAudioFrame::*; + +#[cfg(feature = "RtcEncodedAudioFrameMetadata")] +#[allow(non_snake_case)] +mod gen_RtcEncodedAudioFrameMetadata; +#[cfg(feature = "RtcEncodedAudioFrameMetadata")] +#[allow(unused_imports)] +pub use gen_RtcEncodedAudioFrameMetadata::*; + +#[cfg(feature = "RtcEncodedAudioFrameOptions")] +#[allow(non_snake_case)] +mod gen_RtcEncodedAudioFrameOptions; +#[cfg(feature = "RtcEncodedAudioFrameOptions")] +#[allow(unused_imports)] +pub use gen_RtcEncodedAudioFrameOptions::*; + +#[cfg(feature = "RtcEncodedVideoFrame")] +#[allow(non_snake_case)] +mod gen_RtcEncodedVideoFrame; +#[cfg(feature = "RtcEncodedVideoFrame")] +#[allow(unused_imports)] +pub use gen_RtcEncodedVideoFrame::*; + +#[cfg(feature = "RtcEncodedVideoFrameMetadata")] +#[allow(non_snake_case)] +mod gen_RtcEncodedVideoFrameMetadata; +#[cfg(feature = "RtcEncodedVideoFrameMetadata")] +#[allow(unused_imports)] +pub use gen_RtcEncodedVideoFrameMetadata::*; + +#[cfg(feature = "RtcEncodedVideoFrameOptions")] +#[allow(non_snake_case)] +mod gen_RtcEncodedVideoFrameOptions; +#[cfg(feature = "RtcEncodedVideoFrameOptions")] +#[allow(unused_imports)] +pub use gen_RtcEncodedVideoFrameOptions::*; + +#[cfg(feature = "RtcEncodedVideoFrameType")] +#[allow(non_snake_case)] +mod gen_RtcEncodedVideoFrameType; +#[cfg(feature = "RtcEncodedVideoFrameType")] +#[allow(unused_imports)] +pub use gen_RtcEncodedVideoFrameType::*; + #[cfg(feature = "RtcFecParameters")] #[allow(non_snake_case)] mod gen_RtcFecParameters; #[cfg(feature = "RtcFecParameters")] +#[allow(unused_imports)] pub use gen_RtcFecParameters::*; #[cfg(feature = "RtcIceCandidate")] #[allow(non_snake_case)] mod gen_RtcIceCandidate; #[cfg(feature = "RtcIceCandidate")] +#[allow(unused_imports)] pub use gen_RtcIceCandidate::*; #[cfg(feature = "RtcIceCandidateInit")] #[allow(non_snake_case)] mod gen_RtcIceCandidateInit; #[cfg(feature = "RtcIceCandidateInit")] +#[allow(unused_imports)] pub use gen_RtcIceCandidateInit::*; #[cfg(feature = "RtcIceCandidatePairStats")] #[allow(non_snake_case)] mod gen_RtcIceCandidatePairStats; #[cfg(feature = "RtcIceCandidatePairStats")] +#[allow(unused_imports)] pub use gen_RtcIceCandidatePairStats::*; #[cfg(feature = "RtcIceCandidateStats")] #[allow(non_snake_case)] mod gen_RtcIceCandidateStats; #[cfg(feature = "RtcIceCandidateStats")] +#[allow(unused_imports)] pub use gen_RtcIceCandidateStats::*; #[cfg(feature = "RtcIceComponentStats")] #[allow(non_snake_case)] mod gen_RtcIceComponentStats; #[cfg(feature = "RtcIceComponentStats")] +#[allow(unused_imports)] pub use gen_RtcIceComponentStats::*; #[cfg(feature = "RtcIceConnectionState")] #[allow(non_snake_case)] mod gen_RtcIceConnectionState; #[cfg(feature = "RtcIceConnectionState")] +#[allow(unused_imports)] pub use gen_RtcIceConnectionState::*; #[cfg(feature = "RtcIceCredentialType")] #[allow(non_snake_case)] mod gen_RtcIceCredentialType; #[cfg(feature = "RtcIceCredentialType")] +#[allow(unused_imports)] pub use gen_RtcIceCredentialType::*; #[cfg(feature = "RtcIceGatheringState")] #[allow(non_snake_case)] mod gen_RtcIceGatheringState; #[cfg(feature = "RtcIceGatheringState")] +#[allow(unused_imports)] pub use gen_RtcIceGatheringState::*; #[cfg(feature = "RtcIceServer")] #[allow(non_snake_case)] mod gen_RtcIceServer; #[cfg(feature = "RtcIceServer")] +#[allow(unused_imports)] pub use gen_RtcIceServer::*; #[cfg(feature = "RtcIceTransportPolicy")] #[allow(non_snake_case)] mod gen_RtcIceTransportPolicy; #[cfg(feature = "RtcIceTransportPolicy")] +#[allow(unused_imports)] pub use gen_RtcIceTransportPolicy::*; #[cfg(feature = "RtcIdentityAssertion")] #[allow(non_snake_case)] mod gen_RtcIdentityAssertion; #[cfg(feature = "RtcIdentityAssertion")] +#[allow(unused_imports)] pub use gen_RtcIdentityAssertion::*; #[cfg(feature = "RtcIdentityAssertionResult")] #[allow(non_snake_case)] mod gen_RtcIdentityAssertionResult; #[cfg(feature = "RtcIdentityAssertionResult")] +#[allow(unused_imports)] pub use gen_RtcIdentityAssertionResult::*; #[cfg(feature = "RtcIdentityProvider")] #[allow(non_snake_case)] mod gen_RtcIdentityProvider; #[cfg(feature = "RtcIdentityProvider")] +#[allow(unused_imports)] pub use gen_RtcIdentityProvider::*; #[cfg(feature = "RtcIdentityProviderDetails")] #[allow(non_snake_case)] mod gen_RtcIdentityProviderDetails; #[cfg(feature = "RtcIdentityProviderDetails")] +#[allow(unused_imports)] pub use gen_RtcIdentityProviderDetails::*; #[cfg(feature = "RtcIdentityProviderOptions")] #[allow(non_snake_case)] mod gen_RtcIdentityProviderOptions; #[cfg(feature = "RtcIdentityProviderOptions")] +#[allow(unused_imports)] pub use gen_RtcIdentityProviderOptions::*; #[cfg(feature = "RtcIdentityProviderRegistrar")] #[allow(non_snake_case)] mod gen_RtcIdentityProviderRegistrar; #[cfg(feature = "RtcIdentityProviderRegistrar")] +#[allow(unused_imports)] pub use gen_RtcIdentityProviderRegistrar::*; #[cfg(feature = "RtcIdentityValidationResult")] #[allow(non_snake_case)] mod gen_RtcIdentityValidationResult; #[cfg(feature = "RtcIdentityValidationResult")] +#[allow(unused_imports)] pub use gen_RtcIdentityValidationResult::*; #[cfg(feature = "RtcInboundRtpStreamStats")] #[allow(non_snake_case)] mod gen_RtcInboundRtpStreamStats; #[cfg(feature = "RtcInboundRtpStreamStats")] +#[allow(unused_imports)] pub use gen_RtcInboundRtpStreamStats::*; -#[cfg(feature = "RtcLifecycleEvent")] -#[allow(non_snake_case)] -mod gen_RtcLifecycleEvent; -#[cfg(feature = "RtcLifecycleEvent")] -pub use gen_RtcLifecycleEvent::*; - #[cfg(feature = "RtcMediaStreamStats")] #[allow(non_snake_case)] mod gen_RtcMediaStreamStats; #[cfg(feature = "RtcMediaStreamStats")] +#[allow(unused_imports)] pub use gen_RtcMediaStreamStats::*; #[cfg(feature = "RtcMediaStreamTrackStats")] #[allow(non_snake_case)] mod gen_RtcMediaStreamTrackStats; #[cfg(feature = "RtcMediaStreamTrackStats")] +#[allow(unused_imports)] pub use gen_RtcMediaStreamTrackStats::*; #[cfg(feature = "RtcOfferAnswerOptions")] #[allow(non_snake_case)] mod gen_RtcOfferAnswerOptions; #[cfg(feature = "RtcOfferAnswerOptions")] +#[allow(unused_imports)] pub use gen_RtcOfferAnswerOptions::*; #[cfg(feature = "RtcOfferOptions")] #[allow(non_snake_case)] mod gen_RtcOfferOptions; #[cfg(feature = "RtcOfferOptions")] +#[allow(unused_imports)] pub use gen_RtcOfferOptions::*; #[cfg(feature = "RtcOutboundRtpStreamStats")] #[allow(non_snake_case)] mod gen_RtcOutboundRtpStreamStats; #[cfg(feature = "RtcOutboundRtpStreamStats")] +#[allow(unused_imports)] pub use gen_RtcOutboundRtpStreamStats::*; #[cfg(feature = "RtcPeerConnection")] #[allow(non_snake_case)] mod gen_RtcPeerConnection; #[cfg(feature = "RtcPeerConnection")] +#[allow(unused_imports)] pub use gen_RtcPeerConnection::*; +#[cfg(feature = "RtcPeerConnectionIceErrorEvent")] +#[allow(non_snake_case)] +mod gen_RtcPeerConnectionIceErrorEvent; +#[cfg(feature = "RtcPeerConnectionIceErrorEvent")] +#[allow(unused_imports)] +pub use gen_RtcPeerConnectionIceErrorEvent::*; + #[cfg(feature = "RtcPeerConnectionIceEvent")] #[allow(non_snake_case)] mod gen_RtcPeerConnectionIceEvent; #[cfg(feature = "RtcPeerConnectionIceEvent")] +#[allow(unused_imports)] pub use gen_RtcPeerConnectionIceEvent::*; #[cfg(feature = "RtcPeerConnectionIceEventInit")] #[allow(non_snake_case)] mod gen_RtcPeerConnectionIceEventInit; #[cfg(feature = "RtcPeerConnectionIceEventInit")] +#[allow(unused_imports)] pub use gen_RtcPeerConnectionIceEventInit::*; +#[cfg(feature = "RtcPeerConnectionState")] +#[allow(non_snake_case)] +mod gen_RtcPeerConnectionState; +#[cfg(feature = "RtcPeerConnectionState")] +#[allow(unused_imports)] +pub use gen_RtcPeerConnectionState::*; + #[cfg(feature = "RtcPriorityType")] #[allow(non_snake_case)] mod gen_RtcPriorityType; #[cfg(feature = "RtcPriorityType")] +#[allow(unused_imports)] pub use gen_RtcPriorityType::*; #[cfg(feature = "RtcRtcpParameters")] #[allow(non_snake_case)] mod gen_RtcRtcpParameters; #[cfg(feature = "RtcRtcpParameters")] +#[allow(unused_imports)] pub use gen_RtcRtcpParameters::*; +#[cfg(feature = "RtcRtpCapabilities")] +#[allow(non_snake_case)] +mod gen_RtcRtpCapabilities; +#[cfg(feature = "RtcRtpCapabilities")] +#[allow(unused_imports)] +pub use gen_RtcRtpCapabilities::*; + +#[cfg(feature = "RtcRtpCodecCapability")] +#[allow(non_snake_case)] +mod gen_RtcRtpCodecCapability; +#[cfg(feature = "RtcRtpCodecCapability")] +#[allow(unused_imports)] +pub use gen_RtcRtpCodecCapability::*; + #[cfg(feature = "RtcRtpCodecParameters")] #[allow(non_snake_case)] mod gen_RtcRtpCodecParameters; #[cfg(feature = "RtcRtpCodecParameters")] +#[allow(unused_imports)] pub use gen_RtcRtpCodecParameters::*; #[cfg(feature = "RtcRtpContributingSource")] #[allow(non_snake_case)] mod gen_RtcRtpContributingSource; #[cfg(feature = "RtcRtpContributingSource")] +#[allow(unused_imports)] pub use gen_RtcRtpContributingSource::*; #[cfg(feature = "RtcRtpEncodingParameters")] #[allow(non_snake_case)] mod gen_RtcRtpEncodingParameters; #[cfg(feature = "RtcRtpEncodingParameters")] +#[allow(unused_imports)] pub use gen_RtcRtpEncodingParameters::*; +#[cfg(feature = "RtcRtpHeaderExtensionCapability")] +#[allow(non_snake_case)] +mod gen_RtcRtpHeaderExtensionCapability; +#[cfg(feature = "RtcRtpHeaderExtensionCapability")] +#[allow(unused_imports)] +pub use gen_RtcRtpHeaderExtensionCapability::*; + #[cfg(feature = "RtcRtpHeaderExtensionParameters")] #[allow(non_snake_case)] mod gen_RtcRtpHeaderExtensionParameters; #[cfg(feature = "RtcRtpHeaderExtensionParameters")] +#[allow(unused_imports)] pub use gen_RtcRtpHeaderExtensionParameters::*; #[cfg(feature = "RtcRtpParameters")] #[allow(non_snake_case)] mod gen_RtcRtpParameters; #[cfg(feature = "RtcRtpParameters")] +#[allow(unused_imports)] pub use gen_RtcRtpParameters::*; #[cfg(feature = "RtcRtpReceiver")] #[allow(non_snake_case)] mod gen_RtcRtpReceiver; #[cfg(feature = "RtcRtpReceiver")] +#[allow(unused_imports)] pub use gen_RtcRtpReceiver::*; +#[cfg(feature = "RtcRtpScriptTransform")] +#[allow(non_snake_case)] +mod gen_RtcRtpScriptTransform; +#[cfg(feature = "RtcRtpScriptTransform")] +#[allow(unused_imports)] +pub use gen_RtcRtpScriptTransform::*; + +#[cfg(feature = "RtcRtpScriptTransformer")] +#[allow(non_snake_case)] +mod gen_RtcRtpScriptTransformer; +#[cfg(feature = "RtcRtpScriptTransformer")] +#[allow(unused_imports)] +pub use gen_RtcRtpScriptTransformer::*; + #[cfg(feature = "RtcRtpSender")] #[allow(non_snake_case)] mod gen_RtcRtpSender; #[cfg(feature = "RtcRtpSender")] +#[allow(unused_imports)] pub use gen_RtcRtpSender::*; #[cfg(feature = "RtcRtpSourceEntry")] #[allow(non_snake_case)] mod gen_RtcRtpSourceEntry; #[cfg(feature = "RtcRtpSourceEntry")] +#[allow(unused_imports)] pub use gen_RtcRtpSourceEntry::*; #[cfg(feature = "RtcRtpSourceEntryType")] #[allow(non_snake_case)] mod gen_RtcRtpSourceEntryType; #[cfg(feature = "RtcRtpSourceEntryType")] +#[allow(unused_imports)] pub use gen_RtcRtpSourceEntryType::*; #[cfg(feature = "RtcRtpSynchronizationSource")] #[allow(non_snake_case)] mod gen_RtcRtpSynchronizationSource; #[cfg(feature = "RtcRtpSynchronizationSource")] +#[allow(unused_imports)] pub use gen_RtcRtpSynchronizationSource::*; #[cfg(feature = "RtcRtpTransceiver")] #[allow(non_snake_case)] mod gen_RtcRtpTransceiver; #[cfg(feature = "RtcRtpTransceiver")] +#[allow(unused_imports)] pub use gen_RtcRtpTransceiver::*; #[cfg(feature = "RtcRtpTransceiverDirection")] #[allow(non_snake_case)] mod gen_RtcRtpTransceiverDirection; #[cfg(feature = "RtcRtpTransceiverDirection")] +#[allow(unused_imports)] pub use gen_RtcRtpTransceiverDirection::*; #[cfg(feature = "RtcRtpTransceiverInit")] #[allow(non_snake_case)] mod gen_RtcRtpTransceiverInit; #[cfg(feature = "RtcRtpTransceiverInit")] +#[allow(unused_imports)] pub use gen_RtcRtpTransceiverInit::*; #[cfg(feature = "RtcRtxParameters")] #[allow(non_snake_case)] mod gen_RtcRtxParameters; #[cfg(feature = "RtcRtxParameters")] +#[allow(unused_imports)] pub use gen_RtcRtxParameters::*; #[cfg(feature = "RtcSdpType")] #[allow(non_snake_case)] mod gen_RtcSdpType; #[cfg(feature = "RtcSdpType")] +#[allow(unused_imports)] pub use gen_RtcSdpType::*; #[cfg(feature = "RtcSessionDescription")] #[allow(non_snake_case)] mod gen_RtcSessionDescription; #[cfg(feature = "RtcSessionDescription")] +#[allow(unused_imports)] pub use gen_RtcSessionDescription::*; #[cfg(feature = "RtcSessionDescriptionInit")] #[allow(non_snake_case)] mod gen_RtcSessionDescriptionInit; #[cfg(feature = "RtcSessionDescriptionInit")] +#[allow(unused_imports)] pub use gen_RtcSessionDescriptionInit::*; #[cfg(feature = "RtcSignalingState")] #[allow(non_snake_case)] mod gen_RtcSignalingState; #[cfg(feature = "RtcSignalingState")] +#[allow(unused_imports)] pub use gen_RtcSignalingState::*; #[cfg(feature = "RtcStats")] #[allow(non_snake_case)] mod gen_RtcStats; #[cfg(feature = "RtcStats")] +#[allow(unused_imports)] pub use gen_RtcStats::*; #[cfg(feature = "RtcStatsIceCandidatePairState")] #[allow(non_snake_case)] mod gen_RtcStatsIceCandidatePairState; #[cfg(feature = "RtcStatsIceCandidatePairState")] +#[allow(unused_imports)] pub use gen_RtcStatsIceCandidatePairState::*; #[cfg(feature = "RtcStatsIceCandidateType")] #[allow(non_snake_case)] mod gen_RtcStatsIceCandidateType; #[cfg(feature = "RtcStatsIceCandidateType")] +#[allow(unused_imports)] pub use gen_RtcStatsIceCandidateType::*; #[cfg(feature = "RtcStatsReport")] #[allow(non_snake_case)] mod gen_RtcStatsReport; #[cfg(feature = "RtcStatsReport")] +#[allow(unused_imports)] pub use gen_RtcStatsReport::*; #[cfg(feature = "RtcStatsReportInternal")] #[allow(non_snake_case)] mod gen_RtcStatsReportInternal; #[cfg(feature = "RtcStatsReportInternal")] +#[allow(unused_imports)] pub use gen_RtcStatsReportInternal::*; #[cfg(feature = "RtcStatsType")] #[allow(non_snake_case)] mod gen_RtcStatsType; #[cfg(feature = "RtcStatsType")] +#[allow(unused_imports)] pub use gen_RtcStatsType::*; #[cfg(feature = "RtcTrackEvent")] #[allow(non_snake_case)] mod gen_RtcTrackEvent; #[cfg(feature = "RtcTrackEvent")] +#[allow(unused_imports)] pub use gen_RtcTrackEvent::*; #[cfg(feature = "RtcTrackEventInit")] #[allow(non_snake_case)] mod gen_RtcTrackEventInit; #[cfg(feature = "RtcTrackEventInit")] +#[allow(unused_imports)] pub use gen_RtcTrackEventInit::*; +#[cfg(feature = "RtcTransformEvent")] +#[allow(non_snake_case)] +mod gen_RtcTransformEvent; +#[cfg(feature = "RtcTransformEvent")] +#[allow(unused_imports)] +pub use gen_RtcTransformEvent::*; + #[cfg(feature = "RtcTransportStats")] #[allow(non_snake_case)] mod gen_RtcTransportStats; #[cfg(feature = "RtcTransportStats")] +#[allow(unused_imports)] pub use gen_RtcTransportStats::*; #[cfg(feature = "RtcdtmfSender")] #[allow(non_snake_case)] mod gen_RtcdtmfSender; #[cfg(feature = "RtcdtmfSender")] +#[allow(unused_imports)] pub use gen_RtcdtmfSender::*; #[cfg(feature = "RtcdtmfToneChangeEvent")] #[allow(non_snake_case)] mod gen_RtcdtmfToneChangeEvent; #[cfg(feature = "RtcdtmfToneChangeEvent")] +#[allow(unused_imports)] pub use gen_RtcdtmfToneChangeEvent::*; #[cfg(feature = "RtcdtmfToneChangeEventInit")] #[allow(non_snake_case)] mod gen_RtcdtmfToneChangeEventInit; #[cfg(feature = "RtcdtmfToneChangeEventInit")] +#[allow(unused_imports)] pub use gen_RtcdtmfToneChangeEventInit::*; #[cfg(feature = "RtcrtpContributingSourceStats")] #[allow(non_snake_case)] mod gen_RtcrtpContributingSourceStats; #[cfg(feature = "RtcrtpContributingSourceStats")] +#[allow(unused_imports)] pub use gen_RtcrtpContributingSourceStats::*; #[cfg(feature = "RtcrtpStreamStats")] #[allow(non_snake_case)] mod gen_RtcrtpStreamStats; #[cfg(feature = "RtcrtpStreamStats")] +#[allow(unused_imports)] pub use gen_RtcrtpStreamStats::*; +#[cfg(feature = "SFrameTransform")] +#[allow(non_snake_case)] +mod gen_SFrameTransform; +#[cfg(feature = "SFrameTransform")] +#[allow(unused_imports)] +pub use gen_SFrameTransform::*; + +#[cfg(feature = "SFrameTransformErrorEvent")] +#[allow(non_snake_case)] +mod gen_SFrameTransformErrorEvent; +#[cfg(feature = "SFrameTransformErrorEvent")] +#[allow(unused_imports)] +pub use gen_SFrameTransformErrorEvent::*; + +#[cfg(feature = "SFrameTransformErrorEventInit")] +#[allow(non_snake_case)] +mod gen_SFrameTransformErrorEventInit; +#[cfg(feature = "SFrameTransformErrorEventInit")] +#[allow(unused_imports)] +pub use gen_SFrameTransformErrorEventInit::*; + +#[cfg(feature = "SFrameTransformErrorEventType")] +#[allow(non_snake_case)] +mod gen_SFrameTransformErrorEventType; +#[cfg(feature = "SFrameTransformErrorEventType")] +#[allow(unused_imports)] +pub use gen_SFrameTransformErrorEventType::*; + +#[cfg(feature = "SFrameTransformOptions")] +#[allow(non_snake_case)] +mod gen_SFrameTransformOptions; +#[cfg(feature = "SFrameTransformOptions")] +#[allow(unused_imports)] +pub use gen_SFrameTransformOptions::*; + +#[cfg(feature = "SFrameTransformRole")] +#[allow(non_snake_case)] +mod gen_SFrameTransformRole; +#[cfg(feature = "SFrameTransformRole")] +#[allow(unused_imports)] +pub use gen_SFrameTransformRole::*; + +#[cfg(feature = "SaveFilePickerOptions")] +#[allow(non_snake_case)] +mod gen_SaveFilePickerOptions; +#[cfg(feature = "SaveFilePickerOptions")] +#[allow(unused_imports)] +pub use gen_SaveFilePickerOptions::*; + +#[cfg(feature = "Scheduler")] +#[allow(non_snake_case)] +mod gen_Scheduler; +#[cfg(feature = "Scheduler")] +#[allow(unused_imports)] +pub use gen_Scheduler::*; + +#[cfg(feature = "SchedulerPostTaskOptions")] +#[allow(non_snake_case)] +mod gen_SchedulerPostTaskOptions; +#[cfg(feature = "SchedulerPostTaskOptions")] +#[allow(unused_imports)] +pub use gen_SchedulerPostTaskOptions::*; + +#[cfg(feature = "Scheduling")] +#[allow(non_snake_case)] +mod gen_Scheduling; +#[cfg(feature = "Scheduling")] +#[allow(unused_imports)] +pub use gen_Scheduling::*; + #[cfg(feature = "Screen")] #[allow(non_snake_case)] mod gen_Screen; #[cfg(feature = "Screen")] +#[allow(unused_imports)] pub use gen_Screen::*; #[cfg(feature = "ScreenColorGamut")] #[allow(non_snake_case)] mod gen_ScreenColorGamut; #[cfg(feature = "ScreenColorGamut")] +#[allow(unused_imports)] pub use gen_ScreenColorGamut::*; #[cfg(feature = "ScreenLuminance")] #[allow(non_snake_case)] mod gen_ScreenLuminance; #[cfg(feature = "ScreenLuminance")] +#[allow(unused_imports)] pub use gen_ScreenLuminance::*; #[cfg(feature = "ScreenOrientation")] #[allow(non_snake_case)] mod gen_ScreenOrientation; #[cfg(feature = "ScreenOrientation")] +#[allow(unused_imports)] pub use gen_ScreenOrientation::*; #[cfg(feature = "ScriptProcessorNode")] #[allow(non_snake_case)] mod gen_ScriptProcessorNode; #[cfg(feature = "ScriptProcessorNode")] +#[allow(unused_imports)] pub use gen_ScriptProcessorNode::*; #[cfg(feature = "ScrollAreaEvent")] #[allow(non_snake_case)] mod gen_ScrollAreaEvent; #[cfg(feature = "ScrollAreaEvent")] +#[allow(unused_imports)] pub use gen_ScrollAreaEvent::*; #[cfg(feature = "ScrollBehavior")] #[allow(non_snake_case)] mod gen_ScrollBehavior; #[cfg(feature = "ScrollBehavior")] +#[allow(unused_imports)] pub use gen_ScrollBehavior::*; #[cfg(feature = "ScrollBoxObject")] #[allow(non_snake_case)] mod gen_ScrollBoxObject; #[cfg(feature = "ScrollBoxObject")] +#[allow(unused_imports)] pub use gen_ScrollBoxObject::*; #[cfg(feature = "ScrollIntoViewOptions")] #[allow(non_snake_case)] mod gen_ScrollIntoViewOptions; #[cfg(feature = "ScrollIntoViewOptions")] +#[allow(unused_imports)] pub use gen_ScrollIntoViewOptions::*; #[cfg(feature = "ScrollLogicalPosition")] #[allow(non_snake_case)] mod gen_ScrollLogicalPosition; #[cfg(feature = "ScrollLogicalPosition")] +#[allow(unused_imports)] pub use gen_ScrollLogicalPosition::*; #[cfg(feature = "ScrollOptions")] #[allow(non_snake_case)] mod gen_ScrollOptions; #[cfg(feature = "ScrollOptions")] +#[allow(unused_imports)] pub use gen_ScrollOptions::*; #[cfg(feature = "ScrollRestoration")] #[allow(non_snake_case)] mod gen_ScrollRestoration; #[cfg(feature = "ScrollRestoration")] +#[allow(unused_imports)] pub use gen_ScrollRestoration::*; #[cfg(feature = "ScrollSetting")] #[allow(non_snake_case)] mod gen_ScrollSetting; #[cfg(feature = "ScrollSetting")] +#[allow(unused_imports)] pub use gen_ScrollSetting::*; #[cfg(feature = "ScrollState")] #[allow(non_snake_case)] mod gen_ScrollState; #[cfg(feature = "ScrollState")] +#[allow(unused_imports)] pub use gen_ScrollState::*; #[cfg(feature = "ScrollToOptions")] #[allow(non_snake_case)] mod gen_ScrollToOptions; #[cfg(feature = "ScrollToOptions")] +#[allow(unused_imports)] pub use gen_ScrollToOptions::*; #[cfg(feature = "ScrollViewChangeEventInit")] #[allow(non_snake_case)] mod gen_ScrollViewChangeEventInit; #[cfg(feature = "ScrollViewChangeEventInit")] +#[allow(unused_imports)] pub use gen_ScrollViewChangeEventInit::*; #[cfg(feature = "SecurityPolicyViolationEvent")] #[allow(non_snake_case)] mod gen_SecurityPolicyViolationEvent; #[cfg(feature = "SecurityPolicyViolationEvent")] +#[allow(unused_imports)] pub use gen_SecurityPolicyViolationEvent::*; #[cfg(feature = "SecurityPolicyViolationEventDisposition")] #[allow(non_snake_case)] mod gen_SecurityPolicyViolationEventDisposition; #[cfg(feature = "SecurityPolicyViolationEventDisposition")] +#[allow(unused_imports)] pub use gen_SecurityPolicyViolationEventDisposition::*; #[cfg(feature = "SecurityPolicyViolationEventInit")] #[allow(non_snake_case)] mod gen_SecurityPolicyViolationEventInit; #[cfg(feature = "SecurityPolicyViolationEventInit")] +#[allow(unused_imports)] pub use gen_SecurityPolicyViolationEventInit::*; #[cfg(feature = "Selection")] #[allow(non_snake_case)] mod gen_Selection; #[cfg(feature = "Selection")] +#[allow(unused_imports)] pub use gen_Selection::*; +#[cfg(feature = "SelectionMode")] +#[allow(non_snake_case)] +mod gen_SelectionMode; +#[cfg(feature = "SelectionMode")] +#[allow(unused_imports)] +pub use gen_SelectionMode::*; + +#[cfg(feature = "Serial")] +#[allow(non_snake_case)] +mod gen_Serial; +#[cfg(feature = "Serial")] +#[allow(unused_imports)] +pub use gen_Serial::*; + +#[cfg(feature = "SerialInputSignals")] +#[allow(non_snake_case)] +mod gen_SerialInputSignals; +#[cfg(feature = "SerialInputSignals")] +#[allow(unused_imports)] +pub use gen_SerialInputSignals::*; + +#[cfg(feature = "SerialOptions")] +#[allow(non_snake_case)] +mod gen_SerialOptions; +#[cfg(feature = "SerialOptions")] +#[allow(unused_imports)] +pub use gen_SerialOptions::*; + +#[cfg(feature = "SerialOutputSignals")] +#[allow(non_snake_case)] +mod gen_SerialOutputSignals; +#[cfg(feature = "SerialOutputSignals")] +#[allow(unused_imports)] +pub use gen_SerialOutputSignals::*; + +#[cfg(feature = "SerialPort")] +#[allow(non_snake_case)] +mod gen_SerialPort; +#[cfg(feature = "SerialPort")] +#[allow(unused_imports)] +pub use gen_SerialPort::*; + +#[cfg(feature = "SerialPortFilter")] +#[allow(non_snake_case)] +mod gen_SerialPortFilter; +#[cfg(feature = "SerialPortFilter")] +#[allow(unused_imports)] +pub use gen_SerialPortFilter::*; + +#[cfg(feature = "SerialPortInfo")] +#[allow(non_snake_case)] +mod gen_SerialPortInfo; +#[cfg(feature = "SerialPortInfo")] +#[allow(unused_imports)] +pub use gen_SerialPortInfo::*; + +#[cfg(feature = "SerialPortRequestOptions")] +#[allow(non_snake_case)] +mod gen_SerialPortRequestOptions; +#[cfg(feature = "SerialPortRequestOptions")] +#[allow(unused_imports)] +pub use gen_SerialPortRequestOptions::*; + #[cfg(feature = "ServerSocketOptions")] #[allow(non_snake_case)] mod gen_ServerSocketOptions; #[cfg(feature = "ServerSocketOptions")] +#[allow(unused_imports)] pub use gen_ServerSocketOptions::*; #[cfg(feature = "ServiceWorker")] #[allow(non_snake_case)] mod gen_ServiceWorker; #[cfg(feature = "ServiceWorker")] +#[allow(unused_imports)] pub use gen_ServiceWorker::*; #[cfg(feature = "ServiceWorkerContainer")] #[allow(non_snake_case)] mod gen_ServiceWorkerContainer; #[cfg(feature = "ServiceWorkerContainer")] +#[allow(unused_imports)] pub use gen_ServiceWorkerContainer::*; #[cfg(feature = "ServiceWorkerGlobalScope")] #[allow(non_snake_case)] mod gen_ServiceWorkerGlobalScope; #[cfg(feature = "ServiceWorkerGlobalScope")] +#[allow(unused_imports)] pub use gen_ServiceWorkerGlobalScope::*; #[cfg(feature = "ServiceWorkerRegistration")] #[allow(non_snake_case)] mod gen_ServiceWorkerRegistration; #[cfg(feature = "ServiceWorkerRegistration")] +#[allow(unused_imports)] pub use gen_ServiceWorkerRegistration::*; #[cfg(feature = "ServiceWorkerState")] #[allow(non_snake_case)] mod gen_ServiceWorkerState; #[cfg(feature = "ServiceWorkerState")] +#[allow(unused_imports)] pub use gen_ServiceWorkerState::*; #[cfg(feature = "ServiceWorkerUpdateViaCache")] #[allow(non_snake_case)] mod gen_ServiceWorkerUpdateViaCache; #[cfg(feature = "ServiceWorkerUpdateViaCache")] +#[allow(unused_imports)] pub use gen_ServiceWorkerUpdateViaCache::*; #[cfg(feature = "ShadowRoot")] #[allow(non_snake_case)] mod gen_ShadowRoot; #[cfg(feature = "ShadowRoot")] +#[allow(unused_imports)] pub use gen_ShadowRoot::*; #[cfg(feature = "ShadowRootInit")] #[allow(non_snake_case)] mod gen_ShadowRootInit; #[cfg(feature = "ShadowRootInit")] +#[allow(unused_imports)] pub use gen_ShadowRootInit::*; #[cfg(feature = "ShadowRootMode")] #[allow(non_snake_case)] mod gen_ShadowRootMode; #[cfg(feature = "ShadowRootMode")] +#[allow(unused_imports)] pub use gen_ShadowRootMode::*; #[cfg(feature = "ShareData")] #[allow(non_snake_case)] mod gen_ShareData; #[cfg(feature = "ShareData")] +#[allow(unused_imports)] pub use gen_ShareData::*; #[cfg(feature = "SharedWorker")] #[allow(non_snake_case)] mod gen_SharedWorker; #[cfg(feature = "SharedWorker")] +#[allow(unused_imports)] pub use gen_SharedWorker::*; #[cfg(feature = "SharedWorkerGlobalScope")] #[allow(non_snake_case)] mod gen_SharedWorkerGlobalScope; #[cfg(feature = "SharedWorkerGlobalScope")] +#[allow(unused_imports)] pub use gen_SharedWorkerGlobalScope::*; #[cfg(feature = "SignResponse")] #[allow(non_snake_case)] mod gen_SignResponse; #[cfg(feature = "SignResponse")] +#[allow(unused_imports)] pub use gen_SignResponse::*; #[cfg(feature = "SocketElement")] #[allow(non_snake_case)] mod gen_SocketElement; #[cfg(feature = "SocketElement")] +#[allow(unused_imports)] pub use gen_SocketElement::*; #[cfg(feature = "SocketOptions")] #[allow(non_snake_case)] mod gen_SocketOptions; #[cfg(feature = "SocketOptions")] +#[allow(unused_imports)] pub use gen_SocketOptions::*; #[cfg(feature = "SocketReadyState")] #[allow(non_snake_case)] mod gen_SocketReadyState; #[cfg(feature = "SocketReadyState")] +#[allow(unused_imports)] pub use gen_SocketReadyState::*; #[cfg(feature = "SocketsDict")] #[allow(non_snake_case)] mod gen_SocketsDict; #[cfg(feature = "SocketsDict")] +#[allow(unused_imports)] pub use gen_SocketsDict::*; #[cfg(feature = "SourceBuffer")] #[allow(non_snake_case)] mod gen_SourceBuffer; #[cfg(feature = "SourceBuffer")] +#[allow(unused_imports)] pub use gen_SourceBuffer::*; #[cfg(feature = "SourceBufferAppendMode")] #[allow(non_snake_case)] mod gen_SourceBufferAppendMode; #[cfg(feature = "SourceBufferAppendMode")] +#[allow(unused_imports)] pub use gen_SourceBufferAppendMode::*; #[cfg(feature = "SourceBufferList")] #[allow(non_snake_case)] mod gen_SourceBufferList; #[cfg(feature = "SourceBufferList")] +#[allow(unused_imports)] pub use gen_SourceBufferList::*; #[cfg(feature = "SpeechGrammar")] #[allow(non_snake_case)] mod gen_SpeechGrammar; #[cfg(feature = "SpeechGrammar")] +#[allow(unused_imports)] pub use gen_SpeechGrammar::*; #[cfg(feature = "SpeechGrammarList")] #[allow(non_snake_case)] mod gen_SpeechGrammarList; #[cfg(feature = "SpeechGrammarList")] +#[allow(unused_imports)] pub use gen_SpeechGrammarList::*; #[cfg(feature = "SpeechRecognition")] #[allow(non_snake_case)] mod gen_SpeechRecognition; #[cfg(feature = "SpeechRecognition")] +#[allow(unused_imports)] pub use gen_SpeechRecognition::*; #[cfg(feature = "SpeechRecognitionAlternative")] #[allow(non_snake_case)] mod gen_SpeechRecognitionAlternative; #[cfg(feature = "SpeechRecognitionAlternative")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionAlternative::*; #[cfg(feature = "SpeechRecognitionError")] #[allow(non_snake_case)] mod gen_SpeechRecognitionError; #[cfg(feature = "SpeechRecognitionError")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionError::*; #[cfg(feature = "SpeechRecognitionErrorCode")] #[allow(non_snake_case)] mod gen_SpeechRecognitionErrorCode; #[cfg(feature = "SpeechRecognitionErrorCode")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionErrorCode::*; #[cfg(feature = "SpeechRecognitionErrorInit")] #[allow(non_snake_case)] mod gen_SpeechRecognitionErrorInit; #[cfg(feature = "SpeechRecognitionErrorInit")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionErrorInit::*; #[cfg(feature = "SpeechRecognitionEvent")] #[allow(non_snake_case)] mod gen_SpeechRecognitionEvent; #[cfg(feature = "SpeechRecognitionEvent")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionEvent::*; #[cfg(feature = "SpeechRecognitionEventInit")] #[allow(non_snake_case)] mod gen_SpeechRecognitionEventInit; #[cfg(feature = "SpeechRecognitionEventInit")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionEventInit::*; #[cfg(feature = "SpeechRecognitionResult")] #[allow(non_snake_case)] mod gen_SpeechRecognitionResult; #[cfg(feature = "SpeechRecognitionResult")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionResult::*; #[cfg(feature = "SpeechRecognitionResultList")] #[allow(non_snake_case)] mod gen_SpeechRecognitionResultList; #[cfg(feature = "SpeechRecognitionResultList")] +#[allow(unused_imports)] pub use gen_SpeechRecognitionResultList::*; #[cfg(feature = "SpeechSynthesis")] #[allow(non_snake_case)] mod gen_SpeechSynthesis; #[cfg(feature = "SpeechSynthesis")] +#[allow(unused_imports)] pub use gen_SpeechSynthesis::*; #[cfg(feature = "SpeechSynthesisErrorCode")] #[allow(non_snake_case)] mod gen_SpeechSynthesisErrorCode; #[cfg(feature = "SpeechSynthesisErrorCode")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisErrorCode::*; #[cfg(feature = "SpeechSynthesisErrorEvent")] #[allow(non_snake_case)] mod gen_SpeechSynthesisErrorEvent; #[cfg(feature = "SpeechSynthesisErrorEvent")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisErrorEvent::*; #[cfg(feature = "SpeechSynthesisErrorEventInit")] #[allow(non_snake_case)] mod gen_SpeechSynthesisErrorEventInit; #[cfg(feature = "SpeechSynthesisErrorEventInit")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisErrorEventInit::*; #[cfg(feature = "SpeechSynthesisEvent")] #[allow(non_snake_case)] mod gen_SpeechSynthesisEvent; #[cfg(feature = "SpeechSynthesisEvent")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisEvent::*; #[cfg(feature = "SpeechSynthesisEventInit")] #[allow(non_snake_case)] mod gen_SpeechSynthesisEventInit; #[cfg(feature = "SpeechSynthesisEventInit")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisEventInit::*; #[cfg(feature = "SpeechSynthesisUtterance")] #[allow(non_snake_case)] mod gen_SpeechSynthesisUtterance; #[cfg(feature = "SpeechSynthesisUtterance")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisUtterance::*; #[cfg(feature = "SpeechSynthesisVoice")] #[allow(non_snake_case)] mod gen_SpeechSynthesisVoice; #[cfg(feature = "SpeechSynthesisVoice")] +#[allow(unused_imports)] pub use gen_SpeechSynthesisVoice::*; #[cfg(feature = "StereoPannerNode")] #[allow(non_snake_case)] mod gen_StereoPannerNode; #[cfg(feature = "StereoPannerNode")] +#[allow(unused_imports)] pub use gen_StereoPannerNode::*; #[cfg(feature = "StereoPannerOptions")] #[allow(non_snake_case)] mod gen_StereoPannerOptions; #[cfg(feature = "StereoPannerOptions")] +#[allow(unused_imports)] pub use gen_StereoPannerOptions::*; #[cfg(feature = "Storage")] #[allow(non_snake_case)] mod gen_Storage; #[cfg(feature = "Storage")] +#[allow(unused_imports)] pub use gen_Storage::*; #[cfg(feature = "StorageEstimate")] #[allow(non_snake_case)] mod gen_StorageEstimate; #[cfg(feature = "StorageEstimate")] +#[allow(unused_imports)] pub use gen_StorageEstimate::*; #[cfg(feature = "StorageEvent")] #[allow(non_snake_case)] mod gen_StorageEvent; #[cfg(feature = "StorageEvent")] +#[allow(unused_imports)] pub use gen_StorageEvent::*; #[cfg(feature = "StorageEventInit")] #[allow(non_snake_case)] mod gen_StorageEventInit; #[cfg(feature = "StorageEventInit")] +#[allow(unused_imports)] pub use gen_StorageEventInit::*; #[cfg(feature = "StorageManager")] #[allow(non_snake_case)] mod gen_StorageManager; #[cfg(feature = "StorageManager")] +#[allow(unused_imports)] pub use gen_StorageManager::*; #[cfg(feature = "StorageType")] #[allow(non_snake_case)] mod gen_StorageType; #[cfg(feature = "StorageType")] +#[allow(unused_imports)] pub use gen_StorageType::*; #[cfg(feature = "StreamPipeOptions")] #[allow(non_snake_case)] mod gen_StreamPipeOptions; #[cfg(feature = "StreamPipeOptions")] +#[allow(unused_imports)] pub use gen_StreamPipeOptions::*; #[cfg(feature = "StyleRuleChangeEventInit")] #[allow(non_snake_case)] mod gen_StyleRuleChangeEventInit; #[cfg(feature = "StyleRuleChangeEventInit")] +#[allow(unused_imports)] pub use gen_StyleRuleChangeEventInit::*; #[cfg(feature = "StyleSheet")] #[allow(non_snake_case)] mod gen_StyleSheet; #[cfg(feature = "StyleSheet")] +#[allow(unused_imports)] pub use gen_StyleSheet::*; #[cfg(feature = "StyleSheetApplicableStateChangeEventInit")] #[allow(non_snake_case)] mod gen_StyleSheetApplicableStateChangeEventInit; #[cfg(feature = "StyleSheetApplicableStateChangeEventInit")] +#[allow(unused_imports)] pub use gen_StyleSheetApplicableStateChangeEventInit::*; #[cfg(feature = "StyleSheetChangeEventInit")] #[allow(non_snake_case)] mod gen_StyleSheetChangeEventInit; #[cfg(feature = "StyleSheetChangeEventInit")] +#[allow(unused_imports)] pub use gen_StyleSheetChangeEventInit::*; #[cfg(feature = "StyleSheetList")] #[allow(non_snake_case)] mod gen_StyleSheetList; #[cfg(feature = "StyleSheetList")] +#[allow(unused_imports)] pub use gen_StyleSheetList::*; +#[cfg(feature = "SubmitEvent")] +#[allow(non_snake_case)] +mod gen_SubmitEvent; +#[cfg(feature = "SubmitEvent")] +#[allow(unused_imports)] +pub use gen_SubmitEvent::*; + +#[cfg(feature = "SubmitEventInit")] +#[allow(non_snake_case)] +mod gen_SubmitEventInit; +#[cfg(feature = "SubmitEventInit")] +#[allow(unused_imports)] +pub use gen_SubmitEventInit::*; + #[cfg(feature = "SubtleCrypto")] #[allow(non_snake_case)] mod gen_SubtleCrypto; #[cfg(feature = "SubtleCrypto")] +#[allow(unused_imports)] pub use gen_SubtleCrypto::*; #[cfg(feature = "SupportedType")] #[allow(non_snake_case)] mod gen_SupportedType; #[cfg(feature = "SupportedType")] +#[allow(unused_imports)] pub use gen_SupportedType::*; #[cfg(feature = "SvcOutputMetadata")] #[allow(non_snake_case)] mod gen_SvcOutputMetadata; #[cfg(feature = "SvcOutputMetadata")] +#[allow(unused_imports)] pub use gen_SvcOutputMetadata::*; #[cfg(feature = "SvgAngle")] #[allow(non_snake_case)] mod gen_SvgAngle; #[cfg(feature = "SvgAngle")] +#[allow(unused_imports)] pub use gen_SvgAngle::*; #[cfg(feature = "SvgAnimateElement")] #[allow(non_snake_case)] mod gen_SvgAnimateElement; #[cfg(feature = "SvgAnimateElement")] +#[allow(unused_imports)] pub use gen_SvgAnimateElement::*; #[cfg(feature = "SvgAnimateMotionElement")] #[allow(non_snake_case)] mod gen_SvgAnimateMotionElement; #[cfg(feature = "SvgAnimateMotionElement")] +#[allow(unused_imports)] pub use gen_SvgAnimateMotionElement::*; #[cfg(feature = "SvgAnimateTransformElement")] #[allow(non_snake_case)] mod gen_SvgAnimateTransformElement; #[cfg(feature = "SvgAnimateTransformElement")] +#[allow(unused_imports)] pub use gen_SvgAnimateTransformElement::*; #[cfg(feature = "SvgAnimatedAngle")] #[allow(non_snake_case)] mod gen_SvgAnimatedAngle; #[cfg(feature = "SvgAnimatedAngle")] +#[allow(unused_imports)] pub use gen_SvgAnimatedAngle::*; #[cfg(feature = "SvgAnimatedBoolean")] #[allow(non_snake_case)] mod gen_SvgAnimatedBoolean; #[cfg(feature = "SvgAnimatedBoolean")] +#[allow(unused_imports)] pub use gen_SvgAnimatedBoolean::*; #[cfg(feature = "SvgAnimatedEnumeration")] #[allow(non_snake_case)] mod gen_SvgAnimatedEnumeration; #[cfg(feature = "SvgAnimatedEnumeration")] +#[allow(unused_imports)] pub use gen_SvgAnimatedEnumeration::*; #[cfg(feature = "SvgAnimatedInteger")] #[allow(non_snake_case)] mod gen_SvgAnimatedInteger; #[cfg(feature = "SvgAnimatedInteger")] +#[allow(unused_imports)] pub use gen_SvgAnimatedInteger::*; #[cfg(feature = "SvgAnimatedLength")] #[allow(non_snake_case)] mod gen_SvgAnimatedLength; #[cfg(feature = "SvgAnimatedLength")] +#[allow(unused_imports)] pub use gen_SvgAnimatedLength::*; #[cfg(feature = "SvgAnimatedLengthList")] #[allow(non_snake_case)] mod gen_SvgAnimatedLengthList; #[cfg(feature = "SvgAnimatedLengthList")] +#[allow(unused_imports)] pub use gen_SvgAnimatedLengthList::*; #[cfg(feature = "SvgAnimatedNumber")] #[allow(non_snake_case)] mod gen_SvgAnimatedNumber; #[cfg(feature = "SvgAnimatedNumber")] +#[allow(unused_imports)] pub use gen_SvgAnimatedNumber::*; #[cfg(feature = "SvgAnimatedNumberList")] #[allow(non_snake_case)] mod gen_SvgAnimatedNumberList; #[cfg(feature = "SvgAnimatedNumberList")] +#[allow(unused_imports)] pub use gen_SvgAnimatedNumberList::*; #[cfg(feature = "SvgAnimatedPreserveAspectRatio")] #[allow(non_snake_case)] mod gen_SvgAnimatedPreserveAspectRatio; #[cfg(feature = "SvgAnimatedPreserveAspectRatio")] +#[allow(unused_imports)] pub use gen_SvgAnimatedPreserveAspectRatio::*; #[cfg(feature = "SvgAnimatedRect")] #[allow(non_snake_case)] mod gen_SvgAnimatedRect; #[cfg(feature = "SvgAnimatedRect")] +#[allow(unused_imports)] pub use gen_SvgAnimatedRect::*; #[cfg(feature = "SvgAnimatedString")] #[allow(non_snake_case)] mod gen_SvgAnimatedString; #[cfg(feature = "SvgAnimatedString")] +#[allow(unused_imports)] pub use gen_SvgAnimatedString::*; #[cfg(feature = "SvgAnimatedTransformList")] #[allow(non_snake_case)] mod gen_SvgAnimatedTransformList; #[cfg(feature = "SvgAnimatedTransformList")] +#[allow(unused_imports)] pub use gen_SvgAnimatedTransformList::*; #[cfg(feature = "SvgAnimationElement")] #[allow(non_snake_case)] mod gen_SvgAnimationElement; #[cfg(feature = "SvgAnimationElement")] +#[allow(unused_imports)] pub use gen_SvgAnimationElement::*; #[cfg(feature = "SvgBoundingBoxOptions")] #[allow(non_snake_case)] mod gen_SvgBoundingBoxOptions; #[cfg(feature = "SvgBoundingBoxOptions")] +#[allow(unused_imports)] pub use gen_SvgBoundingBoxOptions::*; #[cfg(feature = "SvgCircleElement")] #[allow(non_snake_case)] mod gen_SvgCircleElement; #[cfg(feature = "SvgCircleElement")] +#[allow(unused_imports)] pub use gen_SvgCircleElement::*; #[cfg(feature = "SvgClipPathElement")] #[allow(non_snake_case)] mod gen_SvgClipPathElement; #[cfg(feature = "SvgClipPathElement")] +#[allow(unused_imports)] pub use gen_SvgClipPathElement::*; #[cfg(feature = "SvgComponentTransferFunctionElement")] #[allow(non_snake_case)] mod gen_SvgComponentTransferFunctionElement; #[cfg(feature = "SvgComponentTransferFunctionElement")] +#[allow(unused_imports)] pub use gen_SvgComponentTransferFunctionElement::*; #[cfg(feature = "SvgDefsElement")] #[allow(non_snake_case)] mod gen_SvgDefsElement; #[cfg(feature = "SvgDefsElement")] +#[allow(unused_imports)] pub use gen_SvgDefsElement::*; #[cfg(feature = "SvgDescElement")] #[allow(non_snake_case)] mod gen_SvgDescElement; #[cfg(feature = "SvgDescElement")] +#[allow(unused_imports)] pub use gen_SvgDescElement::*; #[cfg(feature = "SvgElement")] #[allow(non_snake_case)] mod gen_SvgElement; #[cfg(feature = "SvgElement")] +#[allow(unused_imports)] pub use gen_SvgElement::*; #[cfg(feature = "SvgEllipseElement")] #[allow(non_snake_case)] mod gen_SvgEllipseElement; #[cfg(feature = "SvgEllipseElement")] +#[allow(unused_imports)] pub use gen_SvgEllipseElement::*; #[cfg(feature = "SvgFilterElement")] #[allow(non_snake_case)] mod gen_SvgFilterElement; #[cfg(feature = "SvgFilterElement")] +#[allow(unused_imports)] pub use gen_SvgFilterElement::*; #[cfg(feature = "SvgForeignObjectElement")] #[allow(non_snake_case)] mod gen_SvgForeignObjectElement; #[cfg(feature = "SvgForeignObjectElement")] +#[allow(unused_imports)] pub use gen_SvgForeignObjectElement::*; #[cfg(feature = "SvgGeometryElement")] #[allow(non_snake_case)] mod gen_SvgGeometryElement; #[cfg(feature = "SvgGeometryElement")] +#[allow(unused_imports)] pub use gen_SvgGeometryElement::*; #[cfg(feature = "SvgGradientElement")] #[allow(non_snake_case)] mod gen_SvgGradientElement; #[cfg(feature = "SvgGradientElement")] +#[allow(unused_imports)] pub use gen_SvgGradientElement::*; #[cfg(feature = "SvgGraphicsElement")] #[allow(non_snake_case)] mod gen_SvgGraphicsElement; #[cfg(feature = "SvgGraphicsElement")] +#[allow(unused_imports)] pub use gen_SvgGraphicsElement::*; #[cfg(feature = "SvgImageElement")] #[allow(non_snake_case)] mod gen_SvgImageElement; #[cfg(feature = "SvgImageElement")] +#[allow(unused_imports)] pub use gen_SvgImageElement::*; #[cfg(feature = "SvgLength")] #[allow(non_snake_case)] mod gen_SvgLength; #[cfg(feature = "SvgLength")] +#[allow(unused_imports)] pub use gen_SvgLength::*; #[cfg(feature = "SvgLengthList")] #[allow(non_snake_case)] mod gen_SvgLengthList; #[cfg(feature = "SvgLengthList")] +#[allow(unused_imports)] pub use gen_SvgLengthList::*; #[cfg(feature = "SvgLineElement")] #[allow(non_snake_case)] mod gen_SvgLineElement; #[cfg(feature = "SvgLineElement")] +#[allow(unused_imports)] pub use gen_SvgLineElement::*; #[cfg(feature = "SvgLinearGradientElement")] #[allow(non_snake_case)] mod gen_SvgLinearGradientElement; #[cfg(feature = "SvgLinearGradientElement")] +#[allow(unused_imports)] pub use gen_SvgLinearGradientElement::*; #[cfg(feature = "SvgMarkerElement")] #[allow(non_snake_case)] mod gen_SvgMarkerElement; #[cfg(feature = "SvgMarkerElement")] +#[allow(unused_imports)] pub use gen_SvgMarkerElement::*; #[cfg(feature = "SvgMaskElement")] #[allow(non_snake_case)] mod gen_SvgMaskElement; #[cfg(feature = "SvgMaskElement")] +#[allow(unused_imports)] pub use gen_SvgMaskElement::*; #[cfg(feature = "SvgMatrix")] #[allow(non_snake_case)] mod gen_SvgMatrix; #[cfg(feature = "SvgMatrix")] +#[allow(unused_imports)] pub use gen_SvgMatrix::*; #[cfg(feature = "SvgMetadataElement")] #[allow(non_snake_case)] mod gen_SvgMetadataElement; #[cfg(feature = "SvgMetadataElement")] +#[allow(unused_imports)] pub use gen_SvgMetadataElement::*; #[cfg(feature = "SvgNumber")] #[allow(non_snake_case)] mod gen_SvgNumber; #[cfg(feature = "SvgNumber")] +#[allow(unused_imports)] pub use gen_SvgNumber::*; #[cfg(feature = "SvgNumberList")] #[allow(non_snake_case)] mod gen_SvgNumberList; #[cfg(feature = "SvgNumberList")] +#[allow(unused_imports)] pub use gen_SvgNumberList::*; #[cfg(feature = "SvgPathElement")] #[allow(non_snake_case)] mod gen_SvgPathElement; #[cfg(feature = "SvgPathElement")] +#[allow(unused_imports)] pub use gen_SvgPathElement::*; #[cfg(feature = "SvgPathSeg")] #[allow(non_snake_case)] mod gen_SvgPathSeg; #[cfg(feature = "SvgPathSeg")] +#[allow(unused_imports)] pub use gen_SvgPathSeg::*; #[cfg(feature = "SvgPathSegArcAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegArcAbs; #[cfg(feature = "SvgPathSegArcAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegArcAbs::*; #[cfg(feature = "SvgPathSegArcRel")] #[allow(non_snake_case)] mod gen_SvgPathSegArcRel; #[cfg(feature = "SvgPathSegArcRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegArcRel::*; #[cfg(feature = "SvgPathSegClosePath")] #[allow(non_snake_case)] mod gen_SvgPathSegClosePath; #[cfg(feature = "SvgPathSegClosePath")] +#[allow(unused_imports)] pub use gen_SvgPathSegClosePath::*; #[cfg(feature = "SvgPathSegCurvetoCubicAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoCubicAbs; #[cfg(feature = "SvgPathSegCurvetoCubicAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoCubicAbs::*; #[cfg(feature = "SvgPathSegCurvetoCubicRel")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoCubicRel; #[cfg(feature = "SvgPathSegCurvetoCubicRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoCubicRel::*; #[cfg(feature = "SvgPathSegCurvetoCubicSmoothAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoCubicSmoothAbs; #[cfg(feature = "SvgPathSegCurvetoCubicSmoothAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoCubicSmoothAbs::*; #[cfg(feature = "SvgPathSegCurvetoCubicSmoothRel")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoCubicSmoothRel; #[cfg(feature = "SvgPathSegCurvetoCubicSmoothRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoCubicSmoothRel::*; #[cfg(feature = "SvgPathSegCurvetoQuadraticAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoQuadraticAbs; #[cfg(feature = "SvgPathSegCurvetoQuadraticAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoQuadraticAbs::*; #[cfg(feature = "SvgPathSegCurvetoQuadraticRel")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoQuadraticRel; #[cfg(feature = "SvgPathSegCurvetoQuadraticRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoQuadraticRel::*; #[cfg(feature = "SvgPathSegCurvetoQuadraticSmoothAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoQuadraticSmoothAbs; #[cfg(feature = "SvgPathSegCurvetoQuadraticSmoothAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoQuadraticSmoothAbs::*; #[cfg(feature = "SvgPathSegCurvetoQuadraticSmoothRel")] #[allow(non_snake_case)] mod gen_SvgPathSegCurvetoQuadraticSmoothRel; #[cfg(feature = "SvgPathSegCurvetoQuadraticSmoothRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegCurvetoQuadraticSmoothRel::*; #[cfg(feature = "SvgPathSegLinetoAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoAbs; #[cfg(feature = "SvgPathSegLinetoAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoAbs::*; #[cfg(feature = "SvgPathSegLinetoHorizontalAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoHorizontalAbs; #[cfg(feature = "SvgPathSegLinetoHorizontalAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoHorizontalAbs::*; #[cfg(feature = "SvgPathSegLinetoHorizontalRel")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoHorizontalRel; #[cfg(feature = "SvgPathSegLinetoHorizontalRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoHorizontalRel::*; #[cfg(feature = "SvgPathSegLinetoRel")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoRel; #[cfg(feature = "SvgPathSegLinetoRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoRel::*; #[cfg(feature = "SvgPathSegLinetoVerticalAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoVerticalAbs; #[cfg(feature = "SvgPathSegLinetoVerticalAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoVerticalAbs::*; #[cfg(feature = "SvgPathSegLinetoVerticalRel")] #[allow(non_snake_case)] mod gen_SvgPathSegLinetoVerticalRel; #[cfg(feature = "SvgPathSegLinetoVerticalRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegLinetoVerticalRel::*; #[cfg(feature = "SvgPathSegList")] #[allow(non_snake_case)] mod gen_SvgPathSegList; #[cfg(feature = "SvgPathSegList")] +#[allow(unused_imports)] pub use gen_SvgPathSegList::*; #[cfg(feature = "SvgPathSegMovetoAbs")] #[allow(non_snake_case)] mod gen_SvgPathSegMovetoAbs; #[cfg(feature = "SvgPathSegMovetoAbs")] +#[allow(unused_imports)] pub use gen_SvgPathSegMovetoAbs::*; #[cfg(feature = "SvgPathSegMovetoRel")] #[allow(non_snake_case)] mod gen_SvgPathSegMovetoRel; #[cfg(feature = "SvgPathSegMovetoRel")] +#[allow(unused_imports)] pub use gen_SvgPathSegMovetoRel::*; #[cfg(feature = "SvgPatternElement")] #[allow(non_snake_case)] mod gen_SvgPatternElement; #[cfg(feature = "SvgPatternElement")] +#[allow(unused_imports)] pub use gen_SvgPatternElement::*; #[cfg(feature = "SvgPoint")] #[allow(non_snake_case)] mod gen_SvgPoint; #[cfg(feature = "SvgPoint")] +#[allow(unused_imports)] pub use gen_SvgPoint::*; #[cfg(feature = "SvgPointList")] #[allow(non_snake_case)] mod gen_SvgPointList; #[cfg(feature = "SvgPointList")] +#[allow(unused_imports)] pub use gen_SvgPointList::*; #[cfg(feature = "SvgPolygonElement")] #[allow(non_snake_case)] mod gen_SvgPolygonElement; #[cfg(feature = "SvgPolygonElement")] +#[allow(unused_imports)] pub use gen_SvgPolygonElement::*; #[cfg(feature = "SvgPolylineElement")] #[allow(non_snake_case)] mod gen_SvgPolylineElement; #[cfg(feature = "SvgPolylineElement")] +#[allow(unused_imports)] pub use gen_SvgPolylineElement::*; #[cfg(feature = "SvgPreserveAspectRatio")] #[allow(non_snake_case)] mod gen_SvgPreserveAspectRatio; #[cfg(feature = "SvgPreserveAspectRatio")] +#[allow(unused_imports)] pub use gen_SvgPreserveAspectRatio::*; #[cfg(feature = "SvgRadialGradientElement")] #[allow(non_snake_case)] mod gen_SvgRadialGradientElement; #[cfg(feature = "SvgRadialGradientElement")] +#[allow(unused_imports)] pub use gen_SvgRadialGradientElement::*; #[cfg(feature = "SvgRect")] #[allow(non_snake_case)] mod gen_SvgRect; #[cfg(feature = "SvgRect")] +#[allow(unused_imports)] pub use gen_SvgRect::*; #[cfg(feature = "SvgRectElement")] #[allow(non_snake_case)] mod gen_SvgRectElement; #[cfg(feature = "SvgRectElement")] +#[allow(unused_imports)] pub use gen_SvgRectElement::*; #[cfg(feature = "SvgScriptElement")] #[allow(non_snake_case)] mod gen_SvgScriptElement; #[cfg(feature = "SvgScriptElement")] +#[allow(unused_imports)] pub use gen_SvgScriptElement::*; #[cfg(feature = "SvgSetElement")] #[allow(non_snake_case)] mod gen_SvgSetElement; #[cfg(feature = "SvgSetElement")] +#[allow(unused_imports)] pub use gen_SvgSetElement::*; #[cfg(feature = "SvgStopElement")] #[allow(non_snake_case)] mod gen_SvgStopElement; #[cfg(feature = "SvgStopElement")] +#[allow(unused_imports)] pub use gen_SvgStopElement::*; #[cfg(feature = "SvgStringList")] #[allow(non_snake_case)] mod gen_SvgStringList; #[cfg(feature = "SvgStringList")] +#[allow(unused_imports)] pub use gen_SvgStringList::*; #[cfg(feature = "SvgStyleElement")] #[allow(non_snake_case)] mod gen_SvgStyleElement; #[cfg(feature = "SvgStyleElement")] +#[allow(unused_imports)] pub use gen_SvgStyleElement::*; #[cfg(feature = "SvgSwitchElement")] #[allow(non_snake_case)] mod gen_SvgSwitchElement; #[cfg(feature = "SvgSwitchElement")] +#[allow(unused_imports)] pub use gen_SvgSwitchElement::*; #[cfg(feature = "SvgSymbolElement")] #[allow(non_snake_case)] mod gen_SvgSymbolElement; #[cfg(feature = "SvgSymbolElement")] +#[allow(unused_imports)] pub use gen_SvgSymbolElement::*; #[cfg(feature = "SvgTextContentElement")] #[allow(non_snake_case)] mod gen_SvgTextContentElement; #[cfg(feature = "SvgTextContentElement")] +#[allow(unused_imports)] pub use gen_SvgTextContentElement::*; #[cfg(feature = "SvgTextElement")] #[allow(non_snake_case)] mod gen_SvgTextElement; #[cfg(feature = "SvgTextElement")] +#[allow(unused_imports)] pub use gen_SvgTextElement::*; #[cfg(feature = "SvgTextPathElement")] #[allow(non_snake_case)] mod gen_SvgTextPathElement; #[cfg(feature = "SvgTextPathElement")] +#[allow(unused_imports)] pub use gen_SvgTextPathElement::*; #[cfg(feature = "SvgTextPositioningElement")] #[allow(non_snake_case)] mod gen_SvgTextPositioningElement; #[cfg(feature = "SvgTextPositioningElement")] +#[allow(unused_imports)] pub use gen_SvgTextPositioningElement::*; #[cfg(feature = "SvgTitleElement")] #[allow(non_snake_case)] mod gen_SvgTitleElement; #[cfg(feature = "SvgTitleElement")] +#[allow(unused_imports)] pub use gen_SvgTitleElement::*; #[cfg(feature = "SvgTransform")] #[allow(non_snake_case)] mod gen_SvgTransform; #[cfg(feature = "SvgTransform")] +#[allow(unused_imports)] pub use gen_SvgTransform::*; #[cfg(feature = "SvgTransformList")] #[allow(non_snake_case)] mod gen_SvgTransformList; #[cfg(feature = "SvgTransformList")] +#[allow(unused_imports)] pub use gen_SvgTransformList::*; #[cfg(feature = "SvgUnitTypes")] #[allow(non_snake_case)] mod gen_SvgUnitTypes; #[cfg(feature = "SvgUnitTypes")] +#[allow(unused_imports)] pub use gen_SvgUnitTypes::*; #[cfg(feature = "SvgUseElement")] #[allow(non_snake_case)] mod gen_SvgUseElement; #[cfg(feature = "SvgUseElement")] +#[allow(unused_imports)] pub use gen_SvgUseElement::*; #[cfg(feature = "SvgViewElement")] #[allow(non_snake_case)] mod gen_SvgViewElement; #[cfg(feature = "SvgViewElement")] +#[allow(unused_imports)] pub use gen_SvgViewElement::*; #[cfg(feature = "SvgZoomAndPan")] #[allow(non_snake_case)] mod gen_SvgZoomAndPan; #[cfg(feature = "SvgZoomAndPan")] +#[allow(unused_imports)] pub use gen_SvgZoomAndPan::*; #[cfg(feature = "SvgaElement")] #[allow(non_snake_case)] mod gen_SvgaElement; #[cfg(feature = "SvgaElement")] +#[allow(unused_imports)] pub use gen_SvgaElement::*; #[cfg(feature = "SvgfeBlendElement")] #[allow(non_snake_case)] mod gen_SvgfeBlendElement; #[cfg(feature = "SvgfeBlendElement")] +#[allow(unused_imports)] pub use gen_SvgfeBlendElement::*; #[cfg(feature = "SvgfeColorMatrixElement")] #[allow(non_snake_case)] mod gen_SvgfeColorMatrixElement; #[cfg(feature = "SvgfeColorMatrixElement")] +#[allow(unused_imports)] pub use gen_SvgfeColorMatrixElement::*; #[cfg(feature = "SvgfeComponentTransferElement")] #[allow(non_snake_case)] mod gen_SvgfeComponentTransferElement; #[cfg(feature = "SvgfeComponentTransferElement")] +#[allow(unused_imports)] pub use gen_SvgfeComponentTransferElement::*; #[cfg(feature = "SvgfeCompositeElement")] #[allow(non_snake_case)] mod gen_SvgfeCompositeElement; #[cfg(feature = "SvgfeCompositeElement")] +#[allow(unused_imports)] pub use gen_SvgfeCompositeElement::*; #[cfg(feature = "SvgfeConvolveMatrixElement")] #[allow(non_snake_case)] mod gen_SvgfeConvolveMatrixElement; #[cfg(feature = "SvgfeConvolveMatrixElement")] +#[allow(unused_imports)] pub use gen_SvgfeConvolveMatrixElement::*; #[cfg(feature = "SvgfeDiffuseLightingElement")] #[allow(non_snake_case)] mod gen_SvgfeDiffuseLightingElement; #[cfg(feature = "SvgfeDiffuseLightingElement")] +#[allow(unused_imports)] pub use gen_SvgfeDiffuseLightingElement::*; #[cfg(feature = "SvgfeDisplacementMapElement")] #[allow(non_snake_case)] mod gen_SvgfeDisplacementMapElement; #[cfg(feature = "SvgfeDisplacementMapElement")] +#[allow(unused_imports)] pub use gen_SvgfeDisplacementMapElement::*; #[cfg(feature = "SvgfeDistantLightElement")] #[allow(non_snake_case)] mod gen_SvgfeDistantLightElement; #[cfg(feature = "SvgfeDistantLightElement")] +#[allow(unused_imports)] pub use gen_SvgfeDistantLightElement::*; #[cfg(feature = "SvgfeDropShadowElement")] #[allow(non_snake_case)] mod gen_SvgfeDropShadowElement; #[cfg(feature = "SvgfeDropShadowElement")] +#[allow(unused_imports)] pub use gen_SvgfeDropShadowElement::*; #[cfg(feature = "SvgfeFloodElement")] #[allow(non_snake_case)] mod gen_SvgfeFloodElement; #[cfg(feature = "SvgfeFloodElement")] +#[allow(unused_imports)] pub use gen_SvgfeFloodElement::*; #[cfg(feature = "SvgfeFuncAElement")] #[allow(non_snake_case)] mod gen_SvgfeFuncAElement; #[cfg(feature = "SvgfeFuncAElement")] +#[allow(unused_imports)] pub use gen_SvgfeFuncAElement::*; #[cfg(feature = "SvgfeFuncBElement")] #[allow(non_snake_case)] mod gen_SvgfeFuncBElement; #[cfg(feature = "SvgfeFuncBElement")] +#[allow(unused_imports)] pub use gen_SvgfeFuncBElement::*; #[cfg(feature = "SvgfeFuncGElement")] #[allow(non_snake_case)] mod gen_SvgfeFuncGElement; #[cfg(feature = "SvgfeFuncGElement")] +#[allow(unused_imports)] pub use gen_SvgfeFuncGElement::*; #[cfg(feature = "SvgfeFuncRElement")] #[allow(non_snake_case)] mod gen_SvgfeFuncRElement; #[cfg(feature = "SvgfeFuncRElement")] +#[allow(unused_imports)] pub use gen_SvgfeFuncRElement::*; #[cfg(feature = "SvgfeGaussianBlurElement")] #[allow(non_snake_case)] mod gen_SvgfeGaussianBlurElement; #[cfg(feature = "SvgfeGaussianBlurElement")] +#[allow(unused_imports)] pub use gen_SvgfeGaussianBlurElement::*; #[cfg(feature = "SvgfeImageElement")] #[allow(non_snake_case)] mod gen_SvgfeImageElement; #[cfg(feature = "SvgfeImageElement")] +#[allow(unused_imports)] pub use gen_SvgfeImageElement::*; #[cfg(feature = "SvgfeMergeElement")] #[allow(non_snake_case)] mod gen_SvgfeMergeElement; #[cfg(feature = "SvgfeMergeElement")] +#[allow(unused_imports)] pub use gen_SvgfeMergeElement::*; #[cfg(feature = "SvgfeMergeNodeElement")] #[allow(non_snake_case)] mod gen_SvgfeMergeNodeElement; #[cfg(feature = "SvgfeMergeNodeElement")] +#[allow(unused_imports)] pub use gen_SvgfeMergeNodeElement::*; #[cfg(feature = "SvgfeMorphologyElement")] #[allow(non_snake_case)] mod gen_SvgfeMorphologyElement; #[cfg(feature = "SvgfeMorphologyElement")] +#[allow(unused_imports)] pub use gen_SvgfeMorphologyElement::*; #[cfg(feature = "SvgfeOffsetElement")] #[allow(non_snake_case)] mod gen_SvgfeOffsetElement; #[cfg(feature = "SvgfeOffsetElement")] +#[allow(unused_imports)] pub use gen_SvgfeOffsetElement::*; #[cfg(feature = "SvgfePointLightElement")] #[allow(non_snake_case)] mod gen_SvgfePointLightElement; #[cfg(feature = "SvgfePointLightElement")] +#[allow(unused_imports)] pub use gen_SvgfePointLightElement::*; #[cfg(feature = "SvgfeSpecularLightingElement")] #[allow(non_snake_case)] mod gen_SvgfeSpecularLightingElement; #[cfg(feature = "SvgfeSpecularLightingElement")] +#[allow(unused_imports)] pub use gen_SvgfeSpecularLightingElement::*; #[cfg(feature = "SvgfeSpotLightElement")] #[allow(non_snake_case)] mod gen_SvgfeSpotLightElement; #[cfg(feature = "SvgfeSpotLightElement")] +#[allow(unused_imports)] pub use gen_SvgfeSpotLightElement::*; #[cfg(feature = "SvgfeTileElement")] #[allow(non_snake_case)] mod gen_SvgfeTileElement; #[cfg(feature = "SvgfeTileElement")] +#[allow(unused_imports)] pub use gen_SvgfeTileElement::*; #[cfg(feature = "SvgfeTurbulenceElement")] #[allow(non_snake_case)] mod gen_SvgfeTurbulenceElement; #[cfg(feature = "SvgfeTurbulenceElement")] +#[allow(unused_imports)] pub use gen_SvgfeTurbulenceElement::*; #[cfg(feature = "SvggElement")] #[allow(non_snake_case)] mod gen_SvggElement; #[cfg(feature = "SvggElement")] +#[allow(unused_imports)] pub use gen_SvggElement::*; #[cfg(feature = "SvgmPathElement")] #[allow(non_snake_case)] mod gen_SvgmPathElement; #[cfg(feature = "SvgmPathElement")] +#[allow(unused_imports)] pub use gen_SvgmPathElement::*; #[cfg(feature = "SvgsvgElement")] #[allow(non_snake_case)] mod gen_SvgsvgElement; #[cfg(feature = "SvgsvgElement")] +#[allow(unused_imports)] pub use gen_SvgsvgElement::*; #[cfg(feature = "SvgtSpanElement")] #[allow(non_snake_case)] mod gen_SvgtSpanElement; #[cfg(feature = "SvgtSpanElement")] +#[allow(unused_imports)] pub use gen_SvgtSpanElement::*; +#[cfg(feature = "TaskController")] +#[allow(non_snake_case)] +mod gen_TaskController; +#[cfg(feature = "TaskController")] +#[allow(unused_imports)] +pub use gen_TaskController::*; + +#[cfg(feature = "TaskControllerInit")] +#[allow(non_snake_case)] +mod gen_TaskControllerInit; +#[cfg(feature = "TaskControllerInit")] +#[allow(unused_imports)] +pub use gen_TaskControllerInit::*; + +#[cfg(feature = "TaskPriority")] +#[allow(non_snake_case)] +mod gen_TaskPriority; +#[cfg(feature = "TaskPriority")] +#[allow(unused_imports)] +pub use gen_TaskPriority::*; + +#[cfg(feature = "TaskPriorityChangeEvent")] +#[allow(non_snake_case)] +mod gen_TaskPriorityChangeEvent; +#[cfg(feature = "TaskPriorityChangeEvent")] +#[allow(unused_imports)] +pub use gen_TaskPriorityChangeEvent::*; + +#[cfg(feature = "TaskPriorityChangeEventInit")] +#[allow(non_snake_case)] +mod gen_TaskPriorityChangeEventInit; +#[cfg(feature = "TaskPriorityChangeEventInit")] +#[allow(unused_imports)] +pub use gen_TaskPriorityChangeEventInit::*; + +#[cfg(feature = "TaskSignal")] +#[allow(non_snake_case)] +mod gen_TaskSignal; +#[cfg(feature = "TaskSignal")] +#[allow(unused_imports)] +pub use gen_TaskSignal::*; + +#[cfg(feature = "TaskSignalAnyInit")] +#[allow(non_snake_case)] +mod gen_TaskSignalAnyInit; +#[cfg(feature = "TaskSignalAnyInit")] +#[allow(unused_imports)] +pub use gen_TaskSignalAnyInit::*; + #[cfg(feature = "TcpReadyState")] #[allow(non_snake_case)] mod gen_TcpReadyState; #[cfg(feature = "TcpReadyState")] +#[allow(unused_imports)] pub use gen_TcpReadyState::*; #[cfg(feature = "TcpServerSocket")] #[allow(non_snake_case)] mod gen_TcpServerSocket; #[cfg(feature = "TcpServerSocket")] +#[allow(unused_imports)] pub use gen_TcpServerSocket::*; #[cfg(feature = "TcpServerSocketEvent")] #[allow(non_snake_case)] mod gen_TcpServerSocketEvent; #[cfg(feature = "TcpServerSocketEvent")] +#[allow(unused_imports)] pub use gen_TcpServerSocketEvent::*; #[cfg(feature = "TcpServerSocketEventInit")] #[allow(non_snake_case)] mod gen_TcpServerSocketEventInit; #[cfg(feature = "TcpServerSocketEventInit")] +#[allow(unused_imports)] pub use gen_TcpServerSocketEventInit::*; #[cfg(feature = "TcpSocket")] #[allow(non_snake_case)] mod gen_TcpSocket; #[cfg(feature = "TcpSocket")] +#[allow(unused_imports)] pub use gen_TcpSocket::*; #[cfg(feature = "TcpSocketBinaryType")] #[allow(non_snake_case)] mod gen_TcpSocketBinaryType; #[cfg(feature = "TcpSocketBinaryType")] +#[allow(unused_imports)] pub use gen_TcpSocketBinaryType::*; #[cfg(feature = "TcpSocketErrorEvent")] #[allow(non_snake_case)] mod gen_TcpSocketErrorEvent; #[cfg(feature = "TcpSocketErrorEvent")] +#[allow(unused_imports)] pub use gen_TcpSocketErrorEvent::*; #[cfg(feature = "TcpSocketErrorEventInit")] #[allow(non_snake_case)] mod gen_TcpSocketErrorEventInit; #[cfg(feature = "TcpSocketErrorEventInit")] +#[allow(unused_imports)] pub use gen_TcpSocketErrorEventInit::*; #[cfg(feature = "TcpSocketEvent")] #[allow(non_snake_case)] mod gen_TcpSocketEvent; #[cfg(feature = "TcpSocketEvent")] +#[allow(unused_imports)] pub use gen_TcpSocketEvent::*; #[cfg(feature = "TcpSocketEventInit")] #[allow(non_snake_case)] mod gen_TcpSocketEventInit; #[cfg(feature = "TcpSocketEventInit")] +#[allow(unused_imports)] pub use gen_TcpSocketEventInit::*; #[cfg(feature = "Text")] #[allow(non_snake_case)] mod gen_Text; #[cfg(feature = "Text")] +#[allow(unused_imports)] pub use gen_Text::*; #[cfg(feature = "TextDecodeOptions")] #[allow(non_snake_case)] mod gen_TextDecodeOptions; #[cfg(feature = "TextDecodeOptions")] +#[allow(unused_imports)] pub use gen_TextDecodeOptions::*; #[cfg(feature = "TextDecoder")] #[allow(non_snake_case)] mod gen_TextDecoder; #[cfg(feature = "TextDecoder")] +#[allow(unused_imports)] pub use gen_TextDecoder::*; #[cfg(feature = "TextDecoderOptions")] #[allow(non_snake_case)] mod gen_TextDecoderOptions; #[cfg(feature = "TextDecoderOptions")] +#[allow(unused_imports)] pub use gen_TextDecoderOptions::*; #[cfg(feature = "TextEncoder")] #[allow(non_snake_case)] mod gen_TextEncoder; #[cfg(feature = "TextEncoder")] +#[allow(unused_imports)] pub use gen_TextEncoder::*; #[cfg(feature = "TextMetrics")] #[allow(non_snake_case)] mod gen_TextMetrics; #[cfg(feature = "TextMetrics")] +#[allow(unused_imports)] pub use gen_TextMetrics::*; #[cfg(feature = "TextTrack")] #[allow(non_snake_case)] mod gen_TextTrack; #[cfg(feature = "TextTrack")] +#[allow(unused_imports)] pub use gen_TextTrack::*; #[cfg(feature = "TextTrackCue")] #[allow(non_snake_case)] mod gen_TextTrackCue; #[cfg(feature = "TextTrackCue")] +#[allow(unused_imports)] pub use gen_TextTrackCue::*; #[cfg(feature = "TextTrackCueList")] #[allow(non_snake_case)] mod gen_TextTrackCueList; #[cfg(feature = "TextTrackCueList")] +#[allow(unused_imports)] pub use gen_TextTrackCueList::*; #[cfg(feature = "TextTrackKind")] #[allow(non_snake_case)] mod gen_TextTrackKind; #[cfg(feature = "TextTrackKind")] +#[allow(unused_imports)] pub use gen_TextTrackKind::*; #[cfg(feature = "TextTrackList")] #[allow(non_snake_case)] mod gen_TextTrackList; #[cfg(feature = "TextTrackList")] +#[allow(unused_imports)] pub use gen_TextTrackList::*; #[cfg(feature = "TextTrackMode")] #[allow(non_snake_case)] mod gen_TextTrackMode; #[cfg(feature = "TextTrackMode")] +#[allow(unused_imports)] pub use gen_TextTrackMode::*; #[cfg(feature = "TimeEvent")] #[allow(non_snake_case)] mod gen_TimeEvent; #[cfg(feature = "TimeEvent")] +#[allow(unused_imports)] pub use gen_TimeEvent::*; #[cfg(feature = "TimeRanges")] #[allow(non_snake_case)] mod gen_TimeRanges; #[cfg(feature = "TimeRanges")] +#[allow(unused_imports)] pub use gen_TimeRanges::*; +#[cfg(feature = "ToggleEvent")] +#[allow(non_snake_case)] +mod gen_ToggleEvent; +#[cfg(feature = "ToggleEvent")] +#[allow(unused_imports)] +pub use gen_ToggleEvent::*; + +#[cfg(feature = "ToggleEventInit")] +#[allow(non_snake_case)] +mod gen_ToggleEventInit; +#[cfg(feature = "ToggleEventInit")] +#[allow(unused_imports)] +pub use gen_ToggleEventInit::*; + +#[cfg(feature = "TokenBinding")] +#[allow(non_snake_case)] +mod gen_TokenBinding; +#[cfg(feature = "TokenBinding")] +#[allow(unused_imports)] +pub use gen_TokenBinding::*; + +#[cfg(feature = "TokenBindingStatus")] +#[allow(non_snake_case)] +mod gen_TokenBindingStatus; +#[cfg(feature = "TokenBindingStatus")] +#[allow(unused_imports)] +pub use gen_TokenBindingStatus::*; + #[cfg(feature = "Touch")] #[allow(non_snake_case)] mod gen_Touch; #[cfg(feature = "Touch")] +#[allow(unused_imports)] pub use gen_Touch::*; #[cfg(feature = "TouchEvent")] #[allow(non_snake_case)] mod gen_TouchEvent; #[cfg(feature = "TouchEvent")] +#[allow(unused_imports)] pub use gen_TouchEvent::*; #[cfg(feature = "TouchEventInit")] #[allow(non_snake_case)] mod gen_TouchEventInit; #[cfg(feature = "TouchEventInit")] +#[allow(unused_imports)] pub use gen_TouchEventInit::*; #[cfg(feature = "TouchInit")] #[allow(non_snake_case)] mod gen_TouchInit; #[cfg(feature = "TouchInit")] +#[allow(unused_imports)] pub use gen_TouchInit::*; #[cfg(feature = "TouchList")] #[allow(non_snake_case)] mod gen_TouchList; #[cfg(feature = "TouchList")] +#[allow(unused_imports)] pub use gen_TouchList::*; #[cfg(feature = "TrackEvent")] #[allow(non_snake_case)] mod gen_TrackEvent; #[cfg(feature = "TrackEvent")] +#[allow(unused_imports)] pub use gen_TrackEvent::*; #[cfg(feature = "TrackEventInit")] #[allow(non_snake_case)] mod gen_TrackEventInit; #[cfg(feature = "TrackEventInit")] +#[allow(unused_imports)] pub use gen_TrackEventInit::*; #[cfg(feature = "TransformStream")] #[allow(non_snake_case)] mod gen_TransformStream; #[cfg(feature = "TransformStream")] +#[allow(unused_imports)] pub use gen_TransformStream::*; +#[cfg(feature = "TransformStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_TransformStreamDefaultController; +#[cfg(feature = "TransformStreamDefaultController")] +#[allow(unused_imports)] +pub use gen_TransformStreamDefaultController::*; + +#[cfg(feature = "Transformer")] +#[allow(non_snake_case)] +mod gen_Transformer; +#[cfg(feature = "Transformer")] +#[allow(unused_imports)] +pub use gen_Transformer::*; + #[cfg(feature = "TransitionEvent")] #[allow(non_snake_case)] mod gen_TransitionEvent; #[cfg(feature = "TransitionEvent")] +#[allow(unused_imports)] pub use gen_TransitionEvent::*; #[cfg(feature = "TransitionEventInit")] #[allow(non_snake_case)] mod gen_TransitionEventInit; #[cfg(feature = "TransitionEventInit")] +#[allow(unused_imports)] pub use gen_TransitionEventInit::*; #[cfg(feature = "Transport")] #[allow(non_snake_case)] mod gen_Transport; #[cfg(feature = "Transport")] +#[allow(unused_imports)] pub use gen_Transport::*; #[cfg(feature = "TreeBoxObject")] #[allow(non_snake_case)] mod gen_TreeBoxObject; #[cfg(feature = "TreeBoxObject")] +#[allow(unused_imports)] pub use gen_TreeBoxObject::*; #[cfg(feature = "TreeCellInfo")] #[allow(non_snake_case)] mod gen_TreeCellInfo; #[cfg(feature = "TreeCellInfo")] +#[allow(unused_imports)] pub use gen_TreeCellInfo::*; #[cfg(feature = "TreeView")] #[allow(non_snake_case)] mod gen_TreeView; #[cfg(feature = "TreeView")] +#[allow(unused_imports)] pub use gen_TreeView::*; #[cfg(feature = "TreeWalker")] #[allow(non_snake_case)] mod gen_TreeWalker; #[cfg(feature = "TreeWalker")] +#[allow(unused_imports)] pub use gen_TreeWalker::*; #[cfg(feature = "U2f")] #[allow(non_snake_case)] mod gen_U2f; #[cfg(feature = "U2f")] +#[allow(unused_imports)] pub use gen_U2f::*; #[cfg(feature = "U2fClientData")] #[allow(non_snake_case)] mod gen_U2fClientData; #[cfg(feature = "U2fClientData")] +#[allow(unused_imports)] pub use gen_U2fClientData::*; +#[cfg(feature = "ULongRange")] +#[allow(non_snake_case)] +mod gen_ULongRange; +#[cfg(feature = "ULongRange")] +#[allow(unused_imports)] +pub use gen_ULongRange::*; + +#[cfg(feature = "UaDataValues")] +#[allow(non_snake_case)] +mod gen_UaDataValues; +#[cfg(feature = "UaDataValues")] +#[allow(unused_imports)] +pub use gen_UaDataValues::*; + +#[cfg(feature = "UaLowEntropyJson")] +#[allow(non_snake_case)] +mod gen_UaLowEntropyJson; +#[cfg(feature = "UaLowEntropyJson")] +#[allow(unused_imports)] +pub use gen_UaLowEntropyJson::*; + #[cfg(feature = "UdpMessageEventInit")] #[allow(non_snake_case)] mod gen_UdpMessageEventInit; #[cfg(feature = "UdpMessageEventInit")] +#[allow(unused_imports)] pub use gen_UdpMessageEventInit::*; #[cfg(feature = "UdpOptions")] #[allow(non_snake_case)] mod gen_UdpOptions; #[cfg(feature = "UdpOptions")] +#[allow(unused_imports)] pub use gen_UdpOptions::*; #[cfg(feature = "UiEvent")] #[allow(non_snake_case)] mod gen_UiEvent; #[cfg(feature = "UiEvent")] +#[allow(unused_imports)] pub use gen_UiEvent::*; #[cfg(feature = "UiEventInit")] #[allow(non_snake_case)] mod gen_UiEventInit; #[cfg(feature = "UiEventInit")] +#[allow(unused_imports)] pub use gen_UiEventInit::*; +#[cfg(feature = "UnderlyingSink")] +#[allow(non_snake_case)] +mod gen_UnderlyingSink; +#[cfg(feature = "UnderlyingSink")] +#[allow(unused_imports)] +pub use gen_UnderlyingSink::*; + +#[cfg(feature = "UnderlyingSource")] +#[allow(non_snake_case)] +mod gen_UnderlyingSource; +#[cfg(feature = "UnderlyingSource")] +#[allow(unused_imports)] +pub use gen_UnderlyingSource::*; + #[cfg(feature = "Url")] #[allow(non_snake_case)] mod gen_Url; #[cfg(feature = "Url")] +#[allow(unused_imports)] pub use gen_Url::*; #[cfg(feature = "UrlSearchParams")] #[allow(non_snake_case)] mod gen_UrlSearchParams; #[cfg(feature = "UrlSearchParams")] +#[allow(unused_imports)] pub use gen_UrlSearchParams::*; #[cfg(feature = "Usb")] #[allow(non_snake_case)] mod gen_Usb; #[cfg(feature = "Usb")] +#[allow(unused_imports)] pub use gen_Usb::*; #[cfg(feature = "UsbAlternateInterface")] #[allow(non_snake_case)] mod gen_UsbAlternateInterface; #[cfg(feature = "UsbAlternateInterface")] +#[allow(unused_imports)] pub use gen_UsbAlternateInterface::*; #[cfg(feature = "UsbConfiguration")] #[allow(non_snake_case)] mod gen_UsbConfiguration; #[cfg(feature = "UsbConfiguration")] +#[allow(unused_imports)] pub use gen_UsbConfiguration::*; #[cfg(feature = "UsbConnectionEvent")] #[allow(non_snake_case)] mod gen_UsbConnectionEvent; #[cfg(feature = "UsbConnectionEvent")] +#[allow(unused_imports)] pub use gen_UsbConnectionEvent::*; #[cfg(feature = "UsbConnectionEventInit")] #[allow(non_snake_case)] mod gen_UsbConnectionEventInit; #[cfg(feature = "UsbConnectionEventInit")] +#[allow(unused_imports)] pub use gen_UsbConnectionEventInit::*; #[cfg(feature = "UsbControlTransferParameters")] #[allow(non_snake_case)] mod gen_UsbControlTransferParameters; #[cfg(feature = "UsbControlTransferParameters")] +#[allow(unused_imports)] pub use gen_UsbControlTransferParameters::*; #[cfg(feature = "UsbDevice")] #[allow(non_snake_case)] mod gen_UsbDevice; #[cfg(feature = "UsbDevice")] +#[allow(unused_imports)] pub use gen_UsbDevice::*; #[cfg(feature = "UsbDeviceFilter")] #[allow(non_snake_case)] mod gen_UsbDeviceFilter; #[cfg(feature = "UsbDeviceFilter")] +#[allow(unused_imports)] pub use gen_UsbDeviceFilter::*; #[cfg(feature = "UsbDeviceRequestOptions")] #[allow(non_snake_case)] mod gen_UsbDeviceRequestOptions; #[cfg(feature = "UsbDeviceRequestOptions")] +#[allow(unused_imports)] pub use gen_UsbDeviceRequestOptions::*; #[cfg(feature = "UsbDirection")] #[allow(non_snake_case)] mod gen_UsbDirection; #[cfg(feature = "UsbDirection")] +#[allow(unused_imports)] pub use gen_UsbDirection::*; #[cfg(feature = "UsbEndpoint")] #[allow(non_snake_case)] mod gen_UsbEndpoint; #[cfg(feature = "UsbEndpoint")] +#[allow(unused_imports)] pub use gen_UsbEndpoint::*; #[cfg(feature = "UsbEndpointType")] #[allow(non_snake_case)] mod gen_UsbEndpointType; #[cfg(feature = "UsbEndpointType")] +#[allow(unused_imports)] pub use gen_UsbEndpointType::*; #[cfg(feature = "UsbInTransferResult")] #[allow(non_snake_case)] mod gen_UsbInTransferResult; #[cfg(feature = "UsbInTransferResult")] +#[allow(unused_imports)] pub use gen_UsbInTransferResult::*; #[cfg(feature = "UsbInterface")] #[allow(non_snake_case)] mod gen_UsbInterface; #[cfg(feature = "UsbInterface")] +#[allow(unused_imports)] pub use gen_UsbInterface::*; #[cfg(feature = "UsbIsochronousInTransferPacket")] #[allow(non_snake_case)] mod gen_UsbIsochronousInTransferPacket; #[cfg(feature = "UsbIsochronousInTransferPacket")] +#[allow(unused_imports)] pub use gen_UsbIsochronousInTransferPacket::*; #[cfg(feature = "UsbIsochronousInTransferResult")] #[allow(non_snake_case)] mod gen_UsbIsochronousInTransferResult; #[cfg(feature = "UsbIsochronousInTransferResult")] +#[allow(unused_imports)] pub use gen_UsbIsochronousInTransferResult::*; #[cfg(feature = "UsbIsochronousOutTransferPacket")] #[allow(non_snake_case)] mod gen_UsbIsochronousOutTransferPacket; #[cfg(feature = "UsbIsochronousOutTransferPacket")] +#[allow(unused_imports)] pub use gen_UsbIsochronousOutTransferPacket::*; #[cfg(feature = "UsbIsochronousOutTransferResult")] #[allow(non_snake_case)] mod gen_UsbIsochronousOutTransferResult; #[cfg(feature = "UsbIsochronousOutTransferResult")] +#[allow(unused_imports)] pub use gen_UsbIsochronousOutTransferResult::*; #[cfg(feature = "UsbOutTransferResult")] #[allow(non_snake_case)] mod gen_UsbOutTransferResult; #[cfg(feature = "UsbOutTransferResult")] +#[allow(unused_imports)] pub use gen_UsbOutTransferResult::*; #[cfg(feature = "UsbPermissionDescriptor")] #[allow(non_snake_case)] mod gen_UsbPermissionDescriptor; #[cfg(feature = "UsbPermissionDescriptor")] +#[allow(unused_imports)] pub use gen_UsbPermissionDescriptor::*; #[cfg(feature = "UsbPermissionResult")] #[allow(non_snake_case)] mod gen_UsbPermissionResult; #[cfg(feature = "UsbPermissionResult")] +#[allow(unused_imports)] pub use gen_UsbPermissionResult::*; #[cfg(feature = "UsbPermissionStorage")] #[allow(non_snake_case)] mod gen_UsbPermissionStorage; #[cfg(feature = "UsbPermissionStorage")] +#[allow(unused_imports)] pub use gen_UsbPermissionStorage::*; #[cfg(feature = "UsbRecipient")] #[allow(non_snake_case)] mod gen_UsbRecipient; #[cfg(feature = "UsbRecipient")] +#[allow(unused_imports)] pub use gen_UsbRecipient::*; #[cfg(feature = "UsbRequestType")] #[allow(non_snake_case)] mod gen_UsbRequestType; #[cfg(feature = "UsbRequestType")] +#[allow(unused_imports)] pub use gen_UsbRequestType::*; #[cfg(feature = "UsbTransferStatus")] #[allow(non_snake_case)] mod gen_UsbTransferStatus; #[cfg(feature = "UsbTransferStatus")] +#[allow(unused_imports)] pub use gen_UsbTransferStatus::*; +#[cfg(feature = "UserActivation")] +#[allow(non_snake_case)] +mod gen_UserActivation; +#[cfg(feature = "UserActivation")] +#[allow(unused_imports)] +pub use gen_UserActivation::*; + #[cfg(feature = "UserProximityEvent")] #[allow(non_snake_case)] mod gen_UserProximityEvent; #[cfg(feature = "UserProximityEvent")] +#[allow(unused_imports)] pub use gen_UserProximityEvent::*; #[cfg(feature = "UserProximityEventInit")] #[allow(non_snake_case)] mod gen_UserProximityEventInit; #[cfg(feature = "UserProximityEventInit")] +#[allow(unused_imports)] pub use gen_UserProximityEventInit::*; #[cfg(feature = "UserVerificationRequirement")] #[allow(non_snake_case)] mod gen_UserVerificationRequirement; #[cfg(feature = "UserVerificationRequirement")] +#[allow(unused_imports)] pub use gen_UserVerificationRequirement::*; #[cfg(feature = "ValidityState")] #[allow(non_snake_case)] mod gen_ValidityState; #[cfg(feature = "ValidityState")] +#[allow(unused_imports)] pub use gen_ValidityState::*; #[cfg(feature = "ValueEvent")] #[allow(non_snake_case)] mod gen_ValueEvent; #[cfg(feature = "ValueEvent")] +#[allow(unused_imports)] pub use gen_ValueEvent::*; #[cfg(feature = "ValueEventInit")] #[allow(non_snake_case)] mod gen_ValueEventInit; #[cfg(feature = "ValueEventInit")] +#[allow(unused_imports)] pub use gen_ValueEventInit::*; #[cfg(feature = "VideoColorPrimaries")] #[allow(non_snake_case)] mod gen_VideoColorPrimaries; #[cfg(feature = "VideoColorPrimaries")] +#[allow(unused_imports)] pub use gen_VideoColorPrimaries::*; #[cfg(feature = "VideoColorSpace")] #[allow(non_snake_case)] mod gen_VideoColorSpace; #[cfg(feature = "VideoColorSpace")] +#[allow(unused_imports)] pub use gen_VideoColorSpace::*; #[cfg(feature = "VideoColorSpaceInit")] #[allow(non_snake_case)] mod gen_VideoColorSpaceInit; #[cfg(feature = "VideoColorSpaceInit")] +#[allow(unused_imports)] pub use gen_VideoColorSpaceInit::*; #[cfg(feature = "VideoConfiguration")] #[allow(non_snake_case)] mod gen_VideoConfiguration; #[cfg(feature = "VideoConfiguration")] +#[allow(unused_imports)] pub use gen_VideoConfiguration::*; #[cfg(feature = "VideoDecoder")] #[allow(non_snake_case)] mod gen_VideoDecoder; #[cfg(feature = "VideoDecoder")] +#[allow(unused_imports)] pub use gen_VideoDecoder::*; #[cfg(feature = "VideoDecoderConfig")] #[allow(non_snake_case)] mod gen_VideoDecoderConfig; #[cfg(feature = "VideoDecoderConfig")] +#[allow(unused_imports)] pub use gen_VideoDecoderConfig::*; #[cfg(feature = "VideoDecoderInit")] #[allow(non_snake_case)] mod gen_VideoDecoderInit; #[cfg(feature = "VideoDecoderInit")] +#[allow(unused_imports)] pub use gen_VideoDecoderInit::*; #[cfg(feature = "VideoDecoderSupport")] #[allow(non_snake_case)] mod gen_VideoDecoderSupport; #[cfg(feature = "VideoDecoderSupport")] +#[allow(unused_imports)] pub use gen_VideoDecoderSupport::*; #[cfg(feature = "VideoEncoder")] #[allow(non_snake_case)] mod gen_VideoEncoder; #[cfg(feature = "VideoEncoder")] +#[allow(unused_imports)] pub use gen_VideoEncoder::*; #[cfg(feature = "VideoEncoderConfig")] #[allow(non_snake_case)] mod gen_VideoEncoderConfig; #[cfg(feature = "VideoEncoderConfig")] +#[allow(unused_imports)] pub use gen_VideoEncoderConfig::*; #[cfg(feature = "VideoEncoderEncodeOptions")] #[allow(non_snake_case)] mod gen_VideoEncoderEncodeOptions; #[cfg(feature = "VideoEncoderEncodeOptions")] +#[allow(unused_imports)] pub use gen_VideoEncoderEncodeOptions::*; #[cfg(feature = "VideoEncoderInit")] #[allow(non_snake_case)] mod gen_VideoEncoderInit; #[cfg(feature = "VideoEncoderInit")] +#[allow(unused_imports)] pub use gen_VideoEncoderInit::*; #[cfg(feature = "VideoEncoderSupport")] #[allow(non_snake_case)] mod gen_VideoEncoderSupport; #[cfg(feature = "VideoEncoderSupport")] +#[allow(unused_imports)] pub use gen_VideoEncoderSupport::*; #[cfg(feature = "VideoFacingModeEnum")] #[allow(non_snake_case)] mod gen_VideoFacingModeEnum; #[cfg(feature = "VideoFacingModeEnum")] +#[allow(unused_imports)] pub use gen_VideoFacingModeEnum::*; #[cfg(feature = "VideoFrame")] #[allow(non_snake_case)] mod gen_VideoFrame; #[cfg(feature = "VideoFrame")] +#[allow(unused_imports)] pub use gen_VideoFrame::*; #[cfg(feature = "VideoFrameBufferInit")] #[allow(non_snake_case)] mod gen_VideoFrameBufferInit; #[cfg(feature = "VideoFrameBufferInit")] +#[allow(unused_imports)] pub use gen_VideoFrameBufferInit::*; #[cfg(feature = "VideoFrameCopyToOptions")] #[allow(non_snake_case)] mod gen_VideoFrameCopyToOptions; #[cfg(feature = "VideoFrameCopyToOptions")] +#[allow(unused_imports)] pub use gen_VideoFrameCopyToOptions::*; #[cfg(feature = "VideoFrameInit")] #[allow(non_snake_case)] mod gen_VideoFrameInit; #[cfg(feature = "VideoFrameInit")] +#[allow(unused_imports)] pub use gen_VideoFrameInit::*; #[cfg(feature = "VideoMatrixCoefficients")] #[allow(non_snake_case)] mod gen_VideoMatrixCoefficients; #[cfg(feature = "VideoMatrixCoefficients")] +#[allow(unused_imports)] pub use gen_VideoMatrixCoefficients::*; #[cfg(feature = "VideoPixelFormat")] #[allow(non_snake_case)] mod gen_VideoPixelFormat; #[cfg(feature = "VideoPixelFormat")] +#[allow(unused_imports)] pub use gen_VideoPixelFormat::*; #[cfg(feature = "VideoPlaybackQuality")] #[allow(non_snake_case)] mod gen_VideoPlaybackQuality; #[cfg(feature = "VideoPlaybackQuality")] +#[allow(unused_imports)] pub use gen_VideoPlaybackQuality::*; #[cfg(feature = "VideoStreamTrack")] #[allow(non_snake_case)] mod gen_VideoStreamTrack; #[cfg(feature = "VideoStreamTrack")] +#[allow(unused_imports)] pub use gen_VideoStreamTrack::*; #[cfg(feature = "VideoTrack")] #[allow(non_snake_case)] mod gen_VideoTrack; #[cfg(feature = "VideoTrack")] +#[allow(unused_imports)] pub use gen_VideoTrack::*; #[cfg(feature = "VideoTrackList")] #[allow(non_snake_case)] mod gen_VideoTrackList; #[cfg(feature = "VideoTrackList")] +#[allow(unused_imports)] pub use gen_VideoTrackList::*; #[cfg(feature = "VideoTransferCharacteristics")] #[allow(non_snake_case)] mod gen_VideoTransferCharacteristics; #[cfg(feature = "VideoTransferCharacteristics")] +#[allow(unused_imports)] pub use gen_VideoTransferCharacteristics::*; +#[cfg(feature = "ViewTransition")] +#[allow(non_snake_case)] +mod gen_ViewTransition; +#[cfg(feature = "ViewTransition")] +#[allow(unused_imports)] +pub use gen_ViewTransition::*; + #[cfg(feature = "VisibilityState")] #[allow(non_snake_case)] mod gen_VisibilityState; #[cfg(feature = "VisibilityState")] +#[allow(unused_imports)] pub use gen_VisibilityState::*; +#[cfg(feature = "VisualViewport")] +#[allow(non_snake_case)] +mod gen_VisualViewport; +#[cfg(feature = "VisualViewport")] +#[allow(unused_imports)] +pub use gen_VisualViewport::*; + #[cfg(feature = "VoidCallback")] #[allow(non_snake_case)] mod gen_VoidCallback; #[cfg(feature = "VoidCallback")] +#[allow(unused_imports)] pub use gen_VoidCallback::*; #[cfg(feature = "VrDisplay")] #[allow(non_snake_case)] mod gen_VrDisplay; #[cfg(feature = "VrDisplay")] +#[allow(unused_imports)] pub use gen_VrDisplay::*; #[cfg(feature = "VrDisplayCapabilities")] #[allow(non_snake_case)] mod gen_VrDisplayCapabilities; #[cfg(feature = "VrDisplayCapabilities")] +#[allow(unused_imports)] pub use gen_VrDisplayCapabilities::*; #[cfg(feature = "VrEye")] #[allow(non_snake_case)] mod gen_VrEye; #[cfg(feature = "VrEye")] +#[allow(unused_imports)] pub use gen_VrEye::*; #[cfg(feature = "VrEyeParameters")] #[allow(non_snake_case)] mod gen_VrEyeParameters; #[cfg(feature = "VrEyeParameters")] +#[allow(unused_imports)] pub use gen_VrEyeParameters::*; #[cfg(feature = "VrFieldOfView")] #[allow(non_snake_case)] mod gen_VrFieldOfView; #[cfg(feature = "VrFieldOfView")] +#[allow(unused_imports)] pub use gen_VrFieldOfView::*; #[cfg(feature = "VrFrameData")] #[allow(non_snake_case)] mod gen_VrFrameData; #[cfg(feature = "VrFrameData")] +#[allow(unused_imports)] pub use gen_VrFrameData::*; #[cfg(feature = "VrLayer")] #[allow(non_snake_case)] mod gen_VrLayer; #[cfg(feature = "VrLayer")] +#[allow(unused_imports)] pub use gen_VrLayer::*; #[cfg(feature = "VrMockController")] #[allow(non_snake_case)] mod gen_VrMockController; #[cfg(feature = "VrMockController")] +#[allow(unused_imports)] pub use gen_VrMockController::*; #[cfg(feature = "VrMockDisplay")] #[allow(non_snake_case)] mod gen_VrMockDisplay; #[cfg(feature = "VrMockDisplay")] +#[allow(unused_imports)] pub use gen_VrMockDisplay::*; #[cfg(feature = "VrPose")] #[allow(non_snake_case)] mod gen_VrPose; #[cfg(feature = "VrPose")] +#[allow(unused_imports)] pub use gen_VrPose::*; #[cfg(feature = "VrServiceTest")] #[allow(non_snake_case)] mod gen_VrServiceTest; #[cfg(feature = "VrServiceTest")] +#[allow(unused_imports)] pub use gen_VrServiceTest::*; #[cfg(feature = "VrStageParameters")] #[allow(non_snake_case)] mod gen_VrStageParameters; #[cfg(feature = "VrStageParameters")] +#[allow(unused_imports)] pub use gen_VrStageParameters::*; #[cfg(feature = "VrSubmitFrameResult")] #[allow(non_snake_case)] mod gen_VrSubmitFrameResult; #[cfg(feature = "VrSubmitFrameResult")] +#[allow(unused_imports)] pub use gen_VrSubmitFrameResult::*; #[cfg(feature = "VttCue")] #[allow(non_snake_case)] mod gen_VttCue; #[cfg(feature = "VttCue")] +#[allow(unused_imports)] pub use gen_VttCue::*; #[cfg(feature = "VttRegion")] #[allow(non_snake_case)] mod gen_VttRegion; #[cfg(feature = "VttRegion")] +#[allow(unused_imports)] pub use gen_VttRegion::*; #[cfg(feature = "WakeLock")] #[allow(non_snake_case)] mod gen_WakeLock; #[cfg(feature = "WakeLock")] +#[allow(unused_imports)] pub use gen_WakeLock::*; #[cfg(feature = "WakeLockSentinel")] #[allow(non_snake_case)] mod gen_WakeLockSentinel; #[cfg(feature = "WakeLockSentinel")] +#[allow(unused_imports)] pub use gen_WakeLockSentinel::*; #[cfg(feature = "WakeLockType")] #[allow(non_snake_case)] mod gen_WakeLockType; #[cfg(feature = "WakeLockType")] +#[allow(unused_imports)] pub use gen_WakeLockType::*; #[cfg(feature = "WatchAdvertisementsOptions")] #[allow(non_snake_case)] mod gen_WatchAdvertisementsOptions; #[cfg(feature = "WatchAdvertisementsOptions")] +#[allow(unused_imports)] pub use gen_WatchAdvertisementsOptions::*; #[cfg(feature = "WaveShaperNode")] #[allow(non_snake_case)] mod gen_WaveShaperNode; #[cfg(feature = "WaveShaperNode")] +#[allow(unused_imports)] pub use gen_WaveShaperNode::*; #[cfg(feature = "WaveShaperOptions")] #[allow(non_snake_case)] mod gen_WaveShaperOptions; #[cfg(feature = "WaveShaperOptions")] +#[allow(unused_imports)] pub use gen_WaveShaperOptions::*; #[cfg(feature = "WebGl2RenderingContext")] #[allow(non_snake_case)] mod gen_WebGl2RenderingContext; #[cfg(feature = "WebGl2RenderingContext")] +#[allow(unused_imports)] pub use gen_WebGl2RenderingContext::*; #[cfg(feature = "WebGlActiveInfo")] #[allow(non_snake_case)] mod gen_WebGlActiveInfo; #[cfg(feature = "WebGlActiveInfo")] +#[allow(unused_imports)] pub use gen_WebGlActiveInfo::*; #[cfg(feature = "WebGlBuffer")] #[allow(non_snake_case)] mod gen_WebGlBuffer; #[cfg(feature = "WebGlBuffer")] +#[allow(unused_imports)] pub use gen_WebGlBuffer::*; #[cfg(feature = "WebGlContextAttributes")] #[allow(non_snake_case)] mod gen_WebGlContextAttributes; #[cfg(feature = "WebGlContextAttributes")] +#[allow(unused_imports)] pub use gen_WebGlContextAttributes::*; #[cfg(feature = "WebGlContextEvent")] #[allow(non_snake_case)] mod gen_WebGlContextEvent; #[cfg(feature = "WebGlContextEvent")] +#[allow(unused_imports)] pub use gen_WebGlContextEvent::*; #[cfg(feature = "WebGlContextEventInit")] #[allow(non_snake_case)] mod gen_WebGlContextEventInit; #[cfg(feature = "WebGlContextEventInit")] +#[allow(unused_imports)] pub use gen_WebGlContextEventInit::*; #[cfg(feature = "WebGlFramebuffer")] #[allow(non_snake_case)] mod gen_WebGlFramebuffer; #[cfg(feature = "WebGlFramebuffer")] +#[allow(unused_imports)] pub use gen_WebGlFramebuffer::*; #[cfg(feature = "WebGlPowerPreference")] #[allow(non_snake_case)] mod gen_WebGlPowerPreference; #[cfg(feature = "WebGlPowerPreference")] +#[allow(unused_imports)] pub use gen_WebGlPowerPreference::*; #[cfg(feature = "WebGlProgram")] #[allow(non_snake_case)] mod gen_WebGlProgram; #[cfg(feature = "WebGlProgram")] +#[allow(unused_imports)] pub use gen_WebGlProgram::*; #[cfg(feature = "WebGlQuery")] #[allow(non_snake_case)] mod gen_WebGlQuery; #[cfg(feature = "WebGlQuery")] +#[allow(unused_imports)] pub use gen_WebGlQuery::*; #[cfg(feature = "WebGlRenderbuffer")] #[allow(non_snake_case)] mod gen_WebGlRenderbuffer; #[cfg(feature = "WebGlRenderbuffer")] +#[allow(unused_imports)] pub use gen_WebGlRenderbuffer::*; #[cfg(feature = "WebGlRenderingContext")] #[allow(non_snake_case)] mod gen_WebGlRenderingContext; #[cfg(feature = "WebGlRenderingContext")] +#[allow(unused_imports)] pub use gen_WebGlRenderingContext::*; #[cfg(feature = "WebGlSampler")] #[allow(non_snake_case)] mod gen_WebGlSampler; #[cfg(feature = "WebGlSampler")] +#[allow(unused_imports)] pub use gen_WebGlSampler::*; #[cfg(feature = "WebGlShader")] #[allow(non_snake_case)] mod gen_WebGlShader; #[cfg(feature = "WebGlShader")] +#[allow(unused_imports)] pub use gen_WebGlShader::*; #[cfg(feature = "WebGlShaderPrecisionFormat")] #[allow(non_snake_case)] mod gen_WebGlShaderPrecisionFormat; #[cfg(feature = "WebGlShaderPrecisionFormat")] +#[allow(unused_imports)] pub use gen_WebGlShaderPrecisionFormat::*; #[cfg(feature = "WebGlSync")] #[allow(non_snake_case)] mod gen_WebGlSync; #[cfg(feature = "WebGlSync")] +#[allow(unused_imports)] pub use gen_WebGlSync::*; #[cfg(feature = "WebGlTexture")] #[allow(non_snake_case)] mod gen_WebGlTexture; #[cfg(feature = "WebGlTexture")] +#[allow(unused_imports)] pub use gen_WebGlTexture::*; #[cfg(feature = "WebGlTransformFeedback")] #[allow(non_snake_case)] mod gen_WebGlTransformFeedback; #[cfg(feature = "WebGlTransformFeedback")] +#[allow(unused_imports)] pub use gen_WebGlTransformFeedback::*; #[cfg(feature = "WebGlUniformLocation")] #[allow(non_snake_case)] mod gen_WebGlUniformLocation; #[cfg(feature = "WebGlUniformLocation")] +#[allow(unused_imports)] pub use gen_WebGlUniformLocation::*; #[cfg(feature = "WebGlVertexArrayObject")] #[allow(non_snake_case)] mod gen_WebGlVertexArrayObject; #[cfg(feature = "WebGlVertexArrayObject")] +#[allow(unused_imports)] pub use gen_WebGlVertexArrayObject::*; #[cfg(feature = "WebKitCssMatrix")] #[allow(non_snake_case)] mod gen_WebKitCssMatrix; #[cfg(feature = "WebKitCssMatrix")] +#[allow(unused_imports)] pub use gen_WebKitCssMatrix::*; #[cfg(feature = "WebSocket")] #[allow(non_snake_case)] mod gen_WebSocket; #[cfg(feature = "WebSocket")] +#[allow(unused_imports)] pub use gen_WebSocket::*; #[cfg(feature = "WebSocketDict")] #[allow(non_snake_case)] mod gen_WebSocketDict; #[cfg(feature = "WebSocketDict")] +#[allow(unused_imports)] pub use gen_WebSocketDict::*; #[cfg(feature = "WebSocketElement")] #[allow(non_snake_case)] mod gen_WebSocketElement; #[cfg(feature = "WebSocketElement")] +#[allow(unused_imports)] pub use gen_WebSocketElement::*; +#[cfg(feature = "WebTransport")] +#[allow(non_snake_case)] +mod gen_WebTransport; +#[cfg(feature = "WebTransport")] +#[allow(unused_imports)] +pub use gen_WebTransport::*; + +#[cfg(feature = "WebTransportBidirectionalStream")] +#[allow(non_snake_case)] +mod gen_WebTransportBidirectionalStream; +#[cfg(feature = "WebTransportBidirectionalStream")] +#[allow(unused_imports)] +pub use gen_WebTransportBidirectionalStream::*; + +#[cfg(feature = "WebTransportCloseInfo")] +#[allow(non_snake_case)] +mod gen_WebTransportCloseInfo; +#[cfg(feature = "WebTransportCloseInfo")] +#[allow(unused_imports)] +pub use gen_WebTransportCloseInfo::*; + +#[cfg(feature = "WebTransportCongestionControl")] +#[allow(non_snake_case)] +mod gen_WebTransportCongestionControl; +#[cfg(feature = "WebTransportCongestionControl")] +#[allow(unused_imports)] +pub use gen_WebTransportCongestionControl::*; + +#[cfg(feature = "WebTransportDatagramDuplexStream")] +#[allow(non_snake_case)] +mod gen_WebTransportDatagramDuplexStream; +#[cfg(feature = "WebTransportDatagramDuplexStream")] +#[allow(unused_imports)] +pub use gen_WebTransportDatagramDuplexStream::*; + +#[cfg(feature = "WebTransportDatagramStats")] +#[allow(non_snake_case)] +mod gen_WebTransportDatagramStats; +#[cfg(feature = "WebTransportDatagramStats")] +#[allow(unused_imports)] +pub use gen_WebTransportDatagramStats::*; + +#[cfg(feature = "WebTransportError")] +#[allow(non_snake_case)] +mod gen_WebTransportError; +#[cfg(feature = "WebTransportError")] +#[allow(unused_imports)] +pub use gen_WebTransportError::*; + +#[cfg(feature = "WebTransportErrorOptions")] +#[allow(non_snake_case)] +mod gen_WebTransportErrorOptions; +#[cfg(feature = "WebTransportErrorOptions")] +#[allow(unused_imports)] +pub use gen_WebTransportErrorOptions::*; + +#[cfg(feature = "WebTransportErrorSource")] +#[allow(non_snake_case)] +mod gen_WebTransportErrorSource; +#[cfg(feature = "WebTransportErrorSource")] +#[allow(unused_imports)] +pub use gen_WebTransportErrorSource::*; + +#[cfg(feature = "WebTransportHash")] +#[allow(non_snake_case)] +mod gen_WebTransportHash; +#[cfg(feature = "WebTransportHash")] +#[allow(unused_imports)] +pub use gen_WebTransportHash::*; + +#[cfg(feature = "WebTransportOptions")] +#[allow(non_snake_case)] +mod gen_WebTransportOptions; +#[cfg(feature = "WebTransportOptions")] +#[allow(unused_imports)] +pub use gen_WebTransportOptions::*; + +#[cfg(feature = "WebTransportReceiveStream")] +#[allow(non_snake_case)] +mod gen_WebTransportReceiveStream; +#[cfg(feature = "WebTransportReceiveStream")] +#[allow(unused_imports)] +pub use gen_WebTransportReceiveStream::*; + +#[cfg(feature = "WebTransportReceiveStreamStats")] +#[allow(non_snake_case)] +mod gen_WebTransportReceiveStreamStats; +#[cfg(feature = "WebTransportReceiveStreamStats")] +#[allow(unused_imports)] +pub use gen_WebTransportReceiveStreamStats::*; + +#[cfg(feature = "WebTransportReliabilityMode")] +#[allow(non_snake_case)] +mod gen_WebTransportReliabilityMode; +#[cfg(feature = "WebTransportReliabilityMode")] +#[allow(unused_imports)] +pub use gen_WebTransportReliabilityMode::*; + +#[cfg(feature = "WebTransportSendStream")] +#[allow(non_snake_case)] +mod gen_WebTransportSendStream; +#[cfg(feature = "WebTransportSendStream")] +#[allow(unused_imports)] +pub use gen_WebTransportSendStream::*; + +#[cfg(feature = "WebTransportSendStreamOptions")] +#[allow(non_snake_case)] +mod gen_WebTransportSendStreamOptions; +#[cfg(feature = "WebTransportSendStreamOptions")] +#[allow(unused_imports)] +pub use gen_WebTransportSendStreamOptions::*; + +#[cfg(feature = "WebTransportSendStreamStats")] +#[allow(non_snake_case)] +mod gen_WebTransportSendStreamStats; +#[cfg(feature = "WebTransportSendStreamStats")] +#[allow(unused_imports)] +pub use gen_WebTransportSendStreamStats::*; + +#[cfg(feature = "WebTransportStats")] +#[allow(non_snake_case)] +mod gen_WebTransportStats; +#[cfg(feature = "WebTransportStats")] +#[allow(unused_imports)] +pub use gen_WebTransportStats::*; + #[cfg(feature = "WebglColorBufferFloat")] #[allow(non_snake_case)] mod gen_WebglColorBufferFloat; #[cfg(feature = "WebglColorBufferFloat")] +#[allow(unused_imports)] pub use gen_WebglColorBufferFloat::*; #[cfg(feature = "WebglCompressedTextureAstc")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureAstc; #[cfg(feature = "WebglCompressedTextureAstc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureAstc::*; #[cfg(feature = "WebglCompressedTextureAtc")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureAtc; #[cfg(feature = "WebglCompressedTextureAtc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureAtc::*; #[cfg(feature = "WebglCompressedTextureEtc")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureEtc; #[cfg(feature = "WebglCompressedTextureEtc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureEtc::*; #[cfg(feature = "WebglCompressedTextureEtc1")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureEtc1; #[cfg(feature = "WebglCompressedTextureEtc1")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureEtc1::*; #[cfg(feature = "WebglCompressedTexturePvrtc")] #[allow(non_snake_case)] mod gen_WebglCompressedTexturePvrtc; #[cfg(feature = "WebglCompressedTexturePvrtc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTexturePvrtc::*; #[cfg(feature = "WebglCompressedTextureS3tc")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureS3tc; #[cfg(feature = "WebglCompressedTextureS3tc")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureS3tc::*; #[cfg(feature = "WebglCompressedTextureS3tcSrgb")] #[allow(non_snake_case)] mod gen_WebglCompressedTextureS3tcSrgb; #[cfg(feature = "WebglCompressedTextureS3tcSrgb")] +#[allow(unused_imports)] pub use gen_WebglCompressedTextureS3tcSrgb::*; #[cfg(feature = "WebglDebugRendererInfo")] #[allow(non_snake_case)] mod gen_WebglDebugRendererInfo; #[cfg(feature = "WebglDebugRendererInfo")] +#[allow(unused_imports)] pub use gen_WebglDebugRendererInfo::*; #[cfg(feature = "WebglDebugShaders")] #[allow(non_snake_case)] mod gen_WebglDebugShaders; #[cfg(feature = "WebglDebugShaders")] +#[allow(unused_imports)] pub use gen_WebglDebugShaders::*; #[cfg(feature = "WebglDepthTexture")] #[allow(non_snake_case)] mod gen_WebglDepthTexture; #[cfg(feature = "WebglDepthTexture")] +#[allow(unused_imports)] pub use gen_WebglDepthTexture::*; #[cfg(feature = "WebglDrawBuffers")] #[allow(non_snake_case)] mod gen_WebglDrawBuffers; #[cfg(feature = "WebglDrawBuffers")] +#[allow(unused_imports)] pub use gen_WebglDrawBuffers::*; #[cfg(feature = "WebglLoseContext")] #[allow(non_snake_case)] mod gen_WebglLoseContext; #[cfg(feature = "WebglLoseContext")] +#[allow(unused_imports)] pub use gen_WebglLoseContext::*; -#[cfg(feature = "WebrtcGlobalStatisticsReport")] +#[cfg(feature = "WebglMultiDraw")] #[allow(non_snake_case)] -mod gen_WebrtcGlobalStatisticsReport; -#[cfg(feature = "WebrtcGlobalStatisticsReport")] -pub use gen_WebrtcGlobalStatisticsReport::*; +mod gen_WebglMultiDraw; +#[cfg(feature = "WebglMultiDraw")] +#[allow(unused_imports)] +pub use gen_WebglMultiDraw::*; + +#[cfg(feature = "WellKnownDirectory")] +#[allow(non_snake_case)] +mod gen_WellKnownDirectory; +#[cfg(feature = "WellKnownDirectory")] +#[allow(unused_imports)] +pub use gen_WellKnownDirectory::*; + +#[cfg(feature = "WgslLanguageFeatures")] +#[allow(non_snake_case)] +mod gen_WgslLanguageFeatures; +#[cfg(feature = "WgslLanguageFeatures")] +#[allow(unused_imports)] +pub use gen_WgslLanguageFeatures::*; #[cfg(feature = "WheelEvent")] #[allow(non_snake_case)] mod gen_WheelEvent; #[cfg(feature = "WheelEvent")] +#[allow(unused_imports)] pub use gen_WheelEvent::*; #[cfg(feature = "WheelEventInit")] #[allow(non_snake_case)] mod gen_WheelEventInit; #[cfg(feature = "WheelEventInit")] +#[allow(unused_imports)] pub use gen_WheelEventInit::*; #[cfg(feature = "WidevineCdmManifest")] #[allow(non_snake_case)] mod gen_WidevineCdmManifest; #[cfg(feature = "WidevineCdmManifest")] +#[allow(unused_imports)] pub use gen_WidevineCdmManifest::*; #[cfg(feature = "Window")] #[allow(non_snake_case)] mod gen_Window; #[cfg(feature = "Window")] +#[allow(unused_imports)] pub use gen_Window::*; #[cfg(feature = "WindowClient")] #[allow(non_snake_case)] mod gen_WindowClient; #[cfg(feature = "WindowClient")] +#[allow(unused_imports)] pub use gen_WindowClient::*; #[cfg(feature = "Worker")] #[allow(non_snake_case)] mod gen_Worker; #[cfg(feature = "Worker")] +#[allow(unused_imports)] pub use gen_Worker::*; #[cfg(feature = "WorkerDebuggerGlobalScope")] #[allow(non_snake_case)] mod gen_WorkerDebuggerGlobalScope; #[cfg(feature = "WorkerDebuggerGlobalScope")] +#[allow(unused_imports)] pub use gen_WorkerDebuggerGlobalScope::*; #[cfg(feature = "WorkerGlobalScope")] #[allow(non_snake_case)] mod gen_WorkerGlobalScope; #[cfg(feature = "WorkerGlobalScope")] +#[allow(unused_imports)] pub use gen_WorkerGlobalScope::*; #[cfg(feature = "WorkerLocation")] #[allow(non_snake_case)] mod gen_WorkerLocation; #[cfg(feature = "WorkerLocation")] +#[allow(unused_imports)] pub use gen_WorkerLocation::*; #[cfg(feature = "WorkerNavigator")] #[allow(non_snake_case)] mod gen_WorkerNavigator; #[cfg(feature = "WorkerNavigator")] +#[allow(unused_imports)] pub use gen_WorkerNavigator::*; #[cfg(feature = "WorkerOptions")] #[allow(non_snake_case)] mod gen_WorkerOptions; #[cfg(feature = "WorkerOptions")] +#[allow(unused_imports)] pub use gen_WorkerOptions::*; #[cfg(feature = "WorkerType")] #[allow(non_snake_case)] mod gen_WorkerType; #[cfg(feature = "WorkerType")] +#[allow(unused_imports)] pub use gen_WorkerType::*; #[cfg(feature = "Worklet")] #[allow(non_snake_case)] mod gen_Worklet; #[cfg(feature = "Worklet")] +#[allow(unused_imports)] pub use gen_Worklet::*; #[cfg(feature = "WorkletGlobalScope")] #[allow(non_snake_case)] mod gen_WorkletGlobalScope; #[cfg(feature = "WorkletGlobalScope")] +#[allow(unused_imports)] pub use gen_WorkletGlobalScope::*; #[cfg(feature = "WorkletOptions")] #[allow(non_snake_case)] mod gen_WorkletOptions; #[cfg(feature = "WorkletOptions")] +#[allow(unused_imports)] pub use gen_WorkletOptions::*; #[cfg(feature = "WritableStream")] #[allow(non_snake_case)] mod gen_WritableStream; #[cfg(feature = "WritableStream")] +#[allow(unused_imports)] pub use gen_WritableStream::*; +#[cfg(feature = "WritableStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_WritableStreamDefaultController; +#[cfg(feature = "WritableStreamDefaultController")] +#[allow(unused_imports)] +pub use gen_WritableStreamDefaultController::*; + #[cfg(feature = "WritableStreamDefaultWriter")] #[allow(non_snake_case)] mod gen_WritableStreamDefaultWriter; #[cfg(feature = "WritableStreamDefaultWriter")] +#[allow(unused_imports)] pub use gen_WritableStreamDefaultWriter::*; +#[cfg(feature = "WriteCommandType")] +#[allow(non_snake_case)] +mod gen_WriteCommandType; +#[cfg(feature = "WriteCommandType")] +#[allow(unused_imports)] +pub use gen_WriteCommandType::*; + +#[cfg(feature = "WriteParams")] +#[allow(non_snake_case)] +mod gen_WriteParams; +#[cfg(feature = "WriteParams")] +#[allow(unused_imports)] +pub use gen_WriteParams::*; + #[cfg(feature = "XPathExpression")] #[allow(non_snake_case)] mod gen_XPathExpression; #[cfg(feature = "XPathExpression")] +#[allow(unused_imports)] pub use gen_XPathExpression::*; #[cfg(feature = "XPathNsResolver")] #[allow(non_snake_case)] mod gen_XPathNsResolver; #[cfg(feature = "XPathNsResolver")] +#[allow(unused_imports)] pub use gen_XPathNsResolver::*; #[cfg(feature = "XPathResult")] #[allow(non_snake_case)] mod gen_XPathResult; #[cfg(feature = "XPathResult")] +#[allow(unused_imports)] pub use gen_XPathResult::*; #[cfg(feature = "XmlDocument")] #[allow(non_snake_case)] mod gen_XmlDocument; #[cfg(feature = "XmlDocument")] +#[allow(unused_imports)] pub use gen_XmlDocument::*; #[cfg(feature = "XmlHttpRequest")] #[allow(non_snake_case)] mod gen_XmlHttpRequest; #[cfg(feature = "XmlHttpRequest")] +#[allow(unused_imports)] pub use gen_XmlHttpRequest::*; #[cfg(feature = "XmlHttpRequestEventTarget")] #[allow(non_snake_case)] mod gen_XmlHttpRequestEventTarget; #[cfg(feature = "XmlHttpRequestEventTarget")] +#[allow(unused_imports)] pub use gen_XmlHttpRequestEventTarget::*; #[cfg(feature = "XmlHttpRequestResponseType")] #[allow(non_snake_case)] mod gen_XmlHttpRequestResponseType; #[cfg(feature = "XmlHttpRequestResponseType")] +#[allow(unused_imports)] pub use gen_XmlHttpRequestResponseType::*; #[cfg(feature = "XmlHttpRequestUpload")] #[allow(non_snake_case)] mod gen_XmlHttpRequestUpload; #[cfg(feature = "XmlHttpRequestUpload")] +#[allow(unused_imports)] pub use gen_XmlHttpRequestUpload::*; #[cfg(feature = "XmlSerializer")] #[allow(non_snake_case)] mod gen_XmlSerializer; #[cfg(feature = "XmlSerializer")] +#[allow(unused_imports)] pub use gen_XmlSerializer::*; #[cfg(feature = "XrBoundedReferenceSpace")] #[allow(non_snake_case)] mod gen_XrBoundedReferenceSpace; #[cfg(feature = "XrBoundedReferenceSpace")] +#[allow(unused_imports)] pub use gen_XrBoundedReferenceSpace::*; #[cfg(feature = "XrEye")] #[allow(non_snake_case)] mod gen_XrEye; #[cfg(feature = "XrEye")] +#[allow(unused_imports)] pub use gen_XrEye::*; #[cfg(feature = "XrFrame")] #[allow(non_snake_case)] mod gen_XrFrame; #[cfg(feature = "XrFrame")] +#[allow(unused_imports)] pub use gen_XrFrame::*; +#[cfg(feature = "XrHand")] +#[allow(non_snake_case)] +mod gen_XrHand; +#[cfg(feature = "XrHand")] +#[allow(unused_imports)] +pub use gen_XrHand::*; + +#[cfg(feature = "XrHandJoint")] +#[allow(non_snake_case)] +mod gen_XrHandJoint; +#[cfg(feature = "XrHandJoint")] +#[allow(unused_imports)] +pub use gen_XrHandJoint::*; + #[cfg(feature = "XrHandedness")] #[allow(non_snake_case)] mod gen_XrHandedness; #[cfg(feature = "XrHandedness")] +#[allow(unused_imports)] pub use gen_XrHandedness::*; #[cfg(feature = "XrInputSource")] #[allow(non_snake_case)] mod gen_XrInputSource; #[cfg(feature = "XrInputSource")] +#[allow(unused_imports)] pub use gen_XrInputSource::*; #[cfg(feature = "XrInputSourceArray")] #[allow(non_snake_case)] mod gen_XrInputSourceArray; #[cfg(feature = "XrInputSourceArray")] +#[allow(unused_imports)] pub use gen_XrInputSourceArray::*; #[cfg(feature = "XrInputSourceEvent")] #[allow(non_snake_case)] mod gen_XrInputSourceEvent; #[cfg(feature = "XrInputSourceEvent")] +#[allow(unused_imports)] pub use gen_XrInputSourceEvent::*; #[cfg(feature = "XrInputSourceEventInit")] #[allow(non_snake_case)] mod gen_XrInputSourceEventInit; #[cfg(feature = "XrInputSourceEventInit")] +#[allow(unused_imports)] pub use gen_XrInputSourceEventInit::*; #[cfg(feature = "XrInputSourcesChangeEvent")] #[allow(non_snake_case)] mod gen_XrInputSourcesChangeEvent; #[cfg(feature = "XrInputSourcesChangeEvent")] +#[allow(unused_imports)] pub use gen_XrInputSourcesChangeEvent::*; #[cfg(feature = "XrInputSourcesChangeEventInit")] #[allow(non_snake_case)] mod gen_XrInputSourcesChangeEventInit; #[cfg(feature = "XrInputSourcesChangeEventInit")] +#[allow(unused_imports)] pub use gen_XrInputSourcesChangeEventInit::*; +#[cfg(feature = "XrJointPose")] +#[allow(non_snake_case)] +mod gen_XrJointPose; +#[cfg(feature = "XrJointPose")] +#[allow(unused_imports)] +pub use gen_XrJointPose::*; + +#[cfg(feature = "XrJointSpace")] +#[allow(non_snake_case)] +mod gen_XrJointSpace; +#[cfg(feature = "XrJointSpace")] +#[allow(unused_imports)] +pub use gen_XrJointSpace::*; + +#[cfg(feature = "XrLayer")] +#[allow(non_snake_case)] +mod gen_XrLayer; +#[cfg(feature = "XrLayer")] +#[allow(unused_imports)] +pub use gen_XrLayer::*; + +#[cfg(feature = "XrPermissionDescriptor")] +#[allow(non_snake_case)] +mod gen_XrPermissionDescriptor; +#[cfg(feature = "XrPermissionDescriptor")] +#[allow(unused_imports)] +pub use gen_XrPermissionDescriptor::*; + +#[cfg(feature = "XrPermissionStatus")] +#[allow(non_snake_case)] +mod gen_XrPermissionStatus; +#[cfg(feature = "XrPermissionStatus")] +#[allow(unused_imports)] +pub use gen_XrPermissionStatus::*; + #[cfg(feature = "XrPose")] #[allow(non_snake_case)] mod gen_XrPose; #[cfg(feature = "XrPose")] +#[allow(unused_imports)] pub use gen_XrPose::*; #[cfg(feature = "XrReferenceSpace")] #[allow(non_snake_case)] mod gen_XrReferenceSpace; #[cfg(feature = "XrReferenceSpace")] +#[allow(unused_imports)] pub use gen_XrReferenceSpace::*; #[cfg(feature = "XrReferenceSpaceEvent")] #[allow(non_snake_case)] mod gen_XrReferenceSpaceEvent; #[cfg(feature = "XrReferenceSpaceEvent")] +#[allow(unused_imports)] pub use gen_XrReferenceSpaceEvent::*; #[cfg(feature = "XrReferenceSpaceEventInit")] #[allow(non_snake_case)] mod gen_XrReferenceSpaceEventInit; #[cfg(feature = "XrReferenceSpaceEventInit")] +#[allow(unused_imports)] pub use gen_XrReferenceSpaceEventInit::*; #[cfg(feature = "XrReferenceSpaceType")] #[allow(non_snake_case)] mod gen_XrReferenceSpaceType; #[cfg(feature = "XrReferenceSpaceType")] +#[allow(unused_imports)] pub use gen_XrReferenceSpaceType::*; #[cfg(feature = "XrRenderState")] #[allow(non_snake_case)] mod gen_XrRenderState; #[cfg(feature = "XrRenderState")] +#[allow(unused_imports)] pub use gen_XrRenderState::*; #[cfg(feature = "XrRenderStateInit")] #[allow(non_snake_case)] mod gen_XrRenderStateInit; #[cfg(feature = "XrRenderStateInit")] +#[allow(unused_imports)] pub use gen_XrRenderStateInit::*; #[cfg(feature = "XrRigidTransform")] #[allow(non_snake_case)] mod gen_XrRigidTransform; #[cfg(feature = "XrRigidTransform")] +#[allow(unused_imports)] pub use gen_XrRigidTransform::*; #[cfg(feature = "XrSession")] #[allow(non_snake_case)] mod gen_XrSession; #[cfg(feature = "XrSession")] +#[allow(unused_imports)] pub use gen_XrSession::*; #[cfg(feature = "XrSessionEvent")] #[allow(non_snake_case)] mod gen_XrSessionEvent; #[cfg(feature = "XrSessionEvent")] +#[allow(unused_imports)] pub use gen_XrSessionEvent::*; #[cfg(feature = "XrSessionEventInit")] #[allow(non_snake_case)] mod gen_XrSessionEventInit; #[cfg(feature = "XrSessionEventInit")] +#[allow(unused_imports)] pub use gen_XrSessionEventInit::*; #[cfg(feature = "XrSessionInit")] #[allow(non_snake_case)] mod gen_XrSessionInit; #[cfg(feature = "XrSessionInit")] +#[allow(unused_imports)] pub use gen_XrSessionInit::*; #[cfg(feature = "XrSessionMode")] #[allow(non_snake_case)] mod gen_XrSessionMode; #[cfg(feature = "XrSessionMode")] +#[allow(unused_imports)] pub use gen_XrSessionMode::*; +#[cfg(feature = "XrSessionSupportedPermissionDescriptor")] +#[allow(non_snake_case)] +mod gen_XrSessionSupportedPermissionDescriptor; +#[cfg(feature = "XrSessionSupportedPermissionDescriptor")] +#[allow(unused_imports)] +pub use gen_XrSessionSupportedPermissionDescriptor::*; + #[cfg(feature = "XrSpace")] #[allow(non_snake_case)] mod gen_XrSpace; #[cfg(feature = "XrSpace")] +#[allow(unused_imports)] pub use gen_XrSpace::*; #[cfg(feature = "XrSystem")] #[allow(non_snake_case)] mod gen_XrSystem; #[cfg(feature = "XrSystem")] +#[allow(unused_imports)] pub use gen_XrSystem::*; #[cfg(feature = "XrTargetRayMode")] #[allow(non_snake_case)] mod gen_XrTargetRayMode; #[cfg(feature = "XrTargetRayMode")] +#[allow(unused_imports)] pub use gen_XrTargetRayMode::*; #[cfg(feature = "XrView")] #[allow(non_snake_case)] mod gen_XrView; #[cfg(feature = "XrView")] +#[allow(unused_imports)] pub use gen_XrView::*; #[cfg(feature = "XrViewerPose")] #[allow(non_snake_case)] mod gen_XrViewerPose; #[cfg(feature = "XrViewerPose")] +#[allow(unused_imports)] pub use gen_XrViewerPose::*; #[cfg(feature = "XrViewport")] #[allow(non_snake_case)] mod gen_XrViewport; #[cfg(feature = "XrViewport")] +#[allow(unused_imports)] pub use gen_XrViewport::*; #[cfg(feature = "XrVisibilityState")] #[allow(non_snake_case)] mod gen_XrVisibilityState; #[cfg(feature = "XrVisibilityState")] +#[allow(unused_imports)] pub use gen_XrVisibilityState::*; #[cfg(feature = "XrWebGlLayer")] #[allow(non_snake_case)] mod gen_XrWebGlLayer; #[cfg(feature = "XrWebGlLayer")] +#[allow(unused_imports)] pub use gen_XrWebGlLayer::*; #[cfg(feature = "XrWebGlLayerInit")] #[allow(non_snake_case)] mod gen_XrWebGlLayerInit; #[cfg(feature = "XrWebGlLayerInit")] +#[allow(unused_imports)] pub use gen_XrWebGlLayerInit::*; #[cfg(feature = "XsltProcessor")] #[allow(non_snake_case)] mod gen_XsltProcessor; #[cfg(feature = "XsltProcessor")] +#[allow(unused_imports)] pub use gen_XsltProcessor::*; #[cfg(feature = "console")] #[allow(non_snake_case)] mod gen_console; #[cfg(feature = "console")] +#[allow(unused_imports)] pub use gen_console::*; #[cfg(feature = "css")] #[allow(non_snake_case)] mod gen_css; #[cfg(feature = "css")] +#[allow(unused_imports)] pub use gen_css::*; + +#[cfg(feature = "gpu_buffer_usage")] +#[allow(non_snake_case)] +mod gen_gpu_buffer_usage; +#[cfg(feature = "gpu_buffer_usage")] +#[allow(unused_imports)] +pub use gen_gpu_buffer_usage::*; + +#[cfg(feature = "gpu_color_write")] +#[allow(non_snake_case)] +mod gen_gpu_color_write; +#[cfg(feature = "gpu_color_write")] +#[allow(unused_imports)] +pub use gen_gpu_color_write::*; + +#[cfg(feature = "gpu_map_mode")] +#[allow(non_snake_case)] +mod gen_gpu_map_mode; +#[cfg(feature = "gpu_map_mode")] +#[allow(unused_imports)] +pub use gen_gpu_map_mode::*; + +#[cfg(feature = "gpu_shader_stage")] +#[allow(non_snake_case)] +mod gen_gpu_shader_stage; +#[cfg(feature = "gpu_shader_stage")] +#[allow(unused_imports)] +pub use gen_gpu_shader_stage::*; + +#[cfg(feature = "gpu_texture_usage")] +#[allow(non_snake_case)] +mod gen_gpu_texture_usage; +#[cfg(feature = "gpu_texture_usage")] +#[allow(unused_imports)] +pub use gen_gpu_texture_usage::*; diff --git a/crates/web-sys/src/lib.rs b/crates/web-sys/src/lib.rs index c057cd9c1a9..38cdb6732e9 100644 --- a/crates/web-sys/src/lib.rs +++ b/crates/web-sys/src/lib.rs @@ -12,11 +12,18 @@ //! require. #![doc(html_root_url = "https://docs.rs/web-sys/0.3")] +#![no_std] #![allow(deprecated)] +extern crate alloc; + mod features; +#[allow(unused_imports)] pub use features::*; +pub use js_sys; +pub use wasm_bindgen; + /// Getter for the `Window` object /// /// [MDN Documentation] diff --git a/crates/web-sys/tests/wasm/blob.rs b/crates/web-sys/tests/wasm/blob.rs index f4881a73294..726ffc715fe 100644 --- a/crates/web-sys/tests/wasm/blob.rs +++ b/crates/web-sys/tests/wasm/blob.rs @@ -1,6 +1,5 @@ use js_sys::{Array, ArrayBuffer}; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_futures::JsFuture; use wasm_bindgen_test::*; use web_sys::Blob; diff --git a/crates/web-sys/tests/wasm/button_element.rs b/crates/web-sys/tests/wasm/button_element.rs index d94160aace7..f46051b3ceb 100644 --- a/crates/web-sys/tests/wasm/button_element.rs +++ b/crates/web-sys/tests/wasm/button_element.rs @@ -1,6 +1,6 @@ use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; -use web_sys::{HtmlButtonElement, HtmlFormElement, Node}; +use web_sys::{HtmlButtonElement, HtmlFormElement}; #[wasm_bindgen(module = "/tests/wasm/element.js")] extern "C" { @@ -9,6 +9,7 @@ extern "C" { } #[wasm_bindgen_test] +#[allow(deprecated)] fn test_button_element() { let element = new_button(); let location = web_sys::window().unwrap().location().href().unwrap(); @@ -21,8 +22,9 @@ fn test_button_element() { assert!(element.disabled(), "Should be disabled"); match element.form() { - None => assert!(true, "Shouldn't have a form"), - _ => assert!(false, "Shouldn't have a form"), + // Shouldn't have a form + None => (), + _ => unreachable!("Shouldn't have a form"), }; assert_eq!( @@ -73,17 +75,17 @@ fn test_button_element() { element.set_value("value1"); assert_eq!(element.value(), "value1", "Should have a value"); - assert_eq!(element.will_validate(), false, "Shouldn't validate"); + assert!(!element.will_validate(), "Shouldn't validate"); assert_eq!( element.validation_message().unwrap(), "", "Shouldn't have a value" ); - assert_eq!(element.check_validity(), true, "Should be valid"); - assert_eq!(element.report_validity(), true, "Should be valid"); + assert!(element.check_validity(), "Should be valid"); + assert!(element.report_validity(), "Should be valid"); element.set_custom_validity("Boop"); // Method exists but doesn't impact validity - assert_eq!(element.check_validity(), true, "Should be valid"); - assert_eq!(element.report_validity(), true, "Should be valid"); + assert!(element.check_validity(), "Should be valid"); + assert!(element.report_validity(), "Should be valid"); assert_eq!( element.labels().length(), @@ -99,18 +101,13 @@ fn test_button_element_in_form() { let form = new_form(); form.set_name("test-form"); - // TODO: implement `Clone` for types in `web_sys` to make this easier. - let button = JsValue::from(button); - let as_node = Node::from(button.clone()); - Node::from(JsValue::from(form)) - .append_child(&as_node) - .unwrap(); + form.append_child(&button).unwrap(); - let element = HtmlButtonElement::from(button); - match element.form() { - None => assert!(false, "Should have a form"), + match button.form() { + // Should have a form + None => (), Some(form) => { - assert!(true, "Should have a form"); + // Should have a form assert_eq!( form.name(), "test-form", @@ -118,5 +115,5 @@ fn test_button_element_in_form() { ); } }; - assert_eq!(element.type_(), "reset", "Should have a type"); + assert_eq!(button.type_(), "reset", "Should have a type"); } diff --git a/crates/web-sys/tests/wasm/element.js b/crates/web-sys/tests/wasm/element.js index ed51fbdbe71..1c104ed234e 100644 --- a/crates/web-sys/tests/wasm/element.js +++ b/crates/web-sys/tests/wasm/element.js @@ -116,6 +116,7 @@ export function new_select_with_food_opts() { for(let i = 0; i < opts.length; i++) { let opt = document.createElement("option"); + opt.id = opts[i]; opt.value = opts[i]; opt.text = opts[i]; select.appendChild(opt); diff --git a/crates/web-sys/tests/wasm/element.rs b/crates/web-sys/tests/wasm/element.rs index a408a9c7cdf..8cc1cefc706 100644 --- a/crates/web-sys/tests/wasm/element.rs +++ b/crates/web-sys/tests/wasm/element.rs @@ -14,7 +14,10 @@ fn element() { */ let element = new_div(); - assert_eq!(element, element); + #[allow(clippy::eq_op)] + { + assert_eq!(element, element); + } assert_eq!(element.prefix(), None, "Shouldn't have a prefix"); assert_eq!(element.local_name(), "div", "Should have a div local name"); @@ -24,17 +27,11 @@ fn element() { assert_eq!(element.id(), "beep", "Should have an id of 'beep'"); // must_use is set on this result? - assert_eq!( - element.set_attribute("id", "beep").unwrap(), - (), - "Should set id" - ); + // Should set id + let _: () = element.set_attribute("id", "beep").unwrap(); assert!(element.has_attribute("id"), "Should now have an id"); - assert_eq!( - element.remove_attribute("id").unwrap(), - (), - "Should return nothing if removed" - ); + // Should return nothing if removed + let _: () = element.remove_attribute("id").unwrap(); assert_eq!(element.class_name(), "", "Shouldn't have a class name"); element.set_class_name("test thing"); @@ -48,88 +45,80 @@ fn element() { "test thing", "Should have a class name" ); - assert_eq!( - element.remove_attribute("class").unwrap(), - (), - "Should return nothing if removed" - ); + // Should return nothing if removed + let _: () = element.remove_attribute("class").unwrap(); /* Tests needed for: get_attribute_ns */ - /*TODO should we enable toggle_attribute tests? (Firefox Nightly + Chrome canary only) - // TODO toggle_attribute should permit a single argument when optional arguments are supported - assert!(!element.has_attribute("disabled"), "Should not be disabled"); - assert!(element.toggle_attribute("disabled", true).unwrap(), "Should return true when attribute is set"); - assert!(element.has_attribute("disabled"), "Should be disabled"); - assert!(!element.toggle_attribute("disabled", false).unwrap(), "Should return false when attribute is not set"); - assert!(!element.has_attribute("disabled"), "Should not be disabled"); - */ + assert!(!element.has_attribute("disabled"), "Should not be disabled"); + assert!( + element.toggle_attribute("disabled").unwrap(), + "Should return true when attribute is set" + ); + assert!(element.has_attribute("disabled"), "Should be disabled"); + assert!( + element + .toggle_attribute_with_force("disabled", true) + .unwrap(), + "Should return true when attribute is set" + ); + assert!(element.has_attribute("disabled"), "Should be disabled"); + assert!( + !element + .toggle_attribute_with_force("disabled", false) + .unwrap(), + "Should return false when attribute is not set" + ); + assert!(!element.has_attribute("disabled"), "Should not be disabled"); assert!(!element.has_attribute("title"), "Should not have a title"); - assert_eq!( - element.set_attribute("title", "boop").unwrap(), - (), - "Should return nothing if set correctly" - ); + // Should return nothing if set correctly + let _: () = element.set_attribute("title", "boop").unwrap(); assert!(element.has_attribute("title"), "Should have a title"); - // TODO check get_attribute here when supported assert_eq!( - element.remove_attribute("title").unwrap(), - (), - "Should return nothing if removed" + element.get_attribute("title").unwrap(), + "boop", + "Title should be 'boop'" ); + // Should return nothing if removed + let _: () = element.remove_attribute("title").unwrap(); assert!(!element.has_attribute("title"), "Should not have a title"); /* Tests needed for: set_attribute_ns */ assert!(!element.has_attributes(), "Should not have any attributes"); - assert_eq!( - element.set_attribute("title", "boop").unwrap(), - (), - "Should return nothing if set correctly" - ); + // Should return nothing if set correctly + let _: () = element.set_attribute("title", "boop").unwrap(); assert!(element.has_attributes(), "Should have attributes"); - assert_eq!( - element.remove_attribute("title").unwrap(), - (), - "Should return nothing if removed" - ); + // Should return nothing if removed + let _: () = element.remove_attribute("title").unwrap(); /* Tests needed for: remove_attribute_ns - has_attribure_ns + has_attribute_ns closest */ - assert_eq!( - element.matches(".this-is-a-thing").unwrap(), - false, + assert!( + !element.matches(".this-is-a-thing").unwrap(), "Should not match selector" ); - assert_eq!( - element.webkit_matches_selector(".this-is-a-thing").unwrap(), - false, + assert!( + !element.webkit_matches_selector(".this-is-a-thing").unwrap(), "Should not match selector" ); element.set_class_name("this-is-a-thing"); - assert_eq!( + assert!( element.matches(".this-is-a-thing").unwrap(), - true, "Should match selector" ); - assert_eq!( + assert!( element.webkit_matches_selector(".this-is-a-thing").unwrap(), - true, "Should match selector" ); - assert_eq!( - element.remove_attribute("class").unwrap(), - (), - "Should return nothing if removed" - ); - - // TODO non standard moz_matches_selector should we even support? + // Should return nothing if removed + let _: () = element.remove_attribute("class").unwrap(); /* Tests needed for: insert_adjacent_element @@ -160,7 +149,7 @@ fn element() { assert_eq!( element.inner_html(), "Hey!Web!", - "Should return HTML conent" + "Should return HTML content" ); assert_eq!( element.query_selector_all("strong").unwrap().length(), @@ -181,12 +170,12 @@ fn element() { */ assert!( - element.query_selector(".none-existant").unwrap().is_none(), + element.query_selector(".none-existent").unwrap().is_none(), "Should return no results" ); assert_eq!( element - .query_selector_all(".none-existant") + .query_selector_all(".none-existent") .unwrap() .length(), 0, @@ -214,7 +203,7 @@ fn element() { assert_eq!( element.get_elements_by_class_name("foo").length(), 0, - "Element should not have childs with class foo" + "Element should not have children with class foo" ); child.class_list().add_1("foo").unwrap(); assert_eq!( diff --git a/crates/web-sys/tests/wasm/event.rs b/crates/web-sys/tests/wasm/event.rs index 08d74ec83ad..4ffb48f167d 100644 --- a/crates/web-sys/tests/wasm/event.rs +++ b/crates/web-sys/tests/wasm/event.rs @@ -1,6 +1,5 @@ use js_sys::{Object, Promise}; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_futures::JsFuture; use wasm_bindgen_test::*; use web_sys::Event; diff --git a/crates/web-sys/tests/wasm/head_element.rs b/crates/web-sys/tests/wasm/head_element.rs index 4b827335727..7bd2c15eedc 100644 --- a/crates/web-sys/tests/wasm/head_element.rs +++ b/crates/web-sys/tests/wasm/head_element.rs @@ -10,5 +10,5 @@ extern "C" { #[wasm_bindgen_test] fn test_head_element() { let _element = new_head(); - assert!(true, "Head doesn't have an interface"); + // Head doesn't have an interface } diff --git a/crates/web-sys/tests/wasm/headers.js b/crates/web-sys/tests/wasm/headers.js index 3b71cdc66ab..267c0744c00 100644 --- a/crates/web-sys/tests/wasm/headers.js +++ b/crates/web-sys/tests/wasm/headers.js @@ -1,3 +1,7 @@ export function new_headers() { return new Headers({'Content-Type': 'text/plain'}); } + +export function new_headers_2() { + return new Headers({'Content-Type': 'text/plain', 'Cookie': 'foobarbaz'}); +} diff --git a/crates/web-sys/tests/wasm/headers.rs b/crates/web-sys/tests/wasm/headers.rs index 08751444b60..8433ee50e05 100644 --- a/crates/web-sys/tests/wasm/headers.rs +++ b/crates/web-sys/tests/wasm/headers.rs @@ -1,3 +1,4 @@ +use js_sys::Array; use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; use web_sys::Headers; @@ -5,6 +6,7 @@ use web_sys::Headers; #[wasm_bindgen(module = "/tests/wasm/headers.js")] extern "C" { fn new_headers() -> Headers; + fn new_headers_2() -> Headers; } #[wasm_bindgen_test] @@ -29,3 +31,40 @@ fn headers() { assert!(headers.append("a", "z").is_ok()); assert_eq!(headers.get("a").unwrap(), Some("y, z".to_string())); } + +#[wasm_bindgen_test] +fn headers_iter() { + let headers = new_headers_2() + .entries() + .into_iter() + .map(|x| { + let array = x.unwrap().dyn_into::().unwrap(); + assert_eq!(array.length(), 2); + let k: String = array.at(0).as_string().unwrap(); + let v: String = array.at(1).as_string().unwrap(); + (k, v) + }) + .collect::>(); + + assert_eq!(headers.len(), 2); + assert_eq!(&headers[0].0, "content-type"); + assert_eq!(&headers[0].1, "text/plain"); + assert_eq!(&headers[1].0, "cookie"); + assert_eq!(&headers[1].1, "foobarbaz"); +} + +#[wasm_bindgen_test] +fn headers_for_each() { + let mut count = 0; + let cb = Closure::wrap(Box::new(move |jval: JsValue| { + let val: String = jval.as_string().unwrap(); + if count == 0 { + assert_eq!(val, "text/plain"); + } else { + assert_eq!(val, "foobarbaz"); + } + count += 1; + }) as Box); + let res = new_headers_2().for_each(cb.as_ref().unchecked_ref()); + assert!(res.is_ok()); +} diff --git a/crates/web-sys/tests/wasm/history.rs b/crates/web-sys/tests/wasm/history.rs index f3ecdc42eb0..ba073d85e07 100644 --- a/crates/web-sys/tests/wasm/history.rs +++ b/crates/web-sys/tests/wasm/history.rs @@ -4,25 +4,27 @@ use web_sys::{History, ScrollRestoration}; #[wasm_bindgen] extern "C" { - #[wasm_bindgen(js_name = history, js_namespace = window)] + #[wasm_bindgen(thread_local_v2, js_name = history, js_namespace = window)] static HISTORY: History; } #[wasm_bindgen_test] fn history() { - HISTORY - .set_scroll_restoration(ScrollRestoration::Manual) - .expect("failure to set scroll restoration"); - assert_eq!( - HISTORY.scroll_restoration().unwrap(), - ScrollRestoration::Manual - ); + HISTORY.with(|history| { + history + .set_scroll_restoration(ScrollRestoration::Manual) + .expect("failure to set scroll restoration"); + assert_eq!( + history.scroll_restoration().unwrap(), + ScrollRestoration::Manual + ); - HISTORY - .set_scroll_restoration(ScrollRestoration::Auto) - .expect("failure to set scroll restoration"); - assert_eq!( - HISTORY.scroll_restoration().unwrap(), - ScrollRestoration::Auto - ); + history + .set_scroll_restoration(ScrollRestoration::Auto) + .expect("failure to set scroll restoration"); + assert_eq!( + history.scroll_restoration().unwrap(), + ScrollRestoration::Auto + ); + }); } diff --git a/crates/web-sys/tests/wasm/hr_element.rs b/crates/web-sys/tests/wasm/hr_element.rs index fe63c14045a..d707b5a5e58 100644 --- a/crates/web-sys/tests/wasm/hr_element.rs +++ b/crates/web-sys/tests/wasm/hr_element.rs @@ -20,5 +20,5 @@ fn test_hr_element() { assert_eq!(hr.width(), "256"); hr.set_no_shade(true); - assert_eq!(hr.no_shade(), true); + assert!(hr.no_shade()); } diff --git a/crates/web-sys/tests/wasm/html_element.rs b/crates/web-sys/tests/wasm/html_element.rs index 7cf15cdd491..710699e76fe 100644 --- a/crates/web-sys/tests/wasm/html_element.rs +++ b/crates/web-sys/tests/wasm/html_element.rs @@ -1,5 +1,4 @@ use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_test::*; use web_sys::HtmlElement; @@ -94,10 +93,10 @@ fn test_html_element() { assert_eq!(element.tab_index(), 1, "Should be tab_index"); // TODO add a focus handler here - assert_eq!(element.focus().unwrap(), (), "No result"); + let _: () = element.focus().unwrap(); // TODO add a blur handler here - assert_eq!(element.blur().unwrap(), (), "No result"); + let _: () = element.blur().unwrap(); assert_eq!(element.access_key(), "", "Shouldn't have a access_key"); element.set_access_key("a"); @@ -122,23 +121,16 @@ fn test_html_element() { ); assert!(element.is_content_editable(), "Should be content_editable"); - /*TODO doesn't work in Chrome - // TODO verify case where menu is passed - match element.context_menu() { - None => assert!(true, "Shouldn't have a custom menu set"), - _ => assert!(false, "Shouldn't have a custom menu set") - }; - */ - - // TODO: This test is also broken in Chrome (but not Firefox). - // assert!(!element.spellcheck(), "Shouldn't be spellchecked"); + element.set_spellcheck(false); + assert!(!element.spellcheck(), "Shouldn't be spellchecked"); element.set_spellcheck(true); - assert!(element.spellcheck(), "Should be dragspellcheckedgable"); + assert!(element.spellcheck(), "Should be spellchecked"); // TODO verify case where we have an offset_parent match element.offset_parent() { - None => assert!(true, "Shouldn't have an offset_parent set"), - _ => assert!(false, "Shouldn't have a offset_parent set"), + // Shouldn't have an offset_parent set + None => (), + _ => unreachable!("Shouldn't have a offset_parent set"), }; // TODO verify when we have offsets diff --git a/crates/web-sys/tests/wasm/indexeddb.rs b/crates/web-sys/tests/wasm/indexeddb.rs index b85c3e4346b..cfaa2ea431b 100644 --- a/crates/web-sys/tests/wasm/indexeddb.rs +++ b/crates/web-sys/tests/wasm/indexeddb.rs @@ -1,5 +1,4 @@ use wasm_bindgen_test::*; -use web_sys; #[wasm_bindgen_test] fn accessor_works() { diff --git a/crates/web-sys/tests/wasm/input_element.rs b/crates/web-sys/tests/wasm/input_element.rs index 460576328a3..ea2f9c66a56 100644 --- a/crates/web-sys/tests/wasm/input_element.rs +++ b/crates/web-sys/tests/wasm/input_element.rs @@ -8,6 +8,7 @@ extern "C" { } #[wasm_bindgen_test] +#[allow(deprecated)] fn test_input_element() { let element = new_input(); let location = web_sys::window().unwrap().location().href().unwrap(); @@ -40,19 +41,18 @@ fn test_input_element() { element.set_default_checked(true); assert!(element.default_checked(), "Should have an default_checked"); - /*TODO fix - assert!(!element.checked(), "Shouldn't be checked"); - element.set_checked(true); - assert!(element.checked(), "Should be checked"); - */ + assert!(element.checked(), "Should be checked"); + element.set_checked(false); + assert!(!element.checked(), "Shouldn't be checked"); assert!(!element.disabled(), "Shouldn't be disabled"); element.set_disabled(true); assert!(element.disabled(), "Should be disabled"); match element.form() { - None => assert!(true, "Shouldn't have a form"), - _ => assert!(false, "Shouldn't have a form"), + // Shouldn't have a form + None => (), + _ => unreachable!("Shouldn't have a form"), }; assert_eq!( @@ -93,14 +93,18 @@ fn test_input_element() { assert_eq!(element.height(), 0, "Should have no height"); element.set_height(12); - assert_eq!(element.height(), 0, "Should have no height"); // Doesn't change, TODO check with get_attribute("height")=="12" + assert_eq!(element.height(), 0, "Should have no height"); + assert_eq!( + element.get_attribute("height").unwrap(), + "12", + "The height attribute should be 12" + ); - /*TODO fails in chrome element.set_type("checkbox"); + element.set_indeterminate(true); assert!(element.indeterminate(), "Should be indeterminate"); - element.set_checked(true); + element.set_indeterminate(false); assert!(!element.indeterminate(), "Shouldn't be indeterminate"); - */ /*TODO add tests pub fn indeterminate(&self) -> bool pub fn set_indeterminate(&self, indeterminate: bool) @@ -144,12 +148,11 @@ fn test_input_element() { pub fn size(&self) -> u32 pub fn set_size(&self, size: u32) */ - /*TODO fails in chrome - element.set_type("image"); - assert_eq!(element.src(), "", "Should have no src"); - element.set_value("hey.png"); - assert_eq!(element.src(), "hey.png", "Should have a src"); - */ + element.set_type("image"); + assert_eq!(element.src(), "", "Should have no src"); + const EMPTY_IMAGE: &str = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E"; + element.set_src(EMPTY_IMAGE); + assert_eq!(element.src(), EMPTY_IMAGE, "Should have a src"); /*TODO add tests pub fn src(&self) -> String pub fn set_src(&self, src: &str) @@ -160,11 +163,9 @@ fn test_input_element() { pub fn default_value(&self) -> String pub fn set_default_value(&self, default_value: &str) */ - /*TODO fails in chrome - assert_eq!(element.value(), "", "Should have no value"); - element.set_value("hey!"); - assert_eq!(element.value(), "hey!", "Should have a value"); - */ + assert_eq!(element.value(), "", "Should have no value"); + element.set_value("hey!"); + assert_eq!(element.value(), "hey!", "Should have a value"); element.set_type("number"); element.set_value("1"); assert_eq!(element.value_as_number(), 1.0, "Should have value 1"); @@ -173,19 +174,24 @@ fn test_input_element() { assert_eq!(element.width(), 0, "Should have no width"); element.set_width(12); - assert_eq!(element.width(), 0, "Should have no width"); // Doesn't change, TODO check with get_attribute("width")=="12" + assert_eq!(element.width(), 0, "Should have no width"); + assert_eq!( + element.get_attribute("width").unwrap(), + "12", + "The width attribute should be 12" + ); - assert_eq!(element.will_validate(), false, "Shouldn't validate"); + assert!(!element.will_validate(), "Shouldn't validate"); assert_eq!( element.validation_message().unwrap(), "", "Shouldn't have a value" ); - assert_eq!(element.check_validity(), true, "Should be valid"); - assert_eq!(element.report_validity(), true, "Should be valid"); + assert!(element.check_validity(), "Should be valid"); + assert!(element.report_validity(), "Should be valid"); element.set_custom_validity("Boop"); // Method exists but doesn't impact validity ?!??! TODO look into - assert_eq!(element.check_validity(), true, "Should be valid"); - assert_eq!(element.report_validity(), true, "Should be valid"); + assert!(element.check_validity(), "Should be valid"); + assert!(element.report_validity(), "Should be valid"); /*TODO add tests pub fn labels(&self) -> Option pub fn select(&self) diff --git a/crates/web-sys/tests/wasm/main.rs b/crates/web-sys/tests/wasm/main.rs index f78f773a9f6..737d1029a3e 100644 --- a/crates/web-sys/tests/wasm/main.rs +++ b/crates/web-sys/tests/wasm/main.rs @@ -11,6 +11,7 @@ pub mod br_element; pub mod button_element; pub mod console; pub mod div_element; +pub mod dom_point; pub mod element; pub mod event; pub mod head_element; @@ -21,17 +22,15 @@ pub mod hr_element; pub mod html_element; pub mod html_html_element; pub mod image_data; -pub mod input_element; -//TODO: Both menu-related tests completely break in Chrome, but run fine in Firefox. -//pub mod menu_element; -//pub mod menu_item_element; -pub mod dom_point; pub mod indexeddb; +pub mod input_element; pub mod location; +pub mod menu_element; pub mod meta_element; pub mod meter_element; pub mod mod_elements; pub mod olist_element; +pub mod opfs; pub mod optgroup_element; pub mod option_element; pub mod options_collection; diff --git a/crates/web-sys/tests/wasm/menu_element.rs b/crates/web-sys/tests/wasm/menu_element.rs index 92456133ffd..c1ed7504751 100644 --- a/crates/web-sys/tests/wasm/menu_element.rs +++ b/crates/web-sys/tests/wasm/menu_element.rs @@ -1,5 +1,5 @@ -use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; +use wasm_bindgen_test::*; use web_sys::HtmlMenuElement; #[wasm_bindgen(module = "/tests/wasm/element.js")] @@ -11,15 +11,15 @@ extern "C" { fn test_menu_element() { let menu = new_menu(); - menu.set_type("toolbar"); - assert_eq!(menu.type_(), "toolbar", "Menu should have the type value we gave it."); - - menu.set_label("Menu label here"); - assert_eq!(menu.label(), "Menu label here", "Menu should have the label value we gave it."); - menu.set_compact(true); - assert_eq!(menu.compact(), true, "Menu should be compact after we set it to be compact."); + assert!( + menu.compact(), + "Menu should be compact after we set it to be compact." + ); menu.set_compact(false); - assert_eq!(menu.compact(), false, "Menu should not be compact after we set it to be not-compact."); + assert!( + !menu.compact(), + "Menu should not be compact after we set it to be not-compact." + ); } diff --git a/crates/web-sys/tests/wasm/menu_item_element.rs b/crates/web-sys/tests/wasm/menu_item_element.rs deleted file mode 100644 index 6b6eaaffb22..00000000000 --- a/crates/web-sys/tests/wasm/menu_item_element.rs +++ /dev/null @@ -1,43 +0,0 @@ -use wasm_bindgen_test::*; -use wasm_bindgen::prelude::*; -use web_sys::HtmlMenuItemElement; - -#[wasm_bindgen(module = "/tests/wasm/element.js")] -extern "C" { - fn new_menuitem() -> HtmlMenuItemElement; -} - -#[wasm_bindgen_test] -fn test_menuitem_element() { - let menuitem = new_menuitem(); - - menuitem.set_type("radio"); - assert_eq!(menuitem.type_(), "radio", "Menu item should have the type value we gave it."); - - menuitem.set_label("Menu item label here"); - assert_eq!(menuitem.label(), "Menu item label here", "Menu item should have the label value we gave it."); - - menuitem.set_icon("https://en.wikipedia.org/wiki/Rust_(programming_language)#/media/File:Rust_programming_language_black_logo.svg"); - assert_eq!(menuitem.icon(), "https://en.wikipedia.org/wiki/Rust_(programming_language)#/media/File:Rust_programming_language_black_logo.svg", "Menu item should have the icon value we gave it."); - - menuitem.set_disabled(true); - assert_eq!(menuitem.disabled(), true, "Menu item should be disabled after we set it to be disabled."); - - menuitem.set_disabled(false); - assert_eq!(menuitem.disabled(), false, "Menu item should not be disabled after we set it to be not-disabled."); - - menuitem.set_checked(true); - assert_eq!(menuitem.checked(), true, "Menu item should be checked after we set it to be checked."); - - menuitem.set_checked(false); - assert_eq!(menuitem.checked(), false, "Menu item should not be checked after we set it to be not-checked."); - - menuitem.set_radiogroup("Radio group name"); - assert_eq!(menuitem.radiogroup(), "Radio group name", "Menu item should have the radiogroup value we gave it."); - - menuitem.set_default_checked(true); - assert_eq!(menuitem.default_checked(), true, "Menu item should be default_checked after we set it to be default_checked."); - - menuitem.set_default_checked(false); - assert_eq!(menuitem.default_checked(), false, "Menu item should not be default_checked after we set it to be not default_checked."); -} diff --git a/crates/web-sys/tests/wasm/olist_element.rs b/crates/web-sys/tests/wasm/olist_element.rs index 56785c0e796..9108bd24b24 100644 --- a/crates/web-sys/tests/wasm/olist_element.rs +++ b/crates/web-sys/tests/wasm/olist_element.rs @@ -12,16 +12,14 @@ fn test_olist_element() { let olist = new_olist(); olist.set_reversed(true); - assert_eq!( + assert!( olist.reversed(), - true, "Olist should be reversed after we set it to be reversed." ); olist.set_reversed(false); - assert_eq!( - olist.reversed(), - false, + assert!( + !olist.reversed(), "Olist should not be reversed after we set it to be not reversed." ); @@ -47,16 +45,14 @@ fn test_olist_element() { ); olist.set_compact(true); - assert_eq!( + assert!( olist.compact(), - true, "Olist should be compact after we set it to be compact." ); olist.set_compact(false); - assert_eq!( - olist.compact(), - false, + assert!( + !olist.compact(), "Olist should not be compact after we set it to be not compact." ); } diff --git a/crates/web-sys/tests/wasm/opfs.rs b/crates/web-sys/tests/wasm/opfs.rs new file mode 100644 index 00000000000..db679e4f95c --- /dev/null +++ b/crates/web-sys/tests/wasm/opfs.rs @@ -0,0 +1,159 @@ +use std::collections::BTreeMap; + +use futures::stream::StreamExt; +use js_sys::{Array, JsString}; +use wasm_bindgen::prelude::*; +use wasm_bindgen_futures::{stream::JsStream, JsFuture}; +use wasm_bindgen_test::*; +use web_sys::{ + window, File, FileSystemDirectoryHandle, FileSystemFileHandle, FileSystemGetDirectoryOptions, + FileSystemGetFileOptions, FileSystemWritableFileStream, +}; + +// aux functions + +async fn get_storage() -> FileSystemDirectoryHandle { + let storage_promise = window().unwrap().navigator().storage().get_directory(); + JsFuture::from(storage_promise) + .await + .unwrap() + .dyn_into::() + .unwrap() +} + +async fn create_directory( + dir: &FileSystemDirectoryHandle, + path: &str, +) -> FileSystemDirectoryHandle { + let mut opts = FileSystemGetDirectoryOptions::new(); + #[allow(deprecated)] + opts.create(true); + JsFuture::from(dir.get_directory_handle_with_options(path, &opts)) + .await + .expect("Couldn't create test directory") + .dyn_into::() + .unwrap() +} + +async fn create_test_directory(path: &str) -> FileSystemDirectoryHandle { + let storage = get_storage().await; + create_directory(&storage, path).await +} + +async fn create_file(dir: &FileSystemDirectoryHandle, path: &str) { + let mut opts = FileSystemGetFileOptions::new(); + #[allow(deprecated)] + opts.create(true); + let _ = JsFuture::from(dir.get_file_handle_with_options(path, &opts)).await; +} + +// Tests + +// Check we can access the root opfs directory +#[wasm_bindgen_test] +async fn access_storage() { + let storage_promise = window().unwrap().navigator().storage().get_directory(); + let storage = JsFuture::from(storage_promise).await; + assert!(storage.is_ok()); +} + +// Creating a directory in the root dir and test it's there +#[wasm_bindgen_test] +async fn test_create_directory() { + let _test_dir = create_test_directory("create_directory").await; + let storage = get_storage().await; + let dir = JsFuture::from(storage.get_directory_handle("create_directory")).await; + assert!(dir.is_ok()); +} + +#[wasm_bindgen_test] +async fn test_create_file() { + let test_dir = create_test_directory("create_file").await; + create_file(&test_dir, "test.txt").await; + let stream = JsStream::from(test_dir.keys()); + let mut res = stream.collect::>>().await; + assert_eq!(res.len(), 1, "Expected number of files"); + let path = res.pop().unwrap().unwrap().dyn_into::().unwrap(); + assert_eq!(path, "test.txt", "Searched for file"); +} + +#[wasm_bindgen_test] +async fn test_write_to_file() { + let test_dir = create_test_directory("write_to_file").await; + + // create file + let mut opts = FileSystemGetFileOptions::new(); + #[allow(deprecated)] + opts.create(true); + let file = JsFuture::from(test_dir.get_file_handle_with_options("test.txt", &opts)) + .await + .expect("Couldn't create file") + .dyn_into::() + .unwrap(); + + // Write to file + let test_txt = "testing testing"; + let write_stream = JsFuture::from(file.create_writable()) + .await + .unwrap() + .dyn_into::() + .unwrap(); + let _ = JsFuture::from(write_stream.write_with_str(test_txt).unwrap()).await; + JsFuture::from(write_stream.close()).await.unwrap(); + + // Read and check contents + let values = JsStream::from(test_dir.values()) + .map(|x| x.unwrap().dyn_into::().unwrap()) + .collect::>() + .await; + assert_eq!(values.len(), 1); + + let file = JsFuture::from(values[0].get_file()) + .await + .unwrap() + .dyn_into::() + .unwrap(); + + let text = JsFuture::from(file.text()) + .await + .unwrap() + .dyn_into::() + .unwrap(); + assert_eq!(&text, test_txt); +} + +// Create a couple of entries in a directory and check entries returns them all +#[wasm_bindgen_test] +async fn test_entries() { + let test_dir = create_test_directory("entries").await; + create_directory(&test_dir, "dir").await; + create_file(&test_dir, "file").await; + create_file(&test_dir, "file2").await; + + let entries = JsStream::from(test_dir.entries()) + .map(|x| { + let array: Vec = x.unwrap().dyn_into::().unwrap().to_vec(); + assert_eq!(array.len(), 2); + let path: String = array[0].clone().dyn_into::().unwrap().into(); + (path, array[1].clone()) + }) + .collect::>() + .await; + + assert_eq!(entries.len(), 3); + + match entries.get("dir") { + Some(handle) => assert!(FileSystemDirectoryHandle::instanceof(handle)), + _ => panic!("Didn't find directory"), + } + + match entries.get("file") { + Some(handle) => assert!(FileSystemFileHandle::instanceof(handle)), + _ => panic!("Couldn't find file"), + } + + match entries.get("file2") { + Some(handle) => assert!(FileSystemFileHandle::instanceof(handle)), + _ => panic!("Couldn't find file2"), + } +} diff --git a/crates/web-sys/tests/wasm/optgroup_element.rs b/crates/web-sys/tests/wasm/optgroup_element.rs index 99d72dada4a..3e6bea5bf83 100644 --- a/crates/web-sys/tests/wasm/optgroup_element.rs +++ b/crates/web-sys/tests/wasm/optgroup_element.rs @@ -12,16 +12,14 @@ fn test_optgroup_element() { let optgroup = new_optgroup(); optgroup.set_disabled(true); - assert_eq!( + assert!( optgroup.disabled(), - true, "Optgroup should be disabled after we set it to be disabled." ); optgroup.set_disabled(false); - assert_eq!( - optgroup.disabled(), - false, + assert!( + !optgroup.disabled(), "Optgroup should not be disabled after we set it to be not-disabled." ); diff --git a/crates/web-sys/tests/wasm/option_element.rs b/crates/web-sys/tests/wasm/option_element.rs index 10661b29b49..7c060668d04 100644 --- a/crates/web-sys/tests/wasm/option_element.rs +++ b/crates/web-sys/tests/wasm/option_element.rs @@ -12,16 +12,14 @@ fn test_option_element() { .unwrap(); option.set_disabled(true); - assert_eq!( + assert!( option.disabled(), - true, "Option should be disabled after we set it to be disabled." ); option.set_disabled(false); - assert_eq!( - option.disabled(), - false, + assert!( + !option.disabled(), "Option should not be disabled after we set it to be not-disabled." ); @@ -38,30 +36,26 @@ fn test_option_element() { ); option.set_default_selected(true); - assert_eq!( + assert!( option.default_selected(), - true, "Option should be default_selected after we set it to be default_selected." ); option.set_default_selected(false); - assert_eq!( - option.default_selected(), - false, + assert!( + !option.default_selected(), "Option should not be default_selected after we set it to be not default_selected." ); option.set_selected(true); - assert_eq!( + assert!( option.selected(), - true, "Option should be selected after we set it to be selected." ); option.set_selected(false); - assert_eq!( - option.selected(), - false, + assert!( + !option.selected(), "Option should not be selected after we set it to be not selected." ); diff --git a/crates/web-sys/tests/wasm/output_element.rs b/crates/web-sys/tests/wasm/output_element.rs index bb25f182449..c1879cc5b7b 100644 --- a/crates/web-sys/tests/wasm/output_element.rs +++ b/crates/web-sys/tests/wasm/output_element.rs @@ -42,8 +42,10 @@ fn test_output_element() { output.set_value("49"); assert_eq!(output.value(), "49", "Output value should be '49'."); - // TODO: Fails in Chrome, but not in Firefox. - //assert!(output.will_validate(), "Output should validate by default (maybe browser dependent?)"); + assert!( + !output.will_validate(), + "Output is not a submittable element, so willValidate must be false" + ); assert!( output.validity().valid(), diff --git a/crates/web-sys/tests/wasm/performance.rs b/crates/web-sys/tests/wasm/performance.rs index 84931a627cd..1be0c7f11f0 100644 --- a/crates/web-sys/tests/wasm/performance.rs +++ b/crates/web-sys/tests/wasm/performance.rs @@ -4,12 +4,12 @@ use web_sys::Performance; #[wasm_bindgen] extern "C" { - #[wasm_bindgen(js_name = performance)] + #[wasm_bindgen(thread_local_v2, js_name = performance)] static PERFORMANCE: Performance; } #[wasm_bindgen_test] fn to_json() { - let perf = JsValue::from(PERFORMANCE.to_json()); + let perf = JsValue::from(PERFORMANCE.with(Performance::to_json)); assert!(perf.is_object()); } diff --git a/crates/web-sys/tests/wasm/response.js b/crates/web-sys/tests/wasm/response.js index 3dc3e1dc79d..0d2e68647ad 100644 --- a/crates/web-sys/tests/wasm/response.js +++ b/crates/web-sys/tests/wasm/response.js @@ -1,3 +1,13 @@ export function new_response() { return new Response(null, {status: 501}); } + +export function get_wasm_imports() { + return { + imports: { + imported_func: function () { + return 1; + } + } + }; +} diff --git a/crates/web-sys/tests/wasm/response.rs b/crates/web-sys/tests/wasm/response.rs index 0bbaa50122b..c856be20eaa 100644 --- a/crates/web-sys/tests/wasm/response.rs +++ b/crates/web-sys/tests/wasm/response.rs @@ -1,13 +1,13 @@ -use js_sys::{ArrayBuffer, DataView}; +use js_sys::{ArrayBuffer, DataView, Object, Promise, Reflect, WebAssembly}; use wasm_bindgen::prelude::*; -use wasm_bindgen::JsCast; use wasm_bindgen_futures::JsFuture; use wasm_bindgen_test::*; -use web_sys::Response; +use web_sys::{Headers, Response, ResponseInit}; #[wasm_bindgen(module = "/tests/wasm/response.js")] extern "C" { fn new_response() -> Response; + fn get_wasm_imports() -> Object; } #[wasm_bindgen_test] @@ -44,3 +44,26 @@ async fn test_response_from_other_body() { let output = JsFuture::from(response_b.text().unwrap()).await.unwrap(); assert_eq!(JsValue::from_str(input), output); } + +// Because it relies on `Response`, this can't go in `js-sys`, so put it here instead. +#[wasm_bindgen_test] +async fn wasm_instantiate_streaming() { + // Taken from `crates/js-sys/tests/wasm/WebAssembly.js`. + let mut wasm = *b"\x00asm\x01\x00\x00\x00\x01\x08\x02`\x01\x7f\x00`\x00\x00\x02\x19\x01\x07imports\rimported_func\x00\x00\x03\x02\x01\x01\x07\x11\x01\rexported_func\x00\x01\n\x08\x01\x06\x00A*\x10\x00\x0b"; + + let headers = Headers::new().unwrap(); + headers.append("Content-Type", "application/wasm").unwrap(); + #[allow(deprecated)] + let response = Response::new_with_opt_u8_array_and_init( + Some(&mut wasm), + ResponseInit::new().headers(&headers), + ) + .unwrap(); + let response = Promise::resolve(&response); + let imports = get_wasm_imports(); + let p = WebAssembly::instantiate_streaming(&response, &imports); + let obj = JsFuture::from(p).await.unwrap(); + assert!(Reflect::get(obj.as_ref(), &"instance".into()) + .unwrap() + .is_instance_of::()); +} diff --git a/crates/web-sys/tests/wasm/rtc_rtp_transceiver_direction.rs b/crates/web-sys/tests/wasm/rtc_rtp_transceiver_direction.rs index 5ebc0edc06c..67e5a20cfe6 100644 --- a/crates/web-sys/tests/wasm/rtc_rtp_transceiver_direction.rs +++ b/crates/web-sys/tests/wasm/rtc_rtp_transceiver_direction.rs @@ -1,4 +1,4 @@ -use wasm_bindgen::{prelude::*, JsCast}; +use wasm_bindgen::prelude::*; use wasm_bindgen_futures::JsFuture; use wasm_bindgen_test::*; @@ -25,6 +25,7 @@ async fn rtc_rtp_transceiver_direction() { let pc1: RtcPeerConnection = RtcPeerConnection::new().unwrap(); + #[allow(deprecated)] let tr1: RtcRtpTransceiver = pc1.add_transceiver_with_str_and_init( "audio", tr_init.direction(RtcRtpTransceiverDirection::Sendonly), diff --git a/crates/web-sys/tests/wasm/script_element.rs b/crates/web-sys/tests/wasm/script_element.rs index f8816bd8f2b..afddb7ce54b 100644 --- a/crates/web-sys/tests/wasm/script_element.rs +++ b/crates/web-sys/tests/wasm/script_element.rs @@ -59,7 +59,7 @@ fn test_script_element() { ); assert_eq!(element.text().unwrap(), "", "Shouldn't have text"); - assert_eq!(element.set_text("text").unwrap(), ()); + let _: () = element.set_text("text").unwrap(); assert_eq!(element.text().unwrap(), "text", "Should have text"); assert_eq!(element.event(), "", "Shouldn't have an event"); diff --git a/crates/web-sys/tests/wasm/select_element.rs b/crates/web-sys/tests/wasm/select_element.rs index 2f2319f4fcb..f5fd865395e 100644 --- a/crates/web-sys/tests/wasm/select_element.rs +++ b/crates/web-sys/tests/wasm/select_element.rs @@ -8,41 +8,35 @@ extern "C" { } #[wasm_bindgen_test] +#[allow(deprecated)] fn test_select_element() { // Creates a select with four options. Options are ["tomato", "potato", "orange", "apple"], where // the string is the .value and .text of each option. let select = new_select_with_food_opts(); select.set_autofocus(true); - assert_eq!( + assert!( select.autofocus(), - true, "Select element should have a true autofocus property." ); select.set_autofocus(false); - assert_eq!( - select.autofocus(), - false, + assert!( + !select.autofocus(), "Select element should have a false autofocus property." ); - // TODO: This test currently fails on Firefox, but not Chrome. In Firefox, even though we select.set_autocomplete(), select.autocomplete() yields an empty String. - // select.set_autocomplete("tomato"); - // assert_eq!(select.autocomplete(), "tomato", "Select element should have a 'tomato' autocomplete property."); - - select.set_disabled(true); + select.set_autocomplete("country"); assert_eq!( - select.disabled(), - true, - "Select element should be disabled." + select.autocomplete(), + "country", + "Select element should have a 'country' autocomplete property." ); + select.set_disabled(true); + assert!(select.disabled(), "Select element should be disabled."); + select.set_disabled(false); - assert_eq!( - select.disabled(), - false, - "Select element should not be disabled." - ); + assert!(!select.disabled(), "Select element should not be disabled."); assert!( select.form().is_none(), @@ -50,16 +44,14 @@ fn test_select_element() { ); select.set_multiple(false); - assert_eq!( - select.multiple(), - false, + assert!( + !select.multiple(), "Select element should have a false multiple property." ); select.set_multiple(true); - assert_eq!( + assert!( select.multiple(), - true, "Select element should have a true multiple property." ); @@ -71,18 +63,10 @@ fn test_select_element() { ); select.set_required(true); - assert_eq!( - select.required(), - true, - "Select element should be required." - ); + assert!(select.required(), "Select element should be required."); select.set_required(false); - assert_eq!( - select.required(), - false, - "Select element should not be required." - ); + assert!(!select.required(), "Select element should not be required."); select.set_size(432); assert_eq!( @@ -94,7 +78,7 @@ fn test_select_element() { // Default type seems to be "select-multiple" for the browsers I tested, but there's no guarantee // on this, so let's just make sure we get back something here. assert!( - select.type_().len() > 0, + !select.type_().is_empty(), "Select element should have some type." ); @@ -140,9 +124,8 @@ fn test_select_element() { ); // This might be browser dependent, potentially rendering this test useless? Worked fine in Chrome and Firefox for now. - assert_eq!( + assert!( select.will_validate(), - true, "Select element should not validate by default." ); @@ -173,9 +156,13 @@ fn test_select_element() { "There should be no labels associated with our select element." ); - // TODO: This test won't work until this bug is fixed: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20720. Sometime in the future, either remove this test or uncomment after bug is fixed. - // assert!(select.named_item("tomato").is_some(), "Should be able to find the 'tomato' option before removing it."); - // select.remove(0); - // assert!(select.named_item("tomato").is_none(), "Shouldn't be able to find the 'tomato' option after removing it.") - // TODO: As a result, we are missing a test for the remove() method. + assert!( + select.named_item("tomato").is_some(), + "Should be able to find the 'tomato' option before removing it." + ); + select.remove_with_index(0); + assert!( + select.named_item("tomato").is_none(), + "Shouldn't be able to find the 'tomato' option after removing it." + ); } diff --git a/crates/web-sys/tests/wasm/slot_element.rs b/crates/web-sys/tests/wasm/slot_element.rs index d01ccc9fc4d..15a9908b5d1 100644 --- a/crates/web-sys/tests/wasm/slot_element.rs +++ b/crates/web-sys/tests/wasm/slot_element.rs @@ -9,8 +9,11 @@ extern "C" { #[wasm_bindgen_test] fn test_slot_element() { - let _slot = new_slot(); - // TODO: Test fails in Firefox, but not in Chrome. Error in Firefox is 'ReferenceError: HTMLSlotElement is not defined'. https://w3c-test.org/shadow-dom/HTMLSlotElement-interface.html - // slot.set_name("root_separator"); - // assert_eq!(slot.name(), "root_separator", "Slot name should 'root_separator'."); + let slot = new_slot(); + slot.set_name("root_separator"); + assert_eq!( + slot.name(), + "root_separator", + "Slot name should 'root_separator'." + ); } diff --git a/crates/web-sys/tests/wasm/span_element.rs b/crates/web-sys/tests/wasm/span_element.rs index 490df42adb1..cc0bd42a411 100644 --- a/crates/web-sys/tests/wasm/span_element.rs +++ b/crates/web-sys/tests/wasm/span_element.rs @@ -10,5 +10,5 @@ extern "C" { #[wasm_bindgen_test] fn test_span_element() { let _element = new_span(); - assert!(true, "Span doesn't have an interface"); + // Span doesn't have an interface } diff --git a/crates/web-sys/tests/wasm/title_element.rs b/crates/web-sys/tests/wasm/title_element.rs index ebc7aa74e6e..4a139d4fea8 100644 --- a/crates/web-sys/tests/wasm/title_element.rs +++ b/crates/web-sys/tests/wasm/title_element.rs @@ -11,6 +11,6 @@ extern "C" { fn title_element() { let element = new_title(); assert_eq!(element.text().unwrap(), "", "Shouldn't have an text"); - assert_eq!(element.set_text("page text").unwrap(), ()); + let _: () = element.set_text("page text").unwrap(); assert_eq!(element.text().unwrap(), "page text", "Should have an text"); } diff --git a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs index 14bda73c0f9..9030a161ac7 100644 --- a/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs +++ b/crates/web-sys/tests/wasm/whitelisted_immutable_slices.rs @@ -11,10 +11,14 @@ //! @see https://github.com/rustwasm/wasm-bindgen/issues/1005 use wasm_bindgen::{JsCast, JsValue}; +#[cfg(web_sys_unstable_apis)] +use web_sys::{ + FileSystemReadWriteOptions, FileSystemSyncAccessHandle, FileSystemWritableFileStream, +}; use web_sys::{WebGl2RenderingContext, WebGlRenderingContext, WebSocket}; // Ensure that our whitelisted WebGlRenderingContext methods compile with immutable slices. -fn test_webgl_rendering_context_immutable_slices() { +pub fn test_webgl_rendering_context_immutable_slices() { let gl = JsValue::null().unchecked_into::(); gl.vertex_attrib1fv_with_f32_array(0, &[1.]); @@ -31,7 +35,7 @@ fn test_webgl_rendering_context_immutable_slices() { gl.uniform_matrix3fv_with_f32_array(None, false, &[1.]); gl.uniform_matrix4fv_with_f32_array(None, false, &[1.]); - gl.tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array( + let _ = gl.tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array( 0, 0, 0, @@ -42,7 +46,7 @@ fn test_webgl_rendering_context_immutable_slices() { 0, Some(&[1]), ); - gl.tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_u8_array( + let _ = gl.tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_u8_array( 0, 0, 0, @@ -57,18 +61,35 @@ fn test_webgl_rendering_context_immutable_slices() { } // Ensure that our whitelisted WebGl2RenderingContext methods compile with immutable slices. -fn test_webgl2_rendering_context_immutable_slices() { +pub fn test_webgl2_rendering_context_immutable_slices() { let gl = JsValue::null().unchecked_into::(); - gl.tex_image_3d_with_opt_u8_array(0, 0, 0, 0, 0, 0, 0, 0, 0, Some(&[1])); - gl.tex_sub_image_3d_with_opt_u8_array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Some(&[1])); + let _ = gl.tex_image_3d_with_opt_u8_array(0, 0, 0, 0, 0, 0, 0, 0, 0, Some(&[1])); + let _ = gl.tex_sub_image_3d_with_opt_u8_array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Some(&[1])); gl.compressed_tex_image_3d_with_u8_array(0, 0, 0, 0, 0, 0, 0, &[1]); } // Ensure that our whitelisted WebSocket methods compile with immutable slices. -fn test_websocket_immutable_slices() { +pub fn test_websocket_immutable_slices() { let ws = JsValue::null().unchecked_into::(); - ws.send_with_u8_array(&[0]); + let _ = ws.send_with_u8_array(&[0]); +} + +// Ensure that our whitelisted FileSystemSyncAccessHandle methods compile with immutable slices. +#[cfg(web_sys_unstable_apis)] +fn test_file_system_sync_access_handle_immutable_slices() { + let sa = JsValue::null().unchecked_into::(); + let opt = JsValue::null().unchecked_into::(); + + sa.write_with_u8_array(&[0]); + sa.write_with_u8_array_and_options(&[0], &opt); +} + +// Ensure that our whitelisted FileSystemWritableFileStream methods compile with immutable slices. +#[cfg(web_sys_unstable_apis)] +fn test_file_system_writable_file_stream_immutable_slices() { + let wf = JsValue::null().unchecked_into::(); + wf.write_with_u8_array(&[0]); } // TODO: diff --git a/crates/web-sys/tests/wasm/xpath_result.rs b/crates/web-sys/tests/wasm/xpath_result.rs index 933ac97ba4a..2c90784464d 100644 --- a/crates/web-sys/tests/wasm/xpath_result.rs +++ b/crates/web-sys/tests/wasm/xpath_result.rs @@ -14,7 +14,7 @@ fn test_xpath_result() { xpath_result.result_type(), XPathResult::UNORDERED_NODE_ITERATOR_TYPE ); - assert_eq!(xpath_result.invalid_iterator_state(), false); + assert!(!xpath_result.invalid_iterator_state()); assert_eq!( xpath_result .iterate_next() diff --git a/crates/web-sys/webidls/enabled/AbortController.webidl b/crates/web-sys/webidls/enabled/AbortController.webidl index 1fc3e8fd9e2..f7dec48087d 100644 --- a/crates/web-sys/webidls/enabled/AbortController.webidl +++ b/crates/web-sys/webidls/enabled/AbortController.webidl @@ -7,9 +7,11 @@ * https://dom.spec.whatwg.org/#abortcontroller */ -[Constructor(), Exposed=(Window,Worker,System)] +[Exposed=*] interface AbortController { - readonly attribute AbortSignal signal; + constructor(); - undefined abort(); + [SameObject] readonly attribute AbortSignal signal; + + undefined abort(optional any reason); }; diff --git a/crates/web-sys/webidls/enabled/AbortSignal.webidl b/crates/web-sys/webidls/enabled/AbortSignal.webidl index 6b66f76c4cd..b57c6a5feeb 100644 --- a/crates/web-sys/webidls/enabled/AbortSignal.webidl +++ b/crates/web-sys/webidls/enabled/AbortSignal.webidl @@ -7,9 +7,15 @@ * https://dom.spec.whatwg.org/#abortsignal */ -[Exposed=(Window,Worker,System)] +[Exposed=*] interface AbortSignal : EventTarget { + [NewObject] static AbortSignal abort(optional any reason); + [Exposed=(Window,Worker), NewObject] static AbortSignal timeout([EnforceRange] unsigned long long milliseconds); + [NewObject] static AbortSignal _any(sequence signals); + readonly attribute boolean aborted; + readonly attribute any reason; + undefined throwIfAborted(); attribute EventHandler onabort; }; diff --git a/crates/web-sys/webidls/enabled/AnimationFrame.webidl b/crates/web-sys/webidls/enabled/AnimationFrame.webidl new file mode 100644 index 00000000000..6f81d3e1fc7 --- /dev/null +++ b/crates/web-sys/webidls/enabled/AnimationFrame.webidl @@ -0,0 +1,10 @@ +// https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animation-frames + +callback FrameRequestCallback = undefined (DOMHighResTimeStamp time); + +interface mixin AnimationFrameProvider { + [Throws] long requestAnimationFrame(FrameRequestCallback callback); + [Throws] undefined cancelAnimationFrame(long handle); +}; +Window includes AnimationFrameProvider; +DedicatedWorkerGlobalScope includes AnimationFrameProvider; diff --git a/crates/web-sys/webidls/enabled/AudioBufferSourceNode.webidl b/crates/web-sys/webidls/enabled/AudioBufferSourceNode.webidl index cbab503c8e9..6849d1231c8 100644 --- a/crates/web-sys/webidls/enabled/AudioBufferSourceNode.webidl +++ b/crates/web-sys/webidls/enabled/AudioBufferSourceNode.webidl @@ -10,34 +10,28 @@ * liability, trademark and document use rules apply. */ -dictionary AudioBufferSourceOptions { - AudioBuffer? buffer; - float detune = 0; - boolean loop = false; - double loopEnd = 0; - double loopStart = 0; - float playbackRate = 1; -}; - -[Pref="dom.webaudio.enabled", - Constructor(BaseAudioContext context, optional AudioBufferSourceOptions options)] +[Exposed=Window] interface AudioBufferSourceNode : AudioScheduledSourceNode { - + constructor (BaseAudioContext context, + optional AudioBufferSourceOptions options = {}); attribute AudioBuffer? buffer; - readonly attribute AudioParam playbackRate; readonly attribute AudioParam detune; - attribute boolean loop; attribute double loopStart; attribute double loopEnd; + [RustDeprecated] attribute EventHandler onended; + [Throws] undefined start (optional double when = 0, + optional double offset, + optional double duration); + [Throws, RustDeprecated] undefined stop (optional double when = 0); +}; - attribute EventHandler onended; - - [Throws] - undefined start(optional double when = 0, optional double grainOffset = 0, - optional double grainDuration); - - [Throws] - undefined stop (optional double when = 0); +dictionary AudioBufferSourceOptions { + AudioBuffer? buffer; + float detune = 0; + boolean loop = false; + double loopEnd = 0; + double loopStart = 0; + float playbackRate = 1; }; diff --git a/crates/web-sys/webidls/enabled/AudioContext.webidl b/crates/web-sys/webidls/enabled/AudioContext.webidl index 48ca504adee..8d8cc39312b 100644 --- a/crates/web-sys/webidls/enabled/AudioContext.webidl +++ b/crates/web-sys/webidls/enabled/AudioContext.webidl @@ -10,8 +10,15 @@ * liability, trademark and document use rules apply. */ +enum AudioContextLatencyCategory { + "balanced", + "interactive", + "playback" +}; + dictionary AudioContextOptions { - float sampleRate = 0; + (AudioContextLatencyCategory or double) latencyHint = "interactive"; + float sampleRate = 0; }; [Pref="dom.webaudio.enabled", diff --git a/crates/web-sys/webidls/enabled/AudioScheduledSourceNode.webidl b/crates/web-sys/webidls/enabled/AudioScheduledSourceNode.webidl index e8b4717e266..12876dcd981 100644 --- a/crates/web-sys/webidls/enabled/AudioScheduledSourceNode.webidl +++ b/crates/web-sys/webidls/enabled/AudioScheduledSourceNode.webidl @@ -10,7 +10,6 @@ * liability, trademark and document use rules apply. */ -[RustDeprecated="doesn't exist in Safari, use parent class methods instead"] interface AudioScheduledSourceNode : AudioNode { }; diff --git a/crates/web-sys/webidls/enabled/BaseAudioContext.webidl b/crates/web-sys/webidls/enabled/BaseAudioContext.webidl index 863fcc60953..7f12a5af16e 100644 --- a/crates/web-sys/webidls/enabled/BaseAudioContext.webidl +++ b/crates/web-sys/webidls/enabled/BaseAudioContext.webidl @@ -19,7 +19,6 @@ enum AudioContextState { "closed" }; -[RustDeprecated="doesn't exist in Safari, use `AudioContext` instead now"] interface BaseAudioContext : EventTarget { }; diff --git a/crates/web-sys/webidls/enabled/CSPDictionaries.webidl b/crates/web-sys/webidls/enabled/CSPDictionaries.webidl deleted file mode 100644 index f8de1c9ad82..00000000000 --- a/crates/web-sys/webidls/enabled/CSPDictionaries.webidl +++ /dev/null @@ -1,38 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * Dictionary used to display CSP info. - */ - -dictionary CSP { - boolean report-only = false; - - sequence default-src; - sequence script-src; - sequence object-src; - sequence style-src; - sequence img-src; - sequence media-src; - sequence frame-src; - sequence font-src; - sequence connect-src; - sequence report-uri; - sequence frame-ancestors; - // sequence reflected-xss; // not supported in Firefox - sequence base-uri; - sequence form-action; - sequence referrer; - sequence manifest-src; - sequence upgrade-insecure-requests; - sequence child-src; - sequence block-all-mixed-content; - sequence require-sri-for; - sequence sandbox; - sequence worker-src; -}; - -dictionary CSPPolicies { - sequence csp-policies; -}; diff --git a/crates/web-sys/webidls/enabled/CSPReport.webidl b/crates/web-sys/webidls/enabled/CSPReport.webidl deleted file mode 100644 index 301ca2885c9..00000000000 --- a/crates/web-sys/webidls/enabled/CSPReport.webidl +++ /dev/null @@ -1,24 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * This dictionary holds the parameters used to send - * CSP reports in JSON format. - */ - -dictionary CSPReportProperties { - DOMString document-uri = ""; - DOMString referrer = ""; - DOMString blocked-uri = ""; - DOMString violated-directive = ""; - DOMString original-policy= ""; - DOMString source-file; - DOMString script-sample; - long line-number; - long column-number; -}; - -dictionary CSPReport { - CSPReportProperties csp-report; -}; diff --git a/crates/web-sys/webidls/enabled/CSSStyleSheet.webidl b/crates/web-sys/webidls/enabled/CSSStyleSheet.webidl index 7605c949a7a..4f8754f1af3 100644 --- a/crates/web-sys/webidls/enabled/CSSStyleSheet.webidl +++ b/crates/web-sys/webidls/enabled/CSSStyleSheet.webidl @@ -14,6 +14,8 @@ enum CSSStyleSheetParsingMode { }; interface CSSStyleSheet : StyleSheet { + [Throws] + constructor(); [Pure] readonly attribute CSSRule? ownerRule; [Throws, NeedsSubjectPrincipal] @@ -24,4 +26,8 @@ interface CSSStyleSheet : StyleSheet { unsigned long insertRule(DOMString rule, optional unsigned long index = 0); [Throws, NeedsSubjectPrincipal] undefined deleteRule(unsigned long index); + [NewObject] + Promise replace(USVString text); + [Throws] + undefined replaceSync(USVString text); }; diff --git a/crates/web-sys/webidls/enabled/CanvasCaptureMediaStream.webidl b/crates/web-sys/webidls/enabled/CanvasCaptureMediaStream.webidl index 9bd5044173f..f206f36f5d6 100644 --- a/crates/web-sys/webidls/enabled/CanvasCaptureMediaStream.webidl +++ b/crates/web-sys/webidls/enabled/CanvasCaptureMediaStream.webidl @@ -10,7 +10,7 @@ * W3C liability, trademark and document use rules apply. */ -[Pref="canvas.capturestream.enabled"] +[Deprecated] interface CanvasCaptureMediaStream : MediaStream { readonly attribute HTMLCanvasElement canvas; undefined requestFrame(); diff --git a/crates/web-sys/webidls/enabled/CanvasCaptureMediaStreamTrack.webidl b/crates/web-sys/webidls/enabled/CanvasCaptureMediaStreamTrack.webidl new file mode 100644 index 00000000000..e5a7a698193 --- /dev/null +++ b/crates/web-sys/webidls/enabled/CanvasCaptureMediaStreamTrack.webidl @@ -0,0 +1,17 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * The origin of this IDL file is + * https://w3c.github.io/mediacapture-fromelement/index.html + * + * Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. + * W3C liability, trademark and document use rules apply. + */ + +[Exposed=Window] +interface CanvasCaptureMediaStreamTrack : MediaStreamTrack { + readonly attribute HTMLCanvasElement canvas; + undefined requestFrame(); +}; diff --git a/crates/web-sys/webidls/enabled/CanvasRenderingContext2D.webidl b/crates/web-sys/webidls/enabled/CanvasRenderingContext2D.webidl index 143f202572b..82157774a2c 100644 --- a/crates/web-sys/webidls/enabled/CanvasRenderingContext2D.webidl +++ b/crates/web-sys/webidls/enabled/CanvasRenderingContext2D.webidl @@ -32,7 +32,9 @@ typedef (HTMLImageElement or typedef (HTMLOrSVGImageElement or HTMLCanvasElement or HTMLVideoElement or - ImageBitmap) CanvasImageSource; + ImageBitmap or + OffscreenCanvas or + VideoFrame) CanvasImageSource; interface CanvasRenderingContext2D { @@ -122,13 +124,14 @@ CanvasRenderingContext2D includes CanvasDrawImage; CanvasRenderingContext2D includes CanvasImageData; CanvasRenderingContext2D includes CanvasPathDrawingStyles; CanvasRenderingContext2D includes CanvasTextDrawingStyles; -CanvasRenderingContext2D includes CanvasPathMethods; +CanvasRenderingContext2D includes CanvasPath; CanvasRenderingContext2D includes CanvasHitRegions; interface mixin CanvasState { // state undefined save(); // push state on state stack undefined restore(); // pop state stack and restore state + undefined reset(); // clears the backing buffer, drawing state stack, any defined paths, and styles }; interface mixin CanvasTransform { @@ -145,6 +148,8 @@ interface mixin CanvasTransform { [Throws, LenientFloat] undefined setTransform(double a, double b, double c, double d, double e, double f); [Throws] + undefined setTransform(optional DOMMatrix2DInit transform = {}); + [Throws] undefined resetTransform(); [NewObject, Throws] DOMMatrix getTransform(); @@ -199,7 +204,7 @@ interface mixin CanvasRect { }; interface mixin CanvasDrawPath { - // path API (see also CanvasPathMethods) + // path API (see also CanvasPath) undefined beginPath(); undefined fill(optional CanvasWindingRule winding = "nonzero"); undefined fill(Path2D path, optional CanvasWindingRule winding = "nonzero"); @@ -284,31 +289,22 @@ interface mixin CanvasTextDrawingStyles { attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic") }; -interface mixin CanvasPathMethods { +interface mixin CanvasPath { // shared path API methods undefined closePath(); - [LenientFloat] - undefined moveTo(double x, double y); - [LenientFloat] - undefined lineTo(double x, double y); - [LenientFloat] - undefined quadraticCurveTo(double cpx, double cpy, double x, double y); - - [LenientFloat] - undefined bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y); - - [Throws, LenientFloat] - undefined arcTo(double x1, double y1, double x2, double y2, double radius); -// NOT IMPLEMENTED [LenientFloat] undefined arcTo(double x1, double y1, double x2, double y2, double radiusX, double radiusY, double rotation); - - [LenientFloat] - undefined rect(double x, double y, double w, double h); - - [Throws, LenientFloat] - undefined arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise = false); - - [Throws, LenientFloat] - undefined ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, optional boolean anticlockwise = false); + undefined moveTo(unrestricted double x, unrestricted double y); + undefined lineTo(unrestricted double x, unrestricted double y); + undefined quadraticCurveTo(unrestricted double cpx, unrestricted double cpy, unrestricted double x, unrestricted double y); + undefined bezierCurveTo(unrestricted double cp1x, unrestricted double cp1y, unrestricted double cp2x, unrestricted double cp2y, unrestricted double x, unrestricted double y); + [Throws] + undefined arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius); + undefined rect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h); + [Throws] + undefined roundRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h, optional (unrestricted double or DOMPointInit or sequence<(unrestricted double or DOMPointInit)>) radii = 0); + [Throws] + undefined arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false); + [Throws] + undefined ellipse(unrestricted double x, unrestricted double y, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false); }; interface mixin CanvasHitRegions { @@ -369,4 +365,4 @@ interface Path2D { undefined addPath(Path2D path, optional SVGMatrix transformation); }; -Path2D includes CanvasPathMethods; +Path2D includes CanvasPath; diff --git a/crates/web-sys/webidls/enabled/ChildSHistory.webidl b/crates/web-sys/webidls/enabled/ChildSHistory.webidl deleted file mode 100644 index 7ae2151b63f..00000000000 --- a/crates/web-sys/webidls/enabled/ChildSHistory.webidl +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -// invalid widl -///interface nsISHistory; - -/** - * The ChildSHistory interface represents the child side of a browsing - * context's session history. - */ -[ChromeOnly] -interface ChildSHistory { - [Pure] - readonly attribute long count; - [Pure] - readonly attribute long index; - - boolean canGo(long aOffset); - [Throws] - undefined go(long aOffset); - - /** - * Reload the current entry. The flags which should be passed to this - * function are documented and defined in nsIWebNavigation.idl - */ - [Throws] - undefined reload(unsigned long aReloadFlags); - - /** - * Getter for the legacy nsISHistory implementation. - * - * This getter _will be going away_, but is needed while we finish - * implementing all of the APIs which we will need in the content - * process on ChildSHistory. - */ - readonly attribute nsISHistory legacySHistory; -}; diff --git a/crates/web-sys/webidls/enabled/Clipboard.webidl b/crates/web-sys/webidls/enabled/Clipboard.webidl new file mode 100644 index 00000000000..fbf98a2f379 --- /dev/null +++ b/crates/web-sys/webidls/enabled/Clipboard.webidl @@ -0,0 +1,54 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* + * Clipboard API and events + * Editor’s Draft, 4 June 2024 + * + * The origin of this IDL file is: + * https://w3c.github.io/clipboard-apis/#idl-index + */ + +dictionary ClipboardEventInit : EventInit { + DataTransfer? clipboardData = null; +}; + +[Exposed=Window] +interface ClipboardEvent : Event { + constructor(DOMString type, optional ClipboardEventInit eventInitDict = {}); + readonly attribute DataTransfer? clipboardData; +}; + +partial interface Navigator { + [SecureContext, SameObject] readonly attribute Clipboard clipboard; +}; + +typedef Promise<(DOMString or Blob)> ClipboardItemData; + +[SecureContext, Exposed=Window] +interface ClipboardItem { + [Throws] + constructor(record items, + optional ClipboardItemOptions options = {}); + + readonly attribute PresentationStyle presentationStyle; + readonly attribute FrozenArray types; + + Promise getType(DOMString type); + + static boolean supports(DOMString type); +}; + +enum PresentationStyle { "unspecified", "inline", "attachment" }; + +dictionary ClipboardItemOptions { + PresentationStyle presentationStyle = "unspecified"; +}; + +typedef sequence ClipboardItems; + +[SecureContext, Exposed=Window] +interface Clipboard : EventTarget { + Promise read(optional ClipboardUnsanitizedFormats formats = {}); + Promise readText(); + Promise write(ClipboardItems data); + Promise writeText(DOMString data); +}; diff --git a/crates/web-sys/webidls/enabled/CredentialManagement.webidl b/crates/web-sys/webidls/enabled/CredentialManagement.webidl index 31dbfe65f0f..13b2e577454 100644 --- a/crates/web-sys/webidls/enabled/CredentialManagement.webidl +++ b/crates/web-sys/webidls/enabled/CredentialManagement.webidl @@ -26,11 +26,9 @@ interface CredentialsContainer { }; dictionary CredentialRequestOptions { - PublicKeyCredentialRequestOptions publicKey; AbortSignal signal; }; dictionary CredentialCreationOptions { - PublicKeyCredentialCreationOptions publicKey; AbortSignal signal; }; diff --git a/crates/web-sys/webidls/enabled/DOMException.webidl b/crates/web-sys/webidls/enabled/DOMException.webidl index 7e979187052..7ce10e3a5ee 100644 --- a/crates/web-sys/webidls/enabled/DOMException.webidl +++ b/crates/web-sys/webidls/enabled/DOMException.webidl @@ -42,7 +42,7 @@ interface mixin ExceptionMembers [ChromeOnly, Exposed=Window] readonly attribute StackFrame? location; - // Arbitary data for the implementation. + // Arbitrary data for the implementation. [Exposed=Window] readonly attribute nsISupports? data; diff --git a/crates/web-sys/webidls/enabled/DOMMatrix.webidl b/crates/web-sys/webidls/enabled/DOMMatrix.webidl index 06a0da44b3e..e4080137330 100644 --- a/crates/web-sys/webidls/enabled/DOMMatrix.webidl +++ b/crates/web-sys/webidls/enabled/DOMMatrix.webidl @@ -148,3 +148,31 @@ interface DOMMatrix : DOMMatrixReadOnly { [Throws] DOMMatrix setMatrixValue(DOMString transformList); }; +dictionary DOMMatrix2DInit { + unrestricted double a; + unrestricted double b; + unrestricted double c; + unrestricted double d; + unrestricted double e; + unrestricted double f; + unrestricted double m11; + unrestricted double m12; + unrestricted double m21; + unrestricted double m22; + unrestricted double m41; + unrestricted double m42; +}; + +dictionary DOMMatrixInit : DOMMatrix2DInit { + unrestricted double m13 = 0; + unrestricted double m14 = 0; + unrestricted double m23 = 0; + unrestricted double m24 = 0; + unrestricted double m31 = 0; + unrestricted double m32 = 0; + unrestricted double m33 = 1; + unrestricted double m34 = 0; + unrestricted double m43 = 0; + unrestricted double m44 = 1; + boolean is2D; +}; diff --git a/crates/web-sys/webidls/enabled/Document.webidl b/crates/web-sys/webidls/enabled/Document.webidl index df41dfbf140..a0dba3e5d6e 100644 --- a/crates/web-sys/webidls/enabled/Document.webidl +++ b/crates/web-sys/webidls/enabled/Document.webidl @@ -355,7 +355,7 @@ partial interface Document { [ChromeOnly] readonly attribute boolean userHasInteracted; }; -// Extension to give chrome JS the ability to simulate activate the docuement +// Extension to give chrome JS the ability to simulate activate the document // by user gesture. partial interface Document { [ChromeOnly] diff --git a/crates/web-sys/webidls/enabled/Element.webidl b/crates/web-sys/webidls/enabled/Element.webidl index 02704b3185c..7a4a6731527 100644 --- a/crates/web-sys/webidls/enabled/Element.webidl +++ b/crates/web-sys/webidls/enabled/Element.webidl @@ -110,7 +110,7 @@ interface Element : Node { /** * Set this during a mousedown event to grab and retarget all mouse events * to this element until the mouse button is released or releaseCapture is - * called. If retargetToElement is true, then all events are targetted at + * called. If retargetToElement is true, then all events are targeted at * this element. If false, events can also fire at descendants of this * element. * @@ -263,3 +263,20 @@ partial interface Element { [NeedsCallerType] undefined requestPointerLock(); }; + +// https://html.spec.whatwg.org/#htmlorsvgelement +interface mixin HTMLOrSVGElement { + [SameObject] readonly attribute DOMStringMap dataset; + + attribute DOMString nonce; // intentionally no [CEReactions] + [CEReactions, SetterThrows] attribute boolean autofocus; + [CEReactions, SetterThrows] attribute long tabIndex; + [Throws] undefined focus(optional FocusOptions options = {}); + [Throws] undefined blur(); +}; + +// https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-mixin +interface mixin ElementCSSInlineStyle { + [SameObject, PutForwards=cssText] + readonly attribute CSSStyleDeclaration style; +}; diff --git a/crates/web-sys/webidls/enabled/EventHandler.webidl b/crates/web-sys/webidls/enabled/EventHandler.webidl index 5d28db0a056..90e9ae1f3b6 100644 --- a/crates/web-sys/webidls/enabled/EventHandler.webidl +++ b/crates/web-sys/webidls/enabled/EventHandler.webidl @@ -31,6 +31,8 @@ interface mixin GlobalEventHandlers { attribute EventHandler onfocus; //(Not implemented)attribute EventHandler oncancel; attribute EventHandler onauxclick; + [Pref="dom.element.popover.enabled"] + attribute EventHandler onbeforetoggle; attribute EventHandler oncanplay; attribute EventHandler oncanplaythrough; attribute EventHandler onchange; diff --git a/crates/web-sys/webidls/enabled/EventTarget.webidl b/crates/web-sys/webidls/enabled/EventTarget.webidl index fc40a314faf..5e36a09d691 100644 --- a/crates/web-sys/webidls/enabled/EventTarget.webidl +++ b/crates/web-sys/webidls/enabled/EventTarget.webidl @@ -18,6 +18,7 @@ dictionary EventListenerOptions { dictionary AddEventListenerOptions : EventListenerOptions { boolean passive; boolean once = false; + AbortSignal signal; }; [Constructor, diff --git a/crates/web-sys/webidls/enabled/FileSystemHandle.webidl b/crates/web-sys/webidls/enabled/FileSystemHandle.webidl new file mode 100644 index 00000000000..cc5623bdb19 --- /dev/null +++ b/crates/web-sys/webidls/enabled/FileSystemHandle.webidl @@ -0,0 +1,101 @@ +enum FileSystemHandleKind { + "file", + "directory", +}; + +[Exposed=(Window,Worker), SecureContext, Serializable] +interface FileSystemHandle { + readonly attribute FileSystemHandleKind kind; + readonly attribute USVString name; + + Promise isSameEntry(FileSystemHandle other); +}; + +dictionary FileSystemCreateWritableOptions { + boolean keepExistingData = false; +}; + +[Exposed=(Window,Worker), SecureContext, Serializable] +interface FileSystemFileHandle : FileSystemHandle { + Promise getFile(); + Promise createWritable(optional FileSystemCreateWritableOptions options = {}); + [Exposed=DedicatedWorker] + Promise createSyncAccessHandle(); +}; + +dictionary FileSystemGetFileOptions { + boolean create = false; +}; + +dictionary FileSystemGetDirectoryOptions { + boolean create = false; +}; + +dictionary FileSystemRemoveOptions { + boolean recursive = false; +}; + +[Exposed=(Window,Worker), SecureContext, Serializable] +interface FileSystemDirectoryHandle : FileSystemHandle { + async iterable; + + Promise getFileHandle(USVString name, optional FileSystemGetFileOptions options = {}); + Promise getDirectoryHandle(USVString name, optional FileSystemGetDirectoryOptions options = {}); + + Promise removeEntry(USVString name, optional FileSystemRemoveOptions options = {}); + + Promise?> resolve(FileSystemHandle possibleDescendant); +}; + +enum WriteCommandType { + "write", + "seek", + "truncate", +}; + +dictionary WriteParams { + required WriteCommandType type; + unsigned long long? size; + unsigned long long? position; + (BufferSource or Blob or USVString)? data; +}; + +typedef (BufferSource or Blob or USVString or WriteParams) FileSystemWriteChunkType; + +[Exposed=(Window,Worker), SecureContext] +interface FileSystemWritableFileStream : WritableStream { + [Throws] + Promise write(FileSystemWriteChunkType data); + [Throws] + Promise seek(unsigned long long position); + [Throws] + Promise truncate(unsigned long long size); +}; + +dictionary FileSystemReadWriteOptions { + [EnforceRange] unsigned long long at; +}; + +[Exposed=DedicatedWorker, SecureContext] +interface FileSystemSyncAccessHandle { + [Throws] + unsigned long long read([AllowShared] BufferSource buffer, + optional FileSystemReadWriteOptions options = {}); + [Throws] + unsigned long long write([AllowShared] BufferSource buffer, + optional FileSystemReadWriteOptions options = {}); + + [Throws] + undefined truncate([EnforceRange] unsigned long long newSize); + [Throws] + unsigned long long getSize(); + [Throws] + undefined flush(); + undefined close(); +}; + + +[SecureContext] +partial interface StorageManager { + Promise getDirectory(); +}; diff --git a/crates/web-sys/webidls/enabled/Flex.webidl b/crates/web-sys/webidls/enabled/Flex.webidl deleted file mode 100644 index 58c713630be..00000000000 --- a/crates/web-sys/webidls/enabled/Flex.webidl +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -/** - * These objects support visualization of flex containers by the - * dev tools. - */ - -[ChromeOnly] -interface Flex -{ - sequence getLines(); -}; - -/** - * Lines with items that have been shrunk are shrinking; with items - * that have grown are growing, and all others are unchanged. - */ -enum FlexLineGrowthState { "unchanged", "shrinking", "growing" }; - -[ChromeOnly] -interface FlexLine -{ - readonly attribute FlexLineGrowthState growthState; - readonly attribute double crossStart; - readonly attribute double crossSize; - - // firstBaselineOffset measures from flex-start edge. - readonly attribute double firstBaselineOffset; - - // lastBaselineOffset measures from flex-end edge. - readonly attribute double lastBaselineOffset; - - /** - * getItems() returns FlexItems only for the Elements in this Flex - * container -- ignoring struts and abs-pos Elements. - */ - sequence getItems(); -}; - -[ChromeOnly] -interface FlexItem -{ - readonly attribute Node? node; - readonly attribute double mainBaseSize; - readonly attribute double mainDeltaSize; - readonly attribute double mainMinSize; - readonly attribute double mainMaxSize; - readonly attribute double crossMinSize; - readonly attribute double crossMaxSize; -}; diff --git a/crates/web-sys/webidls/enabled/WindowRoot.webidl b/crates/web-sys/webidls/enabled/FocusOptions.webidl similarity index 60% rename from crates/web-sys/webidls/enabled/WindowRoot.webidl rename to crates/web-sys/webidls/enabled/FocusOptions.webidl index 0ddb1a9fb68..2a6725dfd77 100644 --- a/crates/web-sys/webidls/enabled/WindowRoot.webidl +++ b/crates/web-sys/webidls/enabled/FocusOptions.webidl @@ -2,8 +2,12 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * The origin of this IDL file is: + * https://html.spec.whatwg.org/multipage/interaction.html#focusoptions */ -[ChromeOnly] -interface WindowRoot : EventTarget { +dictionary FocusOptions { + boolean preventScroll = false; + boolean focusVisible; }; diff --git a/crates/web-sys/webidls/enabled/FrameLoader.webidl b/crates/web-sys/webidls/enabled/FrameLoader.webidl deleted file mode 100644 index 7cf40f225ef..00000000000 --- a/crates/web-sys/webidls/enabled/FrameLoader.webidl +++ /dev/null @@ -1,219 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -// invalid widl -//interface LoadContext; -//interface TabParent; -//interface URI; -//interface nsIDocShell; -//interface nsIPrintSettings; -//interface nsIWebBrowserPersistDocumentReceiver; -//interface nsIWebProgressListener; - -[ChromeOnly] -interface FrameLoader { - /** - * Get the docshell from the frame loader. - */ - [GetterThrows] - readonly attribute nsIDocShell? docShell; - - /** - * Get this frame loader's TabParent, if it has a remote frame. Otherwise, - * returns null. - */ - readonly attribute TabParent? tabParent; - - /** - * Get an nsILoadContext for the top-level docshell. For remote - * frames, a shim is returned that contains private browsing and app - * information. - */ - readonly attribute LoadContext loadContext; - - /** - * Get the ParentSHistory for the nsFrameLoader. May return null if this - * frameloader is not for a toplevel frame. - */ - readonly attribute ParentSHistory? parentSHistory; - - /** - * Adds a blocking promise for the current cross process navigation. - * This method can only be called while the "BrowserWillChangeProcess" event - * is being fired. - */ - [Throws] - undefined addProcessChangeBlockingPromise(Promise aPromise); - - /** - * Find out whether the loader's frame is at too great a depth in - * the frame tree. This can be used to decide what operations may - * or may not be allowed on the loader's docshell. - */ - [Pure] - readonly attribute boolean depthTooGreat; - - /** - * Activate remote frame. - * Throws an exception with non-remote frames. - */ - [Throws] - undefined activateRemoteFrame(); - - /** - * Deactivate remote frame. - * Throws an exception with non-remote frames. - */ - [Throws] - undefined deactivateRemoteFrame(); - - /** - * @see nsIDOMWindowUtils sendMouseEvent. - */ - [Throws] - undefined sendCrossProcessMouseEvent(DOMString aType, - float aX, - float aY, - long aButton, - long aClickCount, - long aModifiers, - optional boolean aIgnoreRootScrollFrame = false); - - /** - * Activate event forwarding from client (remote frame) to parent. - */ - [Throws] - undefined activateFrameEvent(DOMString aType, boolean capture); - - // Note, when frameloaders are swapped, also messageManagers are swapped. - readonly attribute MessageSender? messageManager; - - /** - * Request that the next time a remote layer transaction has been - * received by the Compositor, a MozAfterRemoteFrame event be sent - * to the window. - */ - undefined requestNotifyAfterRemotePaint(); - - /** - * Close the window through the ownerElement. - */ - [Throws] - undefined requestFrameLoaderClose(); - - /** - * Force a remote browser to recompute its dimension and screen position. - */ - [Throws] - undefined requestUpdatePosition(); - - /** - * Print the current document. - * - * @param aOuterWindowID the ID of the outer window to print - * @param aPrintSettings optional print settings to use; printSilent can be - * set to prevent prompting. - * @param aProgressListener optional print progress listener. - */ - [Throws] - undefined print(unsigned long long aOuterWindowID, - nsIPrintSettings aPrintSettings, - optional nsIWebProgressListener? aProgressListener = null); - - /** - * If false, then the subdocument is not clipped to its CSS viewport, and the - * subdocument's viewport scrollbar(s) are not rendered. - * Defaults to true. - */ - attribute boolean clipSubdocument; - - /** - * If false, then the subdocument's scroll coordinates will not be clamped - * to their scroll boundaries. - * Defaults to true. - */ - attribute boolean clampScrollPosition; - - /** - * The element which owns this frame loader. - * - * For example, if this is a frame loader for an