├── .cargo └── config.toml ├── .gitattributes ├── .github ├── FUNDING.yaml ├── actions │ └── setup-geckodriver │ │ ├── action.yml │ │ └── main.js ├── dependabot.yaml └── workflows │ └── main.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── benchmarks ├── Cargo.toml ├── README.md ├── globals.js ├── index.html ├── index.js ├── js-benchmarks.js ├── raw.wasm ├── raw.wast ├── src │ └── lib.rs └── utils.js ├── build.rs ├── crates ├── backend │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src │ │ ├── ast.rs │ │ ├── codegen.rs │ │ ├── encode.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ └── util.rs ├── cli-support │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src │ │ ├── decode.rs │ │ ├── descriptor.rs │ │ ├── descriptors.rs │ │ ├── externref.rs │ │ ├── intrinsic.rs │ │ ├── js │ │ ├── binding.rs │ │ └── mod.rs │ │ ├── lib.rs │ │ ├── multivalue.rs │ │ ├── wasm2es6js.rs │ │ └── wit │ │ ├── incoming.rs │ │ ├── mod.rs │ │ ├── nonstandard.rs │ │ ├── outgoing.rs │ │ ├── section.rs │ │ └── standard.rs ├── cli │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── src │ │ └── bin │ │ │ ├── wasm-bindgen-test-runner │ │ │ ├── deno.rs │ │ │ ├── headless.rs │ │ │ ├── index-headless.html │ │ │ ├── index.html │ │ │ ├── main.rs │ │ │ ├── node.rs │ │ │ ├── server.rs │ │ │ └── shell.rs │ │ │ ├── wasm-bindgen.rs │ │ │ └── wasm2es6js.rs │ └── tests │ │ ├── reference.rs │ │ ├── reference │ │ ├── add.d.ts │ │ ├── add.js │ │ ├── add.rs │ │ ├── add.wat │ │ ├── anyref-empty.d.ts │ │ ├── anyref-empty.js │ │ ├── anyref-empty.rs │ │ ├── anyref-empty.wat │ │ ├── anyref-import-catch.d.ts │ │ ├── anyref-import-catch.js │ │ ├── anyref-import-catch.rs │ │ ├── anyref-import-catch.wat │ │ ├── anyref-nop.d.ts │ │ ├── anyref-nop.js │ │ ├── anyref-nop.rs │ │ ├── anyref-nop.wat │ │ ├── async-number.d.ts │ │ ├── async-number.rs │ │ ├── async-void.d.ts │ │ ├── async-void.rs │ │ ├── builder.d.ts │ │ ├── builder.js │ │ ├── builder.rs │ │ ├── builder.wat │ │ ├── constructor.d.ts │ │ ├── constructor.js │ │ ├── constructor.rs │ │ ├── constructor.wat │ │ ├── echo.d.ts │ │ ├── echo.js │ │ ├── echo.rs │ │ ├── echo.wat │ │ ├── empty.d.ts │ │ ├── empty.js │ │ ├── empty.rs │ │ ├── empty.wat │ │ ├── enums.d.ts │ │ ├── enums.js │ │ ├── enums.rs │ │ ├── enums.wat │ │ ├── function-attrs.d.ts │ │ ├── function-attrs.rs │ │ ├── getter-setter.d.ts │ │ ├── getter-setter.js │ │ ├── getter-setter.rs │ │ ├── getter-setter.wat │ │ ├── import-getter-setter.d.ts │ │ ├── import-getter-setter.js │ │ ├── import-getter-setter.rs │ │ ├── import-getter-setter.wat │ │ ├── import.d.ts │ │ ├── import.js │ │ ├── import.rs │ │ ├── import.wat │ │ ├── int128.d.ts │ │ ├── int128.js │ │ ├── int128.rs │ │ ├── int128.wat │ │ ├── intrinsic-only.d.ts │ │ ├── intrinsic-only.js │ │ ├── intrinsic-only.rs │ │ ├── intrinsic-only.wat │ │ ├── keyword.d.ts │ │ ├── keyword.js │ │ ├── keyword.rs │ │ ├── keyword.wat │ │ ├── modules.d.ts │ │ ├── modules.js │ │ ├── modules.rs │ │ ├── modules.wat │ │ ├── nop.d.ts │ │ ├── nop.js │ │ ├── nop.rs │ │ ├── nop.wat │ │ ├── optional-args.d.ts │ │ ├── optional-args.js │ │ ├── optional-args.rs │ │ ├── optional-args.wat │ │ ├── pointers.d.ts │ │ ├── pointers.js │ │ ├── pointers.rs │ │ ├── pointers.wat │ │ ├── raw.d.ts │ │ ├── raw.js │ │ ├── raw.rs │ │ ├── raw.wat │ │ ├── result.d.ts │ │ ├── result.js │ │ ├── result.rs │ │ ├── result.wat │ │ ├── self-type.d.ts │ │ ├── self-type.js │ │ ├── self-type.rs │ │ ├── self-type.wat │ │ ├── skip-jsdoc.d.ts │ │ ├── skip-jsdoc.js │ │ ├── skip-jsdoc.rs │ │ ├── skip-jsdoc.wat │ │ ├── static.d.ts │ │ ├── static.js │ │ ├── static.rs │ │ ├── static.wat │ │ ├── string-arg.d.ts │ │ ├── string-arg.js │ │ ├── string-arg.rs │ │ ├── string-arg.wat │ │ ├── targets-0.d.ts │ │ ├── targets-0.js │ │ ├── targets-0.wat │ │ ├── targets-1.d.ts │ │ ├── targets-1.js │ │ ├── targets-1.wat │ │ ├── targets-2.d.ts │ │ ├── targets-2.js │ │ ├── targets-2.wat │ │ ├── targets-3.d.ts │ │ ├── targets-3.js │ │ ├── targets-3.wat │ │ ├── targets-4.d.ts │ │ ├── targets-4.js │ │ ├── targets-4.wat │ │ ├── targets.rs │ │ ├── typescript-type.d.ts │ │ ├── typescript-type.js │ │ ├── typescript-type.rs │ │ ├── typescript-type.wat │ │ ├── wasm-export-types.d.ts │ │ ├── wasm-export-types.js │ │ ├── wasm-export-types.rs │ │ ├── wasm-export-types.wat │ │ ├── web-sys.d.ts │ │ ├── web-sys.js │ │ ├── web-sys.rs │ │ └── web-sys.wat │ │ └── wasm-bindgen │ │ ├── main.rs │ │ └── npm.rs ├── example-tests │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── src │ │ └── lib.rs │ └── tests │ │ ├── shell.rs │ │ └── webpack.rs ├── externref-xform │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── src │ │ └── lib.rs │ └── tests │ │ ├── all.rs │ │ ├── anyref-param-owned.wat │ │ ├── anyref-param.wat │ │ ├── clone-ref-intrinsic.wat │ │ ├── drop-ref-intrinsic.wat │ │ ├── import-anyref-owned.wat │ │ ├── import-anyref-ret.wat │ │ ├── import-anyref.wat │ │ ├── mixed-export.wat │ │ ├── mixed.wat │ │ ├── ret-anyref.wat │ │ ├── table-grow-intrinsic.wat │ │ ├── table-set-null-intrinsic.wat │ │ ├── table.wat │ │ └── tee-before-grow.wat ├── futures │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── src │ │ ├── lib.rs │ │ ├── queue.rs │ │ ├── stream.rs │ │ └── task │ │ │ ├── multithread.rs │ │ │ ├── singlethread.rs │ │ │ ├── wait_async_polyfill.rs │ │ │ └── worker.js │ └── tests │ │ └── tests.rs ├── js-sys │ ├── CHANGELOG.md │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── src │ │ ├── Temporal.rs │ │ └── lib.rs │ └── tests │ │ ├── browser.rs │ │ ├── common │ │ ├── headless.js │ │ └── mod.rs │ │ ├── node.rs │ │ └── wasm │ │ ├── Array.js │ │ ├── Array.rs │ │ ├── ArrayBuffer.rs │ │ ├── ArrayIterator.rs │ │ ├── BigInt.rs │ │ ├── Boolean.rs │ │ ├── DataView.rs │ │ ├── Date.rs │ │ ├── Error.rs │ │ ├── EvalError.rs │ │ ├── Function.js │ │ ├── Function.rs │ │ ├── Generator.js │ │ ├── Generator.rs │ │ ├── Intl.rs │ │ ├── Iterator.js │ │ ├── Iterator.rs │ │ ├── JSON.rs │ │ ├── JsString.js │ │ ├── JsString.rs │ │ ├── Map.rs │ │ ├── MapIterator.rs │ │ ├── Math.rs │ │ ├── Number.js │ │ ├── Number.rs │ │ ├── Object.js │ │ ├── Object.rs │ │ ├── Promise.rs │ │ ├── Proxy.js │ │ ├── Proxy.rs │ │ ├── RangeError.rs │ │ ├── ReferenceError.rs │ │ ├── Reflect.js │ │ ├── Reflect.rs │ │ ├── RegExp.rs │ │ ├── Set.rs │ │ ├── SetIterator.rs │ │ ├── SharedArrayBuffer.js │ │ ├── SharedArrayBuffer.rs │ │ ├── Symbol.js │ │ ├── Symbol.rs │ │ ├── SyntaxError.rs │ │ ├── Temporal.js │ │ ├── Temporal.rs │ │ ├── TypeError.rs │ │ ├── TypedArray.rs │ │ ├── UriError.rs │ │ ├── WeakMap.rs │ │ ├── WeakSet.rs │ │ ├── WebAssembly.js │ │ ├── WebAssembly.rs │ │ ├── global_fns.rs │ │ └── main.rs ├── macro-support │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src │ │ ├── lib.rs │ │ └── parser.rs ├── macro │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── src │ │ ├── lib.rs │ │ └── worker.js │ ├── tests │ │ └── ui.rs │ └── ui-tests │ │ ├── async-errors.rs │ │ ├── async-errors.stderr │ │ ├── attribute-fails-to-parse.rs │ │ ├── attribute-fails-to-parse.stderr │ │ ├── bad-signatures.rs │ │ ├── bad-signatures.stderr │ │ ├── illegal-char-fn-attrs.rs │ │ ├── illegal-char-fn-attrs.stderr │ │ ├── import-keyword.rs │ │ ├── import-keyword.stderr │ │ ├── import-local.rs │ │ ├── import-local.stderr │ │ ├── invalid-attr.rs │ │ ├── invalid-attr.stderr │ │ ├── invalid-enums.rs │ │ ├── invalid-enums.stderr │ │ ├── invalid-fn-arg-name.rs │ │ ├── invalid-fn-arg-name.stderr │ │ ├── invalid-imports.rs │ │ ├── invalid-imports.stderr │ │ ├── invalid-items.rs │ │ ├── invalid-items.stderr │ │ ├── invalid-methods.rs │ │ ├── invalid-methods.stderr │ │ ├── invalid-self-fn-attrs.rs │ │ ├── invalid-self-fn-attrs.stderr │ │ ├── invalid-self.rs │ │ ├── invalid-self.stderr │ │ ├── invalid-setter.rs │ │ ├── invalid-setter.stderr │ │ ├── invalid-static-string.rs │ │ ├── invalid-static-string.stderr │ │ ├── link-to.rs │ │ ├── link-to.stderr │ │ ├── main-async.rs │ │ ├── main-async.stderr │ │ ├── main-debug.rs │ │ ├── main-debug.stderr │ │ ├── main-infallible.rs │ │ ├── main-infallible.stderr │ │ ├── main-jsvalue.rs │ │ ├── main-jsvalue.stderr │ │ ├── main-unit.rs │ │ ├── main-unit.stderr │ │ ├── main.rs │ │ ├── main.stderr │ │ ├── missing-catch.rs │ │ ├── missing-catch.stderr │ │ ├── no-ret-fn-attr.rs │ │ ├── no-ret-fn-attr.stderr │ │ ├── non-public-function.rs │ │ ├── non-public-function.stderr │ │ ├── pub-not-copy.rs │ │ ├── pub-not-copy.stderr │ │ ├── start-function.rs │ │ ├── start-function.stderr │ │ ├── struct-fields.rs │ │ ├── struct-fields.stderr │ │ ├── structural-and-final.rs │ │ ├── structural-and-final.stderr │ │ ├── traits-not-implemented.rs │ │ ├── traits-not-implemented.stderr │ │ ├── unknown-type-in-import.rs │ │ ├── unknown-type-in-import.stderr │ │ ├── unsupported-options.rs │ │ ├── unsupported-options.stderr │ │ ├── unused-attributes.rs │ │ ├── unused-attributes.stderr │ │ ├── unused-fn-attrs.rs │ │ ├── unused-fn-attrs.stderr │ │ ├── update-all-references.sh │ │ ├── update-references.sh │ │ ├── wasm-bindgen.rs │ │ └── wasm-bindgen.stderr ├── msrv │ ├── cli │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── lib │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── resolver │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs ├── multi-value-xform │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── src │ │ └── lib.rs │ └── tests │ │ ├── align.wat │ │ ├── all.rs │ │ ├── many.wat │ │ └── simple.wat ├── shared │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── build.rs │ └── src │ │ ├── identifier.rs │ │ ├── lib.rs │ │ └── schema_hash_approval.rs ├── test-macro │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── src │ │ └── lib.rs │ ├── tests │ │ └── ui.rs │ └── ui-tests │ │ ├── crate.rs │ │ ├── crate.stderr │ │ ├── ignore.rs │ │ ├── ignore.stderr │ │ ├── should_panic.rs │ │ ├── should_panic.stderr │ │ ├── unsupported.rs │ │ └── unsupported.stderr ├── test │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── sample │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── src │ │ │ └── lib.rs │ │ └── tests │ │ │ ├── browser.rs │ │ │ ├── common │ │ │ └── mod.rs │ │ │ └── node.rs │ └── src │ │ ├── coverage.rs │ │ ├── lib.rs │ │ └── rt │ │ ├── browser.rs │ │ ├── detect.rs │ │ ├── mod.rs │ │ ├── node.rs │ │ ├── scoped_tls.rs │ │ └── worker.rs ├── threads-xform │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── src │ │ └── lib.rs │ └── tests │ │ ├── all.rs │ │ ├── basic.wat │ │ └── unaligned.wat ├── typescript-tests │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── jest.config.cjs │ ├── no_modules.tsconfig.json │ ├── package.json │ ├── run.sh │ ├── src │ │ ├── custom_section.rs │ │ ├── custom_section.ts │ │ ├── custom_section_types.d.ts │ │ ├── enums.rs │ │ ├── enums.ts │ │ ├── function_attrs.rs │ │ ├── function_attrs.ts │ │ ├── getters_setters.rs │ │ ├── getters_setters.ts │ │ ├── inspectable.rs │ │ ├── inspectable.ts │ │ ├── lib.rs │ │ ├── memory.ts │ │ ├── omit_definition.rs │ │ ├── omit_definition.ts │ │ ├── opt_args_and_ret.rs │ │ ├── opt_args_and_ret.ts │ │ ├── optional_fields.rs │ │ ├── optional_fields.ts │ │ ├── simple_async_fn.rs │ │ ├── simple_async_fn.ts │ │ ├── simple_fn.rs │ │ ├── simple_fn.ts │ │ ├── simple_struct.rs │ │ ├── simple_struct.ts │ │ ├── typescript_type.rs │ │ ├── typescript_type.ts │ │ ├── usize.rs │ │ ├── usize.ts │ │ ├── web │ │ │ └── init.ts │ │ ├── web_sys.rs │ │ └── web_sys.ts │ └── tsconfig.json ├── wasm-conventions │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src │ │ └── lib.rs ├── wasm-interpreter │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── src │ │ └── lib.rs │ └── tests │ │ └── smoke.rs ├── web-sys │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── src │ │ ├── features │ │ │ ├── gen_AbortController.rs │ │ │ ├── gen_AbortSignal.rs │ │ │ ├── gen_AddEventListenerOptions.rs │ │ │ ├── gen_AesCbcParams.rs │ │ │ ├── gen_AesCtrParams.rs │ │ │ ├── gen_AesDerivedKeyParams.rs │ │ │ ├── gen_AesGcmParams.rs │ │ │ ├── gen_AesKeyAlgorithm.rs │ │ │ ├── gen_AesKeyGenParams.rs │ │ │ ├── gen_Algorithm.rs │ │ │ ├── gen_AlignSetting.rs │ │ │ ├── gen_AllowedBluetoothDevice.rs │ │ │ ├── gen_AllowedUsbDevice.rs │ │ │ ├── gen_AlphaOption.rs │ │ │ ├── gen_AnalyserNode.rs │ │ │ ├── gen_AnalyserOptions.rs │ │ │ ├── gen_AngleInstancedArrays.rs │ │ │ ├── gen_Animation.rs │ │ │ ├── gen_AnimationEffect.rs │ │ │ ├── gen_AnimationEvent.rs │ │ │ ├── gen_AnimationEventInit.rs │ │ │ ├── gen_AnimationPlayState.rs │ │ │ ├── gen_AnimationPlaybackEvent.rs │ │ │ ├── gen_AnimationPlaybackEventInit.rs │ │ │ ├── gen_AnimationPropertyDetails.rs │ │ │ ├── gen_AnimationPropertyValueDetails.rs │ │ │ ├── gen_AnimationTimeline.rs │ │ │ ├── gen_AssignedNodesOptions.rs │ │ │ ├── gen_AttestationConveyancePreference.rs │ │ │ ├── gen_Attr.rs │ │ │ ├── gen_AttributeNameValue.rs │ │ │ ├── gen_AudioBuffer.rs │ │ │ ├── gen_AudioBufferOptions.rs │ │ │ ├── gen_AudioBufferSourceNode.rs │ │ │ ├── gen_AudioBufferSourceOptions.rs │ │ │ ├── gen_AudioConfiguration.rs │ │ │ ├── gen_AudioContext.rs │ │ │ ├── gen_AudioContextLatencyCategory.rs │ │ │ ├── gen_AudioContextOptions.rs │ │ │ ├── gen_AudioContextState.rs │ │ │ ├── gen_AudioData.rs │ │ │ ├── gen_AudioDataCopyToOptions.rs │ │ │ ├── gen_AudioDataInit.rs │ │ │ ├── gen_AudioDecoder.rs │ │ │ ├── gen_AudioDecoderConfig.rs │ │ │ ├── gen_AudioDecoderInit.rs │ │ │ ├── gen_AudioDecoderSupport.rs │ │ │ ├── gen_AudioDestinationNode.rs │ │ │ ├── gen_AudioEncoder.rs │ │ │ ├── gen_AudioEncoderConfig.rs │ │ │ ├── gen_AudioEncoderInit.rs │ │ │ ├── gen_AudioEncoderSupport.rs │ │ │ ├── gen_AudioListener.rs │ │ │ ├── gen_AudioNode.rs │ │ │ ├── gen_AudioNodeOptions.rs │ │ │ ├── gen_AudioParam.rs │ │ │ ├── gen_AudioParamMap.rs │ │ │ ├── gen_AudioProcessingEvent.rs │ │ │ ├── gen_AudioSampleFormat.rs │ │ │ ├── gen_AudioScheduledSourceNode.rs │ │ │ ├── gen_AudioSinkInfo.rs │ │ │ ├── gen_AudioSinkOptions.rs │ │ │ ├── gen_AudioSinkType.rs │ │ │ ├── gen_AudioStreamTrack.rs │ │ │ ├── gen_AudioTrack.rs │ │ │ ├── gen_AudioTrackList.rs │ │ │ ├── gen_AudioWorklet.rs │ │ │ ├── gen_AudioWorkletGlobalScope.rs │ │ │ ├── gen_AudioWorkletNode.rs │ │ │ ├── gen_AudioWorkletNodeOptions.rs │ │ │ ├── gen_AudioWorkletProcessor.rs │ │ │ ├── gen_AuthenticationExtensionsClientInputs.rs │ │ │ ├── gen_AuthenticationExtensionsClientInputsJson.rs │ │ │ ├── gen_AuthenticationExtensionsClientOutputs.rs │ │ │ ├── gen_AuthenticationExtensionsClientOutputsJson.rs │ │ │ ├── gen_AuthenticationExtensionsDevicePublicKeyInputs.rs │ │ │ ├── gen_AuthenticationExtensionsDevicePublicKeyOutputs.rs │ │ │ ├── gen_AuthenticationExtensionsLargeBlobInputs.rs │ │ │ ├── gen_AuthenticationExtensionsLargeBlobOutputs.rs │ │ │ ├── gen_AuthenticationExtensionsPrfInputs.rs │ │ │ ├── gen_AuthenticationExtensionsPrfOutputs.rs │ │ │ ├── gen_AuthenticationExtensionsPrfValues.rs │ │ │ ├── gen_AuthenticationResponseJson.rs │ │ │ ├── gen_AuthenticatorAssertionResponse.rs │ │ │ ├── gen_AuthenticatorAssertionResponseJson.rs │ │ │ ├── gen_AuthenticatorAttachment.rs │ │ │ ├── gen_AuthenticatorAttestationResponse.rs │ │ │ ├── gen_AuthenticatorAttestationResponseJson.rs │ │ │ ├── gen_AuthenticatorResponse.rs │ │ │ ├── gen_AuthenticatorSelectionCriteria.rs │ │ │ ├── gen_AuthenticatorTransport.rs │ │ │ ├── gen_AutoKeyword.rs │ │ │ ├── gen_AutocompleteInfo.rs │ │ │ ├── gen_BarProp.rs │ │ │ ├── gen_BaseAudioContext.rs │ │ │ ├── gen_BaseComputedKeyframe.rs │ │ │ ├── gen_BaseKeyframe.rs │ │ │ ├── gen_BasePropertyIndexedKeyframe.rs │ │ │ ├── gen_BasicCardRequest.rs │ │ │ ├── gen_BasicCardResponse.rs │ │ │ ├── gen_BasicCardType.rs │ │ │ ├── gen_BatteryManager.rs │ │ │ ├── gen_BeforeUnloadEvent.rs │ │ │ ├── gen_BinaryType.rs │ │ │ ├── gen_BiquadFilterNode.rs │ │ │ ├── gen_BiquadFilterOptions.rs │ │ │ ├── gen_BiquadFilterType.rs │ │ │ ├── gen_Blob.rs │ │ │ ├── gen_BlobEvent.rs │ │ │ ├── gen_BlobEventInit.rs │ │ │ ├── gen_BlobPropertyBag.rs │ │ │ ├── gen_BlockParsingOptions.rs │ │ │ ├── gen_Bluetooth.rs │ │ │ ├── gen_BluetoothAdvertisingEvent.rs │ │ │ ├── gen_BluetoothAdvertisingEventInit.rs │ │ │ ├── gen_BluetoothCharacteristicProperties.rs │ │ │ ├── gen_BluetoothDataFilterInit.rs │ │ │ ├── gen_BluetoothDevice.rs │ │ │ ├── gen_BluetoothLeScanFilterInit.rs │ │ │ ├── gen_BluetoothManufacturerDataMap.rs │ │ │ ├── gen_BluetoothPermissionDescriptor.rs │ │ │ ├── gen_BluetoothPermissionResult.rs │ │ │ ├── gen_BluetoothPermissionStorage.rs │ │ │ ├── gen_BluetoothRemoteGattCharacteristic.rs │ │ │ ├── gen_BluetoothRemoteGattDescriptor.rs │ │ │ ├── gen_BluetoothRemoteGattServer.rs │ │ │ ├── gen_BluetoothRemoteGattService.rs │ │ │ ├── gen_BluetoothServiceDataMap.rs │ │ │ ├── gen_BluetoothUuid.rs │ │ │ ├── gen_BoxQuadOptions.rs │ │ │ ├── gen_BroadcastChannel.rs │ │ │ ├── gen_BrowserElementDownloadOptions.rs │ │ │ ├── gen_BrowserElementExecuteScriptOptions.rs │ │ │ ├── gen_BrowserFeedWriter.rs │ │ │ ├── gen_BrowserFindCaseSensitivity.rs │ │ │ ├── gen_BrowserFindDirection.rs │ │ │ ├── gen_ByteLengthQueuingStrategy.rs │ │ │ ├── gen_Cache.rs │ │ │ ├── gen_CacheBatchOperation.rs │ │ │ ├── gen_CacheQueryOptions.rs │ │ │ ├── gen_CacheStorage.rs │ │ │ ├── gen_CacheStorageNamespace.rs │ │ │ ├── gen_CanvasCaptureMediaStream.rs │ │ │ ├── gen_CanvasCaptureMediaStreamTrack.rs │ │ │ ├── gen_CanvasGradient.rs │ │ │ ├── gen_CanvasPattern.rs │ │ │ ├── gen_CanvasRenderingContext2d.rs │ │ │ ├── gen_CanvasWindingRule.rs │ │ │ ├── gen_CaretChangedReason.rs │ │ │ ├── gen_CaretPosition.rs │ │ │ ├── gen_CaretStateChangedEventInit.rs │ │ │ ├── gen_CdataSection.rs │ │ │ ├── gen_ChannelCountMode.rs │ │ │ ├── gen_ChannelInterpretation.rs │ │ │ ├── gen_ChannelMergerNode.rs │ │ │ ├── gen_ChannelMergerOptions.rs │ │ │ ├── gen_ChannelSplitterNode.rs │ │ │ ├── gen_ChannelSplitterOptions.rs │ │ │ ├── gen_CharacterData.rs │ │ │ ├── gen_CheckerboardReason.rs │ │ │ ├── gen_CheckerboardReport.rs │ │ │ ├── gen_CheckerboardReportService.rs │ │ │ ├── gen_ChromeFilePropertyBag.rs │ │ │ ├── gen_ChromeWorker.rs │ │ │ ├── gen_Client.rs │ │ │ ├── gen_ClientQueryOptions.rs │ │ │ ├── gen_ClientRectsAndTexts.rs │ │ │ ├── gen_ClientType.rs │ │ │ ├── gen_Clients.rs │ │ │ ├── gen_Clipboard.rs │ │ │ ├── gen_ClipboardEvent.rs │ │ │ ├── gen_ClipboardEventInit.rs │ │ │ ├── gen_ClipboardItem.rs │ │ │ ├── gen_ClipboardItemOptions.rs │ │ │ ├── gen_ClipboardPermissionDescriptor.rs │ │ │ ├── gen_ClipboardUnsanitizedFormats.rs │ │ │ ├── gen_CloseEvent.rs │ │ │ ├── gen_CloseEventInit.rs │ │ │ ├── gen_CodecState.rs │ │ │ ├── gen_CollectedClientData.rs │ │ │ ├── gen_ColorSpaceConversion.rs │ │ │ ├── gen_Comment.rs │ │ │ ├── gen_CompositeOperation.rs │ │ │ ├── gen_CompositionEvent.rs │ │ │ ├── gen_CompositionEventInit.rs │ │ │ ├── gen_CompressionFormat.rs │ │ │ ├── gen_CompressionStream.rs │ │ │ ├── gen_ComputedEffectTiming.rs │ │ │ ├── gen_ConnStatusDict.rs │ │ │ ├── gen_ConnectionType.rs │ │ │ ├── gen_ConsoleCounter.rs │ │ │ ├── gen_ConsoleCounterError.rs │ │ │ ├── gen_ConsoleEvent.rs │ │ │ ├── gen_ConsoleInstance.rs │ │ │ ├── gen_ConsoleInstanceOptions.rs │ │ │ ├── gen_ConsoleLevel.rs │ │ │ ├── gen_ConsoleLogLevel.rs │ │ │ ├── gen_ConsoleProfileEvent.rs │ │ │ ├── gen_ConsoleStackEntry.rs │ │ │ ├── gen_ConsoleTimerError.rs │ │ │ ├── gen_ConsoleTimerLogOrEnd.rs │ │ │ ├── gen_ConsoleTimerStart.rs │ │ │ ├── gen_ConstantSourceNode.rs │ │ │ ├── gen_ConstantSourceOptions.rs │ │ │ ├── gen_ConstrainBooleanParameters.rs │ │ │ ├── gen_ConstrainDomStringParameters.rs │ │ │ ├── gen_ConstrainDoubleRange.rs │ │ │ ├── gen_ConstrainLongRange.rs │ │ │ ├── gen_ContextAttributes2d.rs │ │ │ ├── gen_ConvertCoordinateOptions.rs │ │ │ ├── gen_ConvolverNode.rs │ │ │ ├── gen_ConvolverOptions.rs │ │ │ ├── gen_Coordinates.rs │ │ │ ├── gen_CountQueuingStrategy.rs │ │ │ ├── gen_Credential.rs │ │ │ ├── gen_CredentialCreationOptions.rs │ │ │ ├── gen_CredentialPropertiesOutput.rs │ │ │ ├── gen_CredentialRequestOptions.rs │ │ │ ├── gen_CredentialsContainer.rs │ │ │ ├── gen_Crypto.rs │ │ │ ├── gen_CryptoKey.rs │ │ │ ├── gen_CryptoKeyPair.rs │ │ │ ├── gen_CssAnimation.rs │ │ │ ├── gen_CssBoxType.rs │ │ │ ├── gen_CssConditionRule.rs │ │ │ ├── gen_CssCounterStyleRule.rs │ │ │ ├── gen_CssFontFaceRule.rs │ │ │ ├── gen_CssFontFeatureValuesRule.rs │ │ │ ├── gen_CssGroupingRule.rs │ │ │ ├── gen_CssImportRule.rs │ │ │ ├── gen_CssKeyframeRule.rs │ │ │ ├── gen_CssKeyframesRule.rs │ │ │ ├── gen_CssMediaRule.rs │ │ │ ├── gen_CssNamespaceRule.rs │ │ │ ├── gen_CssPageRule.rs │ │ │ ├── gen_CssPseudoElement.rs │ │ │ ├── gen_CssRule.rs │ │ │ ├── gen_CssRuleList.rs │ │ │ ├── gen_CssStyleDeclaration.rs │ │ │ ├── gen_CssStyleRule.rs │ │ │ ├── gen_CssStyleSheet.rs │ │ │ ├── gen_CssStyleSheetParsingMode.rs │ │ │ ├── gen_CssSupportsRule.rs │ │ │ ├── gen_CssTransition.rs │ │ │ ├── gen_CustomElementRegistry.rs │ │ │ ├── gen_CustomEvent.rs │ │ │ ├── gen_CustomEventInit.rs │ │ │ ├── gen_DataTransfer.rs │ │ │ ├── gen_DataTransferItem.rs │ │ │ ├── gen_DataTransferItemList.rs │ │ │ ├── gen_DateTimeValue.rs │ │ │ ├── gen_DecoderDoctorNotification.rs │ │ │ ├── gen_DecoderDoctorNotificationType.rs │ │ │ ├── gen_DecompressionStream.rs │ │ │ ├── gen_DedicatedWorkerGlobalScope.rs │ │ │ ├── gen_DelayNode.rs │ │ │ ├── gen_DelayOptions.rs │ │ │ ├── gen_DeviceAcceleration.rs │ │ │ ├── gen_DeviceAccelerationInit.rs │ │ │ ├── gen_DeviceLightEvent.rs │ │ │ ├── gen_DeviceLightEventInit.rs │ │ │ ├── gen_DeviceMotionEvent.rs │ │ │ ├── gen_DeviceMotionEventInit.rs │ │ │ ├── gen_DeviceOrientationEvent.rs │ │ │ ├── gen_DeviceOrientationEventInit.rs │ │ │ ├── gen_DeviceProximityEvent.rs │ │ │ ├── gen_DeviceProximityEventInit.rs │ │ │ ├── gen_DeviceRotationRate.rs │ │ │ ├── gen_DeviceRotationRateInit.rs │ │ │ ├── gen_DhKeyDeriveParams.rs │ │ │ ├── gen_DirectionSetting.rs │ │ │ ├── gen_Directory.rs │ │ │ ├── gen_DirectoryPickerOptions.rs │ │ │ ├── gen_DisplayMediaStreamConstraints.rs │ │ │ ├── gen_DisplayNameOptions.rs │ │ │ ├── gen_DisplayNameResult.rs │ │ │ ├── gen_DistanceModelType.rs │ │ │ ├── gen_DnsCacheDict.rs │ │ │ ├── gen_DnsCacheEntry.rs │ │ │ ├── gen_DnsLookupDict.rs │ │ │ ├── gen_Document.rs │ │ │ ├── gen_DocumentFragment.rs │ │ │ ├── gen_DocumentTimeline.rs │ │ │ ├── gen_DocumentTimelineOptions.rs │ │ │ ├── gen_DocumentType.rs │ │ │ ├── gen_DomError.rs │ │ │ ├── gen_DomException.rs │ │ │ ├── gen_DomImplementation.rs │ │ │ ├── gen_DomMatrix.rs │ │ │ ├── gen_DomMatrix2dInit.rs │ │ │ ├── gen_DomMatrixInit.rs │ │ │ ├── gen_DomMatrixReadOnly.rs │ │ │ ├── gen_DomParser.rs │ │ │ ├── gen_DomPoint.rs │ │ │ ├── gen_DomPointInit.rs │ │ │ ├── gen_DomPointReadOnly.rs │ │ │ ├── gen_DomQuad.rs │ │ │ ├── gen_DomQuadInit.rs │ │ │ ├── gen_DomQuadJson.rs │ │ │ ├── gen_DomRect.rs │ │ │ ├── gen_DomRectInit.rs │ │ │ ├── gen_DomRectList.rs │ │ │ ├── gen_DomRectReadOnly.rs │ │ │ ├── gen_DomRequest.rs │ │ │ ├── gen_DomRequestReadyState.rs │ │ │ ├── gen_DomStringList.rs │ │ │ ├── gen_DomStringMap.rs │ │ │ ├── gen_DomTokenList.rs │ │ │ ├── gen_DomWindowResizeEventDetail.rs │ │ │ ├── gen_DoubleRange.rs │ │ │ ├── gen_DragEvent.rs │ │ │ ├── gen_DragEventInit.rs │ │ │ ├── gen_DynamicsCompressorNode.rs │ │ │ ├── gen_DynamicsCompressorOptions.rs │ │ │ ├── gen_EcKeyAlgorithm.rs │ │ │ ├── gen_EcKeyGenParams.rs │ │ │ ├── gen_EcKeyImportParams.rs │ │ │ ├── gen_EcdhKeyDeriveParams.rs │ │ │ ├── gen_EcdsaParams.rs │ │ │ ├── gen_EffectTiming.rs │ │ │ ├── gen_Element.rs │ │ │ ├── gen_ElementCreationOptions.rs │ │ │ ├── gen_ElementDefinitionOptions.rs │ │ │ ├── gen_EncodedAudioChunk.rs │ │ │ ├── gen_EncodedAudioChunkInit.rs │ │ │ ├── gen_EncodedAudioChunkMetadata.rs │ │ │ ├── gen_EncodedAudioChunkType.rs │ │ │ ├── gen_EncodedVideoChunk.rs │ │ │ ├── gen_EncodedVideoChunkInit.rs │ │ │ ├── gen_EncodedVideoChunkMetadata.rs │ │ │ ├── gen_EncodedVideoChunkType.rs │ │ │ ├── gen_EndingTypes.rs │ │ │ ├── gen_ErrorCallback.rs │ │ │ ├── gen_ErrorEvent.rs │ │ │ ├── gen_ErrorEventInit.rs │ │ │ ├── gen_Event.rs │ │ │ ├── gen_EventInit.rs │ │ │ ├── gen_EventListener.rs │ │ │ ├── gen_EventListenerOptions.rs │ │ │ ├── gen_EventModifierInit.rs │ │ │ ├── gen_EventSource.rs │ │ │ ├── gen_EventSourceInit.rs │ │ │ ├── gen_EventTarget.rs │ │ │ ├── gen_Exception.rs │ │ │ ├── gen_ExtBlendMinmax.rs │ │ │ ├── gen_ExtColorBufferFloat.rs │ │ │ ├── gen_ExtColorBufferHalfFloat.rs │ │ │ ├── gen_ExtDisjointTimerQuery.rs │ │ │ ├── gen_ExtFragDepth.rs │ │ │ ├── gen_ExtSRgb.rs │ │ │ ├── gen_ExtShaderTextureLod.rs │ │ │ ├── gen_ExtTextureFilterAnisotropic.rs │ │ │ ├── gen_ExtTextureNorm16.rs │ │ │ ├── gen_ExtendableEvent.rs │ │ │ ├── gen_ExtendableEventInit.rs │ │ │ ├── gen_ExtendableMessageEvent.rs │ │ │ ├── gen_ExtendableMessageEventInit.rs │ │ │ ├── gen_External.rs │ │ │ ├── gen_FakePluginMimeEntry.rs │ │ │ ├── gen_FakePluginTagInit.rs │ │ │ ├── gen_FetchEvent.rs │ │ │ ├── gen_FetchEventInit.rs │ │ │ ├── gen_FetchObserver.rs │ │ │ ├── gen_FetchReadableStreamReadDataArray.rs │ │ │ ├── gen_FetchReadableStreamReadDataDone.rs │ │ │ ├── gen_FetchState.rs │ │ │ ├── gen_File.rs │ │ │ ├── gen_FileCallback.rs │ │ │ ├── gen_FileList.rs │ │ │ ├── gen_FilePickerAcceptType.rs │ │ │ ├── gen_FilePickerOptions.rs │ │ │ ├── gen_FilePropertyBag.rs │ │ │ ├── gen_FileReader.rs │ │ │ ├── gen_FileReaderSync.rs │ │ │ ├── gen_FileSystem.rs │ │ │ ├── gen_FileSystemCreateWritableOptions.rs │ │ │ ├── gen_FileSystemDirectoryEntry.rs │ │ │ ├── gen_FileSystemDirectoryHandle.rs │ │ │ ├── gen_FileSystemDirectoryReader.rs │ │ │ ├── gen_FileSystemEntriesCallback.rs │ │ │ ├── gen_FileSystemEntry.rs │ │ │ ├── gen_FileSystemEntryCallback.rs │ │ │ ├── gen_FileSystemFileEntry.rs │ │ │ ├── gen_FileSystemFileHandle.rs │ │ │ ├── gen_FileSystemFlags.rs │ │ │ ├── gen_FileSystemGetDirectoryOptions.rs │ │ │ ├── gen_FileSystemGetFileOptions.rs │ │ │ ├── gen_FileSystemHandle.rs │ │ │ ├── gen_FileSystemHandleKind.rs │ │ │ ├── gen_FileSystemHandlePermissionDescriptor.rs │ │ │ ├── gen_FileSystemPermissionDescriptor.rs │ │ │ ├── gen_FileSystemPermissionMode.rs │ │ │ ├── gen_FileSystemReadWriteOptions.rs │ │ │ ├── gen_FileSystemRemoveOptions.rs │ │ │ ├── gen_FileSystemSyncAccessHandle.rs │ │ │ ├── gen_FileSystemWritableFileStream.rs │ │ │ ├── gen_FillMode.rs │ │ │ ├── gen_FlashClassification.rs │ │ │ ├── gen_FlowControlType.rs │ │ │ ├── gen_FocusEvent.rs │ │ │ ├── gen_FocusEventInit.rs │ │ │ ├── gen_FocusOptions.rs │ │ │ ├── gen_FontData.rs │ │ │ ├── gen_FontFace.rs │ │ │ ├── gen_FontFaceDescriptors.rs │ │ │ ├── gen_FontFaceLoadStatus.rs │ │ │ ├── gen_FontFaceSet.rs │ │ │ ├── gen_FontFaceSetIterator.rs │ │ │ ├── gen_FontFaceSetIteratorResult.rs │ │ │ ├── gen_FontFaceSetLoadEvent.rs │ │ │ ├── gen_FontFaceSetLoadEventInit.rs │ │ │ ├── gen_FontFaceSetLoadStatus.rs │ │ │ ├── gen_FormData.rs │ │ │ ├── gen_FrameType.rs │ │ │ ├── gen_FuzzingFunctions.rs │ │ │ ├── gen_GainNode.rs │ │ │ ├── gen_GainOptions.rs │ │ │ ├── gen_Gamepad.rs │ │ │ ├── gen_GamepadButton.rs │ │ │ ├── gen_GamepadEffectParameters.rs │ │ │ ├── gen_GamepadEvent.rs │ │ │ ├── gen_GamepadEventInit.rs │ │ │ ├── gen_GamepadHand.rs │ │ │ ├── gen_GamepadHapticActuator.rs │ │ │ ├── gen_GamepadHapticActuatorType.rs │ │ │ ├── gen_GamepadHapticEffectType.rs │ │ │ ├── gen_GamepadHapticsResult.rs │ │ │ ├── gen_GamepadMappingType.rs │ │ │ ├── gen_GamepadPose.rs │ │ │ ├── gen_GamepadTouch.rs │ │ │ ├── gen_Geolocation.rs │ │ │ ├── gen_GetAnimationsOptions.rs │ │ │ ├── gen_GetRootNodeOptions.rs │ │ │ ├── gen_GetUserMediaRequest.rs │ │ │ ├── gen_Gpu.rs │ │ │ ├── gen_GpuAdapter.rs │ │ │ ├── gen_GpuAdapterInfo.rs │ │ │ ├── gen_GpuAddressMode.rs │ │ │ ├── gen_GpuAutoLayoutMode.rs │ │ │ ├── gen_GpuBindGroup.rs │ │ │ ├── gen_GpuBindGroupDescriptor.rs │ │ │ ├── gen_GpuBindGroupEntry.rs │ │ │ ├── gen_GpuBindGroupLayout.rs │ │ │ ├── gen_GpuBindGroupLayoutDescriptor.rs │ │ │ ├── gen_GpuBindGroupLayoutEntry.rs │ │ │ ├── gen_GpuBlendComponent.rs │ │ │ ├── gen_GpuBlendFactor.rs │ │ │ ├── gen_GpuBlendOperation.rs │ │ │ ├── gen_GpuBlendState.rs │ │ │ ├── gen_GpuBuffer.rs │ │ │ ├── gen_GpuBufferBinding.rs │ │ │ ├── gen_GpuBufferBindingLayout.rs │ │ │ ├── gen_GpuBufferBindingType.rs │ │ │ ├── gen_GpuBufferDescriptor.rs │ │ │ ├── gen_GpuBufferMapState.rs │ │ │ ├── gen_GpuCanvasAlphaMode.rs │ │ │ ├── gen_GpuCanvasConfiguration.rs │ │ │ ├── gen_GpuCanvasContext.rs │ │ │ ├── gen_GpuCanvasToneMapping.rs │ │ │ ├── gen_GpuCanvasToneMappingMode.rs │ │ │ ├── gen_GpuColorDict.rs │ │ │ ├── gen_GpuColorTargetState.rs │ │ │ ├── gen_GpuCommandBuffer.rs │ │ │ ├── gen_GpuCommandBufferDescriptor.rs │ │ │ ├── gen_GpuCommandEncoder.rs │ │ │ ├── gen_GpuCommandEncoderDescriptor.rs │ │ │ ├── gen_GpuCompareFunction.rs │ │ │ ├── gen_GpuCompilationInfo.rs │ │ │ ├── gen_GpuCompilationMessage.rs │ │ │ ├── gen_GpuCompilationMessageType.rs │ │ │ ├── gen_GpuComputePassDescriptor.rs │ │ │ ├── gen_GpuComputePassEncoder.rs │ │ │ ├── gen_GpuComputePassTimestampWrites.rs │ │ │ ├── gen_GpuComputePipeline.rs │ │ │ ├── gen_GpuComputePipelineDescriptor.rs │ │ │ ├── gen_GpuCopyExternalImageDestInfo.rs │ │ │ ├── gen_GpuCopyExternalImageSourceInfo.rs │ │ │ ├── gen_GpuCullMode.rs │ │ │ ├── gen_GpuDepthStencilState.rs │ │ │ ├── gen_GpuDevice.rs │ │ │ ├── gen_GpuDeviceDescriptor.rs │ │ │ ├── gen_GpuDeviceLostInfo.rs │ │ │ ├── gen_GpuDeviceLostReason.rs │ │ │ ├── gen_GpuError.rs │ │ │ ├── gen_GpuErrorFilter.rs │ │ │ ├── gen_GpuExtent3dDict.rs │ │ │ ├── gen_GpuExternalTexture.rs │ │ │ ├── gen_GpuExternalTextureBindingLayout.rs │ │ │ ├── gen_GpuExternalTextureDescriptor.rs │ │ │ ├── gen_GpuFeatureName.rs │ │ │ ├── gen_GpuFilterMode.rs │ │ │ ├── gen_GpuFragmentState.rs │ │ │ ├── gen_GpuFrontFace.rs │ │ │ ├── gen_GpuIndexFormat.rs │ │ │ ├── gen_GpuInternalError.rs │ │ │ ├── gen_GpuLoadOp.rs │ │ │ ├── gen_GpuMipmapFilterMode.rs │ │ │ ├── gen_GpuMultisampleState.rs │ │ │ ├── gen_GpuObjectDescriptorBase.rs │ │ │ ├── gen_GpuOrigin2dDict.rs │ │ │ ├── gen_GpuOrigin3dDict.rs │ │ │ ├── gen_GpuOutOfMemoryError.rs │ │ │ ├── gen_GpuPipelineDescriptorBase.rs │ │ │ ├── gen_GpuPipelineError.rs │ │ │ ├── gen_GpuPipelineErrorInit.rs │ │ │ ├── gen_GpuPipelineErrorReason.rs │ │ │ ├── gen_GpuPipelineLayout.rs │ │ │ ├── gen_GpuPipelineLayoutDescriptor.rs │ │ │ ├── gen_GpuPowerPreference.rs │ │ │ ├── gen_GpuPrimitiveState.rs │ │ │ ├── gen_GpuPrimitiveTopology.rs │ │ │ ├── gen_GpuProgrammableStage.rs │ │ │ ├── gen_GpuQuerySet.rs │ │ │ ├── gen_GpuQuerySetDescriptor.rs │ │ │ ├── gen_GpuQueryType.rs │ │ │ ├── gen_GpuQueue.rs │ │ │ ├── gen_GpuQueueDescriptor.rs │ │ │ ├── gen_GpuRenderBundle.rs │ │ │ ├── gen_GpuRenderBundleDescriptor.rs │ │ │ ├── gen_GpuRenderBundleEncoder.rs │ │ │ ├── gen_GpuRenderBundleEncoderDescriptor.rs │ │ │ ├── gen_GpuRenderPassColorAttachment.rs │ │ │ ├── gen_GpuRenderPassDepthStencilAttachment.rs │ │ │ ├── gen_GpuRenderPassDescriptor.rs │ │ │ ├── gen_GpuRenderPassEncoder.rs │ │ │ ├── gen_GpuRenderPassLayout.rs │ │ │ ├── gen_GpuRenderPassTimestampWrites.rs │ │ │ ├── gen_GpuRenderPipeline.rs │ │ │ ├── gen_GpuRenderPipelineDescriptor.rs │ │ │ ├── gen_GpuRequestAdapterOptions.rs │ │ │ ├── gen_GpuSampler.rs │ │ │ ├── gen_GpuSamplerBindingLayout.rs │ │ │ ├── gen_GpuSamplerBindingType.rs │ │ │ ├── gen_GpuSamplerDescriptor.rs │ │ │ ├── gen_GpuShaderModule.rs │ │ │ ├── gen_GpuShaderModuleCompilationHint.rs │ │ │ ├── gen_GpuShaderModuleDescriptor.rs │ │ │ ├── gen_GpuStencilFaceState.rs │ │ │ ├── gen_GpuStencilOperation.rs │ │ │ ├── gen_GpuStorageTextureAccess.rs │ │ │ ├── gen_GpuStorageTextureBindingLayout.rs │ │ │ ├── gen_GpuStoreOp.rs │ │ │ ├── gen_GpuSupportedFeatures.rs │ │ │ ├── gen_GpuSupportedLimits.rs │ │ │ ├── gen_GpuTexelCopyBufferInfo.rs │ │ │ ├── gen_GpuTexelCopyBufferLayout.rs │ │ │ ├── gen_GpuTexelCopyTextureInfo.rs │ │ │ ├── gen_GpuTexture.rs │ │ │ ├── gen_GpuTextureAspect.rs │ │ │ ├── gen_GpuTextureBindingLayout.rs │ │ │ ├── gen_GpuTextureDescriptor.rs │ │ │ ├── gen_GpuTextureDimension.rs │ │ │ ├── gen_GpuTextureFormat.rs │ │ │ ├── gen_GpuTextureSampleType.rs │ │ │ ├── gen_GpuTextureView.rs │ │ │ ├── gen_GpuTextureViewDescriptor.rs │ │ │ ├── gen_GpuTextureViewDimension.rs │ │ │ ├── gen_GpuUncapturedErrorEvent.rs │ │ │ ├── gen_GpuUncapturedErrorEventInit.rs │ │ │ ├── gen_GpuValidationError.rs │ │ │ ├── gen_GpuVertexAttribute.rs │ │ │ ├── gen_GpuVertexBufferLayout.rs │ │ │ ├── gen_GpuVertexFormat.rs │ │ │ ├── gen_GpuVertexState.rs │ │ │ ├── gen_GpuVertexStepMode.rs │ │ │ ├── gen_GroupedHistoryEventInit.rs │ │ │ ├── gen_HalfOpenInfoDict.rs │ │ │ ├── gen_HardwareAcceleration.rs │ │ │ ├── gen_HashChangeEvent.rs │ │ │ ├── gen_HashChangeEventInit.rs │ │ │ ├── gen_Headers.rs │ │ │ ├── gen_HeadersGuardEnum.rs │ │ │ ├── gen_Hid.rs │ │ │ ├── gen_HidCollectionInfo.rs │ │ │ ├── gen_HidConnectionEvent.rs │ │ │ ├── gen_HidConnectionEventInit.rs │ │ │ ├── gen_HidDevice.rs │ │ │ ├── gen_HidDeviceFilter.rs │ │ │ ├── gen_HidDeviceRequestOptions.rs │ │ │ ├── gen_HidInputReportEvent.rs │ │ │ ├── gen_HidInputReportEventInit.rs │ │ │ ├── gen_HidReportInfo.rs │ │ │ ├── gen_HidReportItem.rs │ │ │ ├── gen_HidUnitSystem.rs │ │ │ ├── gen_HiddenPluginEventInit.rs │ │ │ ├── gen_History.rs │ │ │ ├── gen_HitRegionOptions.rs │ │ │ ├── gen_HkdfParams.rs │ │ │ ├── gen_HmacDerivedKeyParams.rs │ │ │ ├── gen_HmacImportParams.rs │ │ │ ├── gen_HmacKeyAlgorithm.rs │ │ │ ├── gen_HmacKeyGenParams.rs │ │ │ ├── gen_HtmlAllCollection.rs │ │ │ ├── gen_HtmlAnchorElement.rs │ │ │ ├── gen_HtmlAreaElement.rs │ │ │ ├── gen_HtmlAudioElement.rs │ │ │ ├── gen_HtmlBaseElement.rs │ │ │ ├── gen_HtmlBodyElement.rs │ │ │ ├── gen_HtmlBrElement.rs │ │ │ ├── gen_HtmlButtonElement.rs │ │ │ ├── gen_HtmlCanvasElement.rs │ │ │ ├── gen_HtmlCollection.rs │ │ │ ├── gen_HtmlDListElement.rs │ │ │ ├── gen_HtmlDataElement.rs │ │ │ ├── gen_HtmlDataListElement.rs │ │ │ ├── gen_HtmlDetailsElement.rs │ │ │ ├── gen_HtmlDialogElement.rs │ │ │ ├── gen_HtmlDirectoryElement.rs │ │ │ ├── gen_HtmlDivElement.rs │ │ │ ├── gen_HtmlDocument.rs │ │ │ ├── gen_HtmlElement.rs │ │ │ ├── gen_HtmlEmbedElement.rs │ │ │ ├── gen_HtmlFieldSetElement.rs │ │ │ ├── gen_HtmlFontElement.rs │ │ │ ├── gen_HtmlFormControlsCollection.rs │ │ │ ├── gen_HtmlFormElement.rs │ │ │ ├── gen_HtmlFrameElement.rs │ │ │ ├── gen_HtmlFrameSetElement.rs │ │ │ ├── gen_HtmlHeadElement.rs │ │ │ ├── gen_HtmlHeadingElement.rs │ │ │ ├── gen_HtmlHrElement.rs │ │ │ ├── gen_HtmlHtmlElement.rs │ │ │ ├── gen_HtmlIFrameElement.rs │ │ │ ├── gen_HtmlImageElement.rs │ │ │ ├── gen_HtmlInputElement.rs │ │ │ ├── gen_HtmlLabelElement.rs │ │ │ ├── gen_HtmlLegendElement.rs │ │ │ ├── gen_HtmlLiElement.rs │ │ │ ├── gen_HtmlLinkElement.rs │ │ │ ├── gen_HtmlMapElement.rs │ │ │ ├── gen_HtmlMediaElement.rs │ │ │ ├── gen_HtmlMenuElement.rs │ │ │ ├── gen_HtmlMenuItemElement.rs │ │ │ ├── gen_HtmlMetaElement.rs │ │ │ ├── gen_HtmlMeterElement.rs │ │ │ ├── gen_HtmlModElement.rs │ │ │ ├── gen_HtmlOListElement.rs │ │ │ ├── gen_HtmlObjectElement.rs │ │ │ ├── gen_HtmlOptGroupElement.rs │ │ │ ├── gen_HtmlOptionElement.rs │ │ │ ├── gen_HtmlOptionsCollection.rs │ │ │ ├── gen_HtmlOutputElement.rs │ │ │ ├── gen_HtmlParagraphElement.rs │ │ │ ├── gen_HtmlParamElement.rs │ │ │ ├── gen_HtmlPictureElement.rs │ │ │ ├── gen_HtmlPreElement.rs │ │ │ ├── gen_HtmlProgressElement.rs │ │ │ ├── gen_HtmlQuoteElement.rs │ │ │ ├── gen_HtmlScriptElement.rs │ │ │ ├── gen_HtmlSelectElement.rs │ │ │ ├── gen_HtmlSlotElement.rs │ │ │ ├── gen_HtmlSourceElement.rs │ │ │ ├── gen_HtmlSpanElement.rs │ │ │ ├── gen_HtmlStyleElement.rs │ │ │ ├── gen_HtmlTableCaptionElement.rs │ │ │ ├── gen_HtmlTableCellElement.rs │ │ │ ├── gen_HtmlTableColElement.rs │ │ │ ├── gen_HtmlTableElement.rs │ │ │ ├── gen_HtmlTableRowElement.rs │ │ │ ├── gen_HtmlTableSectionElement.rs │ │ │ ├── gen_HtmlTemplateElement.rs │ │ │ ├── gen_HtmlTextAreaElement.rs │ │ │ ├── gen_HtmlTimeElement.rs │ │ │ ├── gen_HtmlTitleElement.rs │ │ │ ├── gen_HtmlTrackElement.rs │ │ │ ├── gen_HtmlUListElement.rs │ │ │ ├── gen_HtmlUnknownElement.rs │ │ │ ├── gen_HtmlVideoElement.rs │ │ │ ├── gen_HttpConnDict.rs │ │ │ ├── gen_HttpConnInfo.rs │ │ │ ├── gen_HttpConnectionElement.rs │ │ │ ├── gen_IdbCursor.rs │ │ │ ├── gen_IdbCursorDirection.rs │ │ │ ├── gen_IdbCursorWithValue.rs │ │ │ ├── gen_IdbDatabase.rs │ │ │ ├── gen_IdbFactory.rs │ │ │ ├── gen_IdbFileHandle.rs │ │ │ ├── gen_IdbFileMetadataParameters.rs │ │ │ ├── gen_IdbFileRequest.rs │ │ │ ├── gen_IdbIndex.rs │ │ │ ├── gen_IdbIndexParameters.rs │ │ │ ├── gen_IdbKeyRange.rs │ │ │ ├── gen_IdbLocaleAwareKeyRange.rs │ │ │ ├── gen_IdbMutableFile.rs │ │ │ ├── gen_IdbObjectStore.rs │ │ │ ├── gen_IdbObjectStoreParameters.rs │ │ │ ├── gen_IdbOpenDbOptions.rs │ │ │ ├── gen_IdbOpenDbRequest.rs │ │ │ ├── gen_IdbRequest.rs │ │ │ ├── gen_IdbRequestReadyState.rs │ │ │ ├── gen_IdbTransaction.rs │ │ │ ├── gen_IdbTransactionDurability.rs │ │ │ ├── gen_IdbTransactionMode.rs │ │ │ ├── gen_IdbTransactionOptions.rs │ │ │ ├── gen_IdbVersionChangeEvent.rs │ │ │ ├── gen_IdbVersionChangeEventInit.rs │ │ │ ├── gen_IdleDeadline.rs │ │ │ ├── gen_IdleRequestOptions.rs │ │ │ ├── gen_IirFilterNode.rs │ │ │ ├── gen_IirFilterOptions.rs │ │ │ ├── gen_ImageBitmap.rs │ │ │ ├── gen_ImageBitmapOptions.rs │ │ │ ├── gen_ImageBitmapRenderingContext.rs │ │ │ ├── gen_ImageCapture.rs │ │ │ ├── gen_ImageCaptureError.rs │ │ │ ├── gen_ImageCaptureErrorEvent.rs │ │ │ ├── gen_ImageCaptureErrorEventInit.rs │ │ │ ├── gen_ImageData.rs │ │ │ ├── gen_ImageDecodeOptions.rs │ │ │ ├── gen_ImageDecodeResult.rs │ │ │ ├── gen_ImageDecoder.rs │ │ │ ├── gen_ImageDecoderInit.rs │ │ │ ├── gen_ImageEncodeOptions.rs │ │ │ ├── gen_ImageOrientation.rs │ │ │ ├── gen_ImageTrack.rs │ │ │ ├── gen_ImageTrackList.rs │ │ │ ├── gen_InputDeviceInfo.rs │ │ │ ├── gen_InputEvent.rs │ │ │ ├── gen_InputEventInit.rs │ │ │ ├── gen_IntersectionObserver.rs │ │ │ ├── gen_IntersectionObserverEntry.rs │ │ │ ├── gen_IntersectionObserverEntryInit.rs │ │ │ ├── gen_IntersectionObserverInit.rs │ │ │ ├── gen_IntlUtils.rs │ │ │ ├── gen_IsInputPendingOptions.rs │ │ │ ├── gen_IterableKeyAndValueResult.rs │ │ │ ├── gen_IterableKeyOrValueResult.rs │ │ │ ├── gen_IterationCompositeOperation.rs │ │ │ ├── gen_JsonWebKey.rs │ │ │ ├── gen_KeyAlgorithm.rs │ │ │ ├── gen_KeyEvent.rs │ │ │ ├── gen_KeyFrameRequestEvent.rs │ │ │ ├── gen_KeyIdsInitData.rs │ │ │ ├── gen_KeyboardEvent.rs │ │ │ ├── gen_KeyboardEventInit.rs │ │ │ ├── gen_KeyframeAnimationOptions.rs │ │ │ ├── gen_KeyframeEffect.rs │ │ │ ├── gen_KeyframeEffectOptions.rs │ │ │ ├── gen_L10nElement.rs │ │ │ ├── gen_L10nValue.rs │ │ │ ├── gen_LargeBlobSupport.rs │ │ │ ├── gen_LatencyMode.rs │ │ │ ├── gen_LifecycleCallbacks.rs │ │ │ ├── gen_LineAlignSetting.rs │ │ │ ├── gen_ListBoxObject.rs │ │ │ ├── gen_LocalMediaStream.rs │ │ │ ├── gen_LocaleInfo.rs │ │ │ ├── gen_Location.rs │ │ │ ├── gen_Lock.rs │ │ │ ├── gen_LockInfo.rs │ │ │ ├── gen_LockManager.rs │ │ │ ├── gen_LockManagerSnapshot.rs │ │ │ ├── gen_LockMode.rs │ │ │ ├── gen_LockOptions.rs │ │ │ ├── gen_MathMlElement.rs │ │ │ ├── gen_MediaCapabilities.rs │ │ │ ├── gen_MediaCapabilitiesInfo.rs │ │ │ ├── gen_MediaConfiguration.rs │ │ │ ├── gen_MediaDecodingConfiguration.rs │ │ │ ├── gen_MediaDecodingType.rs │ │ │ ├── gen_MediaDeviceInfo.rs │ │ │ ├── gen_MediaDeviceKind.rs │ │ │ ├── gen_MediaDevices.rs │ │ │ ├── gen_MediaElementAudioSourceNode.rs │ │ │ ├── gen_MediaElementAudioSourceOptions.rs │ │ │ ├── gen_MediaEncodingConfiguration.rs │ │ │ ├── gen_MediaEncodingType.rs │ │ │ ├── gen_MediaEncryptedEvent.rs │ │ │ ├── gen_MediaError.rs │ │ │ ├── gen_MediaImage.rs │ │ │ ├── gen_MediaKeyError.rs │ │ │ ├── gen_MediaKeyMessageEvent.rs │ │ │ ├── gen_MediaKeyMessageEventInit.rs │ │ │ ├── gen_MediaKeyMessageType.rs │ │ │ ├── gen_MediaKeyNeededEventInit.rs │ │ │ ├── gen_MediaKeySession.rs │ │ │ ├── gen_MediaKeySessionType.rs │ │ │ ├── gen_MediaKeyStatus.rs │ │ │ ├── gen_MediaKeyStatusMap.rs │ │ │ ├── gen_MediaKeySystemAccess.rs │ │ │ ├── gen_MediaKeySystemConfiguration.rs │ │ │ ├── gen_MediaKeySystemMediaCapability.rs │ │ │ ├── gen_MediaKeySystemStatus.rs │ │ │ ├── gen_MediaKeys.rs │ │ │ ├── gen_MediaKeysPolicy.rs │ │ │ ├── gen_MediaKeysRequirement.rs │ │ │ ├── gen_MediaList.rs │ │ │ ├── gen_MediaMetadata.rs │ │ │ ├── gen_MediaMetadataInit.rs │ │ │ ├── gen_MediaPositionState.rs │ │ │ ├── gen_MediaQueryList.rs │ │ │ ├── gen_MediaQueryListEvent.rs │ │ │ ├── gen_MediaQueryListEventInit.rs │ │ │ ├── gen_MediaRecorder.rs │ │ │ ├── gen_MediaRecorderErrorEvent.rs │ │ │ ├── gen_MediaRecorderErrorEventInit.rs │ │ │ ├── gen_MediaRecorderOptions.rs │ │ │ ├── gen_MediaSession.rs │ │ │ ├── gen_MediaSessionAction.rs │ │ │ ├── gen_MediaSessionActionDetails.rs │ │ │ ├── gen_MediaSessionPlaybackState.rs │ │ │ ├── gen_MediaSource.rs │ │ │ ├── gen_MediaSourceEndOfStreamError.rs │ │ │ ├── gen_MediaSourceEnum.rs │ │ │ ├── gen_MediaSourceReadyState.rs │ │ │ ├── gen_MediaStream.rs │ │ │ ├── gen_MediaStreamAudioDestinationNode.rs │ │ │ ├── gen_MediaStreamAudioSourceNode.rs │ │ │ ├── gen_MediaStreamAudioSourceOptions.rs │ │ │ ├── gen_MediaStreamConstraints.rs │ │ │ ├── gen_MediaStreamError.rs │ │ │ ├── gen_MediaStreamEvent.rs │ │ │ ├── gen_MediaStreamEventInit.rs │ │ │ ├── gen_MediaStreamTrack.rs │ │ │ ├── gen_MediaStreamTrackEvent.rs │ │ │ ├── gen_MediaStreamTrackEventInit.rs │ │ │ ├── gen_MediaStreamTrackGenerator.rs │ │ │ ├── gen_MediaStreamTrackGeneratorInit.rs │ │ │ ├── gen_MediaStreamTrackProcessor.rs │ │ │ ├── gen_MediaStreamTrackProcessorInit.rs │ │ │ ├── gen_MediaStreamTrackState.rs │ │ │ ├── gen_MediaTrackCapabilities.rs │ │ │ ├── gen_MediaTrackConstraintSet.rs │ │ │ ├── gen_MediaTrackConstraints.rs │ │ │ ├── gen_MediaTrackSettings.rs │ │ │ ├── gen_MediaTrackSupportedConstraints.rs │ │ │ ├── gen_MemoryAttribution.rs │ │ │ ├── gen_MemoryAttributionContainer.rs │ │ │ ├── gen_MemoryBreakdownEntry.rs │ │ │ ├── gen_MemoryMeasurement.rs │ │ │ ├── gen_MessageChannel.rs │ │ │ ├── gen_MessageEvent.rs │ │ │ ├── gen_MessageEventInit.rs │ │ │ ├── gen_MessagePort.rs │ │ │ ├── gen_MidiAccess.rs │ │ │ ├── gen_MidiConnectionEvent.rs │ │ │ ├── gen_MidiConnectionEventInit.rs │ │ │ ├── gen_MidiInput.rs │ │ │ ├── gen_MidiInputMap.rs │ │ │ ├── gen_MidiMessageEvent.rs │ │ │ ├── gen_MidiMessageEventInit.rs │ │ │ ├── gen_MidiOptions.rs │ │ │ ├── gen_MidiOutput.rs │ │ │ ├── gen_MidiOutputMap.rs │ │ │ ├── gen_MidiPort.rs │ │ │ ├── gen_MidiPortConnectionState.rs │ │ │ ├── gen_MidiPortDeviceState.rs │ │ │ ├── gen_MidiPortType.rs │ │ │ ├── gen_MimeType.rs │ │ │ ├── gen_MimeTypeArray.rs │ │ │ ├── gen_MouseEvent.rs │ │ │ ├── gen_MouseEventInit.rs │ │ │ ├── gen_MouseScrollEvent.rs │ │ │ ├── gen_MozDebug.rs │ │ │ ├── gen_MutationEvent.rs │ │ │ ├── gen_MutationObserver.rs │ │ │ ├── gen_MutationObserverInit.rs │ │ │ ├── gen_MutationObservingInfo.rs │ │ │ ├── gen_MutationRecord.rs │ │ │ ├── gen_NamedNodeMap.rs │ │ │ ├── gen_NativeOsFileReadOptions.rs │ │ │ ├── gen_NativeOsFileWriteAtomicOptions.rs │ │ │ ├── gen_NavigationType.rs │ │ │ ├── gen_Navigator.rs │ │ │ ├── gen_NavigatorAutomationInformation.rs │ │ │ ├── gen_NavigatorUaBrandVersion.rs │ │ │ ├── gen_NavigatorUaData.rs │ │ │ ├── gen_NetworkCommandOptions.rs │ │ │ ├── gen_NetworkInformation.rs │ │ │ ├── gen_NetworkResultOptions.rs │ │ │ ├── gen_Node.rs │ │ │ ├── gen_NodeFilter.rs │ │ │ ├── gen_NodeIterator.rs │ │ │ ├── gen_NodeList.rs │ │ │ ├── gen_Notification.rs │ │ │ ├── gen_NotificationAction.rs │ │ │ ├── gen_NotificationDirection.rs │ │ │ ├── gen_NotificationEvent.rs │ │ │ ├── gen_NotificationEventInit.rs │ │ │ ├── gen_NotificationOptions.rs │ │ │ ├── gen_NotificationPermission.rs │ │ │ ├── gen_ObserverCallback.rs │ │ │ ├── gen_OesElementIndexUint.rs │ │ │ ├── gen_OesStandardDerivatives.rs │ │ │ ├── gen_OesTextureFloat.rs │ │ │ ├── gen_OesTextureFloatLinear.rs │ │ │ ├── gen_OesTextureHalfFloat.rs │ │ │ ├── gen_OesTextureHalfFloatLinear.rs │ │ │ ├── gen_OesVertexArrayObject.rs │ │ │ ├── gen_OfflineAudioCompletionEvent.rs │ │ │ ├── gen_OfflineAudioCompletionEventInit.rs │ │ │ ├── gen_OfflineAudioContext.rs │ │ │ ├── gen_OfflineAudioContextOptions.rs │ │ │ ├── gen_OfflineResourceList.rs │ │ │ ├── gen_OffscreenCanvas.rs │ │ │ ├── gen_OffscreenCanvasRenderingContext2d.rs │ │ │ ├── gen_OpenFilePickerOptions.rs │ │ │ ├── gen_OpenWindowEventDetail.rs │ │ │ ├── gen_OptionalEffectTiming.rs │ │ │ ├── gen_OrientationLockType.rs │ │ │ ├── gen_OrientationType.rs │ │ │ ├── gen_OscillatorNode.rs │ │ │ ├── gen_OscillatorOptions.rs │ │ │ ├── gen_OscillatorType.rs │ │ │ ├── gen_OverSampleType.rs │ │ │ ├── gen_OvrMultiview2.rs │ │ │ ├── gen_PageTransitionEvent.rs │ │ │ ├── gen_PageTransitionEventInit.rs │ │ │ ├── gen_PaintRequest.rs │ │ │ ├── gen_PaintRequestList.rs │ │ │ ├── gen_PaintWorkletGlobalScope.rs │ │ │ ├── gen_PannerNode.rs │ │ │ ├── gen_PannerOptions.rs │ │ │ ├── gen_PanningModelType.rs │ │ │ ├── gen_ParityType.rs │ │ │ ├── gen_Path2d.rs │ │ │ ├── gen_PaymentAddress.rs │ │ │ ├── gen_PaymentComplete.rs │ │ │ ├── gen_PaymentMethodChangeEvent.rs │ │ │ ├── gen_PaymentMethodChangeEventInit.rs │ │ │ ├── gen_PaymentRequestUpdateEvent.rs │ │ │ ├── gen_PaymentRequestUpdateEventInit.rs │ │ │ ├── gen_PaymentResponse.rs │ │ │ ├── gen_Pbkdf2Params.rs │ │ │ ├── gen_PcImplIceConnectionState.rs │ │ │ ├── gen_PcImplIceGatheringState.rs │ │ │ ├── gen_PcImplSignalingState.rs │ │ │ ├── gen_PcObserverStateType.rs │ │ │ ├── gen_Performance.rs │ │ │ ├── gen_PerformanceEntry.rs │ │ │ ├── gen_PerformanceEntryEventInit.rs │ │ │ ├── gen_PerformanceEntryFilterOptions.rs │ │ │ ├── gen_PerformanceMark.rs │ │ │ ├── gen_PerformanceMeasure.rs │ │ │ ├── gen_PerformanceNavigation.rs │ │ │ ├── gen_PerformanceNavigationTiming.rs │ │ │ ├── gen_PerformanceObserver.rs │ │ │ ├── gen_PerformanceObserverEntryList.rs │ │ │ ├── gen_PerformanceObserverInit.rs │ │ │ ├── gen_PerformanceResourceTiming.rs │ │ │ ├── gen_PerformanceServerTiming.rs │ │ │ ├── gen_PerformanceTiming.rs │ │ │ ├── gen_PeriodicWave.rs │ │ │ ├── gen_PeriodicWaveConstraints.rs │ │ │ ├── gen_PeriodicWaveOptions.rs │ │ │ ├── gen_PermissionDescriptor.rs │ │ │ ├── gen_PermissionName.rs │ │ │ ├── gen_PermissionState.rs │ │ │ ├── gen_PermissionStatus.rs │ │ │ ├── gen_Permissions.rs │ │ │ ├── gen_PlaneLayout.rs │ │ │ ├── gen_PlaybackDirection.rs │ │ │ ├── gen_Plugin.rs │ │ │ ├── gen_PluginArray.rs │ │ │ ├── gen_PluginCrashedEventInit.rs │ │ │ ├── gen_PointerEvent.rs │ │ │ ├── gen_PointerEventInit.rs │ │ │ ├── gen_PopStateEvent.rs │ │ │ ├── gen_PopStateEventInit.rs │ │ │ ├── gen_PopupBlockedEvent.rs │ │ │ ├── gen_PopupBlockedEventInit.rs │ │ │ ├── gen_Position.rs │ │ │ ├── gen_PositionAlignSetting.rs │ │ │ ├── gen_PositionError.rs │ │ │ ├── gen_PositionOptions.rs │ │ │ ├── gen_PremultiplyAlpha.rs │ │ │ ├── gen_Presentation.rs │ │ │ ├── gen_PresentationAvailability.rs │ │ │ ├── gen_PresentationConnection.rs │ │ │ ├── gen_PresentationConnectionAvailableEvent.rs │ │ │ ├── gen_PresentationConnectionAvailableEventInit.rs │ │ │ ├── gen_PresentationConnectionBinaryType.rs │ │ │ ├── gen_PresentationConnectionCloseEvent.rs │ │ │ ├── gen_PresentationConnectionCloseEventInit.rs │ │ │ ├── gen_PresentationConnectionClosedReason.rs │ │ │ ├── gen_PresentationConnectionList.rs │ │ │ ├── gen_PresentationConnectionState.rs │ │ │ ├── gen_PresentationReceiver.rs │ │ │ ├── gen_PresentationRequest.rs │ │ │ ├── gen_PresentationStyle.rs │ │ │ ├── gen_ProcessingInstruction.rs │ │ │ ├── gen_ProfileTimelineLayerRect.rs │ │ │ ├── gen_ProfileTimelineMarker.rs │ │ │ ├── gen_ProfileTimelineMessagePortOperationType.rs │ │ │ ├── gen_ProfileTimelineStackFrame.rs │ │ │ ├── gen_ProfileTimelineWorkerOperationType.rs │ │ │ ├── gen_ProgressEvent.rs │ │ │ ├── gen_ProgressEventInit.rs │ │ │ ├── gen_PromiseNativeHandler.rs │ │ │ ├── gen_PromiseRejectionEvent.rs │ │ │ ├── gen_PromiseRejectionEventInit.rs │ │ │ ├── gen_PublicKeyCredential.rs │ │ │ ├── gen_PublicKeyCredentialCreationOptions.rs │ │ │ ├── gen_PublicKeyCredentialCreationOptionsJson.rs │ │ │ ├── gen_PublicKeyCredentialDescriptor.rs │ │ │ ├── gen_PublicKeyCredentialDescriptorJson.rs │ │ │ ├── gen_PublicKeyCredentialEntity.rs │ │ │ ├── gen_PublicKeyCredentialHints.rs │ │ │ ├── gen_PublicKeyCredentialParameters.rs │ │ │ ├── gen_PublicKeyCredentialRequestOptions.rs │ │ │ ├── gen_PublicKeyCredentialRequestOptionsJson.rs │ │ │ ├── gen_PublicKeyCredentialRpEntity.rs │ │ │ ├── gen_PublicKeyCredentialType.rs │ │ │ ├── gen_PublicKeyCredentialUserEntity.rs │ │ │ ├── gen_PublicKeyCredentialUserEntityJson.rs │ │ │ ├── gen_PushEncryptionKeyName.rs │ │ │ ├── gen_PushEvent.rs │ │ │ ├── gen_PushEventInit.rs │ │ │ ├── gen_PushManager.rs │ │ │ ├── gen_PushMessageData.rs │ │ │ ├── gen_PushPermissionState.rs │ │ │ ├── gen_PushSubscription.rs │ │ │ ├── gen_PushSubscriptionInit.rs │ │ │ ├── gen_PushSubscriptionJson.rs │ │ │ ├── gen_PushSubscriptionKeys.rs │ │ │ ├── gen_PushSubscriptionOptions.rs │ │ │ ├── gen_PushSubscriptionOptionsInit.rs │ │ │ ├── gen_QueryOptions.rs │ │ │ ├── gen_QueuingStrategy.rs │ │ │ ├── gen_QueuingStrategyInit.rs │ │ │ ├── gen_RadioNodeList.rs │ │ │ ├── gen_Range.rs │ │ │ ├── gen_RcwnPerfStats.rs │ │ │ ├── gen_RcwnStatus.rs │ │ │ ├── gen_ReadableByteStreamController.rs │ │ │ ├── gen_ReadableStream.rs │ │ │ ├── gen_ReadableStreamByobReader.rs │ │ │ ├── gen_ReadableStreamByobRequest.rs │ │ │ ├── gen_ReadableStreamDefaultController.rs │ │ │ ├── gen_ReadableStreamDefaultReader.rs │ │ │ ├── gen_ReadableStreamGetReaderOptions.rs │ │ │ ├── gen_ReadableStreamIteratorOptions.rs │ │ │ ├── gen_ReadableStreamReadResult.rs │ │ │ ├── gen_ReadableStreamReaderMode.rs │ │ │ ├── gen_ReadableStreamType.rs │ │ │ ├── gen_ReadableWritablePair.rs │ │ │ ├── gen_RecordingState.rs │ │ │ ├── gen_ReferrerPolicy.rs │ │ │ ├── gen_RegisterRequest.rs │ │ │ ├── gen_RegisterResponse.rs │ │ │ ├── gen_RegisteredKey.rs │ │ │ ├── gen_RegistrationOptions.rs │ │ │ ├── gen_RegistrationResponseJson.rs │ │ │ ├── gen_Request.rs │ │ │ ├── gen_RequestCache.rs │ │ │ ├── gen_RequestCredentials.rs │ │ │ ├── gen_RequestDestination.rs │ │ │ ├── gen_RequestDeviceOptions.rs │ │ │ ├── gen_RequestInit.rs │ │ │ ├── gen_RequestMediaKeySystemAccessNotification.rs │ │ │ ├── gen_RequestMode.rs │ │ │ ├── gen_RequestRedirect.rs │ │ │ ├── gen_ResidentKeyRequirement.rs │ │ │ ├── gen_ResizeObserver.rs │ │ │ ├── gen_ResizeObserverBoxOptions.rs │ │ │ ├── gen_ResizeObserverEntry.rs │ │ │ ├── gen_ResizeObserverOptions.rs │ │ │ ├── gen_ResizeObserverSize.rs │ │ │ ├── gen_ResizeQuality.rs │ │ │ ├── gen_Response.rs │ │ │ ├── gen_ResponseInit.rs │ │ │ ├── gen_ResponseType.rs │ │ │ ├── gen_RsaHashedImportParams.rs │ │ │ ├── gen_RsaOaepParams.rs │ │ │ ├── gen_RsaOtherPrimesInfo.rs │ │ │ ├── gen_RsaPssParams.rs │ │ │ ├── gen_RtcAnswerOptions.rs │ │ │ ├── gen_RtcBundlePolicy.rs │ │ │ ├── gen_RtcCertificate.rs │ │ │ ├── gen_RtcCertificateExpiration.rs │ │ │ ├── gen_RtcCodecStats.rs │ │ │ ├── gen_RtcConfiguration.rs │ │ │ ├── gen_RtcDataChannel.rs │ │ │ ├── gen_RtcDataChannelEvent.rs │ │ │ ├── gen_RtcDataChannelEventInit.rs │ │ │ ├── gen_RtcDataChannelInit.rs │ │ │ ├── gen_RtcDataChannelState.rs │ │ │ ├── gen_RtcDataChannelType.rs │ │ │ ├── gen_RtcDegradationPreference.rs │ │ │ ├── gen_RtcEncodedAudioFrame.rs │ │ │ ├── gen_RtcEncodedAudioFrameMetadata.rs │ │ │ ├── gen_RtcEncodedAudioFrameOptions.rs │ │ │ ├── gen_RtcEncodedVideoFrame.rs │ │ │ ├── gen_RtcEncodedVideoFrameMetadata.rs │ │ │ ├── gen_RtcEncodedVideoFrameOptions.rs │ │ │ ├── gen_RtcEncodedVideoFrameType.rs │ │ │ ├── gen_RtcFecParameters.rs │ │ │ ├── gen_RtcIceCandidate.rs │ │ │ ├── gen_RtcIceCandidateInit.rs │ │ │ ├── gen_RtcIceCandidatePairStats.rs │ │ │ ├── gen_RtcIceCandidateStats.rs │ │ │ ├── gen_RtcIceComponentStats.rs │ │ │ ├── gen_RtcIceConnectionState.rs │ │ │ ├── gen_RtcIceCredentialType.rs │ │ │ ├── gen_RtcIceGatheringState.rs │ │ │ ├── gen_RtcIceServer.rs │ │ │ ├── gen_RtcIceTransportPolicy.rs │ │ │ ├── gen_RtcIdentityAssertion.rs │ │ │ ├── gen_RtcIdentityAssertionResult.rs │ │ │ ├── gen_RtcIdentityProvider.rs │ │ │ ├── gen_RtcIdentityProviderDetails.rs │ │ │ ├── gen_RtcIdentityProviderOptions.rs │ │ │ ├── gen_RtcIdentityProviderRegistrar.rs │ │ │ ├── gen_RtcIdentityValidationResult.rs │ │ │ ├── gen_RtcInboundRtpStreamStats.rs │ │ │ ├── gen_RtcMediaStreamStats.rs │ │ │ ├── gen_RtcMediaStreamTrackStats.rs │ │ │ ├── gen_RtcOfferAnswerOptions.rs │ │ │ ├── gen_RtcOfferOptions.rs │ │ │ ├── gen_RtcOutboundRtpStreamStats.rs │ │ │ ├── gen_RtcPeerConnection.rs │ │ │ ├── gen_RtcPeerConnectionIceErrorEvent.rs │ │ │ ├── gen_RtcPeerConnectionIceEvent.rs │ │ │ ├── gen_RtcPeerConnectionIceEventInit.rs │ │ │ ├── gen_RtcPeerConnectionState.rs │ │ │ ├── gen_RtcPriorityType.rs │ │ │ ├── gen_RtcRtcpParameters.rs │ │ │ ├── gen_RtcRtpCapabilities.rs │ │ │ ├── gen_RtcRtpCodecCapability.rs │ │ │ ├── gen_RtcRtpCodecParameters.rs │ │ │ ├── gen_RtcRtpContributingSource.rs │ │ │ ├── gen_RtcRtpEncodingParameters.rs │ │ │ ├── gen_RtcRtpHeaderExtensionCapability.rs │ │ │ ├── gen_RtcRtpHeaderExtensionParameters.rs │ │ │ ├── gen_RtcRtpParameters.rs │ │ │ ├── gen_RtcRtpReceiver.rs │ │ │ ├── gen_RtcRtpScriptTransform.rs │ │ │ ├── gen_RtcRtpScriptTransformer.rs │ │ │ ├── gen_RtcRtpSender.rs │ │ │ ├── gen_RtcRtpSourceEntry.rs │ │ │ ├── gen_RtcRtpSourceEntryType.rs │ │ │ ├── gen_RtcRtpSynchronizationSource.rs │ │ │ ├── gen_RtcRtpTransceiver.rs │ │ │ ├── gen_RtcRtpTransceiverDirection.rs │ │ │ ├── gen_RtcRtpTransceiverInit.rs │ │ │ ├── gen_RtcRtxParameters.rs │ │ │ ├── gen_RtcSdpType.rs │ │ │ ├── gen_RtcSessionDescription.rs │ │ │ ├── gen_RtcSessionDescriptionInit.rs │ │ │ ├── gen_RtcSignalingState.rs │ │ │ ├── gen_RtcStats.rs │ │ │ ├── gen_RtcStatsIceCandidatePairState.rs │ │ │ ├── gen_RtcStatsIceCandidateType.rs │ │ │ ├── gen_RtcStatsReport.rs │ │ │ ├── gen_RtcStatsReportInternal.rs │ │ │ ├── gen_RtcStatsType.rs │ │ │ ├── gen_RtcTrackEvent.rs │ │ │ ├── gen_RtcTrackEventInit.rs │ │ │ ├── gen_RtcTransformEvent.rs │ │ │ ├── gen_RtcTransportStats.rs │ │ │ ├── gen_RtcdtmfSender.rs │ │ │ ├── gen_RtcdtmfToneChangeEvent.rs │ │ │ ├── gen_RtcdtmfToneChangeEventInit.rs │ │ │ ├── gen_RtcrtpContributingSourceStats.rs │ │ │ ├── gen_RtcrtpStreamStats.rs │ │ │ ├── gen_SFrameTransform.rs │ │ │ ├── gen_SFrameTransformErrorEvent.rs │ │ │ ├── gen_SFrameTransformErrorEventInit.rs │ │ │ ├── gen_SFrameTransformErrorEventType.rs │ │ │ ├── gen_SFrameTransformOptions.rs │ │ │ ├── gen_SFrameTransformRole.rs │ │ │ ├── gen_SaveFilePickerOptions.rs │ │ │ ├── gen_Scheduler.rs │ │ │ ├── gen_SchedulerPostTaskOptions.rs │ │ │ ├── gen_Scheduling.rs │ │ │ ├── gen_Screen.rs │ │ │ ├── gen_ScreenColorGamut.rs │ │ │ ├── gen_ScreenLuminance.rs │ │ │ ├── gen_ScreenOrientation.rs │ │ │ ├── gen_ScriptProcessorNode.rs │ │ │ ├── gen_ScrollAreaEvent.rs │ │ │ ├── gen_ScrollBehavior.rs │ │ │ ├── gen_ScrollBoxObject.rs │ │ │ ├── gen_ScrollIntoViewOptions.rs │ │ │ ├── gen_ScrollLogicalPosition.rs │ │ │ ├── gen_ScrollOptions.rs │ │ │ ├── gen_ScrollRestoration.rs │ │ │ ├── gen_ScrollSetting.rs │ │ │ ├── gen_ScrollState.rs │ │ │ ├── gen_ScrollToOptions.rs │ │ │ ├── gen_ScrollViewChangeEventInit.rs │ │ │ ├── gen_SecurityPolicyViolationEvent.rs │ │ │ ├── gen_SecurityPolicyViolationEventDisposition.rs │ │ │ ├── gen_SecurityPolicyViolationEventInit.rs │ │ │ ├── gen_Selection.rs │ │ │ ├── gen_SelectionMode.rs │ │ │ ├── gen_Serial.rs │ │ │ ├── gen_SerialInputSignals.rs │ │ │ ├── gen_SerialOptions.rs │ │ │ ├── gen_SerialOutputSignals.rs │ │ │ ├── gen_SerialPort.rs │ │ │ ├── gen_SerialPortFilter.rs │ │ │ ├── gen_SerialPortInfo.rs │ │ │ ├── gen_SerialPortRequestOptions.rs │ │ │ ├── gen_ServerSocketOptions.rs │ │ │ ├── gen_ServiceWorker.rs │ │ │ ├── gen_ServiceWorkerContainer.rs │ │ │ ├── gen_ServiceWorkerGlobalScope.rs │ │ │ ├── gen_ServiceWorkerRegistration.rs │ │ │ ├── gen_ServiceWorkerState.rs │ │ │ ├── gen_ServiceWorkerUpdateViaCache.rs │ │ │ ├── gen_ShadowRoot.rs │ │ │ ├── gen_ShadowRootInit.rs │ │ │ ├── gen_ShadowRootMode.rs │ │ │ ├── gen_ShareData.rs │ │ │ ├── gen_SharedWorker.rs │ │ │ ├── gen_SharedWorkerGlobalScope.rs │ │ │ ├── gen_SignResponse.rs │ │ │ ├── gen_SocketElement.rs │ │ │ ├── gen_SocketOptions.rs │ │ │ ├── gen_SocketReadyState.rs │ │ │ ├── gen_SocketsDict.rs │ │ │ ├── gen_SourceBuffer.rs │ │ │ ├── gen_SourceBufferAppendMode.rs │ │ │ ├── gen_SourceBufferList.rs │ │ │ ├── gen_SpeechGrammar.rs │ │ │ ├── gen_SpeechGrammarList.rs │ │ │ ├── gen_SpeechRecognition.rs │ │ │ ├── gen_SpeechRecognitionAlternative.rs │ │ │ ├── gen_SpeechRecognitionError.rs │ │ │ ├── gen_SpeechRecognitionErrorCode.rs │ │ │ ├── gen_SpeechRecognitionErrorInit.rs │ │ │ ├── gen_SpeechRecognitionEvent.rs │ │ │ ├── gen_SpeechRecognitionEventInit.rs │ │ │ ├── gen_SpeechRecognitionResult.rs │ │ │ ├── gen_SpeechRecognitionResultList.rs │ │ │ ├── gen_SpeechSynthesis.rs │ │ │ ├── gen_SpeechSynthesisErrorCode.rs │ │ │ ├── gen_SpeechSynthesisErrorEvent.rs │ │ │ ├── gen_SpeechSynthesisErrorEventInit.rs │ │ │ ├── gen_SpeechSynthesisEvent.rs │ │ │ ├── gen_SpeechSynthesisEventInit.rs │ │ │ ├── gen_SpeechSynthesisUtterance.rs │ │ │ ├── gen_SpeechSynthesisVoice.rs │ │ │ ├── gen_StereoPannerNode.rs │ │ │ ├── gen_StereoPannerOptions.rs │ │ │ ├── gen_Storage.rs │ │ │ ├── gen_StorageEstimate.rs │ │ │ ├── gen_StorageEvent.rs │ │ │ ├── gen_StorageEventInit.rs │ │ │ ├── gen_StorageManager.rs │ │ │ ├── gen_StorageType.rs │ │ │ ├── gen_StreamPipeOptions.rs │ │ │ ├── gen_StyleRuleChangeEventInit.rs │ │ │ ├── gen_StyleSheet.rs │ │ │ ├── gen_StyleSheetApplicableStateChangeEventInit.rs │ │ │ ├── gen_StyleSheetChangeEventInit.rs │ │ │ ├── gen_StyleSheetList.rs │ │ │ ├── gen_SubmitEvent.rs │ │ │ ├── gen_SubmitEventInit.rs │ │ │ ├── gen_SubtleCrypto.rs │ │ │ ├── gen_SupportedType.rs │ │ │ ├── gen_SvcOutputMetadata.rs │ │ │ ├── gen_SvgAngle.rs │ │ │ ├── gen_SvgAnimateElement.rs │ │ │ ├── gen_SvgAnimateMotionElement.rs │ │ │ ├── gen_SvgAnimateTransformElement.rs │ │ │ ├── gen_SvgAnimatedAngle.rs │ │ │ ├── gen_SvgAnimatedBoolean.rs │ │ │ ├── gen_SvgAnimatedEnumeration.rs │ │ │ ├── gen_SvgAnimatedInteger.rs │ │ │ ├── gen_SvgAnimatedLength.rs │ │ │ ├── gen_SvgAnimatedLengthList.rs │ │ │ ├── gen_SvgAnimatedNumber.rs │ │ │ ├── gen_SvgAnimatedNumberList.rs │ │ │ ├── gen_SvgAnimatedPreserveAspectRatio.rs │ │ │ ├── gen_SvgAnimatedRect.rs │ │ │ ├── gen_SvgAnimatedString.rs │ │ │ ├── gen_SvgAnimatedTransformList.rs │ │ │ ├── gen_SvgAnimationElement.rs │ │ │ ├── gen_SvgBoundingBoxOptions.rs │ │ │ ├── gen_SvgCircleElement.rs │ │ │ ├── gen_SvgClipPathElement.rs │ │ │ ├── gen_SvgComponentTransferFunctionElement.rs │ │ │ ├── gen_SvgDefsElement.rs │ │ │ ├── gen_SvgDescElement.rs │ │ │ ├── gen_SvgElement.rs │ │ │ ├── gen_SvgEllipseElement.rs │ │ │ ├── gen_SvgFilterElement.rs │ │ │ ├── gen_SvgForeignObjectElement.rs │ │ │ ├── gen_SvgGeometryElement.rs │ │ │ ├── gen_SvgGradientElement.rs │ │ │ ├── gen_SvgGraphicsElement.rs │ │ │ ├── gen_SvgImageElement.rs │ │ │ ├── gen_SvgLength.rs │ │ │ ├── gen_SvgLengthList.rs │ │ │ ├── gen_SvgLineElement.rs │ │ │ ├── gen_SvgLinearGradientElement.rs │ │ │ ├── gen_SvgMarkerElement.rs │ │ │ ├── gen_SvgMaskElement.rs │ │ │ ├── gen_SvgMatrix.rs │ │ │ ├── gen_SvgMetadataElement.rs │ │ │ ├── gen_SvgNumber.rs │ │ │ ├── gen_SvgNumberList.rs │ │ │ ├── gen_SvgPathElement.rs │ │ │ ├── gen_SvgPathSeg.rs │ │ │ ├── gen_SvgPathSegArcAbs.rs │ │ │ ├── gen_SvgPathSegArcRel.rs │ │ │ ├── gen_SvgPathSegClosePath.rs │ │ │ ├── gen_SvgPathSegCurvetoCubicAbs.rs │ │ │ ├── gen_SvgPathSegCurvetoCubicRel.rs │ │ │ ├── gen_SvgPathSegCurvetoCubicSmoothAbs.rs │ │ │ ├── gen_SvgPathSegCurvetoCubicSmoothRel.rs │ │ │ ├── gen_SvgPathSegCurvetoQuadraticAbs.rs │ │ │ ├── gen_SvgPathSegCurvetoQuadraticRel.rs │ │ │ ├── gen_SvgPathSegCurvetoQuadraticSmoothAbs.rs │ │ │ ├── gen_SvgPathSegCurvetoQuadraticSmoothRel.rs │ │ │ ├── gen_SvgPathSegLinetoAbs.rs │ │ │ ├── gen_SvgPathSegLinetoHorizontalAbs.rs │ │ │ ├── gen_SvgPathSegLinetoHorizontalRel.rs │ │ │ ├── gen_SvgPathSegLinetoRel.rs │ │ │ ├── gen_SvgPathSegLinetoVerticalAbs.rs │ │ │ ├── gen_SvgPathSegLinetoVerticalRel.rs │ │ │ ├── gen_SvgPathSegList.rs │ │ │ ├── gen_SvgPathSegMovetoAbs.rs │ │ │ ├── gen_SvgPathSegMovetoRel.rs │ │ │ ├── gen_SvgPatternElement.rs │ │ │ ├── gen_SvgPoint.rs │ │ │ ├── gen_SvgPointList.rs │ │ │ ├── gen_SvgPolygonElement.rs │ │ │ ├── gen_SvgPolylineElement.rs │ │ │ ├── gen_SvgPreserveAspectRatio.rs │ │ │ ├── gen_SvgRadialGradientElement.rs │ │ │ ├── gen_SvgRect.rs │ │ │ ├── gen_SvgRectElement.rs │ │ │ ├── gen_SvgScriptElement.rs │ │ │ ├── gen_SvgSetElement.rs │ │ │ ├── gen_SvgStopElement.rs │ │ │ ├── gen_SvgStringList.rs │ │ │ ├── gen_SvgStyleElement.rs │ │ │ ├── gen_SvgSwitchElement.rs │ │ │ ├── gen_SvgSymbolElement.rs │ │ │ ├── gen_SvgTextContentElement.rs │ │ │ ├── gen_SvgTextElement.rs │ │ │ ├── gen_SvgTextPathElement.rs │ │ │ ├── gen_SvgTextPositioningElement.rs │ │ │ ├── gen_SvgTitleElement.rs │ │ │ ├── gen_SvgTransform.rs │ │ │ ├── gen_SvgTransformList.rs │ │ │ ├── gen_SvgUnitTypes.rs │ │ │ ├── gen_SvgUseElement.rs │ │ │ ├── gen_SvgViewElement.rs │ │ │ ├── gen_SvgZoomAndPan.rs │ │ │ ├── gen_SvgaElement.rs │ │ │ ├── gen_SvgfeBlendElement.rs │ │ │ ├── gen_SvgfeColorMatrixElement.rs │ │ │ ├── gen_SvgfeComponentTransferElement.rs │ │ │ ├── gen_SvgfeCompositeElement.rs │ │ │ ├── gen_SvgfeConvolveMatrixElement.rs │ │ │ ├── gen_SvgfeDiffuseLightingElement.rs │ │ │ ├── gen_SvgfeDisplacementMapElement.rs │ │ │ ├── gen_SvgfeDistantLightElement.rs │ │ │ ├── gen_SvgfeDropShadowElement.rs │ │ │ ├── gen_SvgfeFloodElement.rs │ │ │ ├── gen_SvgfeFuncAElement.rs │ │ │ ├── gen_SvgfeFuncBElement.rs │ │ │ ├── gen_SvgfeFuncGElement.rs │ │ │ ├── gen_SvgfeFuncRElement.rs │ │ │ ├── gen_SvgfeGaussianBlurElement.rs │ │ │ ├── gen_SvgfeImageElement.rs │ │ │ ├── gen_SvgfeMergeElement.rs │ │ │ ├── gen_SvgfeMergeNodeElement.rs │ │ │ ├── gen_SvgfeMorphologyElement.rs │ │ │ ├── gen_SvgfeOffsetElement.rs │ │ │ ├── gen_SvgfePointLightElement.rs │ │ │ ├── gen_SvgfeSpecularLightingElement.rs │ │ │ ├── gen_SvgfeSpotLightElement.rs │ │ │ ├── gen_SvgfeTileElement.rs │ │ │ ├── gen_SvgfeTurbulenceElement.rs │ │ │ ├── gen_SvggElement.rs │ │ │ ├── gen_SvgmPathElement.rs │ │ │ ├── gen_SvgsvgElement.rs │ │ │ ├── gen_SvgtSpanElement.rs │ │ │ ├── gen_TaskController.rs │ │ │ ├── gen_TaskControllerInit.rs │ │ │ ├── gen_TaskPriority.rs │ │ │ ├── gen_TaskPriorityChangeEvent.rs │ │ │ ├── gen_TaskPriorityChangeEventInit.rs │ │ │ ├── gen_TaskSignal.rs │ │ │ ├── gen_TaskSignalAnyInit.rs │ │ │ ├── gen_TcpReadyState.rs │ │ │ ├── gen_TcpServerSocket.rs │ │ │ ├── gen_TcpServerSocketEvent.rs │ │ │ ├── gen_TcpServerSocketEventInit.rs │ │ │ ├── gen_TcpSocket.rs │ │ │ ├── gen_TcpSocketBinaryType.rs │ │ │ ├── gen_TcpSocketErrorEvent.rs │ │ │ ├── gen_TcpSocketErrorEventInit.rs │ │ │ ├── gen_TcpSocketEvent.rs │ │ │ ├── gen_TcpSocketEventInit.rs │ │ │ ├── gen_Text.rs │ │ │ ├── gen_TextDecodeOptions.rs │ │ │ ├── gen_TextDecoder.rs │ │ │ ├── gen_TextDecoderOptions.rs │ │ │ ├── gen_TextEncoder.rs │ │ │ ├── gen_TextMetrics.rs │ │ │ ├── gen_TextTrack.rs │ │ │ ├── gen_TextTrackCue.rs │ │ │ ├── gen_TextTrackCueList.rs │ │ │ ├── gen_TextTrackKind.rs │ │ │ ├── gen_TextTrackList.rs │ │ │ ├── gen_TextTrackMode.rs │ │ │ ├── gen_TimeEvent.rs │ │ │ ├── gen_TimeRanges.rs │ │ │ ├── gen_ToggleEvent.rs │ │ │ ├── gen_ToggleEventInit.rs │ │ │ ├── gen_TokenBinding.rs │ │ │ ├── gen_TokenBindingStatus.rs │ │ │ ├── gen_Touch.rs │ │ │ ├── gen_TouchEvent.rs │ │ │ ├── gen_TouchEventInit.rs │ │ │ ├── gen_TouchInit.rs │ │ │ ├── gen_TouchList.rs │ │ │ ├── gen_TrackEvent.rs │ │ │ ├── gen_TrackEventInit.rs │ │ │ ├── gen_TransformStream.rs │ │ │ ├── gen_TransformStreamDefaultController.rs │ │ │ ├── gen_Transformer.rs │ │ │ ├── gen_TransitionEvent.rs │ │ │ ├── gen_TransitionEventInit.rs │ │ │ ├── gen_Transport.rs │ │ │ ├── gen_TreeBoxObject.rs │ │ │ ├── gen_TreeCellInfo.rs │ │ │ ├── gen_TreeView.rs │ │ │ ├── gen_TreeWalker.rs │ │ │ ├── gen_U2f.rs │ │ │ ├── gen_U2fClientData.rs │ │ │ ├── gen_ULongRange.rs │ │ │ ├── gen_UaDataValues.rs │ │ │ ├── gen_UaLowEntropyJson.rs │ │ │ ├── gen_UdpMessageEventInit.rs │ │ │ ├── gen_UdpOptions.rs │ │ │ ├── gen_UiEvent.rs │ │ │ ├── gen_UiEventInit.rs │ │ │ ├── gen_UnderlyingSink.rs │ │ │ ├── gen_UnderlyingSource.rs │ │ │ ├── gen_Url.rs │ │ │ ├── gen_UrlSearchParams.rs │ │ │ ├── gen_Usb.rs │ │ │ ├── gen_UsbAlternateInterface.rs │ │ │ ├── gen_UsbConfiguration.rs │ │ │ ├── gen_UsbConnectionEvent.rs │ │ │ ├── gen_UsbConnectionEventInit.rs │ │ │ ├── gen_UsbControlTransferParameters.rs │ │ │ ├── gen_UsbDevice.rs │ │ │ ├── gen_UsbDeviceFilter.rs │ │ │ ├── gen_UsbDeviceRequestOptions.rs │ │ │ ├── gen_UsbDirection.rs │ │ │ ├── gen_UsbEndpoint.rs │ │ │ ├── gen_UsbEndpointType.rs │ │ │ ├── gen_UsbInTransferResult.rs │ │ │ ├── gen_UsbInterface.rs │ │ │ ├── gen_UsbIsochronousInTransferPacket.rs │ │ │ ├── gen_UsbIsochronousInTransferResult.rs │ │ │ ├── gen_UsbIsochronousOutTransferPacket.rs │ │ │ ├── gen_UsbIsochronousOutTransferResult.rs │ │ │ ├── gen_UsbOutTransferResult.rs │ │ │ ├── gen_UsbPermissionDescriptor.rs │ │ │ ├── gen_UsbPermissionResult.rs │ │ │ ├── gen_UsbPermissionStorage.rs │ │ │ ├── gen_UsbRecipient.rs │ │ │ ├── gen_UsbRequestType.rs │ │ │ ├── gen_UsbTransferStatus.rs │ │ │ ├── gen_UserActivation.rs │ │ │ ├── gen_UserProximityEvent.rs │ │ │ ├── gen_UserProximityEventInit.rs │ │ │ ├── gen_UserVerificationRequirement.rs │ │ │ ├── gen_ValidityState.rs │ │ │ ├── gen_ValueEvent.rs │ │ │ ├── gen_ValueEventInit.rs │ │ │ ├── gen_VideoColorPrimaries.rs │ │ │ ├── gen_VideoColorSpace.rs │ │ │ ├── gen_VideoColorSpaceInit.rs │ │ │ ├── gen_VideoConfiguration.rs │ │ │ ├── gen_VideoDecoder.rs │ │ │ ├── gen_VideoDecoderConfig.rs │ │ │ ├── gen_VideoDecoderInit.rs │ │ │ ├── gen_VideoDecoderSupport.rs │ │ │ ├── gen_VideoEncoder.rs │ │ │ ├── gen_VideoEncoderConfig.rs │ │ │ ├── gen_VideoEncoderEncodeOptions.rs │ │ │ ├── gen_VideoEncoderInit.rs │ │ │ ├── gen_VideoEncoderSupport.rs │ │ │ ├── gen_VideoFacingModeEnum.rs │ │ │ ├── gen_VideoFrame.rs │ │ │ ├── gen_VideoFrameBufferInit.rs │ │ │ ├── gen_VideoFrameCopyToOptions.rs │ │ │ ├── gen_VideoFrameInit.rs │ │ │ ├── gen_VideoMatrixCoefficients.rs │ │ │ ├── gen_VideoPixelFormat.rs │ │ │ ├── gen_VideoPlaybackQuality.rs │ │ │ ├── gen_VideoStreamTrack.rs │ │ │ ├── gen_VideoTrack.rs │ │ │ ├── gen_VideoTrackList.rs │ │ │ ├── gen_VideoTransferCharacteristics.rs │ │ │ ├── gen_ViewTransition.rs │ │ │ ├── gen_VisibilityState.rs │ │ │ ├── gen_VisualViewport.rs │ │ │ ├── gen_VoidCallback.rs │ │ │ ├── gen_VrDisplay.rs │ │ │ ├── gen_VrDisplayCapabilities.rs │ │ │ ├── gen_VrEye.rs │ │ │ ├── gen_VrEyeParameters.rs │ │ │ ├── gen_VrFieldOfView.rs │ │ │ ├── gen_VrFrameData.rs │ │ │ ├── gen_VrLayer.rs │ │ │ ├── gen_VrMockController.rs │ │ │ ├── gen_VrMockDisplay.rs │ │ │ ├── gen_VrPose.rs │ │ │ ├── gen_VrServiceTest.rs │ │ │ ├── gen_VrStageParameters.rs │ │ │ ├── gen_VrSubmitFrameResult.rs │ │ │ ├── gen_VttCue.rs │ │ │ ├── gen_VttRegion.rs │ │ │ ├── gen_WakeLock.rs │ │ │ ├── gen_WakeLockSentinel.rs │ │ │ ├── gen_WakeLockType.rs │ │ │ ├── gen_WatchAdvertisementsOptions.rs │ │ │ ├── gen_WaveShaperNode.rs │ │ │ ├── gen_WaveShaperOptions.rs │ │ │ ├── gen_WebGl2RenderingContext.rs │ │ │ ├── gen_WebGlActiveInfo.rs │ │ │ ├── gen_WebGlBuffer.rs │ │ │ ├── gen_WebGlContextAttributes.rs │ │ │ ├── gen_WebGlContextEvent.rs │ │ │ ├── gen_WebGlContextEventInit.rs │ │ │ ├── gen_WebGlFramebuffer.rs │ │ │ ├── gen_WebGlPowerPreference.rs │ │ │ ├── gen_WebGlProgram.rs │ │ │ ├── gen_WebGlQuery.rs │ │ │ ├── gen_WebGlRenderbuffer.rs │ │ │ ├── gen_WebGlRenderingContext.rs │ │ │ ├── gen_WebGlSampler.rs │ │ │ ├── gen_WebGlShader.rs │ │ │ ├── gen_WebGlShaderPrecisionFormat.rs │ │ │ ├── gen_WebGlSync.rs │ │ │ ├── gen_WebGlTexture.rs │ │ │ ├── gen_WebGlTransformFeedback.rs │ │ │ ├── gen_WebGlUniformLocation.rs │ │ │ ├── gen_WebGlVertexArrayObject.rs │ │ │ ├── gen_WebKitCssMatrix.rs │ │ │ ├── gen_WebSocket.rs │ │ │ ├── gen_WebSocketDict.rs │ │ │ ├── gen_WebSocketElement.rs │ │ │ ├── gen_WebTransport.rs │ │ │ ├── gen_WebTransportBidirectionalStream.rs │ │ │ ├── gen_WebTransportCloseInfo.rs │ │ │ ├── gen_WebTransportCongestionControl.rs │ │ │ ├── gen_WebTransportDatagramDuplexStream.rs │ │ │ ├── gen_WebTransportDatagramStats.rs │ │ │ ├── gen_WebTransportError.rs │ │ │ ├── gen_WebTransportErrorOptions.rs │ │ │ ├── gen_WebTransportErrorSource.rs │ │ │ ├── gen_WebTransportHash.rs │ │ │ ├── gen_WebTransportOptions.rs │ │ │ ├── gen_WebTransportReceiveStream.rs │ │ │ ├── gen_WebTransportReceiveStreamStats.rs │ │ │ ├── gen_WebTransportReliabilityMode.rs │ │ │ ├── gen_WebTransportSendStream.rs │ │ │ ├── gen_WebTransportSendStreamOptions.rs │ │ │ ├── gen_WebTransportSendStreamStats.rs │ │ │ ├── gen_WebTransportStats.rs │ │ │ ├── gen_WebglColorBufferFloat.rs │ │ │ ├── gen_WebglCompressedTextureAstc.rs │ │ │ ├── gen_WebglCompressedTextureAtc.rs │ │ │ ├── gen_WebglCompressedTextureEtc.rs │ │ │ ├── gen_WebglCompressedTextureEtc1.rs │ │ │ ├── gen_WebglCompressedTexturePvrtc.rs │ │ │ ├── gen_WebglCompressedTextureS3tc.rs │ │ │ ├── gen_WebglCompressedTextureS3tcSrgb.rs │ │ │ ├── gen_WebglDebugRendererInfo.rs │ │ │ ├── gen_WebglDebugShaders.rs │ │ │ ├── gen_WebglDepthTexture.rs │ │ │ ├── gen_WebglDrawBuffers.rs │ │ │ ├── gen_WebglLoseContext.rs │ │ │ ├── gen_WebglMultiDraw.rs │ │ │ ├── gen_WellKnownDirectory.rs │ │ │ ├── gen_WgslLanguageFeatures.rs │ │ │ ├── gen_WheelEvent.rs │ │ │ ├── gen_WheelEventInit.rs │ │ │ ├── gen_WidevineCdmManifest.rs │ │ │ ├── gen_Window.rs │ │ │ ├── gen_WindowClient.rs │ │ │ ├── gen_Worker.rs │ │ │ ├── gen_WorkerDebuggerGlobalScope.rs │ │ │ ├── gen_WorkerGlobalScope.rs │ │ │ ├── gen_WorkerLocation.rs │ │ │ ├── gen_WorkerNavigator.rs │ │ │ ├── gen_WorkerOptions.rs │ │ │ ├── gen_WorkerType.rs │ │ │ ├── gen_Worklet.rs │ │ │ ├── gen_WorkletGlobalScope.rs │ │ │ ├── gen_WorkletOptions.rs │ │ │ ├── gen_WritableStream.rs │ │ │ ├── gen_WritableStreamDefaultController.rs │ │ │ ├── gen_WritableStreamDefaultWriter.rs │ │ │ ├── gen_WriteCommandType.rs │ │ │ ├── gen_WriteParams.rs │ │ │ ├── gen_XPathExpression.rs │ │ │ ├── gen_XPathNsResolver.rs │ │ │ ├── gen_XPathResult.rs │ │ │ ├── gen_XmlDocument.rs │ │ │ ├── gen_XmlHttpRequest.rs │ │ │ ├── gen_XmlHttpRequestEventTarget.rs │ │ │ ├── gen_XmlHttpRequestResponseType.rs │ │ │ ├── gen_XmlHttpRequestUpload.rs │ │ │ ├── gen_XmlSerializer.rs │ │ │ ├── gen_XrBoundedReferenceSpace.rs │ │ │ ├── gen_XrEye.rs │ │ │ ├── gen_XrFrame.rs │ │ │ ├── gen_XrHand.rs │ │ │ ├── gen_XrHandJoint.rs │ │ │ ├── gen_XrHandedness.rs │ │ │ ├── gen_XrInputSource.rs │ │ │ ├── gen_XrInputSourceArray.rs │ │ │ ├── gen_XrInputSourceEvent.rs │ │ │ ├── gen_XrInputSourceEventInit.rs │ │ │ ├── gen_XrInputSourcesChangeEvent.rs │ │ │ ├── gen_XrInputSourcesChangeEventInit.rs │ │ │ ├── gen_XrJointPose.rs │ │ │ ├── gen_XrJointSpace.rs │ │ │ ├── gen_XrLayer.rs │ │ │ ├── gen_XrPermissionDescriptor.rs │ │ │ ├── gen_XrPermissionStatus.rs │ │ │ ├── gen_XrPose.rs │ │ │ ├── gen_XrReferenceSpace.rs │ │ │ ├── gen_XrReferenceSpaceEvent.rs │ │ │ ├── gen_XrReferenceSpaceEventInit.rs │ │ │ ├── gen_XrReferenceSpaceType.rs │ │ │ ├── gen_XrRenderState.rs │ │ │ ├── gen_XrRenderStateInit.rs │ │ │ ├── gen_XrRigidTransform.rs │ │ │ ├── gen_XrSession.rs │ │ │ ├── gen_XrSessionEvent.rs │ │ │ ├── gen_XrSessionEventInit.rs │ │ │ ├── gen_XrSessionInit.rs │ │ │ ├── gen_XrSessionMode.rs │ │ │ ├── gen_XrSessionSupportedPermissionDescriptor.rs │ │ │ ├── gen_XrSpace.rs │ │ │ ├── gen_XrSystem.rs │ │ │ ├── gen_XrTargetRayMode.rs │ │ │ ├── gen_XrView.rs │ │ │ ├── gen_XrViewerPose.rs │ │ │ ├── gen_XrViewport.rs │ │ │ ├── gen_XrVisibilityState.rs │ │ │ ├── gen_XrWebGlLayer.rs │ │ │ ├── gen_XrWebGlLayerInit.rs │ │ │ ├── gen_XsltProcessor.rs │ │ │ ├── gen_console.rs │ │ │ ├── gen_css.rs │ │ │ ├── gen_gpu_buffer_usage.rs │ │ │ ├── gen_gpu_color_write.rs │ │ │ ├── gen_gpu_map_mode.rs │ │ │ ├── gen_gpu_shader_stage.rs │ │ │ ├── gen_gpu_texture_usage.rs │ │ │ └── mod.rs │ │ └── lib.rs │ ├── tests │ │ └── wasm │ │ │ ├── anchor_element.rs │ │ │ ├── blob.js │ │ │ ├── blob.rs │ │ │ ├── body_element.rs │ │ │ ├── br_element.rs │ │ │ ├── button_element.rs │ │ │ ├── console.rs │ │ │ ├── div_element.rs │ │ │ ├── dom_point.rs │ │ │ ├── element.js │ │ │ ├── element.rs │ │ │ ├── event.js │ │ │ ├── event.rs │ │ │ ├── head_element.rs │ │ │ ├── headers.js │ │ │ ├── headers.rs │ │ │ ├── heading_element.rs │ │ │ ├── history.rs │ │ │ ├── hr_element.rs │ │ │ ├── html_element.rs │ │ │ ├── html_html_element.rs │ │ │ ├── image_data.rs │ │ │ ├── indexeddb.rs │ │ │ ├── input_element.rs │ │ │ ├── location.rs │ │ │ ├── main.rs │ │ │ ├── menu_element.rs │ │ │ ├── meta_element.rs │ │ │ ├── meter_element.rs │ │ │ ├── mod_elements.rs │ │ │ ├── olist_element.rs │ │ │ ├── opfs.rs │ │ │ ├── optgroup_element.rs │ │ │ ├── option_element.rs │ │ │ ├── options_collection.rs │ │ │ ├── output_element.rs │ │ │ ├── paragraph_element.rs │ │ │ ├── param_element.rs │ │ │ ├── performance.rs │ │ │ ├── pre_element.rs │ │ │ ├── progress_element.rs │ │ │ ├── quote_element.rs │ │ │ ├── response.js │ │ │ ├── response.rs │ │ │ ├── rtc_rtp_transceiver_direction.rs │ │ │ ├── script_element.rs │ │ │ ├── select_element.rs │ │ │ ├── slot_element.rs │ │ │ ├── span_element.rs │ │ │ ├── style_element.rs │ │ │ ├── table_element.rs │ │ │ ├── title_element.rs │ │ │ ├── whitelisted_immutable_slices.rs │ │ │ └── xpath_result.rs │ └── webidls │ │ ├── disabled │ │ └── README.md │ │ ├── enabled │ │ ├── AbortController.webidl │ │ ├── AbortSignal.webidl │ │ ├── AbstractWorker.webidl │ │ ├── AnalyserNode.webidl │ │ ├── Animation.webidl │ │ ├── AnimationEffect.webidl │ │ ├── AnimationEvent.webidl │ │ ├── AnimationFrame.webidl │ │ ├── AnimationPlaybackEvent.webidl │ │ ├── AnimationTimeline.webidl │ │ ├── Attr.webidl │ │ ├── AudioBuffer.webidl │ │ ├── AudioBufferSourceNode.webidl │ │ ├── AudioContext.webidl │ │ ├── AudioDestinationNode.webidl │ │ ├── AudioListener.webidl │ │ ├── AudioNode.webidl │ │ ├── AudioParam.webidl │ │ ├── AudioParamMap.webidl │ │ ├── AudioProcessingEvent.webidl │ │ ├── AudioScheduledSourceNode.webidl │ │ ├── AudioStreamTrack.webidl │ │ ├── AudioTrack.webidl │ │ ├── AudioTrackList.webidl │ │ ├── AudioWorklet.webidl │ │ ├── AudioWorkletGlobalScope.webidl │ │ ├── AudioWorkletNode.webidl │ │ ├── AudioWorkletProcessor.webidl │ │ ├── AutocompleteInfo.webidl │ │ ├── BarProp.webidl │ │ ├── BaseAudioContext.webidl │ │ ├── BaseKeyframeTypes.webidl │ │ ├── BasicCardPayment.webidl │ │ ├── BatteryManager.webidl │ │ ├── BeforeUnloadEvent.webidl │ │ ├── BiquadFilterNode.webidl │ │ ├── Blob.webidl │ │ ├── BlobEvent.webidl │ │ ├── BroadcastChannel.webidl │ │ ├── BrowserElement.webidl │ │ ├── BrowserElementDictionaries.webidl │ │ ├── BrowserFeedWriter.webidl │ │ ├── CDATASection.webidl │ │ ├── CSS.webidl │ │ ├── CSSAnimation.webidl │ │ ├── CSSConditionRule.webidl │ │ ├── CSSCounterStyleRule.webidl │ │ ├── CSSFontFaceRule.webidl │ │ ├── CSSFontFeatureValuesRule.webidl │ │ ├── CSSGroupingRule.webidl │ │ ├── CSSImportRule.webidl │ │ ├── CSSKeyframeRule.webidl │ │ ├── CSSKeyframesRule.webidl │ │ ├── CSSMediaRule.webidl │ │ ├── CSSMozDocumentRule.webidl │ │ ├── CSSNamespaceRule.webidl │ │ ├── CSSPageRule.webidl │ │ ├── CSSPseudoElement.webidl │ │ ├── CSSRule.webidl │ │ ├── CSSRuleList.webidl │ │ ├── CSSStyleDeclaration.webidl │ │ ├── CSSStyleRule.webidl │ │ ├── CSSStyleSheet.webidl │ │ ├── CSSSupportsRule.webidl │ │ ├── CSSTransition.webidl │ │ ├── Cache.webidl │ │ ├── CacheStorage.webidl │ │ ├── CanvasCaptureMediaStream.webidl │ │ ├── CanvasCaptureMediaStreamTrack.webidl │ │ ├── CanvasRenderingContext2D.webidl │ │ ├── CaretPosition.webidl │ │ ├── CaretStateChangedEvent.webidl │ │ ├── ChannelMergerNode.webidl │ │ ├── ChannelSplitterNode.webidl │ │ ├── CharacterData.webidl │ │ ├── CheckerboardReportService.webidl │ │ ├── ChildNode.webidl │ │ ├── Client.webidl │ │ ├── Clients.webidl │ │ ├── Clipboard.webidl │ │ ├── CloseEvent.webidl │ │ ├── Comment.webidl │ │ ├── CompositionEvent.webidl │ │ ├── Console.webidl │ │ ├── ConstantSourceNode.webidl │ │ ├── ConvolverNode.webidl │ │ ├── Coordinates.webidl │ │ ├── CreateOfferRequest.webidl │ │ ├── CredentialManagement.webidl │ │ ├── Crypto.webidl │ │ ├── CustomElementRegistry.webidl │ │ ├── CustomEvent.webidl │ │ ├── DOMError.webidl │ │ ├── DOMException.webidl │ │ ├── DOMHighResTimeStamp.webidl │ │ ├── DOMImplementation.webidl │ │ ├── DOMMatrix.webidl │ │ ├── DOMParser.webidl │ │ ├── DOMPoint.webidl │ │ ├── DOMQuad.webidl │ │ ├── DOMRect.webidl │ │ ├── DOMRectList.webidl │ │ ├── DOMRequest.webidl │ │ ├── DOMStringList.webidl │ │ ├── DOMStringMap.webidl │ │ ├── DOMTokenList.webidl │ │ ├── DataTransfer.webidl │ │ ├── DataTransferItem.webidl │ │ ├── DataTransferItemList.webidl │ │ ├── DecoderDoctorNotification.webidl │ │ ├── DedicatedWorkerGlobalScope.webidl │ │ ├── DelayNode.webidl │ │ ├── DeviceLightEvent.webidl │ │ ├── DeviceMotionEvent.webidl │ │ ├── DeviceOrientationEvent.webidl │ │ ├── DeviceProximityEvent.webidl │ │ ├── Directory.webidl │ │ ├── Document.webidl │ │ ├── DocumentFragment.webidl │ │ ├── DocumentOrShadowRoot.webidl │ │ ├── DocumentTimeline.webidl │ │ ├── DocumentType.webidl │ │ ├── DragEvent.webidl │ │ ├── DynamicsCompressorNode.webidl │ │ ├── Element.webidl │ │ ├── ErrorEvent.webidl │ │ ├── Event.webidl │ │ ├── EventHandler.webidl │ │ ├── EventListener.webidl │ │ ├── EventSource.webidl │ │ ├── EventTarget.webidl │ │ ├── ExtendableEvent.webidl │ │ ├── ExtendableMessageEvent.webidl │ │ ├── External.webidl │ │ ├── FakePluginTagInit.webidl │ │ ├── Fetch.webidl │ │ ├── FetchEvent.webidl │ │ ├── FetchObserver.webidl │ │ ├── File.webidl │ │ ├── FileList.webidl │ │ ├── FileReader.webidl │ │ ├── FileReaderSync.webidl │ │ ├── FileSystem.webidl │ │ ├── FileSystemDirectoryEntry.webidl │ │ ├── FileSystemDirectoryReader.webidl │ │ ├── FileSystemEntry.webidl │ │ ├── FileSystemFileEntry.webidl │ │ ├── FileSystemHandle.webidl │ │ ├── FocusEvent.webidl │ │ ├── FocusOptions.webidl │ │ ├── FontFace.webidl │ │ ├── FontFaceSet.webidl │ │ ├── FontFaceSetLoadEvent.webidl │ │ ├── FontFaceSource.webidl │ │ ├── FormData.webidl │ │ ├── Function.webidl │ │ ├── FuzzingFunctions.webidl │ │ ├── GainNode.webidl │ │ ├── Gamepad.webidl │ │ ├── GamepadExtensions.webidl │ │ ├── Geolocation.webidl │ │ ├── GeometryUtils.webidl │ │ ├── GetUserMediaRequest.webidl │ │ ├── GroupedHistoryEvent.webidl │ │ ├── HTMLAllCollection.webidl │ │ ├── HTMLAnchorElement.webidl │ │ ├── HTMLAreaElement.webidl │ │ ├── HTMLAudioElement.webidl │ │ ├── HTMLBRElement.webidl │ │ ├── HTMLBaseElement.webidl │ │ ├── HTMLBodyElement.webidl │ │ ├── HTMLButtonElement.webidl │ │ ├── HTMLCanvasElement.webidl │ │ ├── HTMLCollection.webidl │ │ ├── HTMLDListElement.webidl │ │ ├── HTMLDataElement.webidl │ │ ├── HTMLDataListElement.webidl │ │ ├── HTMLDetailsElement.webidl │ │ ├── HTMLDialogElement.webidl │ │ ├── HTMLDirectoryElement.webidl │ │ ├── HTMLDivElement.webidl │ │ ├── HTMLDocument.webidl │ │ ├── HTMLElement.webidl │ │ ├── HTMLEmbedElement.webidl │ │ ├── HTMLFieldSetElement.webidl │ │ ├── HTMLFontElement.webidl │ │ ├── HTMLFormControlsCollection.webidl │ │ ├── HTMLFormElement.webidl │ │ ├── HTMLFrameElement.webidl │ │ ├── HTMLFrameSetElement.webidl │ │ ├── HTMLHRElement.webidl │ │ ├── HTMLHeadElement.webidl │ │ ├── HTMLHeadingElement.webidl │ │ ├── HTMLHtmlElement.webidl │ │ ├── HTMLHyperlinkElementUtils.webidl │ │ ├── HTMLIFrameElement.webidl │ │ ├── HTMLImageElement.webidl │ │ ├── HTMLInputElement.webidl │ │ ├── HTMLLIElement.webidl │ │ ├── HTMLLabelElement.webidl │ │ ├── HTMLLegendElement.webidl │ │ ├── HTMLLinkElement.webidl │ │ ├── HTMLMapElement.webidl │ │ ├── HTMLMediaElement.webidl │ │ ├── HTMLMenuElement.webidl │ │ ├── HTMLMenuItemElement.webidl │ │ ├── HTMLMetaElement.webidl │ │ ├── HTMLMeterElement.webidl │ │ ├── HTMLModElement.webidl │ │ ├── HTMLOListElement.webidl │ │ ├── HTMLObjectElement.webidl │ │ ├── HTMLOptGroupElement.webidl │ │ ├── HTMLOptionElement.webidl │ │ ├── HTMLOptionsCollection.webidl │ │ ├── HTMLOutputElement.webidl │ │ ├── HTMLParagraphElement.webidl │ │ ├── HTMLParamElement.webidl │ │ ├── HTMLPictureElement.webidl │ │ ├── HTMLPreElement.webidl │ │ ├── HTMLProgressElement.webidl │ │ ├── HTMLQuoteElement.webidl │ │ ├── HTMLScriptElement.webidl │ │ ├── HTMLSelectElement.webidl │ │ ├── HTMLSlotElement.webidl │ │ ├── HTMLSourceElement.webidl │ │ ├── HTMLSpanElement.webidl │ │ ├── HTMLStyleElement.webidl │ │ ├── HTMLTableCaptionElement.webidl │ │ ├── HTMLTableCellElement.webidl │ │ ├── HTMLTableColElement.webidl │ │ ├── HTMLTableElement.webidl │ │ ├── HTMLTableRowElement.webidl │ │ ├── HTMLTableSectionElement.webidl │ │ ├── HTMLTemplateElement.webidl │ │ ├── HTMLTextAreaElement.webidl │ │ ├── HTMLTimeElement.webidl │ │ ├── HTMLTitleElement.webidl │ │ ├── HTMLTrackElement.webidl │ │ ├── HTMLUListElement.webidl │ │ ├── HTMLVideoElement.webidl │ │ ├── HashChangeEvent.webidl │ │ ├── Headers.webidl │ │ ├── HiddenPluginEvent.webidl │ │ ├── History.webidl │ │ ├── IDB.webidl │ │ ├── IIRFilterNode.webidl │ │ ├── IdleDeadline.webidl │ │ ├── ImageBitmap.webidl │ │ ├── ImageBitmapRenderingContext.webidl │ │ ├── ImageCaptureErrorEvent.webidl │ │ ├── ImageData.webidl │ │ ├── ImageDocument.webidl │ │ ├── InputEvent.webidl │ │ ├── IntersectionObserver.webidl │ │ ├── IntlUtils.webidl │ │ ├── IterableIterator.webidl │ │ ├── KeyAlgorithm.webidl │ │ ├── KeyEvent.webidl │ │ ├── KeyIdsInitData.webidl │ │ ├── KeyboardEvent.webidl │ │ ├── KeyframeAnimationOptions.webidl │ │ ├── KeyframeEffect.webidl │ │ ├── L10nUtils.webidl │ │ ├── LinkStyle.webidl │ │ ├── ListBoxObject.webidl │ │ ├── LocalMediaStream.webidl │ │ ├── Location.webidl │ │ ├── MIDIAccess.webidl │ │ ├── MIDIConnectionEvent.webidl │ │ ├── MIDIInput.webidl │ │ ├── MIDIInputMap.webidl │ │ ├── MIDIMessageEvent.webidl │ │ ├── MIDIOptions.webidl │ │ ├── MIDIOutput.webidl │ │ ├── MIDIOutputMap.webidl │ │ ├── MIDIPort.webidl │ │ ├── MathMLElement.webidl │ │ ├── MediaCapabilities.webidl │ │ ├── MediaDeviceInfo.webidl │ │ ├── MediaDevices.webidl │ │ ├── MediaElementAudioSourceNode.webidl │ │ ├── MediaEncryptedEvent.webidl │ │ ├── MediaError.webidl │ │ ├── MediaKeyError.webidl │ │ ├── MediaKeyMessageEvent.webidl │ │ ├── MediaKeySession.webidl │ │ ├── MediaKeyStatusMap.webidl │ │ ├── MediaKeySystemAccess.webidl │ │ ├── MediaKeys.webidl │ │ ├── MediaKeysRequestStatus.webidl │ │ ├── MediaList.webidl │ │ ├── MediaQueryList.webidl │ │ ├── MediaQueryListEvent.webidl │ │ ├── MediaRecorder.webidl │ │ ├── MediaRecorderErrorEvent.webidl │ │ ├── MediaSource.webidl │ │ ├── MediaStream.webidl │ │ ├── MediaStreamAudioDestinationNode.webidl │ │ ├── MediaStreamAudioSourceNode.webidl │ │ ├── MediaStreamError.webidl │ │ ├── MediaStreamEvent.webidl │ │ ├── MediaStreamTrack.webidl │ │ ├── MediaStreamTrackEvent.webidl │ │ ├── MediaTrackConstraintSet.webidl │ │ ├── MediaTrackSettings.webidl │ │ ├── MediaTrackSupportedConstraints.webidl │ │ ├── MessageChannel.webidl │ │ ├── MessageEvent.webidl │ │ ├── MessagePort.webidl │ │ ├── MimeType.webidl │ │ ├── MimeTypeArray.webidl │ │ ├── MouseEvent.webidl │ │ ├── MouseScrollEvent.webidl │ │ ├── MozApplicationEvent.webidl │ │ ├── MutationEvent.webidl │ │ ├── MutationObserver.webidl │ │ ├── NamedNodeMap.webidl │ │ ├── NativeOSFileInternals.webidl │ │ ├── Navigator.webidl │ │ ├── NetDashboard.webidl │ │ ├── NetworkInformation.webidl │ │ ├── NetworkOptions.webidl │ │ ├── Node.webidl │ │ ├── NodeFilter.webidl │ │ ├── NodeIterator.webidl │ │ ├── NodeList.webidl │ │ ├── Notification.webidl │ │ ├── NotificationEvent.webidl │ │ ├── NotifyPaintEvent.webidl │ │ ├── OVRMultiview2.webidl │ │ ├── OfflineAudioCompletionEvent.webidl │ │ ├── OfflineAudioContext.webidl │ │ ├── OfflineResourceList.webidl │ │ ├── OffscreenCanvas.webidl │ │ ├── OffscreenCanvasRenderingContext2D.webidl │ │ ├── OscillatorNode.webidl │ │ ├── PageTransitionEvent.webidl │ │ ├── PaintRequest.webidl │ │ ├── PaintRequestList.webidl │ │ ├── PaintWorkletGlobalScope.webidl │ │ ├── PannerNode.webidl │ │ ├── ParentNode.webidl │ │ ├── PaymentAddress.webidl │ │ ├── PaymentMethodChangeEvent.webidl │ │ ├── PaymentRequestUpdateEvent.webidl │ │ ├── PaymentResponse.webidl │ │ ├── PeerConnectionImplEnums.webidl │ │ ├── PeerConnectionObserverEnums.webidl │ │ ├── Performance.webidl │ │ ├── PerformanceEntry.webidl │ │ ├── PerformanceEntryEvent.webidl │ │ ├── PerformanceMark.webidl │ │ ├── PerformanceMeasure.webidl │ │ ├── PerformanceNavigation.webidl │ │ ├── PerformanceNavigationTiming.webidl │ │ ├── PerformanceObserver.webidl │ │ ├── PerformanceObserverEntryList.webidl │ │ ├── PerformanceResourceTiming.webidl │ │ ├── PerformanceServerTiming.webidl │ │ ├── PerformanceTiming.webidl │ │ ├── PeriodicWave.webidl │ │ ├── PermissionStatus.webidl │ │ ├── Permissions.webidl │ │ ├── Plugin.webidl │ │ ├── PluginArray.webidl │ │ ├── PluginCrashedEvent.webidl │ │ ├── PointerEvent.webidl │ │ ├── PopStateEvent.webidl │ │ ├── PopoverInvokerElement.webidl │ │ ├── PopupBlockedEvent.webidl │ │ ├── Position.webidl │ │ ├── PositionError.webidl │ │ ├── Presentation.webidl │ │ ├── PresentationAvailability.webidl │ │ ├── PresentationConnection.webidl │ │ ├── PresentationConnectionAvailableEvent.webidl │ │ ├── PresentationConnectionCloseEvent.webidl │ │ ├── PresentationConnectionList.webidl │ │ ├── PresentationReceiver.webidl │ │ ├── PresentationRequest.webidl │ │ ├── ProcessingInstruction.webidl │ │ ├── ProfileTimelineMarker.webidl │ │ ├── ProgressEvent.webidl │ │ ├── Promise.webidl │ │ ├── PromiseRejectionEvent.webidl │ │ ├── PushEvent.webidl │ │ ├── PushManager.webidl │ │ ├── PushMessageData.webidl │ │ ├── PushSubscription.webidl │ │ ├── PushSubscriptionOptions.webidl │ │ ├── RTCCertificate.webidl │ │ ├── RTCConfiguration.webidl │ │ ├── RTCDTMFSender.webidl │ │ ├── RTCDTMFToneChangeEvent.webidl │ │ ├── RTCDataChannel.webidl │ │ ├── RTCDataChannelEvent.webidl │ │ ├── RTCIceCandidate.webidl │ │ ├── RTCIdentityAssertion.webidl │ │ ├── RTCIdentityProvider.webidl │ │ ├── RTCPeerConnection.webidl │ │ ├── RTCPeerConnectionIceErrorEvent.webidl │ │ ├── RTCPeerConnectionIceEvent.webidl │ │ ├── RTCRtpReceiver.webidl │ │ ├── RTCRtpSender.webidl │ │ ├── RTCRtpSources.webidl │ │ ├── RTCRtpTransceiver.webidl │ │ ├── RTCSessionDescription.webidl │ │ ├── RTCStatsReport.webidl │ │ ├── RTCTrackEvent.webidl │ │ ├── RadioNodeList.webidl │ │ ├── Range.webidl │ │ ├── Request.webidl │ │ ├── ResizeObserver.webidl │ │ ├── Response.webidl │ │ ├── SVGAElement.webidl │ │ ├── SVGAngle.webidl │ │ ├── SVGAnimateElement.webidl │ │ ├── SVGAnimateMotionElement.webidl │ │ ├── SVGAnimateTransformElement.webidl │ │ ├── SVGAnimatedAngle.webidl │ │ ├── SVGAnimatedBoolean.webidl │ │ ├── SVGAnimatedEnumeration.webidl │ │ ├── SVGAnimatedInteger.webidl │ │ ├── SVGAnimatedLength.webidl │ │ ├── SVGAnimatedLengthList.webidl │ │ ├── SVGAnimatedNumber.webidl │ │ ├── SVGAnimatedNumberList.webidl │ │ ├── SVGAnimatedPathData.webidl │ │ ├── SVGAnimatedPoints.webidl │ │ ├── SVGAnimatedPreserveAspectRatio.webidl │ │ ├── SVGAnimatedRect.webidl │ │ ├── SVGAnimatedString.webidl │ │ ├── SVGAnimatedTransformList.webidl │ │ ├── SVGAnimationElement.webidl │ │ ├── SVGCircleElement.webidl │ │ ├── SVGClipPathElement.webidl │ │ ├── SVGComponentTransferFunctionElement.webidl │ │ ├── SVGDefsElement.webidl │ │ ├── SVGDescElement.webidl │ │ ├── SVGElement.webidl │ │ ├── SVGEllipseElement.webidl │ │ ├── SVGFEBlendElement.webidl │ │ ├── SVGFEColorMatrixElement.webidl │ │ ├── SVGFEComponentTransferElement.webidl │ │ ├── SVGFECompositeElement.webidl │ │ ├── SVGFEConvolveMatrixElement.webidl │ │ ├── SVGFEDiffuseLightingElement.webidl │ │ ├── SVGFEDisplacementMapElement.webidl │ │ ├── SVGFEDistantLightElement.webidl │ │ ├── SVGFEDropShadowElement.webidl │ │ ├── SVGFEFloodElement.webidl │ │ ├── SVGFEFuncAElement.webidl │ │ ├── SVGFEFuncBElement.webidl │ │ ├── SVGFEFuncGElement.webidl │ │ ├── SVGFEFuncRElement.webidl │ │ ├── SVGFEGaussianBlurElement.webidl │ │ ├── SVGFEImageElement.webidl │ │ ├── SVGFEMergeElement.webidl │ │ ├── SVGFEMergeNodeElement.webidl │ │ ├── SVGFEMorphologyElement.webidl │ │ ├── SVGFEOffsetElement.webidl │ │ ├── SVGFEPointLightElement.webidl │ │ ├── SVGFESpecularLightingElement.webidl │ │ ├── SVGFESpotLightElement.webidl │ │ ├── SVGFETileElement.webidl │ │ ├── SVGFETurbulenceElement.webidl │ │ ├── SVGFilterElement.webidl │ │ ├── SVGFilterPrimitiveStandardAttributes.webidl │ │ ├── SVGFitToViewBox.webidl │ │ ├── SVGForeignObjectElement.webidl │ │ ├── SVGGElement.webidl │ │ ├── SVGGeometryElement.webidl │ │ ├── SVGGradientElement.webidl │ │ ├── SVGGraphicsElement.webidl │ │ ├── SVGImageElement.webidl │ │ ├── SVGLength.webidl │ │ ├── SVGLengthList.webidl │ │ ├── SVGLineElement.webidl │ │ ├── SVGLinearGradientElement.webidl │ │ ├── SVGMPathElement.webidl │ │ ├── SVGMarkerElement.webidl │ │ ├── SVGMaskElement.webidl │ │ ├── SVGMatrix.webidl │ │ ├── SVGMetadataElement.webidl │ │ ├── SVGNumber.webidl │ │ ├── SVGNumberList.webidl │ │ ├── SVGPathElement.webidl │ │ ├── SVGPathSeg.webidl │ │ ├── SVGPathSegList.webidl │ │ ├── SVGPatternElement.webidl │ │ ├── SVGPoint.webidl │ │ ├── SVGPointList.webidl │ │ ├── SVGPolygonElement.webidl │ │ ├── SVGPolylineElement.webidl │ │ ├── SVGPreserveAspectRatio.webidl │ │ ├── SVGRadialGradientElement.webidl │ │ ├── SVGRect.webidl │ │ ├── SVGRectElement.webidl │ │ ├── SVGSVGElement.webidl │ │ ├── SVGScriptElement.webidl │ │ ├── SVGSetElement.webidl │ │ ├── SVGStopElement.webidl │ │ ├── SVGStringList.webidl │ │ ├── SVGStyleElement.webidl │ │ ├── SVGSwitchElement.webidl │ │ ├── SVGSymbolElement.webidl │ │ ├── SVGTSpanElement.webidl │ │ ├── SVGTests.webidl │ │ ├── SVGTextContentElement.webidl │ │ ├── SVGTextElement.webidl │ │ ├── SVGTextPathElement.webidl │ │ ├── SVGTextPositioningElement.webidl │ │ ├── SVGTitleElement.webidl │ │ ├── SVGTransform.webidl │ │ ├── SVGTransformList.webidl │ │ ├── SVGURIReference.webidl │ │ ├── SVGUnitTypes.webidl │ │ ├── SVGUseElement.webidl │ │ ├── SVGViewElement.webidl │ │ ├── SVGZoomAndPan.webidl │ │ ├── SVGZoomAndPanValues.webidl │ │ ├── Screen.webidl │ │ ├── ScreenOrientation.webidl │ │ ├── ScriptProcessorNode.webidl │ │ ├── ScrollAreaEvent.webidl │ │ ├── ScrollBoxObject.webidl │ │ ├── ScrollViewChangeEvent.webidl │ │ ├── SecurityPolicyViolationEvent.webidl │ │ ├── Selection.webidl │ │ ├── ServiceWorker.webidl │ │ ├── ServiceWorkerContainer.webidl │ │ ├── ServiceWorkerGlobalScope.webidl │ │ ├── ServiceWorkerRegistration.webidl │ │ ├── ShadowRoot.webidl │ │ ├── Share.webidl │ │ ├── SharedWorker.webidl │ │ ├── SharedWorkerGlobalScope.webidl │ │ ├── SocketCommon.webidl │ │ ├── SourceBuffer.webidl │ │ ├── SourceBufferList.webidl │ │ ├── SpeechGrammar.webidl │ │ ├── SpeechGrammarList.webidl │ │ ├── SpeechRecognition.webidl │ │ ├── SpeechRecognitionAlternative.webidl │ │ ├── SpeechRecognitionError.webidl │ │ ├── SpeechRecognitionEvent.webidl │ │ ├── SpeechRecognitionResult.webidl │ │ ├── SpeechRecognitionResultList.webidl │ │ ├── SpeechSynthesis.webidl │ │ ├── SpeechSynthesisErrorEvent.webidl │ │ ├── SpeechSynthesisEvent.webidl │ │ ├── SpeechSynthesisUtterance.webidl │ │ ├── SpeechSynthesisVoice.webidl │ │ ├── StereoPannerNode.webidl │ │ ├── Storage.webidl │ │ ├── StorageEvent.webidl │ │ ├── StorageManager.webidl │ │ ├── StorageType.webidl │ │ ├── Streams.webidl │ │ ├── StyleRuleChangeEvent.webidl │ │ ├── StyleSheet.webidl │ │ ├── StyleSheetApplicableStateChangeEvent.webidl │ │ ├── StyleSheetChangeEvent.webidl │ │ ├── StyleSheetList.webidl │ │ ├── SubmitEvent.webidl │ │ ├── SubtleCrypto.webidl │ │ ├── TCPServerSocket.webidl │ │ ├── TCPServerSocketEvent.webidl │ │ ├── TCPSocket.webidl │ │ ├── TCPSocketErrorEvent.webidl │ │ ├── TCPSocketEvent.webidl │ │ ├── Text.webidl │ │ ├── TextClause.webidl │ │ ├── TextDecoder.webidl │ │ ├── TextEncoder.webidl │ │ ├── TextTrack.webidl │ │ ├── TextTrackCue.webidl │ │ ├── TextTrackCueList.webidl │ │ ├── TextTrackList.webidl │ │ ├── TimeEvent.webidl │ │ ├── TimeRanges.webidl │ │ ├── ToggleEvent.webidl │ │ ├── Touch.webidl │ │ ├── TouchEvent.webidl │ │ ├── TouchList.webidl │ │ ├── TrackEvent.webidl │ │ ├── TransitionEvent.webidl │ │ ├── TreeBoxObject.webidl │ │ ├── TreeView.webidl │ │ ├── TreeWalker.webidl │ │ ├── U2F.webidl │ │ ├── UDPMessageEvent.webidl │ │ ├── UDPSocket.webidl │ │ ├── UIEvent.webidl │ │ ├── URL.webidl │ │ ├── URLSearchParams.webidl │ │ ├── UserActivation.webidl │ │ ├── UserProximityEvent.webidl │ │ ├── VRDisplay.webidl │ │ ├── VRServiceTest.webidl │ │ ├── VTTCue.webidl │ │ ├── VTTRegion.webidl │ │ ├── ValidityState.webidl │ │ ├── Vibration.webidl │ │ ├── VideoPlaybackQuality.webidl │ │ ├── VideoStreamTrack.webidl │ │ ├── VideoTrack.webidl │ │ ├── VideoTrackList.webidl │ │ ├── VisualViewport.webidl │ │ ├── WaveShaperNode.webidl │ │ ├── WebAuthentication.webidl │ │ ├── WebComponents.webidl │ │ ├── WebGL2RenderingContext.webidl │ │ ├── WebGLContextEvent.webidl │ │ ├── WebGLMultiDraw.webidl │ │ ├── WebGLRenderingContext.webidl │ │ ├── WebKitCSSMatrix.webidl │ │ ├── WebSocket.webidl │ │ ├── WebrtcDeprecated.webidl │ │ ├── WheelEvent.webidl │ │ ├── WidevineCDMManifest.webidl │ │ ├── Window.webidl │ │ ├── WindowOrWorkerGlobalScope.webidl │ │ ├── Worker.webidl │ │ ├── WorkerDebuggerGlobalScope.webidl │ │ ├── WorkerGlobalScope.webidl │ │ ├── WorkerLocation.webidl │ │ ├── WorkerNavigator.webidl │ │ ├── Worklet.webidl │ │ ├── WorkletGlobalScope.webidl │ │ ├── XMLDocument.webidl │ │ ├── XMLHttpRequest.webidl │ │ ├── XMLHttpRequestEventTarget.webidl │ │ ├── XMLHttpRequestUpload.webidl │ │ ├── XMLSerializer.webidl │ │ ├── XPathEvaluator.webidl │ │ ├── XPathExpression.webidl │ │ ├── XPathNSResolver.webidl │ │ ├── XPathResult.webidl │ │ ├── XSLTProcessor.webidl │ │ └── nsISupports.webidl │ │ ├── unavailable_option_primitive │ │ ├── PaymentRequest.webidl │ │ ├── README.md │ │ └── VRDisplayEvent.webidl │ │ └── unstable │ │ ├── Animatable.webidl │ │ ├── AudioContext.webidl │ │ ├── AudioSinkInfo.webidl │ │ ├── Bluetooth.webidl │ │ ├── Clipboard.webidl │ │ ├── Compression.webidl │ │ ├── DeviceMemory.webidl │ │ ├── FileSystemAccess.webidl │ │ ├── Gamepad.webidl │ │ ├── GamepadExtensions.webidl │ │ ├── IDB.webidl │ │ ├── ImageCapture.webidl │ │ ├── InputDeviceInfo.webidl │ │ ├── LocalFontAccess.webidl │ │ ├── MeasureMemory.webidl │ │ ├── MediaCaptureTransform.webidl │ │ ├── MediaSession.webidl │ │ ├── MediaTrackCapabilities.webidl │ │ ├── NavigatorUAData.webidl │ │ ├── RTCRtpReceiver.webidl │ │ ├── RTCRtpSender.webidl │ │ ├── ScreenWakeLock.webidl │ │ ├── ViewTransition.webidl │ │ ├── WebAuthentication.webidl │ │ ├── WebCodecs.webidl │ │ ├── WebGPU.webidl │ │ ├── WebHID.webidl │ │ ├── WebRTCEncodeTransform.webidl │ │ ├── WebSerial.webidl │ │ ├── WebTransport.webidl │ │ ├── WebUSB.webidl │ │ ├── WebXRDevice.webidl │ │ ├── WebXRGamepadsModule.webidl │ │ ├── WebXRHandInputModule.webidl │ │ ├── is-input-pending.webidl │ │ ├── scheduling-apis.webidl │ │ └── weblock-apis.webidl ├── webidl-tests │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── array.rs │ ├── array_buffer.rs │ ├── build.rs │ ├── callbacks.rs │ ├── consts.rs │ ├── dictionary.rs │ ├── enums.rs │ ├── global.rs │ ├── globals.js │ ├── lib.rs │ ├── main.rs │ ├── maplike.rs │ ├── namespace.rs │ ├── no_interface.rs │ ├── promise.rs │ ├── setlike.rs │ ├── simple.rs │ ├── throws.rs │ ├── unstable.rs │ └── webidls │ │ ├── enabled │ │ ├── array.webidl │ │ ├── array_buffer.webidl │ │ ├── callbacks.webidl │ │ ├── consts.webidl │ │ ├── dictionary.webidl │ │ ├── enums.webidl │ │ ├── global.webidl │ │ ├── maplike.webidl │ │ ├── namespace.webidl │ │ ├── no_interface.webidl │ │ ├── promise.webidl │ │ ├── setlike.webidl │ │ ├── simple.webidl │ │ └── throws.webidl │ │ └── unstable │ │ └── unstable.webidl └── webidl │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src │ ├── constants.rs │ ├── first_pass.rs │ ├── generator.rs │ ├── idl_type.rs │ ├── lib.rs │ ├── main.rs │ ├── traverse.rs │ ├── update_cargo_toml.rs │ └── util.rs ├── examples ├── .gitignore ├── README.md ├── add │ ├── Cargo.toml │ ├── README.md │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── canvas │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── char │ ├── Cargo.toml │ ├── README.md │ ├── chars-list.js │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── closures │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── console_log │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── deno │ ├── Cargo.toml │ ├── README.md │ ├── build.sh │ ├── crate │ │ └── .gitignore │ ├── defined-in-js.js │ ├── src │ │ └── lib.rs │ └── test.ts ├── dom │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── duck-typed-interfaces │ ├── Cargo.toml │ ├── README.md │ ├── duck-typed-interfaces.js │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── explicit-resource-management │ ├── Cargo.toml │ ├── README.md │ ├── build.sh │ ├── crate │ │ └── .gitignore │ ├── src │ │ └── lib.rs │ └── test.ts ├── fetch │ ├── Cargo.toml │ ├── README.md │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── guide-supported-types-examples │ ├── Cargo.toml │ ├── bool.js │ ├── bootstrap.js │ ├── boxed_js_value_slice.js │ ├── boxed_number_slices.js │ ├── char.js │ ├── exported_types.js │ ├── imported_types.js │ ├── index.js │ ├── js_value.js │ ├── non_null.js │ ├── number_slices.js │ ├── numbers.js │ ├── package.json │ ├── pointers.js │ ├── src │ │ ├── bool.rs │ │ ├── boxed_js_value_slice.rs │ │ ├── boxed_number_slices.rs │ │ ├── char.rs │ │ ├── exported_types.rs │ │ ├── imported_types.rs │ │ ├── js_value.rs │ │ ├── lib.rs │ │ ├── non_null.rs │ │ ├── number_slices.rs │ │ ├── numbers.rs │ │ ├── pointers.rs │ │ ├── str.rs │ │ └── string.rs │ ├── str.js │ ├── string.js │ └── webpack.config.js ├── hello_world │ ├── Cargo.toml │ ├── README.md │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── import_js │ ├── README.md │ ├── crate │ │ ├── Cargo.toml │ │ ├── defined-in-js.js │ │ └── src │ │ │ └── lib.rs │ ├── index.html │ ├── index.js │ ├── package.json │ └── webpack.config.js ├── julia_set │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ ├── styles │ │ ├── normalize.css │ │ ├── skeleton.css │ │ └── style.css │ └── webpack.config.js ├── paint │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── performance │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── raytrace-parallel │ ├── Cargo.toml │ ├── README.md │ ├── build.py │ ├── build.sh │ ├── index.html │ ├── index.js │ ├── run.py │ ├── run.sh │ ├── rust-toolchain.toml │ ├── server.py │ ├── src │ │ ├── lib.rs │ │ └── pool.rs │ └── worker.js ├── request-animation-frame │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── synchronous-instantiation │ ├── Cargo.toml │ ├── README.md │ ├── build.sh │ ├── index.html │ ├── src │ │ └── lib.rs │ └── worker.js ├── todomvc │ ├── Cargo.toml │ ├── README.md │ ├── index.css │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ ├── build.rs │ │ ├── controller.rs │ │ ├── element.rs │ │ ├── lib.rs │ │ ├── scheduler.rs │ │ ├── store.rs │ │ ├── template.rs │ │ └── view.rs │ ├── templates │ │ ├── itemsLeft.html │ │ └── row.html │ └── webpack.config.js ├── wasm-audio-worklet │ ├── Cargo.toml │ ├── README.md │ ├── build.py │ ├── build.sh │ ├── index.html │ ├── run.py │ ├── run.sh │ ├── rust-toolchain.toml │ ├── server.py │ └── src │ │ ├── dependent_module.rs │ │ ├── gui.rs │ │ ├── lib.rs │ │ ├── oscillator.rs │ │ ├── wasm_audio.rs │ │ └── worklet.js ├── wasm-in-wasm-imports │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ ├── lib.rs │ │ └── native_add.wasm │ └── webpack.config.js ├── wasm-in-wasm │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ ├── add.wasm │ │ └── lib.rs │ └── webpack.config.js ├── wasm-in-web-worker │ ├── Cargo.toml │ ├── build.sh │ ├── index.html │ ├── index.js │ ├── src │ │ └── lib.rs │ ├── style.css │ └── worker.js ├── weather_report │ ├── Cargo.toml │ ├── README.md │ ├── assets │ │ ├── images │ │ │ ├── image.png │ │ │ └── weather.png │ │ └── stylesheets │ │ │ └── bootstrap.css │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ ├── util.js │ └── webpack.config.js ├── webaudio │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── webgl │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── webrtc_datachannel │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ └── lib.rs │ └── webpack.config.js ├── websockets │ ├── Cargo.toml │ ├── README.md │ ├── build.sh │ ├── index.html │ ├── index.js │ └── src │ │ └── lib.rs ├── webxr │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ ├── index.js │ ├── package.json │ ├── src │ │ ├── lib.rs │ │ └── utils.rs │ ├── webpack.config.js │ └── webxr.js ├── without-a-bundler-no-modules │ ├── Cargo.toml │ ├── README.md │ ├── build.sh │ ├── index.html │ └── src │ │ └── lib.rs └── without-a-bundler │ ├── Cargo.toml │ ├── README.md │ ├── build.sh │ ├── index.html │ └── src │ └── lib.rs ├── guide ├── .gitignore ├── book.toml └── src │ ├── SUMMARY.md │ ├── _headers │ ├── contributing │ ├── design │ │ ├── describe.md │ │ ├── exporting-rust-struct.md │ │ ├── exporting-rust.md │ │ ├── importing-js-struct.md │ │ ├── importing-js.md │ │ ├── index.md │ │ ├── js-objects-in-rust.md │ │ └── rust-type-conversions.md │ ├── index.md │ ├── js-sys │ │ ├── adding-more-apis.md │ │ ├── index.md │ │ └── testing.md │ ├── publishing.md │ ├── team.md │ ├── testing.md │ └── web-sys │ │ ├── index.md │ │ ├── logging.md │ │ ├── overview.md │ │ ├── supporting-more-web-apis.md │ │ └── testing.md │ ├── examples │ ├── 2d-canvas.md │ ├── 2d-canvas.png │ ├── add.md │ ├── char.md │ ├── closures.md │ ├── console-log.md │ ├── dom.md │ ├── fetch.md │ ├── hello-world.md │ ├── import-js.md │ ├── index.md │ ├── julia.md │ ├── paint.md │ ├── performance.md │ ├── raytrace.md │ ├── request-animation-frame.md │ ├── synchronous-instantiation.md │ ├── todomvc.md │ ├── wasm-audio-worklet.md │ ├── wasm-in-wasm.md │ ├── wasm-in-web-worker.md │ ├── weather_report.md │ ├── web-audio.md │ ├── webgl.md │ ├── webrtc_datachannel.md │ ├── websockets.md │ └── without-a-bundler.md │ ├── introduction.md │ ├── reference │ ├── accessing-properties-of-untyped-js-values.md │ ├── arbitrary-data-with-serde.md │ ├── attributes │ │ ├── index.md │ │ ├── on-js-imports │ │ │ ├── catch.md │ │ │ ├── constructor.md │ │ │ ├── extends.md │ │ │ ├── final.md │ │ │ ├── getter-and-setter.md │ │ │ ├── index.md │ │ │ ├── indexing-getter-setter-deleter.md │ │ │ ├── js_class.md │ │ │ ├── js_name.md │ │ │ ├── js_namespace.md │ │ │ ├── method.md │ │ │ ├── module.md │ │ │ ├── no_deref.md │ │ │ ├── raw_module.md │ │ │ ├── static_method_of.md │ │ │ ├── structural.md │ │ │ ├── typescript_type.md │ │ │ ├── variadic.md │ │ │ └── vendor_prefix.md │ │ └── on-rust-exports │ │ │ ├── constructor.md │ │ │ ├── description.md │ │ │ ├── getter-and-setter.md │ │ │ ├── getter_with_clone.md │ │ │ ├── index.md │ │ │ ├── inspectable.md │ │ │ ├── js_class.md │ │ │ ├── js_name.md │ │ │ ├── main.md │ │ │ ├── readonly.md │ │ │ ├── skip.md │ │ │ ├── skip_jsdoc.md │ │ │ ├── skip_typescript.md │ │ │ ├── start.md │ │ │ ├── typescript_custom_section.md │ │ │ └── unchecked_type.md │ ├── browser-support.md │ ├── cli.md │ ├── deployment.md │ ├── index.md │ ├── iterating-over-js-values.md │ ├── js-promises-and-rust-futures.md │ ├── js-snippets.md │ ├── optimize-size.md │ ├── passing-rust-closures-to-js.md │ ├── receiving-js-closures-in-rust.md │ ├── reference-types.md │ ├── rust-targets.md │ ├── static-js-objects.md │ ├── types.md │ ├── types │ │ ├── bool.md │ │ ├── boxed-number-slices.md │ │ ├── boxed-slices.md │ │ ├── char.md │ │ ├── exported-rust-types.md │ │ ├── imported-js-types.md │ │ ├── jsvalue.md │ │ ├── non-null.md │ │ ├── number-slices.md │ │ ├── numbers.md │ │ ├── pointers.md │ │ ├── result.md │ │ ├── str.md │ │ └── string.md │ ├── weak-references.md │ └── working-with-duck-typed-interfaces.md │ ├── wasm-bindgen-test │ ├── asynchronous-tests.md │ ├── browsers.md │ ├── continuous-integration.md │ ├── coverage.md │ ├── index.md │ └── usage.md │ └── web-sys │ ├── cargo-features.md │ ├── function-overloads.md │ ├── index.md │ ├── inheritance.md │ ├── type-translations.md │ ├── unstable-apis.md │ └── using-web-sys.md ├── publish.rs ├── releases ├── friends.sh └── release-announcement-template.md ├── src ├── cache │ ├── intern.rs │ └── mod.rs ├── cast.rs ├── closure.rs ├── convert │ ├── closures.rs │ ├── impls.rs │ ├── mod.rs │ ├── slices.rs │ └── traits.rs ├── describe.rs ├── externref.rs ├── lib.rs ├── link.rs └── rt │ ├── marker.rs │ └── mod.rs ├── taplo.toml └── tests ├── crates ├── a │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── b │ ├── Cargo.toml │ └── src │ └── lib.rs ├── headless ├── externref_heap_live_count.rs ├── main.js ├── main.rs ├── modules.js ├── modules.rs ├── snippets.rs ├── snippets1.js ├── strings.js └── strings.rs ├── must_use.rs ├── no-std ├── Cargo.toml └── src │ └── lib.rs ├── non_wasm.rs ├── non_wasm_test.rs ├── std-crate-no-std-dep.rs ├── unwrap_throw.rs ├── wasm ├── 3944.rs ├── api.js ├── api.rs ├── arg_names.js ├── arg_names.rs ├── async_vecs.js ├── async_vecs.rs ├── bigint.js ├── bigint.rs ├── char.js ├── char.rs ├── classes.js ├── classes.rs ├── closures.js ├── closures.rs ├── comments.js ├── comments.rs ├── duplicate_deps.js ├── duplicate_deps.rs ├── duplicates.rs ├── duplicates_a.js ├── duplicates_b.js ├── duplicates_c.js ├── enum_vecs.js ├── enum_vecs.rs ├── enums.js ├── enums.rs ├── final.js ├── final.rs ├── futures.js ├── futures.rs ├── gc.js ├── gc.rs ├── getters_and_setters.js ├── getters_and_setters.rs ├── ignore.rs ├── import_class.js ├── import_class.rs ├── imports.js ├── imports.rs ├── imports_2.js ├── inner_self.rs ├── intrinsics.rs ├── js_keywords.js ├── js_keywords.rs ├── js_objects.js ├── js_objects.rs ├── js_vec.js ├── js_vec.rs ├── jscast.js ├── jscast.rs ├── link_to.js ├── link_to.rs ├── linked_module.js ├── macro_rules.rs ├── main.rs ├── math.js ├── math.rs ├── no_shims.rs ├── node.js ├── node.rs ├── option.js ├── option.rs ├── optional_primitives.js ├── optional_primitives.rs ├── result.js ├── result.rs ├── result_jserror.js ├── result_jserror.rs ├── rethrow.js ├── rethrow.rs ├── should_panic.rs ├── simple.js ├── simple.rs ├── slice.js ├── slice.rs ├── string_vecs.js ├── string_vecs.rs ├── struct_vecs.js ├── struct_vecs.rs ├── structural.js ├── structural.rs ├── truthy_falsy.rs ├── usize.js ├── usize.rs ├── validate_prt.js ├── validate_prt.rs ├── variadic.js ├── variadic.rs ├── vendor_prefix.js └── vendor_prefix.rs └── worker ├── dedicated.rs ├── modules.js ├── modules.rs ├── service.rs └── shared.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.'cfg(target_arch = "wasm32")'] 2 | runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --' 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.webidl linguist-vendored 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yaml: -------------------------------------------------------------------------------- 1 | github: [daxpedda] 2 | -------------------------------------------------------------------------------- /.github/actions/setup-geckodriver/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup Geckodriver' 2 | description: 'Setup Geckodriver' 3 | 4 | runs: 5 | using: node20 6 | main: 'main.js' 7 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | updates: 4 | - package-ecosystem: cargo 5 | directory: / 6 | schedule: 7 | interval: daily 8 | ignore: 9 | - dependency-name: 'wasmparser' 10 | - dependency-name: 'wasmprinter' 11 | - dependency-name: 'wast' 12 | 13 | - package-ecosystem: github-actions 14 | directory: / 15 | schedule: 16 | interval: daily 17 | groups: 18 | github-actions: 19 | patterns: 20 | - "*" 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | /target/ 3 | **/*.rs.bk 4 | Cargo.lock 5 | node_modules 6 | package-lock.json 7 | npm-shrinkwrap.json 8 | pnpm-lock.yaml 9 | yarn.lock 10 | /publish 11 | /publish.exe 12 | .vscode 13 | webdriver.json 14 | benchmarks/pkg 15 | /crates/msrv/*/target 16 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | See the ["Contributing" section of the `wasm-bindgen` 4 | guide](https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html). 5 | -------------------------------------------------------------------------------- /benchmarks/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "wasm-bindgen-benchmark" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [dependencies] 9 | js-sys = { path = '../crates/js-sys' } 10 | wasm-bindgen = { path = '../' } 11 | web-sys = { path = '../crates/web-sys', features = ['Node'] } 12 | 13 | [lib] 14 | crate-type = ['cdylib'] 15 | -------------------------------------------------------------------------------- /benchmarks/globals.js: -------------------------------------------------------------------------------- 1 | export function jsthunk() {} 2 | export function add(a, b) { return a + b; } 3 | export function use_baz(baz) { 4 | if (baz !== Baz['variant-2']) { 5 | throw new Error("Passed wrong variant"); 6 | } 7 | } 8 | export class Foo { 9 | bar() {} 10 | } 11 | 12 | export const Baz = { 13 | 'variant-1': 'variant-1', 14 | 'variant-2': 'variant-2', 15 | 'variant-3': 'variant-3', 16 | } 17 | -------------------------------------------------------------------------------- /benchmarks/raw.wasm: -------------------------------------------------------------------------------- 1 | asm````+ ./globals.jsjsthunk ./globals.jsadd=call_js_thunk_n_timescall_js_add_n_timesthunkadd 2 | C@ E @ Ak" @ E @   Ak"   j -------------------------------------------------------------------------------- /benchmarks/utils.js: -------------------------------------------------------------------------------- 1 | export class Lock { 2 | constructor() { 3 | this.lockHolder = null; 4 | } 5 | 6 | async withLock(scope) { 7 | while (this.lockHolder !== null) { 8 | await this.lockHolder; 9 | } 10 | this.lockHolder = Promise.resolve(null).then(scope); 11 | await this.lockHolder; 12 | this.lockHolder = null; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | // Empty `build.rs` so that `[package] links = ...` works in `Cargo.toml`. 2 | fn main() { 3 | println!("cargo:rerun-if-changed=build.rs"); 4 | } 5 | -------------------------------------------------------------------------------- /crates/backend/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/backend/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/cli-support/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/cli-support/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/cli/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/cli/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/cli/tests/reference/add.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function add_u32(a: number, b: number): number; 4 | export function add_i32(a: number, b: number): number; 5 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/add.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn add_u32(a: u32, b: u32) -> u32 { 5 | a + b 6 | } 7 | 8 | #[wasm_bindgen] 9 | pub fn add_i32(a: i32, b: i32) -> i32 { 10 | a + b 11 | } 12 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/anyref-empty.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/anyref-empty.js: -------------------------------------------------------------------------------- 1 | let wasm; 2 | export function __wbg_set_wasm(val) { 3 | wasm = val; 4 | } 5 | 6 | 7 | export function __wbindgen_init_externref_table() { 8 | const table = wasm.__wbindgen_export_0; 9 | const offset = table.grow(4); 10 | table.set(0, undefined); 11 | table.set(offset + 0, undefined); 12 | table.set(offset + 1, null); 13 | table.set(offset + 2, true); 14 | table.set(offset + 3, false); 15 | ; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/anyref-empty.rs: -------------------------------------------------------------------------------- 1 | // enable-externref 2 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/anyref-empty.wat: -------------------------------------------------------------------------------- 1 | (module $reference_test.wasm 2 | (type (;0;) (func)) 3 | (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) 4 | (table (;0;) 128 externref) 5 | (memory (;0;) 16) 6 | (export "memory" (memory 0)) 7 | (export "__wbindgen_export_0" (table 0)) 8 | (export "__wbindgen_start" (func 0)) 9 | (@custom "target_features" (after export) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/anyref-import-catch.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function exported(): void; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/anyref-import-catch.rs: -------------------------------------------------------------------------------- 1 | // enable-externref 2 | 3 | use wasm_bindgen::prelude::*; 4 | 5 | #[wasm_bindgen] 6 | extern "C" { 7 | #[wasm_bindgen(catch)] 8 | fn foo() -> Result<(), JsValue>; 9 | } 10 | 11 | #[wasm_bindgen] 12 | pub fn exported() -> Result<(), JsValue> { 13 | foo() 14 | } 15 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/anyref-nop.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function foo(): void; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/anyref-nop.rs: -------------------------------------------------------------------------------- 1 | // enable-externref 2 | 3 | use wasm_bindgen::prelude::*; 4 | 5 | #[wasm_bindgen] 6 | pub fn foo() {} 7 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/async-number.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function foo(): Promise; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/async-number.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub async fn foo() -> u32 { 5 | 1 6 | } 7 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/async-void.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function foo(): Promise; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/async-void.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub async fn foo() {} 5 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/builder.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export class ClassBuilder { 4 | private constructor(); 5 | free(): void; 6 | static builder(): ClassBuilder; 7 | } 8 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/builder.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub struct ClassBuilder(()); 5 | 6 | #[wasm_bindgen] 7 | impl ClassBuilder { 8 | pub fn builder() -> ClassBuilder { 9 | ClassBuilder(()) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/constructor.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export class ClassConstructor { 4 | free(): void; 5 | constructor(); 6 | } 7 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/constructor.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub struct ClassConstructor(()); 5 | 6 | #[wasm_bindgen] 7 | impl ClassConstructor { 8 | 9 | #[wasm_bindgen(constructor)] 10 | pub fn new() -> ClassConstructor { 11 | ClassConstructor(()) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/empty.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/empty.js: -------------------------------------------------------------------------------- 1 | let wasm; 2 | export function __wbg_set_wasm(val) { 3 | wasm = val; 4 | } 5 | 6 | 7 | export function __wbindgen_init_externref_table() { 8 | const table = wasm.__wbindgen_export_0; 9 | const offset = table.grow(4); 10 | table.set(0, undefined); 11 | table.set(offset + 0, undefined); 12 | table.set(offset + 1, null); 13 | table.set(offset + 2, true); 14 | table.set(offset + 3, false); 15 | ; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/empty.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustwasm/wasm-bindgen/c35cc9369d5e0dc418986f7811a0dd702fb33ef9/crates/cli/tests/reference/empty.rs -------------------------------------------------------------------------------- /crates/cli/tests/reference/empty.wat: -------------------------------------------------------------------------------- 1 | (module $reference_test.wasm 2 | (type (;0;) (func)) 3 | (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) 4 | (table (;0;) 128 externref) 5 | (memory (;0;) 16) 6 | (export "memory" (memory 0)) 7 | (export "__wbindgen_export_0" (table 0)) 8 | (export "__wbindgen_start" (func 0)) 9 | (@custom "target_features" (after export) "\04+\0amultivalue+\0fmutable-globals+\0freference-types+\08sign-ext") 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/import-getter-setter.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function exported(): void; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/import.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function exported(): void; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/int128.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function echo_i128(a: bigint): bigint; 4 | export function echo_u128(a: bigint): bigint; 5 | export function echo_option_i128(a?: bigint | null): bigint | undefined; 6 | export function echo_option_u128(a?: bigint | null): bigint | undefined; 7 | export function throw_i128(): bigint; 8 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/intrinsic-only.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function causes_error(): number; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/intrinsic-only.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn causes_error() -> Result { 5 | Ok(1.0) 6 | } 7 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/keyword.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function exported(): void; 4 | export function _function(): void; 5 | export function _var(): void; 6 | export function weird_arguments(_new: number, _var: number, _switch: number, _default: number, _arguments: number): void; 7 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/modules.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function exported(): void; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/nop.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function nop(): void; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/nop.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn nop() {} 5 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/optional-args.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function all_optional(a?: number | null, b?: number | null, c?: number | null): void; 4 | export function some_optional(a: number | null | undefined, b: number, c?: number | null): void; 5 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/optional-args.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn all_optional(a: Option, b: Option, c: Option) {} 5 | 6 | #[wasm_bindgen] 7 | pub fn some_optional(a: Option, b: u32, c: Option) {} 8 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/pointers.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function const_pointer(input: number): number; 4 | export function mut_pointer(input: number): number; 5 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/pointers.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn const_pointer(input: *const u8) -> *const u8 { 5 | u32::MAX as *const _ 6 | } 7 | 8 | #[wasm_bindgen] 9 | pub fn mut_pointer(input: *mut u8) -> *mut u8 { 10 | u32::MAX as *mut _ 11 | } 12 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/raw.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function test1(test: number): number; 4 | export class Test { 5 | private constructor(); 6 | free(): void; 7 | static test1(test: number): Test; 8 | test2(test: number): void; 9 | } 10 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/raw.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn r#test1(r#test: u32) -> u32 { 5 | r#test2(); 6 | r#test 7 | } 8 | 9 | #[wasm_bindgen] 10 | pub struct r#Test; 11 | 12 | #[wasm_bindgen] 13 | impl r#Test { 14 | pub fn r#test1(r#test: u32) -> Self { 15 | Self 16 | } 17 | 18 | pub fn r#test2(&self, r#test: u32) {} 19 | } 20 | 21 | #[wasm_bindgen(module = "test")] 22 | extern "C" { 23 | fn r#test2() -> JsValue; 24 | } 25 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/result.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function result_string(): string; 4 | export function result_void(): void; 5 | export function result_i32(): number; 6 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/result.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn result_string() -> Result { 5 | Err(JsValue::from(5i32)) 6 | } 7 | 8 | #[wasm_bindgen] 9 | pub fn result_void() -> Result<(), JsError> { 10 | Err(JsError::new("message")) 11 | } 12 | 13 | #[wasm_bindgen] 14 | pub fn result_i32() -> Result { 15 | Ok(1) 16 | } 17 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/self-type.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export class Test { 4 | free(): void; 5 | constructor(); 6 | consume_self(): void; 7 | ref_self(): void; 8 | ref_mut_self(): void; 9 | self_Self(): void; 10 | self_ref_Self(): void; 11 | self_ref_mut_Self(): void; 12 | } 13 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/skip-jsdoc.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | /** 4 | * Manually documented function 5 | * 6 | * @param {number} arg - This is my arg. It is mine. 7 | * @returns to whence I came 8 | */ 9 | export function docme(arg: number): number; 10 | /** 11 | * Regular documentation. 12 | */ 13 | export function i_has_docs(arg: number): number; 14 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/skip-jsdoc.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | /// Manually documented function 4 | /// 5 | /// @param {number} arg - This is my arg. It is mine. 6 | /// @returns to whence I came 7 | #[wasm_bindgen(skip_jsdoc)] 8 | pub fn docme(arg: u32) -> u32 { 9 | arg + 1 10 | } 11 | 12 | /// Regular documentation. 13 | #[wasm_bindgen] 14 | pub fn i_has_docs(arg: u32) -> u32 { 15 | arg + 1 16 | } 17 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/static.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function exported(): void; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/string-arg.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function foo(a: string): void; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/string-arg.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn foo(a: &str) { 5 | drop(a); 6 | } 7 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/targets-0.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function add_that_might_fail(a: number, b: number): number; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/targets-3.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function add_that_might_fail(a: number, b: number): number; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/targets-4.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function add_that_might_fail(a: number, b: number): number; 4 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/targets.rs: -------------------------------------------------------------------------------- 1 | // FLAGS: --target=bundler 2 | // FLAGS: --target=web 3 | // FLAGS: --target=no-modules 4 | // FLAGS: --target=nodejs 5 | // FLAGS: --target=deno 6 | 7 | use wasm_bindgen::prelude::*; 8 | 9 | #[wasm_bindgen] 10 | extern "C" { 11 | #[wasm_bindgen(js_namespace = Math)] 12 | fn random() -> f64; 13 | } 14 | 15 | #[wasm_bindgen] 16 | pub fn add_that_might_fail(a: u32, b: u32) -> u32 { 17 | assert!(random() > 0.5); 18 | a + b 19 | } 20 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/typescript-type.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function single(a: number | string): void; 4 | export function slice(a: (number | string)[]): void; 5 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/typescript-type.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | extern "C" { 5 | #[wasm_bindgen(typescript_type = "number | string")] 6 | type CustomType; 7 | } 8 | 9 | #[wasm_bindgen] 10 | pub fn single(a: CustomType) {} 11 | 12 | #[wasm_bindgen] 13 | pub fn slice(a: Vec) {} 14 | -------------------------------------------------------------------------------- /crates/cli/tests/reference/web-sys.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | export function get_url(): URL; 4 | export function get_media_source(): MediaSourceEnum; 5 | /** 6 | * The `MediaSourceEnum` enum. 7 | * 8 | * *This API requires the following crate features to be activated: `MediaSourceEnum`* 9 | */ 10 | type MediaSourceEnum = "camera" | "screen" | "application" | "window" | "browser" | "microphone" | "audioCapture" | "other"; 11 | -------------------------------------------------------------------------------- /crates/example-tests/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/example-tests/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/example-tests/README.md: -------------------------------------------------------------------------------- 1 | # example-tests 2 | 3 | Tests that none of our examples are broken, by opening them in a browser 4 | and checking that no errors get logged to the console. 5 | 6 | This currently only supports Firefox. 7 | -------------------------------------------------------------------------------- /crates/externref-xform/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/externref-xform/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/futures/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/futures/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/futures/src/task/worker.js: -------------------------------------------------------------------------------- 1 | onmessage = function (ev) { 2 | let [ia, index, value] = ev.data; 3 | ia = new Int32Array(ia.buffer); 4 | let result = Atomics.wait(ia, index, value); 5 | postMessage(result); 6 | }; 7 | -------------------------------------------------------------------------------- /crates/js-sys/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/js-sys/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/js-sys/README.md: -------------------------------------------------------------------------------- 1 | # `js-sys` 2 | 3 | [API documentation](https://rustwasm.github.io/wasm-bindgen/api/js_sys/) 4 | 5 | Raw bindings to JS global APIs for projects using `wasm-bindgen`. This crate is 6 | handwritten and intended to work in *all* JS environments like browsers and 7 | Node.js. 8 | -------------------------------------------------------------------------------- /crates/js-sys/tests/browser.rs: -------------------------------------------------------------------------------- 1 | #![cfg(target_arch = "wasm32")] 2 | 3 | extern crate js_sys; 4 | extern crate wasm_bindgen; 5 | extern crate wasm_bindgen_test; 6 | 7 | use wasm_bindgen_test::*; 8 | 9 | wasm_bindgen_test_configure!(run_in_browser); 10 | 11 | pub mod common; 12 | -------------------------------------------------------------------------------- /crates/js-sys/tests/common/headless.js: -------------------------------------------------------------------------------- 1 | export function is_array_values_supported() { 2 | return typeof Array.prototype.values === 'function'; 3 | } 4 | -------------------------------------------------------------------------------- /crates/js-sys/tests/node.rs: -------------------------------------------------------------------------------- 1 | #![cfg(target_arch = "wasm32")] 2 | 3 | extern crate js_sys; 4 | extern crate wasm_bindgen; 5 | extern crate wasm_bindgen_test; 6 | 7 | use wasm_bindgen_test::*; 8 | 9 | wasm_bindgen_test_configure!(run_in_node_experimental); 10 | 11 | pub mod common; 12 | -------------------------------------------------------------------------------- /crates/js-sys/tests/wasm/Array.js: -------------------------------------------------------------------------------- 1 | // Used for `Array.rs` tests 2 | exports.populate_array = function(arr, start, len) { 3 | var isBigInt = typeof(arr[0]) === "bigint"; 4 | for (i = 0; i < len; i++) { 5 | arr[i] = isBigInt ? BigInt(start + i) : start + i; 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /crates/js-sys/tests/wasm/JsString.js: -------------------------------------------------------------------------------- 1 | exports.new_string_object = () => new String("hi"); 2 | 3 | exports.get_replacer_function = function() { 4 | return function upperToHyphenLower(match, offset, string) { 5 | return (offset > 0 ? '-' : '') + match.toLowerCase(); 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /crates/js-sys/tests/wasm/Object.js: -------------------------------------------------------------------------------- 1 | const symbol_key = Symbol(); 2 | 3 | exports.map_with_symbol_key = function() { 4 | return { [symbol_key]: 42 }; 5 | }; 6 | exports.symbol_key = function() { 7 | return symbol_key; 8 | }; 9 | 10 | exports.Foo = class {}; 11 | exports.Bar = class {}; 12 | -------------------------------------------------------------------------------- /crates/js-sys/tests/wasm/Promise.rs: -------------------------------------------------------------------------------- 1 | use js_sys::*; 2 | use wasm_bindgen::JsCast; 3 | use wasm_bindgen_test::*; 4 | 5 | #[wasm_bindgen_test] 6 | fn promise_inheritance() { 7 | let promise = Promise::new(&mut |_, _| ()); 8 | assert!(promise.is_instance_of::()); 9 | assert!(promise.is_instance_of::()); 10 | let _: &Object = promise.as_ref(); 11 | } 12 | -------------------------------------------------------------------------------- /crates/js-sys/tests/wasm/Proxy.js: -------------------------------------------------------------------------------- 1 | exports.proxy_target = function() { 2 | return { a: 100 }; 3 | }; 4 | 5 | exports.proxy_handler = function() { 6 | return { 7 | get: function(obj, prop) { 8 | return prop in obj ? obj[prop] : 37; 9 | } 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /crates/js-sys/tests/wasm/SharedArrayBuffer.js: -------------------------------------------------------------------------------- 1 | exports.is_shared_array_buffer_supported = function () { 2 | return typeof SharedArrayBuffer === 'function'; 3 | }; 4 | -------------------------------------------------------------------------------- /crates/js-sys/tests/wasm/Temporal.js: -------------------------------------------------------------------------------- 1 | exports.is_temporal_supported = function () { 2 | return typeof Temporal === 'object'; 3 | }; 4 | -------------------------------------------------------------------------------- /crates/macro/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/macro/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/macro/src/worker.js: -------------------------------------------------------------------------------- 1 | // This file is needed for the doctest of `crate::link_to`. 2 | -------------------------------------------------------------------------------- /crates/macro/tests/ui.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn ui() { 3 | let t = trybuild::TestCases::new(); 4 | t.compile_fail("ui-tests/*.rs"); 5 | } 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/attribute-fails-to-parse.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen(nonsense)] 4 | pub fn foo() {} 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/attribute-fails-to-parse.stderr: -------------------------------------------------------------------------------- 1 | error: unknown attribute 2 | --> $DIR/attribute-fails-to-parse.rs:3:16 3 | | 4 | 3 | #[wasm_bindgen(nonsense)] 5 | | ^^^^^^^^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/bad-signatures.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn foo() -> &u32 {} 5 | 6 | #[wasm_bindgen] 7 | extern "C" { 8 | fn foo(Foo(x): Foo); 9 | 10 | fn foo() -> &u32; 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/import-local.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen(module = "./foo.js")] 4 | extern { 5 | fn wut(); 6 | } 7 | 8 | #[wasm_bindgen(module = "../foo.js")] 9 | extern { 10 | fn wut2(); 11 | } 12 | 13 | fn main() {} 14 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/import-local.stderr: -------------------------------------------------------------------------------- 1 | error: relative module paths aren't supported yet 2 | --> $DIR/import-local.rs:3:25 3 | | 4 | 3 | #[wasm_bindgen(module = "./foo.js")] 5 | | ^^^^^^^^^^ 6 | 7 | error: relative module paths aren't supported yet 8 | --> $DIR/import-local.rs:8:25 9 | | 10 | 8 | #[wasm_bindgen(module = "../foo.js")] 11 | | ^^^^^^^^^^^ 12 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/invalid-attr.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen(x)] 4 | pub fn foo() {} 5 | 6 | #[wasm_bindgen] 7 | extern "C" { 8 | #[wasm_bindgen(y)] 9 | fn bar(); 10 | 11 | #[wasm_bindgen { }] 12 | fn bar(); 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/invalid-attr.stderr: -------------------------------------------------------------------------------- 1 | error: unknown attribute 2 | --> $DIR/invalid-attr.rs:3:16 3 | | 4 | 3 | #[wasm_bindgen(x)] 5 | | ^ 6 | 7 | error: unknown attribute 8 | --> $DIR/invalid-attr.rs:8:20 9 | | 10 | 8 | #[wasm_bindgen(y)] 11 | | ^ 12 | 13 | error: malformed #[wasm_bindgen] attribute 14 | --> $DIR/invalid-attr.rs:11:5 15 | | 16 | 11 | #[wasm_bindgen { }] 17 | | ^^^^^^^^^^^^^^^^^^^^ 18 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/invalid-setter.rs: -------------------------------------------------------------------------------- 1 | 2 | use wasm_bindgen::prelude::*; 3 | 4 | #[wasm_bindgen] 5 | extern "C" { 6 | type A; 7 | 8 | #[wasm_bindgen(setter, method)] 9 | fn a(this: &A, b: i32); 10 | 11 | #[wasm_bindgen(setter = x, method)] 12 | fn b(this: &A, b: i32); 13 | 14 | #[wasm_bindgen(setter, method, js_name = x)] 15 | fn c(this: &A, b: i32); 16 | } 17 | 18 | fn main() {} 19 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/invalid-setter.stderr: -------------------------------------------------------------------------------- 1 | error: setters must start with `set_`, found: a 2 | --> $DIR/invalid-setter.rs:9:8 3 | | 4 | 9 | fn a(this: &A, b: i32); 5 | | ^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/invalid-static-string.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | #[rustfmt::skip] 5 | extern "C" { 6 | #[wasm_bindgen(thread_local_v2, static_string)] 7 | static FOO: JsValue = "test"; 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-async.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen(main)] 4 | async fn main() {} 5 | 6 | #[wasm_bindgen(main)] 7 | fn fail() {} 8 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-async.stderr: -------------------------------------------------------------------------------- 1 | error: the main function has to be called main 2 | --> ui-tests/main-async.rs:7:4 3 | | 4 | 7 | fn fail() {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-debug.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | use wasm_bindgen::prelude::*; 3 | 4 | #[wasm_bindgen(main)] 5 | fn main() -> Result<(), Test> { 6 | unimplemented!() 7 | } 8 | 9 | struct Test; 10 | 11 | impl fmt::Debug for Test { 12 | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { 13 | unimplemented!() 14 | } 15 | } 16 | 17 | #[wasm_bindgen(main)] 18 | fn fail() {} 19 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-debug.stderr: -------------------------------------------------------------------------------- 1 | error: the main function has to be called main 2 | --> ui-tests/main-debug.rs:18:4 3 | | 4 | 18 | fn fail() {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-infallible.rs: -------------------------------------------------------------------------------- 1 | use std::convert::Infallible; 2 | use wasm_bindgen::prelude::*; 3 | 4 | #[wasm_bindgen(main)] 5 | fn main() -> Infallible { 6 | unimplemented!() 7 | } 8 | 9 | #[wasm_bindgen(main)] 10 | fn fail() {} 11 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-jsvalue.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen(main)] 4 | fn main() -> Result<(), JsValue> { 5 | unimplemented!() 6 | } 7 | 8 | #[wasm_bindgen(main)] 9 | fn fail() {} 10 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-jsvalue.stderr: -------------------------------------------------------------------------------- 1 | error: the main function has to be called main 2 | --> ui-tests/main-jsvalue.rs:9:4 3 | | 4 | 9 | fn fail() {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-unit.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen(main)] 4 | fn main() -> () {} 5 | 6 | #[wasm_bindgen(main)] 7 | fn fail() {} 8 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main-unit.stderr: -------------------------------------------------------------------------------- 1 | error: the main function has to be called main 2 | --> ui-tests/main-unit.rs:7:4 3 | | 4 | 7 | fn fail() {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen(main)] 4 | fn main() {} 5 | 6 | #[wasm_bindgen(main)] 7 | fn fail() {} 8 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/main.stderr: -------------------------------------------------------------------------------- 1 | error: the main function has to be called main 2 | --> ui-tests/main.rs:7:4 3 | | 4 | 7 | fn fail() {} 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/missing-catch.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | extern "C" { 5 | #[wasm_bindgen] 6 | pub fn foo() -> Result; 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/non-public-function.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | fn foo() {} 5 | 6 | fn main() {} 7 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/non-public-function.stderr: -------------------------------------------------------------------------------- 1 | error: can only #[wasm_bindgen] public functions 2 | --> $DIR/non-public-function.rs:4:1 3 | | 4 | 4 | fn foo() {} 5 | | ^^^^^^^^^^^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/pub-not-copy.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub struct A { 5 | pub field: String, 6 | } 7 | 8 | fn main() {} 9 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/struct-fields.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | extern "C" { 5 | pub type Foo; 6 | } 7 | 8 | #[wasm_bindgen] 9 | struct Bar { 10 | pub a: Foo, 11 | #[wasm_bindgen(getter_with_clone)] 12 | pub b: Foo, 13 | } 14 | 15 | fn main() {} 16 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/structural-and-final.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | extern "C" { 5 | type Foo; 6 | 7 | #[wasm_bindgen(method, structural, final)] 8 | fn bar(this: &Foo); 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/structural-and-final.stderr: -------------------------------------------------------------------------------- 1 | error: cannot specify both `structural` and `final` 2 | --> $DIR/structural-and-final.rs:7:40 3 | | 4 | 7 | #[wasm_bindgen(method, structural, final)] 5 | | ^^^^^ 6 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/traits-not-implemented.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | struct A; 4 | 5 | #[wasm_bindgen] 6 | extern "C" { 7 | #[wasm_bindgen] 8 | pub fn foo(a: A); 9 | } 10 | 11 | fn main() {} 12 | -------------------------------------------------------------------------------- /crates/macro/ui-tests/unknown-type-in-import.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | extern "C" { 5 | #[wasm_bindgen] 6 | pub fn foo(a: A); 7 | } 8 | 9 | fn main() {} 10 | 11 | -------------------------------------------------------------------------------- /crates/msrv/cli/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | edition = "2021" 3 | name = "msrv-cli-test" 4 | publish = false 5 | version = "0.0.0" 6 | 7 | [dependencies] 8 | wasm-bindgen-cli = { path = "../../cli" } 9 | -------------------------------------------------------------------------------- /crates/msrv/cli/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustwasm/wasm-bindgen/c35cc9369d5e0dc418986f7811a0dd702fb33ef9/crates/msrv/cli/src/lib.rs -------------------------------------------------------------------------------- /crates/msrv/lib/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustwasm/wasm-bindgen/c35cc9369d5e0dc418986f7811a0dd702fb33ef9/crates/msrv/lib/src/lib.rs -------------------------------------------------------------------------------- /crates/msrv/resolver/src/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustwasm/wasm-bindgen/c35cc9369d5e0dc418986f7811a0dd702fb33ef9/crates/msrv/resolver/src/lib.rs -------------------------------------------------------------------------------- /crates/multi-value-xform/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/multi-value-xform/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/shared/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/shared/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/test-macro/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/test-macro/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/test-macro/README.md: -------------------------------------------------------------------------------- 1 | # wasm-bindgen-test-runner 2 | 3 | This is an **experimental** crate for enabling `cargo test --target 4 | wasm32-unknown-unknown`. For more information see the README of 5 | `wasm-bindgen-test`. 6 | -------------------------------------------------------------------------------- /crates/test-macro/tests/ui.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn ui() { 3 | let t = trybuild::TestCases::new(); 4 | t.compile_fail("ui-tests/*.rs"); 5 | } 6 | -------------------------------------------------------------------------------- /crates/test-macro/ui-tests/crate.rs: -------------------------------------------------------------------------------- 1 | #![no_implicit_prelude] 2 | 3 | extern crate wasm_bindgen_test_macro; 4 | // 5 | use wasm_bindgen_test_macro::wasm_bindgen_test; 6 | 7 | pub mod wasm { 8 | pub extern crate wasm_bindgen_test as test; 9 | } 10 | 11 | #[wasm_bindgen_test(crate = ::wasm_bindgen_test)] 12 | fn success_1() {} 13 | 14 | #[wasm_bindgen_test(crate = crate::wasm::test)] 15 | fn success_2() {} 16 | 17 | #[wasm_bindgen_test(crate(foo))] 18 | fn failure_1() {} 19 | 20 | fn main() {} 21 | -------------------------------------------------------------------------------- /crates/test-macro/ui-tests/crate.stderr: -------------------------------------------------------------------------------- 1 | error: expected `=` 2 | --> ui-tests/crate.rs:17:26 3 | | 4 | 17 | #[wasm_bindgen_test(crate(foo))] 5 | | ^ 6 | -------------------------------------------------------------------------------- /crates/test-macro/ui-tests/unsupported.rs: -------------------------------------------------------------------------------- 1 | #![no_implicit_prelude] 2 | 3 | extern crate wasm_bindgen_test_macro; 4 | extern crate tokio; 5 | // 6 | use wasm_bindgen_test_macro::wasm_bindgen_test; 7 | 8 | #[wasm_bindgen_test(unsupported = tokio::test(flavor = "multi_thread", worker_threads = 1))] 9 | async fn success() {} 10 | 11 | #[wasm_bindgen_test(unsupported)] 12 | fn failure_1() {} 13 | 14 | #[wasm_bindgen_test(unsupported(test))] 15 | fn failure_2() {} 16 | 17 | fn main() {} 18 | -------------------------------------------------------------------------------- /crates/test/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/test/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/test/sample/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "sample" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | test = false 10 | 11 | [dependencies] 12 | js-sys = { path = '../../js-sys' } 13 | wasm-bindgen = { path = '../../..' } 14 | wasm-bindgen-futures = { path = '../../futures' } 15 | 16 | [dev-dependencies] 17 | wasm-bindgen-test = { path = '..' } 18 | -------------------------------------------------------------------------------- /crates/test/sample/README.md: -------------------------------------------------------------------------------- 1 | # Sample test crate 2 | 3 | This is a dummy crate used to test changes to the `wasm-bindgen-test` crate, 4 | this'll never be published nor tested on CI, it's intended for human inspection. 5 | -------------------------------------------------------------------------------- /crates/test/sample/tests/browser.rs: -------------------------------------------------------------------------------- 1 | wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); 2 | 3 | pub mod common; 4 | -------------------------------------------------------------------------------- /crates/test/sample/tests/node.rs: -------------------------------------------------------------------------------- 1 | pub mod common; 2 | -------------------------------------------------------------------------------- /crates/threads-xform/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/threads-xform/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/typescript-tests/.gitignore: -------------------------------------------------------------------------------- 1 | pkg 2 | dist 3 | src_no_modules 4 | dist_no_modules 5 | -------------------------------------------------------------------------------- /crates/typescript-tests/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/typescript-tests/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/typescript-tests/no_modules.tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "noImplicitAny": true, 5 | "sourceMap": true, 6 | "outDir": "dist_no_modules", 7 | "moduleResolution":"node" 8 | }, 9 | "include": [ 10 | "pkg/no_modules/*.d.ts", 11 | "src_no_modules/*.ts", 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /crates/typescript-tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "tsc": "tsc", 4 | "test": "NODE_OPTIONS=--experimental-vm-modules jest --config ./jest.config.cjs" 5 | }, 6 | "devDependencies": { 7 | "@types/jest": "^29.5.8", 8 | "ts-jest": "=29.2.0", 9 | "typescript": "^5.2.2" 10 | }, 11 | "type": "module" 12 | } 13 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/custom_section.ts: -------------------------------------------------------------------------------- 1 | import * as wbg from "../pkg/typescript_tests" 2 | 3 | const height: wbg.Height = new wbg.Person() 4 | 5 | const height1: wbg.Person1 = new wbg.Person() 6 | 7 | const height2: wbg.Person2 = new wbg.Person() 8 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/custom_section_types.d.ts: -------------------------------------------------------------------------------- 1 | interface Person1 { 2 | height: number 3 | } 4 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/enums.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub enum Foo { 5 | A = 1, 6 | B = 3, 7 | } 8 | 9 | #[wasm_bindgen] 10 | pub fn fn_expects_enum(_: Foo) {} 11 | 12 | #[wasm_bindgen] 13 | pub fn fn_returns_enum() -> Foo { 14 | Foo::A 15 | } 16 | 17 | #[wasm_bindgen] 18 | pub fn fn_expects_option_enum(_: Option) {} 19 | 20 | #[wasm_bindgen] 21 | pub fn fn_returns_option_enum() -> Option { 22 | Some(Foo::A) 23 | } 24 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/inspectable.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen(inspectable)] 4 | pub struct Bar { 5 | pub foo: i32, 6 | _private: i32, 7 | } 8 | 9 | #[wasm_bindgen] 10 | impl Bar { 11 | #[wasm_bindgen(constructor)] 12 | pub fn new(foo: i32) -> Self { 13 | Self { foo, _private: 13 } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/inspectable.ts: -------------------------------------------------------------------------------- 1 | import * as wbg from "../pkg/typescript_tests"; 2 | 3 | const bar: wbg.Bar = new wbg.Bar(1); 4 | const barAsJson: Object = bar.toJSON(); 5 | const barAsString: string = bar.toString(); 6 | const _ = bar.foo; 7 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/memory.ts: -------------------------------------------------------------------------------- 1 | import * as wasm from '../pkg/typescript_tests_bg.wasm'; 2 | 3 | const memory: WebAssembly.Memory = wasm.memory; 4 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/opt_args_and_ret.ts: -------------------------------------------------------------------------------- 1 | import * as wbg from '../pkg/typescript_tests'; 2 | 3 | const opt_fn_mixed: (a: number | undefined, b: number, c?: number) => number | undefined = wbg.opt_fn_mixed; 4 | const opt_fn_only: (a?: number, b?: number, c?: number) => number | undefined = wbg.opt_fn_only; 5 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/optional_fields.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub struct Fields { 5 | pub hallo: Option, 6 | pub spaceboy: bool, 7 | } 8 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/optional_fields.ts: -------------------------------------------------------------------------------- 1 | import * as wbg from '../pkg/typescript_tests'; 2 | 3 | const fields: wbg.Fields = null as unknown as wbg.Fields; 4 | 5 | // optional fields read T | undefined 6 | const _hallo: boolean | undefined = fields.hallo; 7 | 8 | // and allow writing T | null | undefined 9 | fields.hallo = undefined; 10 | fields.hallo = null; 11 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/simple_async_fn.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub async fn async_greet(_: String) {} 5 | 6 | #[wasm_bindgen] 7 | pub async fn async_take_and_return_bool(_: bool) -> bool { 8 | true 9 | } 10 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/simple_async_fn.ts: -------------------------------------------------------------------------------- 1 | import * as wbg from '../pkg/typescript_tests'; 2 | import * as wasm from '../pkg/typescript_tests_bg.wasm'; 3 | 4 | const wbg_async_greet: (a: string) => Promise = wbg.async_greet; 5 | const wasm_async_greet: (a: number, b: number) => number = wasm.async_greet; 6 | const async_take_and_return_bool: (a: boolean) => Promise = wbg.async_take_and_return_bool; 7 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/simple_fn.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn greet(_: &str) {} 5 | 6 | #[wasm_bindgen] 7 | pub fn take_and_return_bool(_: bool) -> bool { 8 | true 9 | } 10 | 11 | #[wasm_bindgen(variadic)] 12 | pub fn variadic_function(arr: &JsValue) -> JsValue { 13 | arr.into() 14 | } 15 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/simple_fn.ts: -------------------------------------------------------------------------------- 1 | import * as wbg from '../pkg/typescript_tests'; 2 | import * as wasm from '../pkg/typescript_tests_bg.wasm'; 3 | 4 | const wbg_greet: (a: string) => void = wbg.greet; 5 | const wasm_greet: (a: number, b: number) => void = wasm.greet; 6 | const take_and_return_bool: (a: boolean) => boolean = wbg.take_and_return_bool; 7 | const wbg_variadic_function: (...arr: any) => any = wbg.variadic_function; 8 | const wasm_variadic_function: (arr: number) => number = wasm.variadic_function; 9 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/simple_struct.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub struct A {} 5 | 6 | #[wasm_bindgen] 7 | impl A { 8 | #[wasm_bindgen(constructor)] 9 | pub fn new() -> A { 10 | A {} 11 | } 12 | 13 | pub fn other() {} 14 | 15 | pub fn foo(&self) {} 16 | 17 | pub fn ret_bool(&self) -> bool { 18 | true 19 | } 20 | pub fn take_bool(&self, _: bool) {} 21 | pub fn take_many(&self, _: bool, _: f64, _: u32) {} 22 | } 23 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/usize.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn usize_identity(x: usize) -> usize { 5 | x 6 | } 7 | 8 | #[wasm_bindgen] 9 | pub fn isize_identity(x: isize) -> isize { 10 | x 11 | } 12 | 13 | #[wasm_bindgen] 14 | pub async fn async_usize_identity(x: usize) -> usize { 15 | x 16 | } 17 | 18 | #[wasm_bindgen] 19 | pub async fn async_isize_identity(x: isize) -> isize { 20 | x 21 | } 22 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/usize.ts: -------------------------------------------------------------------------------- 1 | import * as wbg from "../pkg/typescript_tests"; 2 | 3 | const _f1: (x: number) => number = wbg.usize_identity; 4 | const _f2: (x: number) => number = wbg.isize_identity; 5 | const _f3: (x: number) => Promise = wbg.async_usize_identity; 6 | const _f4: (x: number) => Promise = wbg.async_isize_identity; 7 | -------------------------------------------------------------------------------- /crates/typescript-tests/src/web/init.ts: -------------------------------------------------------------------------------- 1 | import initialize from "../../pkg/web/typescript_tests"; 2 | 3 | const init: Promise = initialize("."); 4 | -------------------------------------------------------------------------------- /crates/typescript-tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "allowSyntheticDefaultImports": true, 6 | "target": "es6", 7 | "noImplicitAny": true, 8 | "sourceMap": true, 9 | "outDir": "dist", 10 | "baseUrl": "." 11 | }, 12 | "include": [ 13 | "src/**/*.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /crates/wasm-conventions/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/wasm-conventions/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/wasm-interpreter/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/wasm-interpreter/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/web-sys/.gitignore: -------------------------------------------------------------------------------- 1 | /features 2 | -------------------------------------------------------------------------------- /crates/web-sys/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/web-sys/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_AlignSetting.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `AlignSetting` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `AlignSetting`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum AlignSetting { 10 | Start = "start", 11 | Center = "center", 12 | End = "end", 13 | Left = "left", 14 | Right = "right", 15 | } 16 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_AudioContextState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `AudioContextState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `AudioContextState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum AudioContextState { 10 | Suspended = "suspended", 11 | Running = "running", 12 | Closed = "closed", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_AuthenticatorAttachment.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `AuthenticatorAttachment` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttachment`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum AuthenticatorAttachment { 10 | Platform = "platform", 11 | CrossPlatform = "cross-platform", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_AutoKeyword.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `AutoKeyword` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `AutoKeyword`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum AutoKeyword { 10 | Auto = "auto", 11 | } 12 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_BasicCardType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `BasicCardType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `BasicCardType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum BasicCardType { 10 | Credit = "credit", 11 | Debit = "debit", 12 | Prepaid = "prepaid", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_BinaryType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `BinaryType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `BinaryType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum BinaryType { 10 | Blob = "blob", 11 | Arraybuffer = "arraybuffer", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_BrowserFindDirection.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `BrowserFindDirection` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `BrowserFindDirection`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum BrowserFindDirection { 10 | Forward = "forward", 11 | Backward = "backward", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_CacheStorageNamespace.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `CacheStorageNamespace` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `CacheStorageNamespace`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum CacheStorageNamespace { 10 | Content = "content", 11 | Chrome = "chrome", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_CanvasWindingRule.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `CanvasWindingRule` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `CanvasWindingRule`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum CanvasWindingRule { 10 | Nonzero = "nonzero", 11 | Evenodd = "evenodd", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ChannelCountMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ChannelCountMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ChannelCountMode { 10 | Max = "max", 11 | ClampedMax = "clamped-max", 12 | Explicit = "explicit", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ChannelInterpretation.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ChannelInterpretation` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ChannelInterpretation { 10 | Speakers = "speakers", 11 | Discrete = "discrete", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_CheckerboardReason.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `CheckerboardReason` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `CheckerboardReason`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum CheckerboardReason { 10 | Severe = "severe", 11 | Recent = "recent", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ColorSpaceConversion.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ColorSpaceConversion` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ColorSpaceConversion { 10 | None = "none", 11 | Default = "default", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_CompositeOperation.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `CompositeOperation` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `CompositeOperation`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum CompositeOperation { 10 | Replace = "replace", 11 | Add = "add", 12 | Accumulate = "accumulate", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ConsoleLevel.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ConsoleLevel` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ConsoleLevel`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ConsoleLevel { 10 | Log = "log", 11 | Warning = "warning", 12 | Error = "error", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_CssBoxType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `CssBoxType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `CssBoxType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum CssBoxType { 10 | Margin = "margin", 11 | Border = "border", 12 | Padding = "padding", 13 | Content = "content", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_CssStyleSheetParsingMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `CssStyleSheetParsingMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `CssStyleSheetParsingMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum CssStyleSheetParsingMode { 10 | Author = "author", 11 | User = "user", 12 | Agent = "agent", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_DirectionSetting.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `DirectionSetting` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `DirectionSetting`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum DirectionSetting { 10 | None = "", 11 | Rl = "rl", 12 | Lr = "lr", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_DistanceModelType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `DistanceModelType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `DistanceModelType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum DistanceModelType { 10 | Linear = "linear", 11 | Inverse = "inverse", 12 | Exponential = "exponential", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_DomRequestReadyState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `DomRequestReadyState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `DomRequestReadyState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum DomRequestReadyState { 10 | Pending = "pending", 11 | Done = "done", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_EndingTypes.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `EndingTypes` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `EndingTypes`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum EndingTypes { 10 | Transparent = "transparent", 11 | Native = "native", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_FileSystemHandleKind.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `FileSystemHandleKind` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `FileSystemHandleKind`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum FileSystemHandleKind { 10 | File = "file", 11 | Directory = "directory", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_FillMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `FillMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `FillMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum FillMode { 10 | None = "none", 11 | Forwards = "forwards", 12 | Backwards = "backwards", 13 | Both = "both", 14 | Auto = "auto", 15 | } 16 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_FontFaceSetLoadStatus.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `FontFaceSetLoadStatus` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `FontFaceSetLoadStatus`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum FontFaceSetLoadStatus { 10 | Loading = "loading", 11 | Loaded = "loaded", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_FrameType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `FrameType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `FrameType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum FrameType { 10 | Auxiliary = "auxiliary", 11 | TopLevel = "top-level", 12 | Nested = "nested", 13 | None = "none", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_GamepadHand.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `GamepadHand` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `GamepadHand`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum GamepadHand { 10 | None = "", 11 | Left = "left", 12 | Right = "right", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_GamepadHapticActuatorType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `GamepadHapticActuatorType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `GamepadHapticActuatorType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum GamepadHapticActuatorType { 10 | Vibration = "vibration", 11 | } 12 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_GamepadMappingType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `GamepadMappingType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `GamepadMappingType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum GamepadMappingType { 10 | None = "", 11 | Standard = "standard", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_IdbRequestReadyState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `IdbRequestReadyState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `IdbRequestReadyState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum IdbRequestReadyState { 10 | Pending = "pending", 11 | Done = "done", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ImageOrientation.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ImageOrientation` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ImageOrientation`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ImageOrientation { 10 | FromImage = "from-image", 11 | FlipY = "flipY", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_IterationCompositeOperation.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `IterationCompositeOperation` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `IterationCompositeOperation`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum IterationCompositeOperation { 10 | Replace = "replace", 11 | Accumulate = "accumulate", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_LargeBlobSupport.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `LargeBlobSupport` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `LargeBlobSupport`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum LargeBlobSupport { 10 | Required = "required", 11 | Preferred = "preferred", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_LineAlignSetting.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `LineAlignSetting` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `LineAlignSetting`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum LineAlignSetting { 10 | Start = "start", 11 | Center = "center", 12 | End = "end", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MediaDecodingType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MediaDecodingType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MediaDecodingType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MediaDecodingType { 10 | File = "file", 11 | MediaSource = "media-source", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MediaDeviceKind.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MediaDeviceKind` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MediaDeviceKind`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MediaDeviceKind { 10 | Audioinput = "audioinput", 11 | Audiooutput = "audiooutput", 12 | Videoinput = "videoinput", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MediaEncodingType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MediaEncodingType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MediaEncodingType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MediaEncodingType { 10 | Record = "record", 11 | Transmission = "transmission", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MediaKeySessionType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MediaKeySessionType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MediaKeySessionType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MediaKeySessionType { 10 | Temporary = "temporary", 11 | PersistentLicense = "persistent-license", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MediaSourceEndOfStreamError.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MediaSourceEndOfStreamError` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MediaSourceEndOfStreamError`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MediaSourceEndOfStreamError { 10 | Network = "network", 11 | Decode = "decode", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MediaSourceReadyState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MediaSourceReadyState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MediaSourceReadyState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MediaSourceReadyState { 10 | Closed = "closed", 11 | Open = "open", 12 | Ended = "ended", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MediaStreamTrackState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MediaStreamTrackState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MediaStreamTrackState { 10 | Live = "live", 11 | Ended = "ended", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MidiPortConnectionState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MidiPortConnectionState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MidiPortConnectionState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MidiPortConnectionState { 10 | Open = "open", 11 | Closed = "closed", 12 | Pending = "pending", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MidiPortDeviceState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MidiPortDeviceState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MidiPortDeviceState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MidiPortDeviceState { 10 | Disconnected = "disconnected", 11 | Connected = "connected", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_MidiPortType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `MidiPortType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `MidiPortType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum MidiPortType { 10 | Input = "input", 11 | Output = "output", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_NotificationDirection.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `NotificationDirection` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `NotificationDirection`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum NotificationDirection { 10 | Auto = "auto", 11 | Ltr = "ltr", 12 | Rtl = "rtl", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_OverSampleType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `OverSampleType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `OverSampleType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum OverSampleType { 10 | None = "none", 11 | N2x = "2x", 12 | N4x = "4x", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_PanningModelType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `PanningModelType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `PanningModelType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum PanningModelType { 10 | Equalpower = "equalpower", 11 | Hrtf = "HRTF", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_PaymentComplete.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `PaymentComplete` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `PaymentComplete`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum PaymentComplete { 10 | Success = "success", 11 | Fail = "fail", 12 | Unknown = "unknown", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_PermissionState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `PermissionState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `PermissionState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum PermissionState { 10 | Granted = "granted", 11 | Denied = "denied", 12 | Prompt = "prompt", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_PremultiplyAlpha.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `PremultiplyAlpha` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `PremultiplyAlpha`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum PremultiplyAlpha { 10 | None = "none", 11 | Premultiply = "premultiply", 12 | Default = "default", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_PresentationStyle.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `PresentationStyle` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `PresentationStyle`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum PresentationStyle { 10 | Unspecified = "unspecified", 11 | Inline = "inline", 12 | Attachment = "attachment", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_PublicKeyCredentialType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `PublicKeyCredentialType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum PublicKeyCredentialType { 10 | PublicKey = "public-key", 11 | } 12 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_PushEncryptionKeyName.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `PushEncryptionKeyName` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `PushEncryptionKeyName`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum PushEncryptionKeyName { 10 | P256dh = "p256dh", 11 | Auth = "auth", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_PushPermissionState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `PushPermissionState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `PushPermissionState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum PushPermissionState { 10 | Granted = "granted", 11 | Denied = "denied", 12 | Prompt = "prompt", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ReadableStreamReaderMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ReadableStreamReaderMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReaderMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ReadableStreamReaderMode { 10 | Byob = "byob", 11 | } 12 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ReadableStreamType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ReadableStreamType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ReadableStreamType { 10 | Bytes = "bytes", 11 | } 12 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RecordingState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RecordingState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RecordingState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RecordingState { 10 | Inactive = "inactive", 11 | Recording = "recording", 12 | Paused = "paused", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RequestCredentials.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RequestCredentials` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RequestCredentials`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RequestCredentials { 10 | Omit = "omit", 11 | SameOrigin = "same-origin", 12 | Include = "include", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RequestMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RequestMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RequestMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RequestMode { 10 | SameOrigin = "same-origin", 11 | NoCors = "no-cors", 12 | Cors = "cors", 13 | Navigate = "navigate", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RequestRedirect.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RequestRedirect` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RequestRedirect`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RequestRedirect { 10 | Follow = "follow", 11 | Error = "error", 12 | Manual = "manual", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ResizeQuality.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ResizeQuality` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ResizeQuality`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ResizeQuality { 10 | Pixelated = "pixelated", 11 | Low = "low", 12 | Medium = "medium", 13 | High = "high", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RtcBundlePolicy.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RtcBundlePolicy` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RtcBundlePolicy`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RtcBundlePolicy { 10 | Balanced = "balanced", 11 | MaxCompat = "max-compat", 12 | MaxBundle = "max-bundle", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RtcDataChannelType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RtcDataChannelType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RtcDataChannelType { 10 | Arraybuffer = "arraybuffer", 11 | Blob = "blob", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RtcIceCredentialType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RtcIceCredentialType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RtcIceCredentialType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RtcIceCredentialType { 10 | Password = "password", 11 | Token = "token", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RtcIceGatheringState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RtcIceGatheringState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RtcIceGatheringState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RtcIceGatheringState { 10 | New = "new", 11 | Gathering = "gathering", 12 | Complete = "complete", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RtcIceTransportPolicy.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RtcIceTransportPolicy` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RtcIceTransportPolicy`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RtcIceTransportPolicy { 10 | Relay = "relay", 11 | All = "all", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RtcPriorityType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RtcPriorityType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RtcPriorityType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RtcPriorityType { 10 | VeryLow = "very-low", 11 | Low = "low", 12 | Medium = "medium", 13 | High = "high", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RtcRtpSourceEntryType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RtcRtpSourceEntryType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntryType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RtcRtpSourceEntryType { 10 | Contributing = "contributing", 11 | Synchronization = "synchronization", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_RtcSdpType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `RtcSdpType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `RtcSdpType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum RtcSdpType { 10 | Offer = "offer", 11 | Pranswer = "pranswer", 12 | Answer = "answer", 13 | Rollback = "rollback", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ScreenColorGamut.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ScreenColorGamut` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ScreenColorGamut`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ScreenColorGamut { 10 | Srgb = "srgb", 11 | P3 = "p3", 12 | Rec2020 = "rec2020", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ScrollBehavior.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ScrollBehavior` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ScrollBehavior`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ScrollBehavior { 10 | Auto = "auto", 11 | Instant = "instant", 12 | Smooth = "smooth", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ScrollRestoration.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ScrollRestoration` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ScrollRestoration`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ScrollRestoration { 10 | Auto = "auto", 11 | Manual = "manual", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ScrollSetting.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ScrollSetting` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ScrollSetting`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ScrollSetting { 10 | None = "", 11 | Up = "up", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ScrollState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ScrollState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ScrollState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ScrollState { 10 | Started = "started", 11 | Stopped = "stopped", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_SelectionMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `SelectionMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `SelectionMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum SelectionMode { 10 | Select = "select", 11 | Start = "start", 12 | End = "end", 13 | Preserve = "preserve", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_ShadowRootMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `ShadowRootMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `ShadowRootMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum ShadowRootMode { 10 | Open = "open", 11 | Closed = "closed", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_SourceBufferAppendMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `SourceBufferAppendMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `SourceBufferAppendMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum SourceBufferAppendMode { 10 | Segments = "segments", 11 | Sequence = "sequence", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_StorageType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `StorageType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `StorageType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum StorageType { 10 | Persistent = "persistent", 11 | Temporary = "temporary", 12 | Default = "default", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_TcpReadyState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `TcpReadyState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `TcpReadyState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum TcpReadyState { 10 | Connecting = "connecting", 11 | Open = "open", 12 | Closing = "closing", 13 | Closed = "closed", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_TcpSocketBinaryType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `TcpSocketBinaryType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `TcpSocketBinaryType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum TcpSocketBinaryType { 10 | Arraybuffer = "arraybuffer", 11 | String = "string", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_TextTrackMode.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `TextTrackMode` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `TextTrackMode`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum TextTrackMode { 10 | Disabled = "disabled", 11 | Hidden = "hidden", 12 | Showing = "showing", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_TokenBindingStatus.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `TokenBindingStatus` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `TokenBindingStatus`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum TokenBindingStatus { 10 | Present = "present", 11 | Supported = "supported", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_Transport.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `Transport` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `Transport`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum Transport { 10 | Bt = "bt", 11 | Ble = "ble", 12 | Nfc = "nfc", 13 | Usb = "usb", 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_VisibilityState.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `VisibilityState` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `VisibilityState`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum VisibilityState { 10 | Hidden = "hidden", 11 | Visible = "visible", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_VrEye.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `VrEye` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `VrEye`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum VrEye { 10 | Left = "left", 11 | Right = "right", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_WorkerType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `WorkerType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `WorkerType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum WorkerType { 10 | Classic = "classic", 11 | Module = "module", 12 | } 13 | -------------------------------------------------------------------------------- /crates/web-sys/src/features/gen_WriteCommandType.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | #![allow(clippy::all)] 3 | use wasm_bindgen::prelude::*; 4 | #[wasm_bindgen] 5 | #[doc = "The `WriteCommandType` enum."] 6 | #[doc = ""] 7 | #[doc = "*This API requires the following crate features to be activated: `WriteCommandType`*"] 8 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 9 | pub enum WriteCommandType { 10 | Write = "write", 11 | Seek = "seek", 12 | Truncate = "truncate", 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/blob.js: -------------------------------------------------------------------------------- 1 | export function new_blob() { 2 | return new Blob([ 1, 2, 3 ]); 3 | } 4 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/console.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen_test::*; 2 | use web_sys::console; 3 | 4 | #[wasm_bindgen_test] 5 | fn test_console() { 6 | console::time_with_label("test label"); 7 | console::time_end_with_label("test label"); 8 | } 9 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/event.js: -------------------------------------------------------------------------------- 1 | export function new_event() { 2 | return new Promise(resolve => { 3 | window.addEventListener("test-event", resolve); 4 | window.dispatchEvent(new Event("test-event", { 5 | bubbles: true, 6 | cancelable: true, 7 | composed: true, 8 | })); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/head_element.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_test::*; 3 | use web_sys::HtmlHeadElement; 4 | 5 | #[wasm_bindgen(module = "/tests/wasm/element.js")] 6 | extern "C" { 7 | fn new_head() -> HtmlHeadElement; 8 | } 9 | 10 | #[wasm_bindgen_test] 11 | fn test_head_element() { 12 | let _element = new_head(); 13 | // Head doesn't have an interface 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/headers.js: -------------------------------------------------------------------------------- 1 | export function new_headers() { 2 | return new Headers({'Content-Type': 'text/plain'}); 3 | } 4 | 5 | export function new_headers_2() { 6 | return new Headers({'Content-Type': 'text/plain', 'Cookie': 'foobarbaz'}); 7 | } 8 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/indexeddb.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen_test::*; 2 | 3 | #[wasm_bindgen_test] 4 | fn accessor_works() { 5 | let window = web_sys::window().unwrap(); 6 | assert!(window.indexed_db().unwrap().is_some()); 7 | } 8 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/performance.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_test::*; 3 | use web_sys::Performance; 4 | 5 | #[wasm_bindgen] 6 | extern "C" { 7 | #[wasm_bindgen(thread_local_v2, js_name = performance)] 8 | static PERFORMANCE: Performance; 9 | } 10 | 11 | #[wasm_bindgen_test] 12 | fn to_json() { 13 | let perf = JsValue::from(PERFORMANCE.with(Performance::to_json)); 14 | assert!(perf.is_object()); 15 | } 16 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/pre_element.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_test::*; 3 | use web_sys::HtmlPreElement; 4 | 5 | #[wasm_bindgen(module = "/tests/wasm/element.js")] 6 | extern "C" { 7 | fn new_pre() -> HtmlPreElement; 8 | } 9 | 10 | #[wasm_bindgen_test] 11 | fn test_pre_element() { 12 | let pre = new_pre(); 13 | pre.set_width(150); 14 | assert_eq!(pre.width(), 150, "Pre width should be 150."); 15 | } 16 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/response.js: -------------------------------------------------------------------------------- 1 | export function new_response() { 2 | return new Response(null, {status: 501}); 3 | } 4 | 5 | export function get_wasm_imports() { 6 | return { 7 | imports: { 8 | imported_func: function () { 9 | return 1; 10 | } 11 | } 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /crates/web-sys/tests/wasm/span_element.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_test::*; 3 | use web_sys::HtmlSpanElement; 4 | 5 | #[wasm_bindgen(module = "/tests/wasm/element.js")] 6 | extern "C" { 7 | fn new_span() -> HtmlSpanElement; 8 | } 9 | 10 | #[wasm_bindgen_test] 11 | fn test_span_element() { 12 | let _element = new_span(); 13 | // Span doesn't have an interface 14 | } 15 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/disabled/README.md: -------------------------------------------------------------------------------- 1 | These webidl files are intentionally disabled because they have not yet stabilized. 2 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/AbstractWorker.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | [Exposed=(Window,Worker,System)] 8 | interface mixin AbstractWorker { 9 | attribute EventHandler onerror; 10 | }; 11 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/BarProp.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | interface BarProp 8 | { 9 | [Throws, NeedsCallerType] 10 | attribute boolean visible; 11 | }; 12 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/CDATASection.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | interface CDATASection : Text { 8 | }; 9 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/CSSMozDocumentRule.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/CSSRuleList.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | interface CSSRuleList { 8 | readonly attribute unsigned long length; 9 | getter CSSRule? item(unsigned long index); 10 | }; 11 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/DOMRectList.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | interface DOMRectList { 8 | readonly attribute unsigned long length; 9 | getter DOMRect? item(unsigned long index); 10 | }; 11 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/HTMLPictureElement.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | [HTMLConstructor] 8 | interface HTMLPictureElement : HTMLElement { 9 | }; 10 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/HiddenPluginEvent.webidl: -------------------------------------------------------------------------------- 1 | // invalid widl 2 | // interface PluginTag; 3 | 4 | [Constructor(DOMString type, optional HiddenPluginEventInit eventInit), ChromeOnly] 5 | interface HiddenPluginEvent : Event 6 | { 7 | readonly attribute PluginTag? tag; 8 | }; 9 | 10 | dictionary HiddenPluginEventInit : EventInit 11 | { 12 | PluginTag? tag = null; 13 | }; 14 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/MozApplicationEvent.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/PaintRequestList.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | interface PaintRequestList { 8 | readonly attribute unsigned long length; 9 | getter PaintRequest? item(unsigned long index); 10 | }; 11 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/RTCDTMFToneChangeEvent.webidl: -------------------------------------------------------------------------------- 1 | [Constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict)] 2 | interface RTCDTMFToneChangeEvent : Event { 3 | readonly attribute DOMString tone; 4 | }; 5 | 6 | dictionary RTCDTMFToneChangeEventInit : EventInit { 7 | DOMString tone = ""; 8 | }; 9 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/StorageType.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | enum StorageType { "persistent", "temporary", "default" }; 8 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/StyleSheetList.webidl: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | interface StyleSheetList { 6 | readonly attribute unsigned long length; 7 | getter StyleSheet? item(unsigned long index); 8 | }; 9 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/UserActivation.webidl: -------------------------------------------------------------------------------- 1 | [Exposed=Window] 2 | interface UserActivation { 3 | readonly attribute boolean hasBeenActive; 4 | readonly attribute boolean isActive; 5 | }; 6 | 7 | partial interface Navigator { 8 | [SameObject] readonly attribute UserActivation userActivation; 9 | }; 10 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/Vibration.webidl: -------------------------------------------------------------------------------- 1 | // https://www.w3.org/TR/vibration/#vibration-interface 2 | 3 | typedef (unsigned long or sequence) VibratePattern; 4 | 5 | partial interface Navigator { 6 | boolean vibrate(VibratePattern pattern); 7 | }; 8 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/XPathNSResolver.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* This Source Code Form is subject to the terms of the Mozilla Public 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. 5 | */ 6 | 7 | callback interface XPathNSResolver 8 | { 9 | DOMString? lookupNamespaceURI(DOMString? prefix); 10 | }; 11 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/enabled/nsISupports.webidl: -------------------------------------------------------------------------------- 1 | // `nsISupports` is a Gecko thing that can be queried if it implements some 2 | // interface. We can query anything via `JsCast`, so it is good enough to just 3 | // call it an Object. 4 | typedef object nsISupports; 5 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unavailable_option_primitive/README.md: -------------------------------------------------------------------------------- 1 | These webidl files are unavailable because web-sys will fail to build when a function has an 2 | optional primitive parameter (e.g. `optional short`). 3 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unstable/AudioSinkInfo.webidl: -------------------------------------------------------------------------------- 1 | [Exposed=Window] 2 | interface AudioSinkInfo { 3 | readonly attribute AudioSinkType type; 4 | }; 5 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unstable/Compression.webidl: -------------------------------------------------------------------------------- 1 | enum CompressionFormat { 2 | "deflate", 3 | "deflate-raw", 4 | "gzip", 5 | }; 6 | 7 | [Exposed=*] 8 | interface CompressionStream { 9 | constructor(CompressionFormat format); 10 | }; 11 | CompressionStream includes GenericTransformStream; 12 | 13 | [Exposed=*] 14 | interface DecompressionStream { 15 | constructor(CompressionFormat format); 16 | }; 17 | DecompressionStream includes GenericTransformStream; 18 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unstable/DeviceMemory.webidl: -------------------------------------------------------------------------------- 1 | // https://www.w3.org/TR/2022/WD-device-memory-1-20220722 2 | 3 | [ 4 | SecureContext, 5 | Exposed=(Window,Worker) 6 | ] interface mixin NavigatorDeviceMemory { 7 | readonly attribute double deviceMemory; 8 | }; 9 | 10 | Navigator includes NavigatorDeviceMemory; 11 | WorkerNavigator includes NavigatorDeviceMemory; 12 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unstable/GamepadExtensions.webidl: -------------------------------------------------------------------------------- 1 | // https://w3c.github.io/gamepad/extensions.html 2 | 3 | [Exposed=Window, SecureContext] 4 | interface GamepadTouch { 5 | readonly attribute unsigned long touchId; 6 | readonly attribute octet surfaceId; 7 | readonly attribute Float32Array position; 8 | readonly attribute Uint32Array? surfaceDimensions; 9 | }; 10 | 11 | partial interface Gamepad { 12 | readonly attribute FrozenArray? touchEvents; 13 | }; 14 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unstable/RTCRtpReceiver.webidl: -------------------------------------------------------------------------------- 1 | partial interface RTCRtpReceiver { 2 | [SetterThrows] 3 | attribute DOMHighResTimeStamp? jitterBufferTarget; 4 | }; 5 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unstable/RTCRtpSender.webidl: -------------------------------------------------------------------------------- 1 | partial dictionary RTCRtpEncodingParameters { 2 | DOMString scalabilityMode; 3 | }; 4 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unstable/WebXRGamepadsModule.webidl: -------------------------------------------------------------------------------- 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | * WebXR Device API 4 | * W3C Working Draft, 31 March 2022 5 | * The origin of this IDL file is: 6 | * https://www.w3.org/TR/2022/WD-webxr-gamepads-module-1-20220426/ 7 | */ 8 | 9 | partial interface XRInputSource { 10 | [SameObject] readonly attribute Gamepad? gamepad; 11 | }; 12 | -------------------------------------------------------------------------------- /crates/web-sys/webidls/unstable/is-input-pending.webidl: -------------------------------------------------------------------------------- 1 | dictionary IsInputPendingOptions { 2 | boolean includeContinuous = false; 3 | }; 4 | 5 | [Exposed=Window] interface Scheduling { 6 | boolean isInputPending(optional IsInputPendingOptions isInputPendingOptions = {}); 7 | }; 8 | 9 | partial interface Navigator { 10 | readonly attribute Scheduling scheduling; 11 | }; 12 | -------------------------------------------------------------------------------- /crates/webidl-tests/.gitignore: -------------------------------------------------------------------------------- 1 | /generated 2 | -------------------------------------------------------------------------------- /crates/webidl-tests/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/webidl-tests/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/webidl-tests/array_buffer.rs: -------------------------------------------------------------------------------- 1 | use crate::generated::*; 2 | use wasm_bindgen_test::*; 3 | 4 | #[wasm_bindgen_test] 5 | fn take_and_return_a_bunch_of_slices() { 6 | let f = ArrayBufferTest::new().unwrap(); 7 | let x = f.get_buffer(); 8 | f.set_buffer(None); 9 | f.set_buffer(Some(&x)); 10 | let buf = f.get_data_view(); 11 | assert_eq!(buf.get_int8(0), 42); 12 | } 13 | -------------------------------------------------------------------------------- /crates/webidl-tests/build.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::path::PathBuf; 3 | 4 | fn main() { 5 | let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); 6 | wasm_bindgen_webidl::generate( 7 | "webidls".as_ref(), 8 | &out_dir, 9 | wasm_bindgen_webidl::Options { features: false }, 10 | ) 11 | .unwrap(); 12 | } 13 | -------------------------------------------------------------------------------- /crates/webidl-tests/lib.rs: -------------------------------------------------------------------------------- 1 | // Intentionally left blank in order for Cargo to work 2 | -------------------------------------------------------------------------------- /crates/webidl-tests/namespace.rs: -------------------------------------------------------------------------------- 1 | use crate::generated::*; 2 | use wasm_bindgen_test::*; 3 | 4 | #[wasm_bindgen_test] 5 | fn simple_namespace_test() { 6 | assert_eq!(math_test::add_one(1), 2); 7 | assert_eq!(math_test::pow(1.0, 100.0), 1.0); 8 | assert_eq!(math_test::pow(10.0, 2.0), 100.0); 9 | } 10 | -------------------------------------------------------------------------------- /crates/webidl-tests/no_interface.rs: -------------------------------------------------------------------------------- 1 | use crate::generated::*; 2 | use wasm_bindgen_test::*; 3 | 4 | #[wasm_bindgen_test] 5 | fn smoke() { 6 | let obj = GetNoInterfaceObject::get(); 7 | assert_eq!(obj.number(), 3.0); 8 | obj.foo(); 9 | } 10 | -------------------------------------------------------------------------------- /crates/webidl-tests/promise.rs: -------------------------------------------------------------------------------- 1 | use crate::generated::*; 2 | use wasm_bindgen_futures::JsFuture; 3 | use wasm_bindgen_test::*; 4 | 5 | #[wasm_bindgen_test] 6 | async fn return_promise() { 7 | let f = TestPromises::new().unwrap(); 8 | let v = JsFuture::from(f.string_promise()) 9 | .await 10 | .unwrap() 11 | .as_string() 12 | .unwrap(); 13 | assert_eq!(v, "abc"); 14 | } 15 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/array_buffer.webidl: -------------------------------------------------------------------------------- 1 | [Constructor] 2 | interface ArrayBufferTest { 3 | ArrayBuffer getBuffer(); 4 | undefined setBuffer(ArrayBuffer? b); 5 | DataView getDataView(); 6 | }; 7 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/callbacks.webidl: -------------------------------------------------------------------------------- 1 | callback interface CallbackInterface1 { 2 | undefined foo(); 3 | }; 4 | 5 | callback interface CallbackInterface2 { 6 | undefined foo(); 7 | undefined bar(); 8 | }; 9 | 10 | [Constructor()] 11 | interface TakeCallbackInterface { 12 | undefined a(CallbackInterface1 arg); 13 | undefined b(CallbackInterface2 arg); 14 | }; 15 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/enums.webidl: -------------------------------------------------------------------------------- 1 | enum ShapeType { "circle", "square" }; 2 | 3 | [Constructor(ShapeType kind)] 4 | interface Shape { 5 | static Shape triangle(); 6 | 7 | [Pure] 8 | boolean isSquare(); 9 | 10 | [Pure] 11 | boolean isCircle(); 12 | 13 | [Pure] 14 | ShapeType getShape(); 15 | 16 | readonly attribute ShapeType? shapeTypeNone; 17 | 18 | readonly attribute ShapeType? shapeTypeSome; 19 | }; 20 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/global.webidl: -------------------------------------------------------------------------------- 1 | [Global=x] 2 | interface Global { 3 | unsigned long global_no_args(); 4 | DOMString global_with_args(DOMString a, DOMString b); 5 | attribute DOMString global_attribute; 6 | }; 7 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/maplike.webidl: -------------------------------------------------------------------------------- 1 | [Constructor()] 2 | interface TestReadOnlyMapLike { 3 | readonly maplike; 4 | }; 5 | 6 | [Constructor()] 7 | interface TestReadWriteMapLike { 8 | maplike; 9 | }; 10 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/namespace.webidl: -------------------------------------------------------------------------------- 1 | namespace math_test { 2 | long add_one(long val); 3 | double pow(double base, double exponent); 4 | }; 5 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/no_interface.webidl: -------------------------------------------------------------------------------- 1 | [NoInterfaceObject] 2 | interface NoInterfaceObject { 3 | readonly attribute double number; 4 | undefined foo(); 5 | }; 6 | 7 | interface GetNoInterfaceObject { 8 | static NoInterfaceObject get(); 9 | }; 10 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/promise.webidl: -------------------------------------------------------------------------------- 1 | [Constructor()] 2 | interface TestPromises { 3 | Promise stringPromise(); 4 | }; 5 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/enabled/setlike.webidl: -------------------------------------------------------------------------------- 1 | [Constructor()] 2 | interface TestReadOnlySetLike { 3 | readonly setlike; 4 | }; 5 | 6 | [Constructor()] 7 | interface TestReadWriteSetLike { 8 | setlike; 9 | }; 10 | -------------------------------------------------------------------------------- /crates/webidl-tests/webidls/unstable/unstable.webidl: -------------------------------------------------------------------------------- 1 | enum UnstableEnum { 2 | "a", 3 | "b" 4 | }; 5 | 6 | dictionary UnstableDictionary { 7 | UnstableEnum unstableEnum; 8 | }; 9 | 10 | typedef unsigned long UnstableTypedef; 11 | 12 | [NoInterfaceObject] 13 | partial interface UnstableInterface { 14 | UnstableTypedef enum_value(optional UnstableDictionary unstableDictionary = {}); 15 | }; 16 | 17 | interface GetUnstableInterface { 18 | static UnstableInterface get(); 19 | }; 20 | -------------------------------------------------------------------------------- /crates/webidl/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/webidl/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | pkg 3 | dist 4 | wasm-pack.log 5 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | This directory contains a number of Cargo projects that are all examples of how 4 | to use `wasm-bindgen` in various contexts. More documentation can be [found 5 | online][dox] 6 | 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/index.html 8 | -------------------------------------------------------------------------------- /examples/add/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "add" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /examples/add/README.md: -------------------------------------------------------------------------------- 1 | # Adding numbers (small Wasm files) 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/add.html 7 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/add/ 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/add/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import { add } from './pkg'; 4 | 5 | alert('1 + 2 = ' + add(1, 2)) 6 | -------------------------------------------------------------------------------- /examples/add/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/add/src/lib.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn add(a: u32, b: u32) -> u32 { 5 | a + b 6 | } 7 | -------------------------------------------------------------------------------- /examples/canvas/README.md: -------------------------------------------------------------------------------- 1 | # 2D Canvas 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/canvas/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/2d-canvas.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/canvas/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/canvas/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example. 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/canvas/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/char/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "char" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /examples/char/README.md: -------------------------------------------------------------------------------- 1 | # Working with the `char` type 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/char/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/char.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/char/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/closures/README.md: -------------------------------------------------------------------------------- 1 | # web-sys: Closures 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/closures/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/closures.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/closures/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/closures/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/console_log/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "console_log" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | web-sys = { path = "../../crates/web-sys", features = ['console'] } 14 | 15 | [lints] 16 | workspace = true 17 | -------------------------------------------------------------------------------- /examples/console_log/README.md: -------------------------------------------------------------------------------- 1 | # `console.log` 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/console_log/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/console-log.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/console_log/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Open up the developer console and you should see "Hello from Rust!"

7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/console_log/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/console_log/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/deno/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "deno" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /examples/deno/README.md: -------------------------------------------------------------------------------- 1 | # Using deno 2 | 3 | You can build the example with 4 | 5 | ```sh 6 | $ ./build.sh 7 | ``` 8 | 9 | and test it with 10 | 11 | ```sh 12 | $ deno run --allow-read test.ts 13 | ``` 14 | 15 | The `--allow-read` flag is needed because the Wasm file is read during runtime. 16 | This will be fixed when https://github.com/denoland/deno/issues/2552 is resolved. 17 | -------------------------------------------------------------------------------- /examples/deno/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eux 4 | 5 | cargo build --target wasm32-unknown-unknown --release 6 | cargo run --package wasm-bindgen-cli --bin wasm-bindgen -- \ 7 | --out-dir pkg --target deno ${CARGO_TARGET_DIR:-../../target}/wasm32-unknown-unknown/release/deno.wasm 8 | -------------------------------------------------------------------------------- /examples/deno/crate/.gitignore: -------------------------------------------------------------------------------- 1 | /deno.wasm 2 | -------------------------------------------------------------------------------- /examples/deno/defined-in-js.js: -------------------------------------------------------------------------------- 1 | export class MyClass { 2 | constructor() { 3 | this._number = 42; 4 | } 5 | 6 | get number() { 7 | return this._number; 8 | } 9 | 10 | set number(n) { 11 | return (this._number = n); 12 | } 13 | 14 | render() { 15 | return `My number is: ${this.number}`; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/deno/test.ts: -------------------------------------------------------------------------------- 1 | import { greet } from "./pkg/deno.js"; 2 | 3 | greet("Deno"); 4 | -------------------------------------------------------------------------------- /examples/dom/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "dom" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [dependencies.web-sys] 15 | features = ['Document', 'Element', 'HtmlElement', 'Node', 'Window'] 16 | path = "../../crates/web-sys" 17 | 18 | [lints] 19 | workspace = true 20 | -------------------------------------------------------------------------------- /examples/dom/README.md: -------------------------------------------------------------------------------- 1 | # web-sys: DOM hello world 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/dom/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/dom.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/dom/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

A greeting from rust looks like...

7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/dom/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/dom/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/duck-typed-interfaces/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "rust-duck-typed-interfaces" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /examples/duck-typed-interfaces/README.md: -------------------------------------------------------------------------------- 1 | # Duck-Typed Interfaces Example 2 | 3 | This directory is an example of using duck-typed JS interfaces with `wasm-bindgen`. 4 | 5 | You can build and run the example with: 6 | 7 | ``` 8 | $ npm run serve 9 | ``` 10 | 11 | and then opening up `http://localhost:8080/` in a web browser should show a 12 | smiley face drawn on canvas by Rust and WebAssembly. 13 | -------------------------------------------------------------------------------- /examples/duck-typed-interfaces/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/duck-typed-interfaces/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example. 3 | import('./pkg'); 4 | -------------------------------------------------------------------------------- /examples/duck-typed-interfaces/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/explicit-resource-management/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "explicit-resource-management" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /examples/explicit-resource-management/README.md: -------------------------------------------------------------------------------- 1 | # Using Explicit Resource Management (via Deno) 2 | 3 | You can build the example with 4 | 5 | ```sh 6 | $ ./build.sh 7 | ``` 8 | 9 | and test it with 10 | 11 | ```sh 12 | $ deno run --allow-read test.ts 13 | ``` 14 | 15 | The `--allow-read` flag is needed because the Wasm file is read during runtime. 16 | This will be fixed when https://github.com/denoland/deno/issues/2552 is resolved. 17 | -------------------------------------------------------------------------------- /examples/explicit-resource-management/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eux 4 | 5 | cargo build --target wasm32-unknown-unknown --release 6 | WASM_BINDGEN_EXPERIMENTAL_SYMBOL_DISPOSE=1 cargo run --package wasm-bindgen-cli --bin wasm-bindgen -- \ 7 | --out-dir pkg --target deno ${CARGO_TARGET_DIR:-../../target}/wasm32-unknown-unknown/release/explicit_resource_management.wasm 8 | -------------------------------------------------------------------------------- /examples/explicit-resource-management/crate/.gitignore: -------------------------------------------------------------------------------- 1 | /explicit-resource-management.wasm 2 | -------------------------------------------------------------------------------- /examples/fetch/index.js: -------------------------------------------------------------------------------- 1 | const rust = import('./pkg'); 2 | 3 | rust 4 | .then(m => { 5 | return m.run("rustwasm/wasm-bindgen").then((data) => { 6 | console.log(data); 7 | 8 | console.log("The latest commit to the wasm-bindgen %s branch is:", data.name); 9 | console.log("%s, authored by %s <%s>", data.commit.sha, data.commit.commit.author.name, data.commit.commit.author.email); 10 | }) 11 | }) 12 | .catch(console.error); 13 | -------------------------------------------------------------------------------- /examples/fetch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "guide-supported-types-examples" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | js-sys = { path = "../../crates/js-sys" } 13 | wasm-bindgen = { path = "../../" } 14 | 15 | [lints] 16 | workspace = true 17 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/char.js: -------------------------------------------------------------------------------- 1 | import { 2 | take_char_by_value, 3 | return_char, 4 | } from './guide_supported_types_examples'; 5 | 6 | take_char_by_value('a'); 7 | 8 | let c = return_char(); 9 | console.log(typeof c); // "string" 10 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | // import('./pkg/bootstrap').then(() => { 4 | // console.log("done"); 5 | // }); 6 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/js_value.js: -------------------------------------------------------------------------------- 1 | import { 2 | take_js_value_by_value, 3 | take_js_value_by_shared_ref, 4 | return_js_value, 5 | } from './guide_supported_types_examples'; 6 | 7 | take_js_value_by_value(42); 8 | take_js_value_by_shared_ref('hello'); 9 | 10 | let v = return_js_value(); 11 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/non_null.js: -------------------------------------------------------------------------------- 1 | import { 2 | take_pointer_by_value, 3 | return_pointer, 4 | } from './guide_supported_types_examples'; 5 | import { memory } from './guide_supported_types_examples_bg'; 6 | 7 | let ptr = return_pointer(); 8 | let buf = new Uint8Array(memory.buffer); 9 | let value = buf[ptr]; 10 | console.log(`The byte at the ${ptr} address is ${value}`); 11 | 12 | take_pointer_by_value(ptr); 13 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/number_slices.js: -------------------------------------------------------------------------------- 1 | import { 2 | take_number_slice_by_shared_ref, 3 | take_number_slice_by_exclusive_ref, 4 | } from './guide_supported_types_examples'; 5 | 6 | take_number_slice_by_shared_ref(new Float64Array(100)); 7 | take_number_slice_by_exclusive_ref(new Uint8Array(100)); 8 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/pointers.js: -------------------------------------------------------------------------------- 1 | import { 2 | take_pointer_by_value, 3 | return_pointer, 4 | } from './guide_supported_types_examples'; 5 | import { memory } from './guide_supported_types_examples_bg'; 6 | 7 | let ptr = return_pointer(); 8 | let buf = new Uint8Array(memory.buffer); 9 | let value = buf[ptr]; 10 | console.log(`The byte at the ${ptr} address is ${value}`); 11 | 12 | take_pointer_by_value(ptr); 13 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/bool.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn take_bool_by_value(x: bool) {} 5 | 6 | #[wasm_bindgen] 7 | pub fn return_bool() -> bool { 8 | true 9 | } 10 | 11 | #[wasm_bindgen] 12 | pub fn take_option_bool(x: Option) {} 13 | 14 | #[wasm_bindgen] 15 | pub fn return_option_bool() -> Option { 16 | Some(false) 17 | } 18 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/char.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn take_char_by_value(x: char) {} 5 | 6 | #[wasm_bindgen] 7 | pub fn return_char() -> char { 8 | '🚀' 9 | } 10 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/js_value.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn take_js_value_by_value(x: JsValue) {} 5 | 6 | #[wasm_bindgen] 7 | pub fn take_js_value_by_shared_ref(x: &JsValue) {} 8 | 9 | #[wasm_bindgen] 10 | pub fn return_js_value() -> JsValue { 11 | JsValue::NULL 12 | } 13 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_variables, dead_code, clippy::boxed_local)] 2 | 3 | pub mod bool; 4 | pub mod boxed_js_value_slice; 5 | pub mod boxed_number_slices; 6 | pub mod char; 7 | pub mod exported_types; 8 | pub mod imported_types; 9 | pub mod js_value; 10 | pub mod number_slices; 11 | pub mod numbers; 12 | pub mod pointers; 13 | pub mod str; 14 | pub mod string; 15 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/non_null.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | use std::ptr::NonNull; 3 | use wasm_bindgen::prelude::*; 4 | 5 | #[wasm_bindgen] 6 | pub unsafe fn take_pointer_by_value(x: Option>) { 7 | Box::from_raw(x.unwrap().as_ptr()); 8 | } 9 | 10 | #[wasm_bindgen] 11 | pub fn return_pointer() -> Option> { 12 | Some(NonNull::from(Box::leak(Box::new(42)))) 13 | } 14 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/number_slices.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn take_number_slice_by_shared_ref(x: &[f64]) {} 5 | 6 | #[wasm_bindgen] 7 | pub fn take_number_slice_by_exclusive_ref(x: &mut [u8]) {} 8 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/numbers.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn take_number_by_value(x: u32) {} 5 | 6 | #[wasm_bindgen] 7 | pub fn return_number() -> f64 { 8 | 42.0 9 | } 10 | 11 | #[wasm_bindgen] 12 | pub fn take_option_number(x: Option) {} 13 | 14 | #[wasm_bindgen] 15 | pub fn return_option_number() -> Option { 16 | Some(-300) 17 | } 18 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/pointers.rs: -------------------------------------------------------------------------------- 1 | use std::ptr; 2 | use wasm_bindgen::prelude::*; 3 | 4 | #[wasm_bindgen] 5 | pub fn take_pointer_by_value(x: *mut u8) {} 6 | 7 | #[wasm_bindgen] 8 | pub fn return_pointer() -> *mut u8 { 9 | ptr::null_mut() 10 | } 11 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/str.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn take_str_by_shared_ref(x: &str) {} 5 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/src/string.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | pub fn take_string_by_value(x: String) {} 5 | 6 | #[wasm_bindgen] 7 | pub fn return_string() -> String { 8 | "hello".into() 9 | } 10 | 11 | #[wasm_bindgen] 12 | pub fn take_option_string(x: Option) {} 13 | 14 | #[wasm_bindgen] 15 | pub fn return_option_string() -> Option { 16 | None 17 | } 18 | -------------------------------------------------------------------------------- /examples/guide-supported-types-examples/str.js: -------------------------------------------------------------------------------- 1 | import { 2 | take_str_by_shared_ref, 3 | } from './guide_supported_types_examples'; 4 | 5 | take_str_by_shared_ref('hello'); 6 | -------------------------------------------------------------------------------- /examples/hello_world/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "hello_world" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /examples/hello_world/README.md: -------------------------------------------------------------------------------- 1 | # Hello, World! 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/hello_world/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/hello-world.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/hello_world/index.js: -------------------------------------------------------------------------------- 1 | import { greet } from './pkg'; 2 | 3 | greet('World'); 4 | -------------------------------------------------------------------------------- /examples/hello_world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/hello_world/src/lib.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | extern "C" { 5 | fn alert(s: &str); 6 | } 7 | 8 | #[wasm_bindgen] 9 | pub fn greet(name: &str) { 10 | alert(&format!("Hello, {}!", name)); 11 | } 12 | -------------------------------------------------------------------------------- /examples/import_js/README.md: -------------------------------------------------------------------------------- 1 | # Importing non-browser JS 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/import_js/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/import-js.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/import_js/crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "import_js" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../../" } 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /examples/import_js/crate/defined-in-js.js: -------------------------------------------------------------------------------- 1 | export function name() { 2 | return 'Rust'; 3 | } 4 | 5 | export class MyClass { 6 | constructor() { 7 | this._number = 42; 8 | } 9 | 10 | get number() { 11 | return this._number; 12 | } 13 | 14 | set number(n) { 15 | return this._number = n; 16 | } 17 | 18 | render() { 19 | return `My number is: ${this.number}`; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/import_js/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Open up the developer console and you should see "Hello from Rust!"

7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/import_js/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./crate/pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/import_js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/julia_set/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "julia_set" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [dependencies.web-sys] 15 | features = ['ImageData', 'CanvasRenderingContext2d'] 16 | path = "../../crates/web-sys" 17 | 18 | [lints] 19 | workspace = true 20 | -------------------------------------------------------------------------------- /examples/julia_set/README.md: -------------------------------------------------------------------------------- 1 | # Julia Set 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/julia_set/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/julia.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/julia_set/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/julia_set/styles/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | display: flex; 3 | justify-content: center; 4 | } 5 | 6 | .controls { 7 | display: flex; 8 | align-items: flex-end; 9 | margin-bottom: 1em; 10 | } 11 | 12 | .controls h1 { 13 | margin: 0 .3em 0 0; 14 | font-style: italic; 15 | font-family: 'Times New Roman', Times, serif; 16 | } 17 | 18 | .controls > div { 19 | margin-right: 1em; 20 | } 21 | 22 | button, 23 | input[type="number"] { 24 | margin-bottom: 0; 25 | } 26 | -------------------------------------------------------------------------------- /examples/paint/README.md: -------------------------------------------------------------------------------- 1 | # Paint Example 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/paint/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/paint.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/paint/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/paint/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example. 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/paint/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/performance/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "performance" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | humantime = "2" 13 | wasm-bindgen = { path = "../../" } 14 | 15 | [dependencies.web-sys] 16 | features = ['Window', 'Performance', 'PerformanceTiming'] 17 | path = "../../crates/web-sys" 18 | 19 | [lints] 20 | workspace = true 21 | -------------------------------------------------------------------------------- /examples/performance/README.md: -------------------------------------------------------------------------------- 1 | # web-sys: `performance.now` 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/performance/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/performance.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/performance/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

The developer console should have timing log messages in it

7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/performance/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/performance/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/raytrace-parallel/README.md: -------------------------------------------------------------------------------- 1 | # Parallel Raytracing 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/raytrace.html 7 | [compiled]: https://wasm-bindgen.netlify.app/exbuild/raytrace-parallel/ 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ python3 run.py 13 | ``` 14 | 15 | and then visiting http://localhost:8000 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/raytrace-parallel/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | python3 build.py 6 | -------------------------------------------------------------------------------- /examples/raytrace-parallel/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | import subprocess 4 | 5 | root_dir = os.path.dirname(__file__) 6 | 7 | subprocess.run(["python3", "build.py"], cwd=root_dir).check_returncode() 8 | 9 | subprocess.run(["python3", "server.py"], cwd=root_dir).check_returncode() 10 | -------------------------------------------------------------------------------- /examples/raytrace-parallel/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | python3 build.py 6 | 7 | python3 server.py 8 | -------------------------------------------------------------------------------- /examples/raytrace-parallel/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | components = ["rust-src"] 4 | profile = "minimal" 5 | targets = ["wasm32-unknown-unknown"] 6 | -------------------------------------------------------------------------------- /examples/request-animation-frame/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "request-animation-frame" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [dependencies.web-sys] 15 | features = ['Document', 'Element', 'HtmlElement', 'Node', 'Window'] 16 | path = "../../crates/web-sys" 17 | 18 | [lints] 19 | workspace = true 20 | -------------------------------------------------------------------------------- /examples/request-animation-frame/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

A greeting from rust looks like...

7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/request-animation-frame/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/request-animation-frame/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^3.11.3" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/synchronous-instantiation/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "synchronous-instantiation" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [lints] 15 | workspace = true 16 | -------------------------------------------------------------------------------- /examples/synchronous-instantiation/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | wasm-pack build --target web 6 | -------------------------------------------------------------------------------- /examples/synchronous-instantiation/src/lib.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | 3 | #[wasm_bindgen] 4 | extern "C" { 5 | #[wasm_bindgen(js_namespace = console)] 6 | fn log(value: &str); 7 | } 8 | 9 | #[wasm_bindgen] 10 | pub fn greet(name: &str) { 11 | log(&format!("Hello, {}!", name)); 12 | } 13 | -------------------------------------------------------------------------------- /examples/todomvc/README.md: -------------------------------------------------------------------------------- 1 | # TODO MVC 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/todomvc/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/todomvc.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/todomvc/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | const rust = import('./pkg'); 4 | const css = import('./index.css'); 5 | 6 | rust 7 | .then(m => m.run()) 8 | .catch(console.error); 9 | -------------------------------------------------------------------------------- /examples/todomvc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "css-loader": "^6.11.0", 9 | "html-webpack-plugin": "^5.6.0", 10 | "mini-css-extract-plugin": "^2.9.0", 11 | "webpack": "^5.97.0", 12 | "webpack-cli": "^5.1.4", 13 | "webpack-dev-server": "^5.0.4" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/todomvc/src/build.rs: -------------------------------------------------------------------------------- 1 | extern crate askama; 2 | 3 | fn main() { 4 | askama::rerun_if_templates_changed(); 5 | } 6 | -------------------------------------------------------------------------------- /examples/todomvc/templates/itemsLeft.html: -------------------------------------------------------------------------------- 1 | {{ active_todos }} item{% if active_todos > 1 %}s{% endif %} left 2 | -------------------------------------------------------------------------------- /examples/todomvc/templates/row.html: -------------------------------------------------------------------------------- 1 |
  • 2 |
    3 | 4 | 5 | 6 |
    7 |
  • 8 | -------------------------------------------------------------------------------- /examples/wasm-audio-worklet/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | python3 build.py 6 | -------------------------------------------------------------------------------- /examples/wasm-audio-worklet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Wasm audio worklet 5 | 6 | 7 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/wasm-audio-worklet/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | import subprocess 4 | 5 | root_dir = os.path.dirname(__file__) 6 | 7 | subprocess.run(["python3", "build.py"], cwd=root_dir).check_returncode() 8 | 9 | subprocess.run(["python3", "server.py"], cwd=root_dir).check_returncode() 10 | -------------------------------------------------------------------------------- /examples/wasm-audio-worklet/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | python3 build.py 6 | 7 | python3 server.py 8 | -------------------------------------------------------------------------------- /examples/wasm-audio-worklet/rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | components = ["rust-src"] 4 | profile = "minimal" 5 | targets = ["wasm32-unknown-unknown"] 6 | -------------------------------------------------------------------------------- /examples/wasm-audio-worklet/src/worklet.js: -------------------------------------------------------------------------------- 1 | registerProcessor("WasmProcessor", class WasmProcessor extends AudioWorkletProcessor { 2 | constructor(options) { 3 | super(); 4 | let [module, memory, handle] = options.processorOptions; 5 | bindgen.initSync({ module, memory }); 6 | this.processor = bindgen.WasmAudioProcessor.unpack(handle); 7 | } 8 | process(inputs, outputs) { 9 | return this.processor.process(outputs[0][0]); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm-imports/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "wasm-in-wasm-imports" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | js-sys = { path = "../../crates/js-sys" } 13 | wasm-bindgen = { path = "../../" } 14 | wasm-bindgen-futures = { path = "../../crates/futures" } 15 | 16 | [lints] 17 | workspace = true 18 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm-imports/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

    The developer console should have messages in it

    7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm-imports/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm-imports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm-imports/src/native_add.wasm: -------------------------------------------------------------------------------- 1 | asm`env 2 | native_addmemoryadd 3 | 4 |   -------------------------------------------------------------------------------- /examples/wasm-in-wasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "wasm-in-wasm" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | js-sys = { path = "../../crates/js-sys" } 13 | wasm-bindgen = { path = "../../" } 14 | wasm-bindgen-futures = { path = "../../crates/futures" } 15 | 16 | [lints] 17 | workspace = true 18 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

    The developer console should have messages in it

    7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/wasm-in-wasm/src/add.wasm: -------------------------------------------------------------------------------- 1 | asm`pmemoryadd 2 |   j -------------------------------------------------------------------------------- /examples/wasm-in-web-worker/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | # This example requires to *not* create ES modules, therefore we pass the flag 6 | # `--target no-modules` 7 | wasm-pack build --target no-modules 8 | -------------------------------------------------------------------------------- /examples/weather_report/assets/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustwasm/wasm-bindgen/c35cc9369d5e0dc418986f7811a0dd702fb33ef9/examples/weather_report/assets/images/image.png -------------------------------------------------------------------------------- /examples/weather_report/assets/images/weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustwasm/wasm-bindgen/c35cc9369d5e0dc418986f7811a0dd702fb33ef9/examples/weather_report/assets/images/weather.png -------------------------------------------------------------------------------- /examples/weather_report/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/weather_report/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/webaudio/README.md: -------------------------------------------------------------------------------- 1 | # WebAudio 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/webaudio/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/web-audio.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/webaudio/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/webgl/README.md: -------------------------------------------------------------------------------- 1 | # WebGL Example 2 | 3 | [View documentation for this example online][dox] or [View compiled example 4 | online][compiled] 5 | 6 | [compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/webgl/ 7 | [dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/webgl.html 8 | 9 | You can build the example locally with: 10 | 11 | ``` 12 | $ npm run serve 13 | ``` 14 | 15 | and then visiting http://localhost:8080 in a browser should run the example! 16 | -------------------------------------------------------------------------------- /examples/webgl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/webgl/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example. 3 | import('./pkg') 4 | .catch(console.error); 5 | -------------------------------------------------------------------------------- /examples/webgl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/webrtc_datachannel/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WebRTC DataChannel example 6 | 7 | 8 |

    Open DevTools and check the Console.

    9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/webrtc_datachannel/index.js: -------------------------------------------------------------------------------- 1 | window.addEventListener('load', async () => { 2 | await import('./pkg'); 3 | }); 4 | -------------------------------------------------------------------------------- /examples/webrtc_datachannel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "devDependencies": { 7 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 8 | "html-webpack-plugin": "^5.6.0", 9 | "webpack": "^5.97.0", 10 | "webpack-cli": "^5.1.4", 11 | "webpack-dev-server": "^5.0.4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/websockets/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | wasm-pack build --target web 6 | -------------------------------------------------------------------------------- /examples/websockets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WebSockets example 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/websockets/index.js: -------------------------------------------------------------------------------- 1 | import init from './pkg/websockets.js'; 2 | 3 | window.addEventListener('load', async () => { 4 | await init({ module_or_path: './pkg/websockets_bg.wasm' }); 5 | }); 6 | -------------------------------------------------------------------------------- /examples/webxr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/webxr/index.js: -------------------------------------------------------------------------------- 1 | // For more comments about what's going on here, check out the `hello_world` 2 | // example. 3 | import("./webxr.js") 4 | .catch(e => console.error("Error importing web assembly:", e)); -------------------------------------------------------------------------------- /examples/webxr/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack", 4 | "serve": "webpack serve" 5 | }, 6 | "dependencies": { 7 | "webxr": "./pkg" 8 | }, 9 | "devDependencies": { 10 | "@wasm-tool/wasm-pack-plugin": "1.5.0", 11 | "html-webpack-plugin": "^5.6.0", 12 | "webpack": "^5.97.0", 13 | "webpack-cli": "^5.1.4", 14 | "webpack-dev-server": "^5.0.4" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/webxr/src/utils.rs: -------------------------------------------------------------------------------- 1 | pub fn set_panic_hook() { 2 | // When the `console_error_panic_hook` feature is enabled, we can call the 3 | // `set_panic_hook` function at least once during initialization, and then 4 | // we will get better error messages if our code ever panics. 5 | // 6 | // For more details see 7 | // https://github.com/rustwasm/console_error_panic_hook#readme 8 | #[cfg(feature = "console_error_panic_hook")] 9 | console_error_panic_hook::set_once(); 10 | } 11 | -------------------------------------------------------------------------------- /examples/webxr/webxr.js: -------------------------------------------------------------------------------- 1 | import * as wasm from "./pkg"; 2 | 3 | var xrApp = new wasm.XrApp(); 4 | xrApp.init() 5 | .then(res => { 6 | console.log(res); 7 | xrApp.start(); 8 | }); -------------------------------------------------------------------------------- /examples/without-a-bundler-no-modules/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "without-a-bundler-no-modules" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [dependencies.web-sys] 15 | features = ['Document', 'Element', 'HtmlElement', 'Node', 'Window'] 16 | path = "../../crates/web-sys" 17 | 18 | [lints] 19 | workspace = true 20 | -------------------------------------------------------------------------------- /examples/without-a-bundler-no-modules/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | wasm-pack build --target no-modules 6 | -------------------------------------------------------------------------------- /examples/without-a-bundler/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "without-a-bundler" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [lib] 9 | crate-type = ["cdylib"] 10 | 11 | [dependencies] 12 | wasm-bindgen = { path = "../../" } 13 | 14 | [dependencies.web-sys] 15 | features = ['Document', 'Element', 'HtmlElement', 'Node', 'Window'] 16 | path = "../../crates/web-sys" 17 | 18 | [lints] 19 | workspace = true 20 | -------------------------------------------------------------------------------- /examples/without-a-bundler/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | wasm-pack build --target web 6 | -------------------------------------------------------------------------------- /guide/.gitignore: -------------------------------------------------------------------------------- 1 | book 2 | -------------------------------------------------------------------------------- /guide/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["Nick Fitzgerald"] 3 | multilingual = false 4 | src = "src" 5 | title = "The `wasm-bindgen` Guide" 6 | 7 | [build] 8 | build-dir = "book/html" 9 | 10 | [output.html] 11 | -------------------------------------------------------------------------------- /guide/src/_headers: -------------------------------------------------------------------------------- 1 | /* 2 | Cross-Origin-Opener-Policy: same-origin 3 | Cross-Origin-Embedder-Policy: require-corp 4 | -------------------------------------------------------------------------------- /guide/src/contributing/js-sys/testing.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | You can test the `js-sys` crate by running `cargo test --target 4 | wasm32-unknown-unknown` within the `crates/js-sys` directory in the 5 | `wasm-bindgen` repository: 6 | 7 | ```sh 8 | cd wasm-bindgen/crates/js-sys 9 | cargo test --target wasm32-unknown-unknown 10 | ``` 11 | 12 | These tests are largely executed in Node.js right now via the 13 | [`wasm-bindgen-test` framework](../../wasm-bindgen-test/index.html) 14 | -------------------------------------------------------------------------------- /guide/src/examples/2d-canvas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rustwasm/wasm-bindgen/c35cc9369d5e0dc418986f7811a0dd702fb33ef9/guide/src/examples/2d-canvas.png -------------------------------------------------------------------------------- /guide/src/reference/attributes/index.md: -------------------------------------------------------------------------------- 1 | # `#[wasm_bindgen]` Attributes 2 | 3 | The `#[wasm_bindgen]` macro supports a good amount of configuration for 4 | controlling precisely how exports are exported, how imports are imported, and 5 | what the generated JavaScript glue ends up looking like. This section is an 6 | exhaustive reference of the possibilities! 7 | -------------------------------------------------------------------------------- /guide/src/reference/attributes/on-js-imports/index.md: -------------------------------------------------------------------------------- 1 | # `#[wasm_bindgen]` on JavaScript Imports 2 | 3 | This section enumerates the attributes available for customizing bindings for 4 | JavaScript functions and classes imported into Rust within an `extern "C" { ... }` 5 | block. 6 | -------------------------------------------------------------------------------- /guide/src/reference/attributes/on-rust-exports/index.md: -------------------------------------------------------------------------------- 1 | # `#[wasm_bindgen]` on Rust Exports 2 | 3 | This section enumerates the attributes available for customizing bindings for 4 | Rust functions and `struct`s exported to JavaScript. 5 | -------------------------------------------------------------------------------- /guide/src/reference/index.md: -------------------------------------------------------------------------------- 1 | # Reference 2 | 3 | This section contains reference material for using `wasm-bindgen`. It is not 4 | intended to be read start to finish. Instead, it aims to quickly answer 5 | questions like: 6 | 7 | * Is type X supported as a parameter in a Rust function exported to JavaScript? 8 | 9 | * What was that CLI flag to disable ECMAScript modules output, and instead 10 | attach the JavaScript bindings directly to `window`? 11 | -------------------------------------------------------------------------------- /guide/src/reference/types.md: -------------------------------------------------------------------------------- 1 | # Supported Rust Types and their JavaScript Representations 2 | 3 | This section provides an overview of all the types that `wasm-bindgen` can send 4 | and receive across the WebAssembly ABI boundary, and how they translate into 5 | JavaScript. 6 | -------------------------------------------------------------------------------- /releases/friends.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | set -o pipefail 5 | 6 | cd $(dirname $0) 7 | 8 | if [[ -z "${1+x}" ]]; then 9 | read -p "List friends since which commit/tag? " since 10 | echo 11 | else 12 | since=$1 13 | fi 14 | 15 | git shortlog -s -n "$since.." \ 16 | | cut -f 2- \ 17 | | sort -u \ 18 | | grep -v bors\-servo \ 19 | | xargs -d '\n' -I{} echo "- {}" 20 | -------------------------------------------------------------------------------- /src/cache/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod intern; 2 | -------------------------------------------------------------------------------- /src/convert/mod.rs: -------------------------------------------------------------------------------- 1 | //! # ⚠️ Unstable 2 | //! 3 | //! This is an internal module, no stability guarantees are provided. Use at 4 | //! your own risk. 5 | 6 | #![allow(clippy::missing_safety_doc)] 7 | 8 | mod closures; 9 | mod impls; 10 | mod slices; 11 | mod traits; 12 | 13 | pub use self::impls::*; 14 | pub use self::slices::WasmSlice; 15 | pub use self::traits::*; 16 | -------------------------------------------------------------------------------- /src/link.rs: -------------------------------------------------------------------------------- 1 | // see comment in module above this in `link_mem_intrinsics` 2 | #[inline(never)] 3 | #[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))] 4 | pub fn link_intrinsics() {} 5 | -------------------------------------------------------------------------------- /taplo.toml: -------------------------------------------------------------------------------- 1 | [formatting] 2 | allowed_blank_lines = 1 3 | column_width = 100 4 | reorder_keys = true 5 | 6 | [[rule]] 7 | formatting = { array_auto_expand = false, reorder_keys = false } 8 | include = ["crates/web-sys/Cargo.toml"] 9 | keys = ["features"] 10 | -------------------------------------------------------------------------------- /tests/crates/a/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "wasm-bindgen-test-crate-a" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [dependencies] 9 | wasm-bindgen = { path = '../../..' } 10 | -------------------------------------------------------------------------------- /tests/crates/a/src/lib.rs: -------------------------------------------------------------------------------- 1 | extern crate wasm_bindgen; 2 | 3 | use wasm_bindgen::prelude::*; 4 | 5 | #[wasm_bindgen(module = "tests/wasm/duplicate_deps.js")] 6 | extern "C" { 7 | fn foo(); 8 | } 9 | 10 | pub fn test() { 11 | foo(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/crates/b/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "wasm-bindgen-test-crate-b" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [dependencies] 9 | wasm-bindgen = { path = '../../..' } 10 | -------------------------------------------------------------------------------- /tests/crates/b/src/lib.rs: -------------------------------------------------------------------------------- 1 | extern crate wasm_bindgen; 2 | 3 | use wasm_bindgen::prelude::*; 4 | 5 | #[wasm_bindgen(module = "tests/wasm/duplicate_deps.js")] 6 | extern "C" { 7 | fn foo(x: u32); 8 | } 9 | 10 | pub fn test() { 11 | foo(10); 12 | } 13 | -------------------------------------------------------------------------------- /tests/headless/main.js: -------------------------------------------------------------------------------- 1 | export function import_export_same_name() { 2 | } 3 | -------------------------------------------------------------------------------- /tests/headless/modules.js: -------------------------------------------------------------------------------- 1 | export function get_five() { 2 | return 5; 3 | } 4 | -------------------------------------------------------------------------------- /tests/headless/modules.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_test::*; 3 | 4 | #[wasm_bindgen(raw_module = "./tests/headless/modules.js")] 5 | extern "C" { 6 | fn get_five() -> u32; 7 | } 8 | 9 | #[wasm_bindgen_test] 10 | fn test_get_five() { 11 | assert_eq!(get_five(), 5); 12 | } 13 | -------------------------------------------------------------------------------- /tests/headless/snippets1.js: -------------------------------------------------------------------------------- 1 | export function get_two() { 2 | return 2; 3 | } 4 | 5 | let a = 0; 6 | export function get_stateful() { 7 | a += 1; 8 | return a; 9 | } 10 | -------------------------------------------------------------------------------- /tests/headless/strings.js: -------------------------------------------------------------------------------- 1 | export function test_string_roundtrip(f) { 2 | const test = expected => { 3 | const actual = f(expected); 4 | if (actual === expected) 5 | return; 6 | throw new Error(`string roundtrip "${actual}" != "${expected}"`); 7 | }; 8 | 9 | test(''); 10 | test('a'); 11 | test('💖'); 12 | 13 | test('a longer string'); 14 | test('a longer 💖 string'); 15 | 16 | test('\uFEFFbar'); 17 | } 18 | 19 | export function identity(s) { 20 | return s; 21 | } 22 | -------------------------------------------------------------------------------- /tests/must_use.rs: -------------------------------------------------------------------------------- 1 | //! This test validates that the generated bindings don't cause linting warnings 2 | //! when used with structs annotated with `#[must_use]`. 3 | 4 | #![deny(unused)] 5 | 6 | use wasm_bindgen::prelude::*; 7 | 8 | #[wasm_bindgen] 9 | #[must_use] 10 | pub struct MustUse {} 11 | -------------------------------------------------------------------------------- /tests/no-std/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["The wasm-bindgen Developers"] 3 | edition = "2021" 4 | name = "no-std" 5 | publish = false 6 | version = "0.0.0" 7 | 8 | [dependencies] 9 | wasm-bindgen = { path = '../..', default-features = false } 10 | -------------------------------------------------------------------------------- /tests/wasm/3944.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::mem_forget)] 2 | 3 | use wasm_bindgen::prelude::*; 4 | 5 | #[wasm_bindgen] 6 | struct Foo2; 7 | -------------------------------------------------------------------------------- /tests/wasm/arg_names.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_test::*; 3 | 4 | #[wasm_bindgen(module = "tests/wasm/arg_names.js")] 5 | extern "C" { 6 | fn js_arg_names(); 7 | } 8 | 9 | #[wasm_bindgen] 10 | pub fn fn_with_many_args(_a: i32, _b: i32, _c: i32, _d: i32) {} 11 | 12 | #[wasm_bindgen_test] 13 | fn rust_arg_names() { 14 | js_arg_names(); 15 | } 16 | -------------------------------------------------------------------------------- /tests/wasm/duplicate_deps.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | 3 | let next = null; 4 | 5 | exports.assert_next_undefined = function() { 6 | next = undefined; 7 | }; 8 | 9 | exports.assert_next_ten = function() { 10 | next = 10; 11 | }; 12 | 13 | exports.foo = function(a) { 14 | console.log(a, next); 15 | assert.strictEqual(a, next); 16 | next = null; 17 | }; 18 | -------------------------------------------------------------------------------- /tests/wasm/duplicate_deps.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_test::*; 3 | use wasm_bindgen_test_crate_a as a; 4 | use wasm_bindgen_test_crate_b as b; 5 | 6 | #[wasm_bindgen(module = "tests/wasm/duplicate_deps.js")] 7 | extern "C" { 8 | fn assert_next_undefined(); 9 | fn assert_next_ten(); 10 | } 11 | 12 | #[wasm_bindgen_test] 13 | fn works() { 14 | assert_next_undefined(); 15 | a::test(); 16 | assert_next_ten(); 17 | b::test(); 18 | } 19 | -------------------------------------------------------------------------------- /tests/wasm/duplicates_a.js: -------------------------------------------------------------------------------- 1 | exports.foo = () => {}; 2 | exports.bar = 3; 3 | -------------------------------------------------------------------------------- /tests/wasm/duplicates_b.js: -------------------------------------------------------------------------------- 1 | exports.foo = () => true; 2 | exports.bar = 4; 3 | -------------------------------------------------------------------------------- /tests/wasm/duplicates_c.js: -------------------------------------------------------------------------------- 1 | exports.foo = () => false; 2 | exports.bar = 5; 3 | -------------------------------------------------------------------------------- /tests/wasm/final.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | 3 | exports.MyType = class { 4 | static foo(y) { 5 | assert.equal(y, 'x'); 6 | return y + 'y'; 7 | } 8 | 9 | constructor(x) { 10 | assert.equal(x, 2); 11 | this._a = 1; 12 | } 13 | 14 | bar(x) { 15 | assert.equal(x, true); 16 | return 3.2; 17 | } 18 | 19 | get a() { 20 | return this._a; 21 | } 22 | set a(v) { 23 | this._a = v; 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /tests/wasm/ignore.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen_test::wasm_bindgen_test; 2 | 3 | #[wasm_bindgen_test] 4 | #[ignore] 5 | fn should_panic() { 6 | panic!() 7 | } 8 | 9 | #[wasm_bindgen_test] 10 | #[ignore = "reason"] 11 | fn should_panic_string() { 12 | panic!() 13 | } 14 | -------------------------------------------------------------------------------- /tests/wasm/imports_2.js: -------------------------------------------------------------------------------- 1 | exports.same_name_from_import = (a) => a * 4; 2 | 3 | exports.same_js_namespace_from_module = { 4 | func_from_module_2_same_js_namespace: (a) => a * 6 5 | } -------------------------------------------------------------------------------- /tests/wasm/js_vec.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const wasm = require('wasm-bindgen-test'); 3 | 4 | // Test if passing large arrays which cause allocation in Wasm are properly handled. 5 | exports.pass_array_with_allocation = () => { 6 | const values = new Array(10_000).fill(1) 7 | assert.strictEqual(wasm.test_sum(values), 10_000); 8 | }; 9 | -------------------------------------------------------------------------------- /tests/wasm/link_to.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const url = require('url'); 3 | 4 | exports.read_file = (str) => fs.readFileSync(url.fileURLToPath(str), "utf8"); 5 | -------------------------------------------------------------------------------- /tests/wasm/linked_module.js: -------------------------------------------------------------------------------- 1 | // linked module 2 | -------------------------------------------------------------------------------- /tests/wasm/macro_rules.rs: -------------------------------------------------------------------------------- 1 | //! This tests that the `wasm_bindgen` macro produces code that compiles for this use case. 2 | //! `cargo test --target wasm32-unknown-unknown` will not run if this test breaks. 3 | use wasm_bindgen::prelude::*; 4 | 5 | macro_rules! my_export { 6 | ($i: ident, $s: ty) => { 7 | #[wasm_bindgen] 8 | pub fn $i(_: $s) {} 9 | }; 10 | } 11 | 12 | my_export!(should_compile, &[i32]); 13 | -------------------------------------------------------------------------------- /tests/wasm/rethrow.js: -------------------------------------------------------------------------------- 1 | const wasm = require('wasm-bindgen-test.js'); 2 | const assert = require('assert'); 3 | 4 | exports.call_throw_one = function() { 5 | try { 6 | wasm.throw_one(); 7 | } catch (e) { 8 | assert.strictEqual(e, 1); 9 | } 10 | }; 11 | 12 | exports.call_ok = function() { 13 | wasm.nothrow(); 14 | }; 15 | -------------------------------------------------------------------------------- /tests/wasm/should_panic.rs: -------------------------------------------------------------------------------- 1 | #[wasm_bindgen_test] 2 | #[should_panic] 3 | fn should_panic() { 4 | panic!() 5 | } 6 | 7 | #[wasm_bindgen_test] 8 | #[should_panic = "error message"] 9 | fn should_panic_string() { 10 | panic!("error message") 11 | } 12 | 13 | #[wasm_bindgen_test] 14 | #[should_panic(expected = "error message")] 15 | fn should_panic_expected() { 16 | panic!("error message") 17 | } 18 | -------------------------------------------------------------------------------- /tests/wasm/structural.js: -------------------------------------------------------------------------------- 1 | const wasm = require('wasm-bindgen-test.js'); 2 | const assert = require('assert'); 3 | 4 | exports.js_works = () => { 5 | let called = false; 6 | wasm.run({ 7 | bar() { 8 | called = true; 9 | }, 10 | baz: 1, 11 | }); 12 | assert.strictEqual(called, true); 13 | }; 14 | -------------------------------------------------------------------------------- /tests/wasm/vendor_prefix.js: -------------------------------------------------------------------------------- 1 | exports.import_me = function() {}; 2 | 3 | global.webkitMySpecialApi = class { 4 | foo() { return 123; } 5 | }; 6 | global.MySpecialApi2 = class { 7 | foo() { return 124; } 8 | }; 9 | global.bMySpecialApi3 = class { 10 | foo() { return 125; } 11 | }; 12 | -------------------------------------------------------------------------------- /tests/worker/dedicated.rs: -------------------------------------------------------------------------------- 1 | #![cfg(target_arch = "wasm32")] 2 | 3 | extern crate js_sys; 4 | extern crate wasm_bindgen; 5 | extern crate wasm_bindgen_test; 6 | 7 | use wasm_bindgen::prelude::*; 8 | use wasm_bindgen_test::wasm_bindgen_test_configure; 9 | 10 | wasm_bindgen_test_configure!(run_in_dedicated_worker); 11 | 12 | pub mod modules; 13 | 14 | // should not be executed 15 | #[wasm_bindgen(start)] 16 | fn start() { 17 | panic!(); 18 | } 19 | -------------------------------------------------------------------------------- /tests/worker/modules.js: -------------------------------------------------------------------------------- 1 | export function get_five() { 2 | return 5; 3 | } 4 | -------------------------------------------------------------------------------- /tests/worker/modules.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_test::*; 3 | 4 | #[wasm_bindgen(raw_module = "./tests/worker/modules.js")] 5 | extern "C" { 6 | fn get_five() -> u32; 7 | } 8 | 9 | #[wasm_bindgen_test] 10 | fn test_get_five() { 11 | assert_eq!(get_five(), 5); 12 | } 13 | -------------------------------------------------------------------------------- /tests/worker/service.rs: -------------------------------------------------------------------------------- 1 | #![cfg(target_arch = "wasm32")] 2 | 3 | extern crate js_sys; 4 | extern crate wasm_bindgen; 5 | extern crate wasm_bindgen_test; 6 | 7 | use wasm_bindgen::prelude::*; 8 | use wasm_bindgen_test::wasm_bindgen_test_configure; 9 | 10 | wasm_bindgen_test_configure!(run_in_service_worker); 11 | 12 | pub mod modules; 13 | 14 | // should not be executed 15 | #[wasm_bindgen(start)] 16 | fn start() { 17 | panic!(); 18 | } 19 | -------------------------------------------------------------------------------- /tests/worker/shared.rs: -------------------------------------------------------------------------------- 1 | #![cfg(target_arch = "wasm32")] 2 | 3 | extern crate js_sys; 4 | extern crate wasm_bindgen; 5 | extern crate wasm_bindgen_test; 6 | 7 | use wasm_bindgen::prelude::*; 8 | use wasm_bindgen_test::wasm_bindgen_test_configure; 9 | 10 | wasm_bindgen_test_configure!(run_in_shared_worker); 11 | 12 | pub mod modules; 13 | 14 | // should not be executed 15 | #[wasm_bindgen(start)] 16 | fn start() { 17 | panic!(); 18 | } 19 | --------------------------------------------------------------------------------