mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-31 11:40:47 +08:00
Merge pull request #3657 from hraban/webaudioapi
[webaudioapi] Specialize event handler type
This commit is contained in:
@@ -323,3 +323,11 @@ declare var footstepsBuffer: any;
|
||||
context.startRendering();
|
||||
}
|
||||
|
||||
// Test automatic type inference of the audio processing event handler
|
||||
() => {
|
||||
var context = new AudioContext();
|
||||
var recorder = context.createScriptProcessor(2048, 1, 1);
|
||||
recorder.onaudioprocess = function (e) {
|
||||
e.inputBuffer;
|
||||
};
|
||||
}
|
||||
|
||||
Vendored
+5
-1
@@ -601,6 +601,10 @@ interface AudioBufferSourceNode extends AudioNode {
|
||||
interface MediaElementAudioSourceNode extends AudioNode {
|
||||
}
|
||||
|
||||
interface AudioProcessingEventHandler {
|
||||
(e: AudioProcessingEvent): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is an AudioNode which can generate, process, or analyse audio directly using JavaScript.
|
||||
*
|
||||
@@ -617,7 +621,7 @@ interface ScriptProcessorNode extends AudioNode {
|
||||
/**
|
||||
* An event listener which is called periodically for audio processing. An event of type AudioProcessingEvent will be passed to the event handler.
|
||||
*/
|
||||
onaudioprocess: EventHandler;
|
||||
onaudioprocess: AudioProcessingEventHandler;
|
||||
|
||||
/**
|
||||
* The size of the buffer (in sample-frames) which needs to be processed each time onprocessaudio is called. Legal values are (256, 512, 1024, 2048, 4096, 8192, 16384).
|
||||
|
||||
Reference in New Issue
Block a user