@webref/idl 3.21.0 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,19 +4,15 @@
4
4
  // Source: CSS View Transitions Module Level 1 (https://drafts.csswg.org/css-view-transitions-1/)
5
5
 
6
6
  partial interface Document {
7
- ViewTransition createTransition(ViewTransitionInit init);
8
- };
9
-
10
- dictionary ViewTransitionInit {
11
- required UpdateDOMCallback updateDOM;
7
+ ViewTransition startViewTransition(optional UpdateDOMCallback? callback = null);
12
8
  };
13
9
 
14
10
  callback UpdateDOMCallback = Promise<any> ();
15
11
 
16
12
  [Exposed=Window]
17
13
  interface ViewTransition {
18
- undefined skipTransition();
19
- readonly attribute Promise<undefined> finished;
20
- readonly attribute Promise<undefined> ready;
21
- readonly attribute Promise<undefined> domUpdated;
14
+ undefined skipTransition();
15
+ readonly attribute Promise<undefined> finished;
16
+ readonly attribute Promise<undefined> ready;
17
+ readonly attribute Promise<undefined> domUpdated;
22
18
  };
@@ -22,18 +22,3 @@ partial interface Window {
22
22
  attribute EventHandler onappinstalled;
23
23
  attribute EventHandler onbeforeinstallprompt;
24
24
  };
25
-
26
- [Exposed=Window] interface LaunchParams {
27
- readonly attribute DOMString? targetURL;
28
- readonly attribute FrozenArray<FileSystemHandle> files;
29
- };
30
-
31
- callback LaunchConsumer = any (LaunchParams params);
32
-
33
- partial interface Window {
34
- readonly attribute LaunchQueue launchQueue;
35
- };
36
-
37
- [Exposed=Window] interface LaunchQueue {
38
- undefined setConsumer(LaunchConsumer consumer);
39
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webref/idl",
3
3
  "description": "Web IDL definitions of the web platform",
4
- "version": "3.21.0",
4
+ "version": "3.22.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/w3c/webref.git"
@@ -0,0 +1,19 @@
1
+ // GENERATED CONTENT - DO NOT EDIT
2
+ // Content was automatically extracted by Reffy into webref
3
+ // (https://github.com/w3c/webref)
4
+ // Source: Web App Launch Handler API (https://wicg.github.io/web-app-launch/)
5
+
6
+ [Exposed=Window] interface LaunchParams {
7
+ readonly attribute DOMString? targetURL;
8
+ readonly attribute FrozenArray<FileSystemHandle> files;
9
+ };
10
+
11
+ callback LaunchConsumer = any (LaunchParams params);
12
+
13
+ partial interface Window {
14
+ readonly attribute LaunchQueue launchQueue;
15
+ };
16
+
17
+ [Exposed=Window] interface LaunchQueue {
18
+ undefined setConsumer(LaunchConsumer consumer);
19
+ };
package/webaudio.idl CHANGED
@@ -4,9 +4,9 @@
4
4
  // Source: Web Audio API (https://webaudio.github.io/web-audio-api/)
5
5
 
6
6
  enum AudioContextState {
7
- "suspended",
8
- "running",
9
- "closed"
7
+ "suspended",
8
+ "running",
9
+ "closed"
10
10
  };
11
11
 
12
12
  callback DecodeErrorCallback = undefined (DOMException error);
@@ -15,604 +15,604 @@ callback DecodeSuccessCallback = undefined (AudioBuffer decodedData);
15
15
 
16
16
  [Exposed=Window]
17
17
  interface BaseAudioContext : EventTarget {
18
- readonly attribute AudioDestinationNode destination;
19
- readonly attribute float sampleRate;
20
- readonly attribute double currentTime;
21
- readonly attribute AudioListener listener;
22
- readonly attribute AudioContextState state;
23
- [SameObject, SecureContext]
24
- readonly attribute AudioWorklet audioWorklet;
25
- attribute EventHandler onstatechange;
26
-
27
- AnalyserNode createAnalyser ();
28
- BiquadFilterNode createBiquadFilter ();
29
- AudioBuffer createBuffer (unsigned long numberOfChannels,
30
- unsigned long length,
31
- float sampleRate);
32
- AudioBufferSourceNode createBufferSource ();
33
- ChannelMergerNode createChannelMerger (optional unsigned long numberOfInputs = 6);
34
- ChannelSplitterNode createChannelSplitter (
35
- optional unsigned long numberOfOutputs = 6);
36
- ConstantSourceNode createConstantSource ();
37
- ConvolverNode createConvolver ();
38
- DelayNode createDelay (optional double maxDelayTime = 1.0);
39
- DynamicsCompressorNode createDynamicsCompressor ();
40
- GainNode createGain ();
41
- IIRFilterNode createIIRFilter (sequence<double> feedforward,
42
- sequence<double> feedback);
43
- OscillatorNode createOscillator ();
44
- PannerNode createPanner ();
45
- PeriodicWave createPeriodicWave (sequence<float> real,
46
- sequence<float> imag,
47
- optional PeriodicWaveConstraints constraints = {});
48
- ScriptProcessorNode createScriptProcessor(
49
- optional unsigned long bufferSize = 0,
50
- optional unsigned long numberOfInputChannels = 2,
51
- optional unsigned long numberOfOutputChannels = 2);
52
- StereoPannerNode createStereoPanner ();
53
- WaveShaperNode createWaveShaper ();
54
-
55
- Promise<AudioBuffer> decodeAudioData (
56
- ArrayBuffer audioData,
57
- optional DecodeSuccessCallback? successCallback,
58
- optional DecodeErrorCallback? errorCallback);
18
+ readonly attribute AudioDestinationNode destination;
19
+ readonly attribute float sampleRate;
20
+ readonly attribute double currentTime;
21
+ readonly attribute AudioListener listener;
22
+ readonly attribute AudioContextState state;
23
+ [SameObject, SecureContext]
24
+ readonly attribute AudioWorklet audioWorklet;
25
+ attribute EventHandler onstatechange;
26
+
27
+ AnalyserNode createAnalyser ();
28
+ BiquadFilterNode createBiquadFilter ();
29
+ AudioBuffer createBuffer (unsigned long numberOfChannels,
30
+ unsigned long length,
31
+ float sampleRate);
32
+ AudioBufferSourceNode createBufferSource ();
33
+ ChannelMergerNode createChannelMerger (optional unsigned long numberOfInputs = 6);
34
+ ChannelSplitterNode createChannelSplitter (
35
+ optional unsigned long numberOfOutputs = 6);
36
+ ConstantSourceNode createConstantSource ();
37
+ ConvolverNode createConvolver ();
38
+ DelayNode createDelay (optional double maxDelayTime = 1.0);
39
+ DynamicsCompressorNode createDynamicsCompressor ();
40
+ GainNode createGain ();
41
+ IIRFilterNode createIIRFilter (sequence<double> feedforward,
42
+ sequence<double> feedback);
43
+ OscillatorNode createOscillator ();
44
+ PannerNode createPanner ();
45
+ PeriodicWave createPeriodicWave (sequence<float> real,
46
+ sequence<float> imag,
47
+ optional PeriodicWaveConstraints constraints = {});
48
+ ScriptProcessorNode createScriptProcessor(
49
+ optional unsigned long bufferSize = 0,
50
+ optional unsigned long numberOfInputChannels = 2,
51
+ optional unsigned long numberOfOutputChannels = 2);
52
+ StereoPannerNode createStereoPanner ();
53
+ WaveShaperNode createWaveShaper ();
54
+
55
+ Promise<AudioBuffer> decodeAudioData (
56
+ ArrayBuffer audioData,
57
+ optional DecodeSuccessCallback? successCallback,
58
+ optional DecodeErrorCallback? errorCallback);
59
59
  };
60
60
 
61
61
  enum AudioContextLatencyCategory {
62
- "balanced",
63
- "interactive",
64
- "playback"
62
+ "balanced",
63
+ "interactive",
64
+ "playback"
65
65
  };
66
66
 
67
67
  enum AudioSinkType {
68
- "none"
68
+ "none"
69
69
  };
70
70
 
71
71
  [Exposed=Window]
72
72
  interface AudioContext : BaseAudioContext {
73
- constructor (optional AudioContextOptions contextOptions = {});
74
- readonly attribute double baseLatency;
75
- readonly attribute double outputLatency;
76
- [SecureContext] readonly attribute (DOMString or AudioSinkInfo) sinkId;
77
- [SecureContext] readonly attribute AudioRenderCapacity renderCapacity;
78
- attribute EventHandler onsinkchange;
79
- AudioTimestamp getOutputTimestamp ();
80
- Promise<undefined> resume ();
81
- Promise<undefined> suspend ();
82
- Promise<undefined> close ();
83
- [SecureContext] Promise<undefined> setSinkId ((DOMString or AudioSinkOptions) sinkId);
84
- MediaElementAudioSourceNode createMediaElementSource (HTMLMediaElement mediaElement);
85
- MediaStreamAudioSourceNode createMediaStreamSource (MediaStream mediaStream);
86
- MediaStreamTrackAudioSourceNode createMediaStreamTrackSource (
87
- MediaStreamTrack mediaStreamTrack);
88
- MediaStreamAudioDestinationNode createMediaStreamDestination ();
73
+ constructor (optional AudioContextOptions contextOptions = {});
74
+ readonly attribute double baseLatency;
75
+ readonly attribute double outputLatency;
76
+ [SecureContext] readonly attribute (DOMString or AudioSinkInfo) sinkId;
77
+ [SecureContext] readonly attribute AudioRenderCapacity renderCapacity;
78
+ attribute EventHandler onsinkchange;
79
+ AudioTimestamp getOutputTimestamp ();
80
+ Promise<undefined> resume ();
81
+ Promise<undefined> suspend ();
82
+ Promise<undefined> close ();
83
+ [SecureContext] Promise<undefined> setSinkId ((DOMString or AudioSinkOptions) sinkId);
84
+ MediaElementAudioSourceNode createMediaElementSource (HTMLMediaElement mediaElement);
85
+ MediaStreamAudioSourceNode createMediaStreamSource (MediaStream mediaStream);
86
+ MediaStreamTrackAudioSourceNode createMediaStreamTrackSource (
87
+ MediaStreamTrack mediaStreamTrack);
88
+ MediaStreamAudioDestinationNode createMediaStreamDestination ();
89
89
  };
90
90
 
91
91
  dictionary AudioContextOptions {
92
- (AudioContextLatencyCategory or double) latencyHint = "interactive";
93
- float sampleRate;
94
- (DOMString or AudioSinkOptions) sinkId;
92
+ (AudioContextLatencyCategory or double) latencyHint = "interactive";
93
+ float sampleRate;
94
+ (DOMString or AudioSinkOptions) sinkId;
95
95
  };
96
96
 
97
97
  dictionary AudioSinkOptions {
98
- required AudioSinkType type;
98
+ required AudioSinkType type;
99
99
  };
100
100
 
101
101
  [Exposed=Window]
102
102
  interface AudioSinkInfo {
103
- readonly attribute AudioSinkType type;
103
+ readonly attribute AudioSinkType type;
104
104
  };
105
105
 
106
106
  dictionary AudioTimestamp {
107
- double contextTime;
108
- DOMHighResTimeStamp performanceTime;
107
+ double contextTime;
108
+ DOMHighResTimeStamp performanceTime;
109
109
  };
110
110
 
111
111
  [Exposed=Window]
112
112
  interface AudioRenderCapacity : EventTarget {
113
- undefined start(optional AudioRenderCapacityOptions options = {});
114
- undefined stop();
115
- attribute EventHandler onupdate;
113
+ undefined start(optional AudioRenderCapacityOptions options = {});
114
+ undefined stop();
115
+ attribute EventHandler onupdate;
116
116
  };
117
117
 
118
118
  dictionary AudioRenderCapacityOptions {
119
- double updateInterval = 1;
119
+ double updateInterval = 1;
120
120
  };
121
121
 
122
122
  [Exposed=Window]
123
123
  interface AudioRenderCapacityEvent : Event {
124
- constructor (DOMString type, optional AudioRenderCapacityEventInit eventInitDict = {});
125
- readonly attribute double timestamp;
126
- readonly attribute double averageLoad;
127
- readonly attribute double peakLoad;
128
- readonly attribute double underrunRatio;
124
+ constructor (DOMString type, optional AudioRenderCapacityEventInit eventInitDict = {});
125
+ readonly attribute double timestamp;
126
+ readonly attribute double averageLoad;
127
+ readonly attribute double peakLoad;
128
+ readonly attribute double underrunRatio;
129
129
  };
130
130
 
131
131
  dictionary AudioRenderCapacityEventInit : EventInit {
132
- double timestamp = 0;
133
- double averageLoad = 0;
134
- double peakLoad = 0;
135
- double underrunRatio = 0;
132
+ double timestamp = 0;
133
+ double averageLoad = 0;
134
+ double peakLoad = 0;
135
+ double underrunRatio = 0;
136
136
  };
137
137
 
138
138
  [Exposed=Window]
139
139
  interface OfflineAudioContext : BaseAudioContext {
140
- constructor(OfflineAudioContextOptions contextOptions);
141
- constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate);
142
- Promise<AudioBuffer> startRendering();
143
- Promise<undefined> resume();
144
- Promise<undefined> suspend(double suspendTime);
145
- readonly attribute unsigned long length;
146
- attribute EventHandler oncomplete;
140
+ constructor(OfflineAudioContextOptions contextOptions);
141
+ constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate);
142
+ Promise<AudioBuffer> startRendering();
143
+ Promise<undefined> resume();
144
+ Promise<undefined> suspend(double suspendTime);
145
+ readonly attribute unsigned long length;
146
+ attribute EventHandler oncomplete;
147
147
  };
148
148
 
149
149
  dictionary OfflineAudioContextOptions {
150
- unsigned long numberOfChannels = 1;
151
- required unsigned long length;
152
- required float sampleRate;
150
+ unsigned long numberOfChannels = 1;
151
+ required unsigned long length;
152
+ required float sampleRate;
153
153
  };
154
154
 
155
155
  [Exposed=Window]
156
156
  interface OfflineAudioCompletionEvent : Event {
157
- constructor (DOMString type, OfflineAudioCompletionEventInit eventInitDict);
158
- readonly attribute AudioBuffer renderedBuffer;
157
+ constructor (DOMString type, OfflineAudioCompletionEventInit eventInitDict);
158
+ readonly attribute AudioBuffer renderedBuffer;
159
159
  };
160
160
 
161
161
  dictionary OfflineAudioCompletionEventInit : EventInit {
162
- required AudioBuffer renderedBuffer;
162
+ required AudioBuffer renderedBuffer;
163
163
  };
164
164
 
165
165
  [Exposed=Window]
166
166
  interface AudioBuffer {
167
- constructor (AudioBufferOptions options);
168
- readonly attribute float sampleRate;
169
- readonly attribute unsigned long length;
170
- readonly attribute double duration;
171
- readonly attribute unsigned long numberOfChannels;
172
- Float32Array getChannelData (unsigned long channel);
173
- undefined copyFromChannel (Float32Array destination,
167
+ constructor (AudioBufferOptions options);
168
+ readonly attribute float sampleRate;
169
+ readonly attribute unsigned long length;
170
+ readonly attribute double duration;
171
+ readonly attribute unsigned long numberOfChannels;
172
+ Float32Array getChannelData (unsigned long channel);
173
+ undefined copyFromChannel (Float32Array destination,
174
+ unsigned long channelNumber,
175
+ optional unsigned long bufferOffset = 0);
176
+ undefined copyToChannel (Float32Array source,
174
177
  unsigned long channelNumber,
175
178
  optional unsigned long bufferOffset = 0);
176
- undefined copyToChannel (Float32Array source,
177
- unsigned long channelNumber,
178
- optional unsigned long bufferOffset = 0);
179
179
  };
180
180
 
181
181
  dictionary AudioBufferOptions {
182
- unsigned long numberOfChannels = 1;
183
- required unsigned long length;
184
- required float sampleRate;
182
+ unsigned long numberOfChannels = 1;
183
+ required unsigned long length;
184
+ required float sampleRate;
185
185
  };
186
186
 
187
187
  [Exposed=Window]
188
188
  interface AudioNode : EventTarget {
189
- AudioNode connect (AudioNode destinationNode,
190
- optional unsigned long output = 0,
191
- optional unsigned long input = 0);
192
- undefined connect (AudioParam destinationParam, optional unsigned long output = 0);
193
- undefined disconnect ();
194
- undefined disconnect (unsigned long output);
195
- undefined disconnect (AudioNode destinationNode);
196
- undefined disconnect (AudioNode destinationNode, unsigned long output);
197
- undefined disconnect (AudioNode destinationNode,
198
- unsigned long output,
199
- unsigned long input);
200
- undefined disconnect (AudioParam destinationParam);
201
- undefined disconnect (AudioParam destinationParam, unsigned long output);
202
- readonly attribute BaseAudioContext context;
203
- readonly attribute unsigned long numberOfInputs;
204
- readonly attribute unsigned long numberOfOutputs;
205
- attribute unsigned long channelCount;
206
- attribute ChannelCountMode channelCountMode;
207
- attribute ChannelInterpretation channelInterpretation;
189
+ AudioNode connect (AudioNode destinationNode,
190
+ optional unsigned long output = 0,
191
+ optional unsigned long input = 0);
192
+ undefined connect (AudioParam destinationParam, optional unsigned long output = 0);
193
+ undefined disconnect ();
194
+ undefined disconnect (unsigned long output);
195
+ undefined disconnect (AudioNode destinationNode);
196
+ undefined disconnect (AudioNode destinationNode, unsigned long output);
197
+ undefined disconnect (AudioNode destinationNode,
198
+ unsigned long output,
199
+ unsigned long input);
200
+ undefined disconnect (AudioParam destinationParam);
201
+ undefined disconnect (AudioParam destinationParam, unsigned long output);
202
+ readonly attribute BaseAudioContext context;
203
+ readonly attribute unsigned long numberOfInputs;
204
+ readonly attribute unsigned long numberOfOutputs;
205
+ attribute unsigned long channelCount;
206
+ attribute ChannelCountMode channelCountMode;
207
+ attribute ChannelInterpretation channelInterpretation;
208
208
  };
209
209
 
210
210
  enum ChannelCountMode {
211
- "max",
212
- "clamped-max",
213
- "explicit"
211
+ "max",
212
+ "clamped-max",
213
+ "explicit"
214
214
  };
215
215
 
216
216
  enum ChannelInterpretation {
217
- "speakers",
218
- "discrete"
217
+ "speakers",
218
+ "discrete"
219
219
  };
220
220
 
221
221
  dictionary AudioNodeOptions {
222
- unsigned long channelCount;
223
- ChannelCountMode channelCountMode;
224
- ChannelInterpretation channelInterpretation;
222
+ unsigned long channelCount;
223
+ ChannelCountMode channelCountMode;
224
+ ChannelInterpretation channelInterpretation;
225
225
  };
226
226
 
227
227
  enum AutomationRate {
228
- "a-rate",
229
- "k-rate"
228
+ "a-rate",
229
+ "k-rate"
230
230
  };
231
231
 
232
232
  [Exposed=Window]
233
233
  interface AudioParam {
234
- attribute float value;
235
- attribute AutomationRate automationRate;
236
- readonly attribute float defaultValue;
237
- readonly attribute float minValue;
238
- readonly attribute float maxValue;
239
- AudioParam setValueAtTime (float value, double startTime);
240
- AudioParam linearRampToValueAtTime (float value, double endTime);
241
- AudioParam exponentialRampToValueAtTime (float value, double endTime);
242
- AudioParam setTargetAtTime (float target, double startTime, float timeConstant);
243
- AudioParam setValueCurveAtTime (sequence<float> values,
244
- double startTime,
245
- double duration);
246
- AudioParam cancelScheduledValues (double cancelTime);
247
- AudioParam cancelAndHoldAtTime (double cancelTime);
234
+ attribute float value;
235
+ attribute AutomationRate automationRate;
236
+ readonly attribute float defaultValue;
237
+ readonly attribute float minValue;
238
+ readonly attribute float maxValue;
239
+ AudioParam setValueAtTime (float value, double startTime);
240
+ AudioParam linearRampToValueAtTime (float value, double endTime);
241
+ AudioParam exponentialRampToValueAtTime (float value, double endTime);
242
+ AudioParam setTargetAtTime (float target, double startTime, float timeConstant);
243
+ AudioParam setValueCurveAtTime (sequence<float> values,
244
+ double startTime,
245
+ double duration);
246
+ AudioParam cancelScheduledValues (double cancelTime);
247
+ AudioParam cancelAndHoldAtTime (double cancelTime);
248
248
  };
249
249
 
250
250
  [Exposed=Window]
251
251
  interface AudioScheduledSourceNode : AudioNode {
252
- attribute EventHandler onended;
253
- undefined start(optional double when = 0);
254
- undefined stop(optional double when = 0);
252
+ attribute EventHandler onended;
253
+ undefined start(optional double when = 0);
254
+ undefined stop(optional double when = 0);
255
255
  };
256
256
 
257
257
  [Exposed=Window]
258
258
  interface AnalyserNode : AudioNode {
259
- constructor (BaseAudioContext context, optional AnalyserOptions options = {});
260
- undefined getFloatFrequencyData (Float32Array array);
261
- undefined getByteFrequencyData (Uint8Array array);
262
- undefined getFloatTimeDomainData (Float32Array array);
263
- undefined getByteTimeDomainData (Uint8Array array);
264
- attribute unsigned long fftSize;
265
- readonly attribute unsigned long frequencyBinCount;
266
- attribute double minDecibels;
267
- attribute double maxDecibels;
268
- attribute double smoothingTimeConstant;
259
+ constructor (BaseAudioContext context, optional AnalyserOptions options = {});
260
+ undefined getFloatFrequencyData (Float32Array array);
261
+ undefined getByteFrequencyData (Uint8Array array);
262
+ undefined getFloatTimeDomainData (Float32Array array);
263
+ undefined getByteTimeDomainData (Uint8Array array);
264
+ attribute unsigned long fftSize;
265
+ readonly attribute unsigned long frequencyBinCount;
266
+ attribute double minDecibels;
267
+ attribute double maxDecibels;
268
+ attribute double smoothingTimeConstant;
269
269
  };
270
270
 
271
271
  dictionary AnalyserOptions : AudioNodeOptions {
272
- unsigned long fftSize = 2048;
273
- double maxDecibels = -30;
274
- double minDecibels = -100;
275
- double smoothingTimeConstant = 0.8;
272
+ unsigned long fftSize = 2048;
273
+ double maxDecibels = -30;
274
+ double minDecibels = -100;
275
+ double smoothingTimeConstant = 0.8;
276
276
  };
277
277
 
278
278
  [Exposed=Window]
279
279
  interface AudioBufferSourceNode : AudioScheduledSourceNode {
280
- constructor (BaseAudioContext context,
281
- optional AudioBufferSourceOptions options = {});
282
- attribute AudioBuffer? buffer;
283
- readonly attribute AudioParam playbackRate;
284
- readonly attribute AudioParam detune;
285
- attribute boolean loop;
286
- attribute double loopStart;
287
- attribute double loopEnd;
288
- undefined start (optional double when = 0,
289
- optional double offset,
290
- optional double duration);
280
+ constructor (BaseAudioContext context,
281
+ optional AudioBufferSourceOptions options = {});
282
+ attribute AudioBuffer? buffer;
283
+ readonly attribute AudioParam playbackRate;
284
+ readonly attribute AudioParam detune;
285
+ attribute boolean loop;
286
+ attribute double loopStart;
287
+ attribute double loopEnd;
288
+ undefined start (optional double when = 0,
289
+ optional double offset,
290
+ optional double duration);
291
291
  };
292
292
 
293
293
  dictionary AudioBufferSourceOptions {
294
- AudioBuffer? buffer;
295
- float detune = 0;
296
- boolean loop = false;
297
- double loopEnd = 0;
298
- double loopStart = 0;
299
- float playbackRate = 1;
294
+ AudioBuffer? buffer;
295
+ float detune = 0;
296
+ boolean loop = false;
297
+ double loopEnd = 0;
298
+ double loopStart = 0;
299
+ float playbackRate = 1;
300
300
  };
301
301
 
302
302
  [Exposed=Window]
303
303
  interface AudioDestinationNode : AudioNode {
304
- readonly attribute unsigned long maxChannelCount;
304
+ readonly attribute unsigned long maxChannelCount;
305
305
  };
306
306
 
307
307
  [Exposed=Window]
308
308
  interface AudioListener {
309
- readonly attribute AudioParam positionX;
310
- readonly attribute AudioParam positionY;
311
- readonly attribute AudioParam positionZ;
312
- readonly attribute AudioParam forwardX;
313
- readonly attribute AudioParam forwardY;
314
- readonly attribute AudioParam forwardZ;
315
- readonly attribute AudioParam upX;
316
- readonly attribute AudioParam upY;
317
- readonly attribute AudioParam upZ;
318
- undefined setPosition (float x, float y, float z);
319
- undefined setOrientation (float x, float y, float z, float xUp, float yUp, float zUp);
309
+ readonly attribute AudioParam positionX;
310
+ readonly attribute AudioParam positionY;
311
+ readonly attribute AudioParam positionZ;
312
+ readonly attribute AudioParam forwardX;
313
+ readonly attribute AudioParam forwardY;
314
+ readonly attribute AudioParam forwardZ;
315
+ readonly attribute AudioParam upX;
316
+ readonly attribute AudioParam upY;
317
+ readonly attribute AudioParam upZ;
318
+ undefined setPosition (float x, float y, float z);
319
+ undefined setOrientation (float x, float y, float z, float xUp, float yUp, float zUp);
320
320
  };
321
321
 
322
322
  [Exposed=Window]
323
323
  interface AudioProcessingEvent : Event {
324
- constructor (DOMString type, AudioProcessingEventInit eventInitDict);
325
- readonly attribute double playbackTime;
326
- readonly attribute AudioBuffer inputBuffer;
327
- readonly attribute AudioBuffer outputBuffer;
324
+ constructor (DOMString type, AudioProcessingEventInit eventInitDict);
325
+ readonly attribute double playbackTime;
326
+ readonly attribute AudioBuffer inputBuffer;
327
+ readonly attribute AudioBuffer outputBuffer;
328
328
  };
329
329
 
330
330
  dictionary AudioProcessingEventInit : EventInit {
331
- required double playbackTime;
332
- required AudioBuffer inputBuffer;
333
- required AudioBuffer outputBuffer;
331
+ required double playbackTime;
332
+ required AudioBuffer inputBuffer;
333
+ required AudioBuffer outputBuffer;
334
334
  };
335
335
 
336
336
  enum BiquadFilterType {
337
- "lowpass",
338
- "highpass",
339
- "bandpass",
340
- "lowshelf",
341
- "highshelf",
342
- "peaking",
343
- "notch",
344
- "allpass"
337
+ "lowpass",
338
+ "highpass",
339
+ "bandpass",
340
+ "lowshelf",
341
+ "highshelf",
342
+ "peaking",
343
+ "notch",
344
+ "allpass"
345
345
  };
346
346
 
347
347
  [Exposed=Window]
348
348
  interface BiquadFilterNode : AudioNode {
349
- constructor (BaseAudioContext context, optional BiquadFilterOptions options = {});
350
- attribute BiquadFilterType type;
351
- readonly attribute AudioParam frequency;
352
- readonly attribute AudioParam detune;
353
- readonly attribute AudioParam Q;
354
- readonly attribute AudioParam gain;
355
- undefined getFrequencyResponse (Float32Array frequencyHz,
356
- Float32Array magResponse,
357
- Float32Array phaseResponse);
349
+ constructor (BaseAudioContext context, optional BiquadFilterOptions options = {});
350
+ attribute BiquadFilterType type;
351
+ readonly attribute AudioParam frequency;
352
+ readonly attribute AudioParam detune;
353
+ readonly attribute AudioParam Q;
354
+ readonly attribute AudioParam gain;
355
+ undefined getFrequencyResponse (Float32Array frequencyHz,
356
+ Float32Array magResponse,
357
+ Float32Array phaseResponse);
358
358
  };
359
359
 
360
360
  dictionary BiquadFilterOptions : AudioNodeOptions {
361
- BiquadFilterType type = "lowpass";
362
- float Q = 1;
363
- float detune = 0;
364
- float frequency = 350;
365
- float gain = 0;
361
+ BiquadFilterType type = "lowpass";
362
+ float Q = 1;
363
+ float detune = 0;
364
+ float frequency = 350;
365
+ float gain = 0;
366
366
  };
367
367
 
368
368
  [Exposed=Window]
369
369
  interface ChannelMergerNode : AudioNode {
370
- constructor (BaseAudioContext context, optional ChannelMergerOptions options = {});
370
+ constructor (BaseAudioContext context, optional ChannelMergerOptions options = {});
371
371
  };
372
372
 
373
373
  dictionary ChannelMergerOptions : AudioNodeOptions {
374
- unsigned long numberOfInputs = 6;
374
+ unsigned long numberOfInputs = 6;
375
375
  };
376
376
 
377
377
  [Exposed=Window]
378
378
  interface ChannelSplitterNode : AudioNode {
379
- constructor (BaseAudioContext context, optional ChannelSplitterOptions options = {});
379
+ constructor (BaseAudioContext context, optional ChannelSplitterOptions options = {});
380
380
  };
381
381
 
382
382
  dictionary ChannelSplitterOptions : AudioNodeOptions {
383
- unsigned long numberOfOutputs = 6;
383
+ unsigned long numberOfOutputs = 6;
384
384
  };
385
385
 
386
386
  [Exposed=Window]
387
387
  interface ConstantSourceNode : AudioScheduledSourceNode {
388
- constructor (BaseAudioContext context, optional ConstantSourceOptions options = {});
389
- readonly attribute AudioParam offset;
388
+ constructor (BaseAudioContext context, optional ConstantSourceOptions options = {});
389
+ readonly attribute AudioParam offset;
390
390
  };
391
391
 
392
392
  dictionary ConstantSourceOptions {
393
- float offset = 1;
393
+ float offset = 1;
394
394
  };
395
395
 
396
396
  [Exposed=Window]
397
397
  interface ConvolverNode : AudioNode {
398
- constructor (BaseAudioContext context, optional ConvolverOptions options = {});
399
- attribute AudioBuffer? buffer;
400
- attribute boolean normalize;
398
+ constructor (BaseAudioContext context, optional ConvolverOptions options = {});
399
+ attribute AudioBuffer? buffer;
400
+ attribute boolean normalize;
401
401
  };
402
402
 
403
403
  dictionary ConvolverOptions : AudioNodeOptions {
404
- AudioBuffer? buffer;
405
- boolean disableNormalization = false;
404
+ AudioBuffer? buffer;
405
+ boolean disableNormalization = false;
406
406
  };
407
407
 
408
408
  [Exposed=Window]
409
409
  interface DelayNode : AudioNode {
410
- constructor (BaseAudioContext context, optional DelayOptions options = {});
411
- readonly attribute AudioParam delayTime;
410
+ constructor (BaseAudioContext context, optional DelayOptions options = {});
411
+ readonly attribute AudioParam delayTime;
412
412
  };
413
413
 
414
414
  dictionary DelayOptions : AudioNodeOptions {
415
- double maxDelayTime = 1;
416
- double delayTime = 0;
415
+ double maxDelayTime = 1;
416
+ double delayTime = 0;
417
417
  };
418
418
 
419
419
  [Exposed=Window]
420
420
  interface DynamicsCompressorNode : AudioNode {
421
- constructor (BaseAudioContext context,
422
- optional DynamicsCompressorOptions options = {});
423
- readonly attribute AudioParam threshold;
424
- readonly attribute AudioParam knee;
425
- readonly attribute AudioParam ratio;
426
- readonly attribute float reduction;
427
- readonly attribute AudioParam attack;
428
- readonly attribute AudioParam release;
421
+ constructor (BaseAudioContext context,
422
+ optional DynamicsCompressorOptions options = {});
423
+ readonly attribute AudioParam threshold;
424
+ readonly attribute AudioParam knee;
425
+ readonly attribute AudioParam ratio;
426
+ readonly attribute float reduction;
427
+ readonly attribute AudioParam attack;
428
+ readonly attribute AudioParam release;
429
429
  };
430
430
 
431
431
  dictionary DynamicsCompressorOptions : AudioNodeOptions {
432
- float attack = 0.003;
433
- float knee = 30;
434
- float ratio = 12;
435
- float release = 0.25;
436
- float threshold = -24;
432
+ float attack = 0.003;
433
+ float knee = 30;
434
+ float ratio = 12;
435
+ float release = 0.25;
436
+ float threshold = -24;
437
437
  };
438
438
 
439
439
  [Exposed=Window]
440
440
  interface GainNode : AudioNode {
441
- constructor (BaseAudioContext context, optional GainOptions options = {});
442
- readonly attribute AudioParam gain;
441
+ constructor (BaseAudioContext context, optional GainOptions options = {});
442
+ readonly attribute AudioParam gain;
443
443
  };
444
444
 
445
445
  dictionary GainOptions : AudioNodeOptions {
446
- float gain = 1.0;
446
+ float gain = 1.0;
447
447
  };
448
448
 
449
449
  [Exposed=Window]
450
450
  interface IIRFilterNode : AudioNode {
451
- constructor (BaseAudioContext context, IIRFilterOptions options);
452
- undefined getFrequencyResponse (Float32Array frequencyHz,
453
- Float32Array magResponse,
454
- Float32Array phaseResponse);
451
+ constructor (BaseAudioContext context, IIRFilterOptions options);
452
+ undefined getFrequencyResponse (Float32Array frequencyHz,
453
+ Float32Array magResponse,
454
+ Float32Array phaseResponse);
455
455
  };
456
456
 
457
457
  dictionary IIRFilterOptions : AudioNodeOptions {
458
- required sequence<double> feedforward;
459
- required sequence<double> feedback;
458
+ required sequence<double> feedforward;
459
+ required sequence<double> feedback;
460
460
  };
461
461
 
462
462
  [Exposed=Window]
463
463
  interface MediaElementAudioSourceNode : AudioNode {
464
- constructor (AudioContext context, MediaElementAudioSourceOptions options);
465
- [SameObject] readonly attribute HTMLMediaElement mediaElement;
464
+ constructor (AudioContext context, MediaElementAudioSourceOptions options);
465
+ [SameObject] readonly attribute HTMLMediaElement mediaElement;
466
466
  };
467
467
 
468
468
  dictionary MediaElementAudioSourceOptions {
469
- required HTMLMediaElement mediaElement;
469
+ required HTMLMediaElement mediaElement;
470
470
  };
471
471
 
472
472
  [Exposed=Window]
473
473
  interface MediaStreamAudioDestinationNode : AudioNode {
474
- constructor (AudioContext context, optional AudioNodeOptions options = {});
475
- readonly attribute MediaStream stream;
474
+ constructor (AudioContext context, optional AudioNodeOptions options = {});
475
+ readonly attribute MediaStream stream;
476
476
  };
477
477
 
478
478
  [Exposed=Window]
479
479
  interface MediaStreamAudioSourceNode : AudioNode {
480
- constructor (AudioContext context, MediaStreamAudioSourceOptions options);
481
- [SameObject] readonly attribute MediaStream mediaStream;
480
+ constructor (AudioContext context, MediaStreamAudioSourceOptions options);
481
+ [SameObject] readonly attribute MediaStream mediaStream;
482
482
  };
483
483
 
484
484
  dictionary MediaStreamAudioSourceOptions {
485
- required MediaStream mediaStream;
485
+ required MediaStream mediaStream;
486
486
  };
487
487
 
488
488
  [Exposed=Window]
489
489
  interface MediaStreamTrackAudioSourceNode : AudioNode {
490
- constructor (AudioContext context, MediaStreamTrackAudioSourceOptions options);
490
+ constructor (AudioContext context, MediaStreamTrackAudioSourceOptions options);
491
491
  };
492
492
 
493
493
  dictionary MediaStreamTrackAudioSourceOptions {
494
- required MediaStreamTrack mediaStreamTrack;
494
+ required MediaStreamTrack mediaStreamTrack;
495
495
  };
496
496
 
497
497
  enum OscillatorType {
498
- "sine",
499
- "square",
500
- "sawtooth",
501
- "triangle",
502
- "custom"
498
+ "sine",
499
+ "square",
500
+ "sawtooth",
501
+ "triangle",
502
+ "custom"
503
503
  };
504
504
 
505
505
  [Exposed=Window]
506
506
  interface OscillatorNode : AudioScheduledSourceNode {
507
- constructor (BaseAudioContext context, optional OscillatorOptions options = {});
508
- attribute OscillatorType type;
509
- readonly attribute AudioParam frequency;
510
- readonly attribute AudioParam detune;
511
- undefined setPeriodicWave (PeriodicWave periodicWave);
507
+ constructor (BaseAudioContext context, optional OscillatorOptions options = {});
508
+ attribute OscillatorType type;
509
+ readonly attribute AudioParam frequency;
510
+ readonly attribute AudioParam detune;
511
+ undefined setPeriodicWave (PeriodicWave periodicWave);
512
512
  };
513
513
 
514
514
  dictionary OscillatorOptions : AudioNodeOptions {
515
- OscillatorType type = "sine";
516
- float frequency = 440;
517
- float detune = 0;
518
- PeriodicWave periodicWave;
515
+ OscillatorType type = "sine";
516
+ float frequency = 440;
517
+ float detune = 0;
518
+ PeriodicWave periodicWave;
519
519
  };
520
520
 
521
521
  enum PanningModelType {
522
- "equalpower",
523
- "HRTF"
522
+ "equalpower",
523
+ "HRTF"
524
524
  };
525
525
 
526
526
  enum DistanceModelType {
527
- "linear",
528
- "inverse",
529
- "exponential"
527
+ "linear",
528
+ "inverse",
529
+ "exponential"
530
530
  };
531
531
 
532
532
  [Exposed=Window]
533
533
  interface PannerNode : AudioNode {
534
- constructor (BaseAudioContext context, optional PannerOptions options = {});
535
- attribute PanningModelType panningModel;
536
- readonly attribute AudioParam positionX;
537
- readonly attribute AudioParam positionY;
538
- readonly attribute AudioParam positionZ;
539
- readonly attribute AudioParam orientationX;
540
- readonly attribute AudioParam orientationY;
541
- readonly attribute AudioParam orientationZ;
542
- attribute DistanceModelType distanceModel;
543
- attribute double refDistance;
544
- attribute double maxDistance;
545
- attribute double rolloffFactor;
546
- attribute double coneInnerAngle;
547
- attribute double coneOuterAngle;
548
- attribute double coneOuterGain;
549
- undefined setPosition (float x, float y, float z);
550
- undefined setOrientation (float x, float y, float z);
534
+ constructor (BaseAudioContext context, optional PannerOptions options = {});
535
+ attribute PanningModelType panningModel;
536
+ readonly attribute AudioParam positionX;
537
+ readonly attribute AudioParam positionY;
538
+ readonly attribute AudioParam positionZ;
539
+ readonly attribute AudioParam orientationX;
540
+ readonly attribute AudioParam orientationY;
541
+ readonly attribute AudioParam orientationZ;
542
+ attribute DistanceModelType distanceModel;
543
+ attribute double refDistance;
544
+ attribute double maxDistance;
545
+ attribute double rolloffFactor;
546
+ attribute double coneInnerAngle;
547
+ attribute double coneOuterAngle;
548
+ attribute double coneOuterGain;
549
+ undefined setPosition (float x, float y, float z);
550
+ undefined setOrientation (float x, float y, float z);
551
551
  };
552
552
 
553
553
  dictionary PannerOptions : AudioNodeOptions {
554
- PanningModelType panningModel = "equalpower";
555
- DistanceModelType distanceModel = "inverse";
556
- float positionX = 0;
557
- float positionY = 0;
558
- float positionZ = 0;
559
- float orientationX = 1;
560
- float orientationY = 0;
561
- float orientationZ = 0;
562
- double refDistance = 1;
563
- double maxDistance = 10000;
564
- double rolloffFactor = 1;
565
- double coneInnerAngle = 360;
566
- double coneOuterAngle = 360;
567
- double coneOuterGain = 0;
554
+ PanningModelType panningModel = "equalpower";
555
+ DistanceModelType distanceModel = "inverse";
556
+ float positionX = 0;
557
+ float positionY = 0;
558
+ float positionZ = 0;
559
+ float orientationX = 1;
560
+ float orientationY = 0;
561
+ float orientationZ = 0;
562
+ double refDistance = 1;
563
+ double maxDistance = 10000;
564
+ double rolloffFactor = 1;
565
+ double coneInnerAngle = 360;
566
+ double coneOuterAngle = 360;
567
+ double coneOuterGain = 0;
568
568
  };
569
569
 
570
570
  [Exposed=Window]
571
571
  interface PeriodicWave {
572
- constructor (BaseAudioContext context, optional PeriodicWaveOptions options = {});
572
+ constructor (BaseAudioContext context, optional PeriodicWaveOptions options = {});
573
573
  };
574
574
 
575
575
  dictionary PeriodicWaveConstraints {
576
- boolean disableNormalization = false;
576
+ boolean disableNormalization = false;
577
577
  };
578
578
 
579
579
  dictionary PeriodicWaveOptions : PeriodicWaveConstraints {
580
- sequence<float> real;
581
- sequence<float> imag;
580
+ sequence<float> real;
581
+ sequence<float> imag;
582
582
  };
583
583
 
584
584
  [Exposed=Window]
585
585
  interface ScriptProcessorNode : AudioNode {
586
- attribute EventHandler onaudioprocess;
587
- readonly attribute long bufferSize;
586
+ attribute EventHandler onaudioprocess;
587
+ readonly attribute long bufferSize;
588
588
  };
589
589
 
590
590
  [Exposed=Window]
591
591
  interface StereoPannerNode : AudioNode {
592
- constructor (BaseAudioContext context, optional StereoPannerOptions options = {});
593
- readonly attribute AudioParam pan;
592
+ constructor (BaseAudioContext context, optional StereoPannerOptions options = {});
593
+ readonly attribute AudioParam pan;
594
594
  };
595
595
 
596
596
  dictionary StereoPannerOptions : AudioNodeOptions {
597
- float pan = 0;
597
+ float pan = 0;
598
598
  };
599
599
 
600
600
  enum OverSampleType {
601
- "none",
602
- "2x",
603
- "4x"
601
+ "none",
602
+ "2x",
603
+ "4x"
604
604
  };
605
605
 
606
606
  [Exposed=Window]
607
607
  interface WaveShaperNode : AudioNode {
608
- constructor (BaseAudioContext context, optional WaveShaperOptions options = {});
609
- attribute Float32Array? curve;
610
- attribute OverSampleType oversample;
608
+ constructor (BaseAudioContext context, optional WaveShaperOptions options = {});
609
+ attribute Float32Array? curve;
610
+ attribute OverSampleType oversample;
611
611
  };
612
612
 
613
613
  dictionary WaveShaperOptions : AudioNodeOptions {
614
- sequence<float> curve;
615
- OverSampleType oversample = "none";
614
+ sequence<float> curve;
615
+ OverSampleType oversample = "none";
616
616
  };
617
617
 
618
618
  [Exposed=Window, SecureContext]
@@ -624,40 +624,40 @@ callback AudioWorkletProcessorConstructor = AudioWorkletProcessor (object option
624
624
 
625
625
  [Global=(Worklet, AudioWorklet), Exposed=AudioWorklet]
626
626
  interface AudioWorkletGlobalScope : WorkletGlobalScope {
627
- undefined registerProcessor (DOMString name,
628
- AudioWorkletProcessorConstructor processorCtor);
629
- readonly attribute unsigned long long currentFrame;
630
- readonly attribute double currentTime;
631
- readonly attribute float sampleRate;
632
- readonly attribute MessagePort port;
627
+ undefined registerProcessor (DOMString name,
628
+ AudioWorkletProcessorConstructor processorCtor);
629
+ readonly attribute unsigned long long currentFrame;
630
+ readonly attribute double currentTime;
631
+ readonly attribute float sampleRate;
632
+ readonly attribute MessagePort port;
633
633
  };
634
634
 
635
635
  [Exposed=Window]
636
636
  interface AudioParamMap {
637
- readonly maplike<DOMString, AudioParam>;
637
+ readonly maplike<DOMString, AudioParam>;
638
638
  };
639
639
 
640
640
  [Exposed=Window, SecureContext]
641
641
  interface AudioWorkletNode : AudioNode {
642
- constructor (BaseAudioContext context, DOMString name,
642
+ constructor (BaseAudioContext context, DOMString name,
643
643
  optional AudioWorkletNodeOptions options = {});
644
- readonly attribute AudioParamMap parameters;
645
- readonly attribute MessagePort port;
646
- attribute EventHandler onprocessorerror;
644
+ readonly attribute AudioParamMap parameters;
645
+ readonly attribute MessagePort port;
646
+ attribute EventHandler onprocessorerror;
647
647
  };
648
648
 
649
649
  dictionary AudioWorkletNodeOptions : AudioNodeOptions {
650
- unsigned long numberOfInputs = 1;
651
- unsigned long numberOfOutputs = 1;
652
- sequence<unsigned long> outputChannelCount;
653
- record<DOMString, double> parameterData;
654
- object processorOptions;
650
+ unsigned long numberOfInputs = 1;
651
+ unsigned long numberOfOutputs = 1;
652
+ sequence<unsigned long> outputChannelCount;
653
+ record<DOMString, double> parameterData;
654
+ object processorOptions;
655
655
  };
656
656
 
657
657
  [Exposed=AudioWorklet]
658
658
  interface AudioWorkletProcessor {
659
- constructor ();
660
- readonly attribute MessagePort port;
659
+ constructor ();
660
+ readonly attribute MessagePort port;
661
661
  };
662
662
 
663
663
  callback AudioWorkletProcessCallback =
@@ -666,9 +666,9 @@ callback AudioWorkletProcessCallback =
666
666
  object parameters);
667
667
 
668
668
  dictionary AudioParamDescriptor {
669
- required DOMString name;
670
- float defaultValue = 0;
671
- float minValue = -3.4028235e38;
672
- float maxValue = 3.4028235e38;
673
- AutomationRate automationRate = "a-rate";
669
+ required DOMString name;
670
+ float defaultValue = 0;
671
+ float minValue = -3.4028235e38;
672
+ float maxValue = 3.4028235e38;
673
+ AutomationRate automationRate = "a-rate";
674
674
  };
package/webnn.idl CHANGED
@@ -27,8 +27,13 @@ dictionary MLContextOptions {
27
27
 
28
28
  [SecureContext, Exposed=(Window, DedicatedWorker)]
29
29
  interface ML {
30
- MLContext createContext(optional MLContextOptions options = {});
31
- MLContext createContext(GPUDevice gpuDevice);
30
+ Promise<MLContext> createContext(optional MLContextOptions options = {});
31
+ Promise<MLContext> createContext(GPUDevice gpuDevice);
32
+
33
+ [Exposed=(DedicatedWorker)]
34
+ MLContext createContextSync(optional MLContextOptions options = {});
35
+ [Exposed=(DedicatedWorker)]
36
+ MLContext createContextSync(GPUDevice gpuDevice);
32
37
  };
33
38
 
34
39
  typedef record<DOMString, ArrayBufferView> MLNamedArrayBufferViews;
@@ -38,12 +43,12 @@ interface MLContext {};
38
43
 
39
44
  partial interface MLContext {
40
45
  [Exposed=(DedicatedWorker)]
41
- undefined compute(
46
+ undefined computeSync(
42
47
  MLGraph graph, MLNamedArrayBufferViews inputs, MLNamedArrayBufferViews outputs);
43
48
  };
44
49
 
45
50
  partial interface MLContext {
46
- Promise<undefined> computeAsync(
51
+ Promise<undefined> compute(
47
52
  MLGraph graph, MLNamedArrayBufferViews inputs, MLNamedArrayBufferViews outputs);
48
53
  };
49
54
 
@@ -103,12 +108,12 @@ interface MLGraphBuilder {
103
108
  // Create a single-value operand from the specified number of the specified type.
104
109
  MLOperand constant(double value, optional MLOperandType type = "float32");
105
110
 
111
+ // Compile the graph up to the specified output operands asynchronously.
112
+ Promise<MLGraph> build(MLNamedOperands outputs);
113
+
106
114
  // Compile the graph up to the specified output operands synchronously.
107
115
  [Exposed=(DedicatedWorker)]
108
- MLGraph build(MLNamedOperands outputs);
109
-
110
- // Compile the graph up to the specified output operands asynchronously.
111
- Promise<MLGraph> buildAsync(MLNamedOperands outputs);
116
+ MLGraph buildSync(MLNamedOperands outputs);
112
117
  };
113
118
 
114
119
  dictionary MLBatchNormalizationOptions {