diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/interfaces/wasm-js-api.idl | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/interfaces/wasm-js-api.idl')
-rw-r--r-- | testing/web-platform/tests/interfaces/wasm-js-api.idl | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/testing/web-platform/tests/interfaces/wasm-js-api.idl b/testing/web-platform/tests/interfaces/wasm-js-api.idl new file mode 100644 index 0000000000..0d4384251d --- /dev/null +++ b/testing/web-platform/tests/interfaces/wasm-js-api.idl @@ -0,0 +1,110 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: WebAssembly JavaScript Interface (https://webassembly.github.io/spec/js-api/) + +dictionary WebAssemblyInstantiatedSource { + required Module module; + required Instance instance; +}; + +[Exposed=*] +namespace WebAssembly { + boolean validate(BufferSource bytes); + Promise<Module> compile(BufferSource bytes); + + Promise<WebAssemblyInstantiatedSource> instantiate( + BufferSource bytes, optional object importObject); + + Promise<Instance> instantiate( + Module moduleObject, optional object importObject); +}; + +enum ImportExportKind { + "function", + "table", + "memory", + "global" +}; + +dictionary ModuleExportDescriptor { + required USVString name; + required ImportExportKind kind; + // Note: Other fields such as signature may be added in the future. +}; + +dictionary ModuleImportDescriptor { + required USVString module; + required USVString name; + required ImportExportKind kind; +}; + +[LegacyNamespace=WebAssembly, Exposed=*] +interface Module { + constructor(BufferSource bytes); + static sequence<ModuleExportDescriptor> exports(Module moduleObject); + static sequence<ModuleImportDescriptor> imports(Module moduleObject); + static sequence<ArrayBuffer> customSections(Module moduleObject, DOMString sectionName); +}; + +[LegacyNamespace=WebAssembly, Exposed=*] +interface Instance { + constructor(Module module, optional object importObject); + readonly attribute object exports; +}; + +dictionary MemoryDescriptor { + required [EnforceRange] unsigned long initial; + [EnforceRange] unsigned long maximum; +}; + +[LegacyNamespace=WebAssembly, Exposed=*] +interface Memory { + constructor(MemoryDescriptor descriptor); + unsigned long grow([EnforceRange] unsigned long delta); + readonly attribute ArrayBuffer buffer; +}; + +enum TableKind { + "externref", + "anyfunc", + // Note: More values may be added in future iterations, + // e.g., typed function references, typed GC references +}; + +dictionary TableDescriptor { + required TableKind element; + required [EnforceRange] unsigned long initial; + [EnforceRange] unsigned long maximum; +}; + +[LegacyNamespace=WebAssembly, Exposed=*] +interface Table { + constructor(TableDescriptor descriptor, optional any value); + unsigned long grow([EnforceRange] unsigned long delta, optional any value); + any get([EnforceRange] unsigned long index); + undefined set([EnforceRange] unsigned long index, optional any value); + readonly attribute unsigned long length; +}; + +enum ValueType { + "i32", + "i64", + "f32", + "f64", + "v128", + "externref", + "anyfunc", +}; + +dictionary GlobalDescriptor { + required ValueType value; + boolean mutable = false; +}; + +[LegacyNamespace=WebAssembly, Exposed=*] +interface Global { + constructor(GlobalDescriptor descriptor, optional any v); + any valueOf(); + attribute any value; +}; |