Skip to content

Upgrade WebAssembly JS IDLs #752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19039,7 +19039,7 @@ declare namespace WebAssembly {

var Global: {
prototype: Global;
new(descriptor: GlobalDescriptor, value?: any): Global;
new(descriptor: GlobalDescriptor, v?: any): Global;
};

interface Instance {
Expand Down Expand Up @@ -19075,9 +19075,9 @@ declare namespace WebAssembly {
var Module: {
prototype: Module;
new(bytes: BufferSource): Module;
customSections(module: Module, sectionName: string): ArrayBuffer[];
exports(module: Module): ModuleExportDescriptor[];
imports(module: Module): ModuleImportDescriptor[];
customSections(moduleObject: Module, sectionName: string): ArrayBuffer[];
exports(moduleObject: Module): ModuleExportDescriptor[];
imports(moduleObject: Module): ModuleImportDescriptor[];
};

interface RuntimeError {
Expand All @@ -19102,7 +19102,7 @@ declare namespace WebAssembly {

interface GlobalDescriptor {
mutable?: boolean;
value: string;
value: ValueType;
}

interface MemoryDescriptor {
Expand Down Expand Up @@ -19135,8 +19135,10 @@ declare namespace WebAssembly {
type ImportExportKind = "function" | "table" | "memory" | "global";
type TableKind = "anyfunc";
function compile(bytes: BufferSource): Promise<Module>;
function compileStreaming(source: Response | Promise<Response>): Promise<Module>;
function instantiate(bytes: BufferSource, importObject?: any): Promise<WebAssemblyInstantiatedSource>;
function instantiate(moduleObject: Module, importObject?: any): Promise<Instance>;
function instantiateStreaming(source: Response | Promise<Response>, importObject?: any): Promise<WebAssemblyInstantiatedSource>;
function validate(bytes: BufferSource): boolean;
}

Expand Down Expand Up @@ -20095,6 +20097,7 @@ type TouchType = "direct" | "stylus";
type Transport = "usb" | "nfc" | "ble";
type UserVerificationRequirement = "required" | "preferred" | "discouraged";
type VRDisplayEventReason = "mounted" | "navigation" | "requested" | "unmounted";
type ValueType = "i32" | "i64" | "f32" | "f64";
type VideoFacingModeEnum = "user" | "environment" | "left" | "right";
type VisibilityState = "hidden" | "visible" | "prerender";
type WebGLPowerPreference = "default" | "low-power" | "high-performance";
Expand Down
13 changes: 8 additions & 5 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5600,7 +5600,7 @@ declare namespace WebAssembly {

var Global: {
prototype: Global;
new(descriptor: GlobalDescriptor, value?: any): Global;
new(descriptor: GlobalDescriptor, v?: any): Global;
};

interface Instance {
Expand Down Expand Up @@ -5628,9 +5628,9 @@ declare namespace WebAssembly {
var Module: {
prototype: Module;
new(bytes: BufferSource): Module;
customSections(module: Module, sectionName: string): ArrayBuffer[];
exports(module: Module): ModuleExportDescriptor[];
imports(module: Module): ModuleImportDescriptor[];
customSections(moduleObject: Module, sectionName: string): ArrayBuffer[];
exports(moduleObject: Module): ModuleExportDescriptor[];
imports(moduleObject: Module): ModuleImportDescriptor[];
};

interface Table {
Expand All @@ -5647,7 +5647,7 @@ declare namespace WebAssembly {

interface GlobalDescriptor {
mutable?: boolean;
value: string;
value: ValueType;
}

interface MemoryDescriptor {
Expand Down Expand Up @@ -5680,8 +5680,10 @@ declare namespace WebAssembly {
type ImportExportKind = "function" | "table" | "memory" | "global";
type TableKind = "anyfunc";
function compile(bytes: BufferSource): Promise<Module>;
function compileStreaming(source: Response | Promise<Response>): Promise<Module>;
function instantiate(bytes: BufferSource, importObject?: any): Promise<WebAssemblyInstantiatedSource>;
function instantiate(moduleObject: Module, importObject?: any): Promise<Instance>;
function instantiateStreaming(source: Response | Promise<Response>, importObject?: any): Promise<WebAssemblyInstantiatedSource>;
function validate(bytes: BufferSource): boolean;
}

Expand Down Expand Up @@ -5855,6 +5857,7 @@ type RequestRedirect = "follow" | "error" | "manual";
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant";
type ServiceWorkerUpdateViaCache = "imports" | "all" | "none";
type ValueType = "i32" | "i64" | "f32" | "f64";
type VisibilityState = "hidden" | "visible" | "prerender";
type WebGLPowerPreference = "default" | "low-power" | "high-performance";
type WorkerType = "classic" | "module";
Expand Down
17 changes: 12 additions & 5 deletions inputfiles/idl/WebAssembly JavaScript Interface.widl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ dictionary ModuleImportDescriptor {

[LegacyNamespace=WebAssembly, Constructor(BufferSource bytes), Exposed=(Window,Worker,Worklet)]
interface Module {
static sequence<ModuleExportDescriptor> exports(Module module);
static sequence<ModuleImportDescriptor> imports(Module module);
static sequence<ArrayBuffer> customSections(Module module, USVString sectionName);
static sequence<ModuleExportDescriptor> exports(Module moduleObject);
static sequence<ModuleImportDescriptor> imports(Module moduleObject);
static sequence<ArrayBuffer> customSections(Module moduleObject, DOMString sectionName);
};

[LegacyNamespace=WebAssembly, Constructor(Module module, optional object importObject), Exposed=(Window,Worker,Worklet)]
Expand Down Expand Up @@ -77,12 +77,19 @@ interface Table {
readonly attribute unsigned long length;
};

enum ValueType {
"i32",
"i64",
"f32",
"f64"
};

dictionary GlobalDescriptor {
required USVString value;
required ValueType value;
boolean mutable = false;
};

[LegacyNamespace=WebAssembly, Constructor(GlobalDescriptor descriptor, optional any value), Exposed=(Window,Worker,Worklet)]
[LegacyNamespace=WebAssembly, Constructor(GlobalDescriptor descriptor, optional any v), Exposed=(Window,Worker,Worklet)]
interface Global {
any valueOf();
attribute any value;
Expand Down
5 changes: 5 additions & 0 deletions inputfiles/idl/WebAssembly Web API.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
partial namespace WebAssembly {
Promise<Module> compileStreaming(Promise<Response> source);
Promise<WebAssemblyInstantiatedSource> instantiateStreaming(
Promise<Response> source, optional object importObject);
};
4 changes: 4 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@
"url": "https://www.w3.org/TR/wasm-js-api-1/",
"title": "WebAssembly JavaScript Interface"
},
{
"url": "https://www.w3.org/TR/wasm-web-api-1/",
"title": "WebAssembly Web API"
},
{
"url": "https://webaudio.github.io/web-audio-api/",
"title": "Web Audio"
Expand Down