[webaudioapi] Specialize event handler type

The event handler was defined to take an argument of generic type Event:
this loses the audio event specific type info as defined in the (unused)
AudioProcessingEvent interface.

This patch declares the onaudioprocessing event handler as accepting an
argument of the correct type.
This commit is contained in:
Hraban Luyat
2015-02-16 05:18:49 +01:00
parent bcf610fef5
commit d24e36d975
2 changed files with 13 additions and 1 deletions
+8
View File
@@ -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;
};
}